function CheckSearchTerm(targetId) { var obj = document.getElementById(targetId); if(obj) { var text = trim(obj.value); if (text.length < 3) { alert("You must enter at least 3 characters to search."); return false; } } return true; } function DoEnter(targetId, triggerId) { var objTarget = document.getElementById(targetId); var objTrigger = document.getElementById(triggerId); if (eval(objTrigger)) { if (event.keyCode && event.keyCode == 13) { event.cancel = true; event.returnValue = false; objTrigger.click(); } } } function OpenWindow(url,name) { var newWindow = window.open(url,name,'width=650,height=550,location=1,menubar=1,toolbar=1,scrollbars=1,resizable=1'); newWindow.focus(); } function CloseWindow() { opener.location.reload(); opener.focus(); window.close(); } function LTrim( value ) { var re = /\s*((\S+\s*)*)/; return value.replace(re, "$1"); } function RTrim( value ) { var re = /((\s*\S+)*)\s*/; return value.replace(re, "$1"); } function trim( value ) { return LTrim(RTrim(value)); } function CoordinateCondition(cond) { return validateTPID(VAM_GetTextValue(cond.IDToEval, cond.Trim)); } function validateTPID(TPID) { if (TPID.substr(0,1) != '9') return 0; if (TPID.length != 8) return 0; sum = 0; checkSum = -1; // add all our fugures togeather for (count = 0; count < 7; count++) { sum += TPID.substr(count, 1) * (8-count); } switch( 11 - sum%11) { case 11: checkSum = 5; break; case 10: checkSum = 0; break; case 9: checkSum = 9; break; case 8: checkSum = 8; break; case 7: checkSum = 7; break; case 6: checkSum = 6; break; case 5: checkSum = 5; break; case 4: checkSum = 4; break; case 3: checkSum = 3; break; case 2: checkSum = 2; break; case 1: checkSum = 1; break; } // dose the check sum match the check digit if (checkSum == TPID.substr(7, 1) ) return 1; else return 0; } function SearchFocus() { if (document.getElementById('ucBanner_txtSearch')) document.getElementById('ucBanner_txtSearch').focus(); } function SetRadioButton() { // these are only stubs } function printPage() { window.print(); return false; } function KeyDownHandler(e, strBtn) { if (e.keyCode == 13) { document.getElementById(strBtn).click(); event.returnValue=false; } } function overParentBG(ulID) { document.getElementById(ulID).style.backgroundColor="#fc0"; document.getElementById(ulID).style.color="#c00"; } function offParentBG(ulID) { document.getElementById(ulID).style.backgroundColor=""; document.getElementById(ulID).style.color=""; } startList = function() { if (document.all&&document.getElementById) { navRoot = document.getElementById("nav") if (navRoot!=null) { for (i=0; imxlength) obj.value=obj.value.substring(0,mxlength) }