//check that the "ViewForm" exists before proceeding
if (eval(SourceRecords.ViewForm)) {
var fieldname = SourceRecords.document.ViewForm.$$SelectDoc;
if (fieldname.length) {
//has more than one value
for(i = 0; i < fieldname.length; i ++){
fieldname[i].checked=true
}
} else {
//has only one value
SourceRecords.document.getElementById("$$SelectDoc").checked=true
}
}