var viaNSLayers = (document.layers) ? true : false; var viaIE = (document.all) ? true : false; var viaDOM = (document.getElementById) ? true : false; errorTimeouts = new Array(); function MarkError(fField) {; Errorize(fField); if (viaIE) errorTimeouts[(errorTimeouts.length + 1)] = window.setTimeout("UnErrorize(document." + fField.form.name + ".elements['" + fField.name + "'])", 2000); else if (viaDOM) errorTimeouts[(errorTimeouts.length + 1)] = window.setTimeout("UnErrorize(document." + fField.form.name + "." + fField.name + ")", 2000); fField.focus(); } function Errorize(fField) { if (navigator.appName.indexOf("Microsoft") > -1 || parseInt(navigator.appVersion) >= 5) { fField.style.background = "#ffff66"; } } function UnErrorize(fField) { if (navigator.appName.indexOf("Microsoft") > -1 || parseInt(navigator.appVersion) >= 5) { fField.style.background = "#f5f5f5"; } } function submitenter(myfield,e,submitstr) { var keycode; if (window.event) keycode = window.event.keyCode; else if (e) keycode = e.which; else return true; if (keycode == 13) { if (submitstr == '') myfield.form.submit(); else eval(submitstr); return false; } else return true; } function isValidDate (year, month, day) { // checks if date passed is in valid dd/mm/yyyy format var test = new Date(year,month-1,day); var yr = test.getYear(); yr = (yr < 1000) ? yr + 1900 : yr; if (year == yr && (month-1 == test.getMonth()) && (day == test.getDate())) { return true; } else { return false; } } function replace(string,text,by) { // Replaces text with by in string var strLength = string.length, txtLength = text.length; if ((strLength == 0) || (txtLength == 0)) return string; var i = string.indexOf(text); if ((!i) && (text != string.substring(0,txtLength))) return string; if (i == -1) return string; var newstr = string.substring(0,i) + by; if (i+txtLength < strLength) newstr += replace(string.substring(i+txtLength,strLength),text,by); return newstr; } function notNumeric(text) { for (var i=0;i '9') && ch != '.') return true; } return false; } function AllDigit(text) { for (var i=0;i '9') return false; } return true; } function checkAmount(amt) { if (amt.length < 4) { return false; } if (notNumeric(amt)) { return false; } if (amt.charAt(amt.length-3) != '.') { return false; } return true; } function doSubmit(formObj, componentAction, operationAction) { if (formObj == null) formObj = document.generalSubmit; formObj.submit(); } function doProxyScreenSubmit(formObj, screenName, componentAction, operationAction) { if (formObj == null) formObj = document.generalSubmit; doSubmit(formObj, componentAction, operationAction); } function doConfirmSubmitAction(formObj, action, message) { //if (formObj == null) formObj = document.generalSubmit; if (action != null && action != "") formObj.action = action; if (confirm(message)) formObj.submit(); } function doConfirmSubmit(formObj, message) { doConfirmSubmitAction(formObj, "", message); } function moveFocusTextBox(srcTextBox, destTextBox, expectedLen) { if (srcTextBox.value.length < expectedLen) srcTextBox.focus(); else destTextBox.focus(); } function checkLength(textbox, neededLen, msg) { if (textbox.value.length != neededLen) { alert(msg); textbox.focus(); } } function setSelectList(selectObj, selectedValue) { var i; var ops = selectObj.options; for (i = 0; i < ops.length; i++) { if (ops[i].value == selectedValue) selectObj.selectedIndex = ops[i].index; } } function setRadioGroup(radioObjs, radioValue) { var i; for (i = 0; i < radioObjs.length; i++) { if (radioObjs[i].value == radioValue) radioObjs[i].checked = true; } } function setMultiSelectList(selectObj, selectedValues) { var i, j; var ops = selectObj.options; for (i = 0; i < ops.length; i++) { for (j = 0; j < selectedValues.length; j++) { if (ops[i].value == selectedValues[j]) ops[i].selected = true; } } } function MM_swapImgRestore() { var i,x,a=document.MM_sr; for(i=0;a&&i0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i= 112) && (window.event.keyCode <= 123) ) { window.event.keyCode = 0; window.event.cancelBubble = true; window.event.returnValue = false; return false; } // keycode for backspace //if (window.event && window.event.keyCode == 8) { // try to cancel the backspace // window.event.cancelBubble = true; // window.event.returnValue = false; // return false; //} } document.onkeydown = cancelRefresh; if (window.Event) document.captureEvents(Event.MOUSEUP); function nocontextmenu() { event.cancelBubble = true, event.returnValue = false; return false; } function norightclick(e) { if (window.Event) { if (e.which == 2 || e.which == 3) return false; } else if (event.button == 2 || event.button == 3) { event.cancelBubble = true, event.returnValue = false; return false; } } if (document.layers) document.captureEvents(Event.MOUSEDOWN); document.oncontextmenu = nocontextmenu; document.onmousedown = norightclick; document.onmouseup = norightclick; var preloadFlag = true;