function validateText(field, descField) { if (field.value == "") { alert ("Please complete the " + descField + " field.") field.focus(); return (false); } return (true) } function validateSingleChkbox(field, descField) { if (!field.checked) { alert ("Please complete the " + descField + ".") field.focus(); return (false); } return (true) } function validateChkbox(field, descField) { var valid valid = false for (i = 0; i < field.length; i++) { if (field[i].checked){ valid = true } } if (!valid) { alert ("Please complete the " + descField + ".") field[0].focus(); return (false); } return (true) } function validateCombo(field, descField) { with(field) { if (options[selectedIndex].text == "") { alert ("Please complete the " + descField + " field.") field.focus(); return (false); } return (true) } } function validateNumber(field, descField) { with(field) { var re = /,/g var tmpNum = parseFloat(field.value.replace(re,"")) if (Number(tmpNum) != tmpNum) { alert ("Please enter a valid number for the " + descField + " field."); field.focus(); return (false); } return (true) } } function isFloat(s,allowCommas) { var result; var re = /,/g if(typeof(allowCommas)=='undefined') { var allowCommas = false; } if (allowCommas) { result = s != "" && parseFloat(s.replace(re,"")) == s.replace(re,""); } else { result = s != "" && parseFloat(s) == s; } return result; } //Pop up window functions function openWindow (url, strWidth, strHeight) { //Get the screen size // if (document.all) { // w = document.body.clientWidth; // h = document.body.clientHeight; // } // else if (document.layers) { // w = window.innerWidth; // h = window.innerHeight; // } //Calc the centre position w = 1024; h = 768; var topPos = (h-strHeight)/2, leftPos = (w-strWidth)/2; //Create the window popWindow = window.open ( url,'popWindow', 'width=' + strWidth + ',height=' + strHeight + 'top=' + topPos + ',left=' + leftPos + ',toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1') popWindow.focus(); } function openWindowMenu (url, strWidth, strHeight) { //Get the screen size // if (document.all) { // w = document.body.clientWidth; // h = document.body.clientHeight; // } // else if (document.layers) { // w = window.innerWidth; // h = window.innerHeight; // } //Calc the centre position w = 1024; h = 768; var topPos = (h-strHeight)/2, leftPos = (w-strWidth)/2; //Create the window popWindow = window.open ( url,'popWindow', 'width=' + strWidth + ',height=' + strHeight + 'top=' + topPos + ',left=' + leftPos + ',toolbar=0,location=0,directories=0,status=0,menubar=1,scrollbars=1,resizable=1') popWindow.focus(); } function showProcessing() { processing.style.visibility = "visible"; } function hideProcessing() { processing.style.visibility = "hidden"; } function isValidObject(objToTest) { if (null == objToTest) { return false; } if ("undefined" == typeof(objToTest) ) { return false; } return true; }