/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////// Global JavaScript functions //////////////////////////// //////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /* Function to capture Enter key press and cancel it if the source of the event is a textbox, select list, checkbox or radio buttton */ function checkCR(evt) { try { var evt = (evt) ? evt : ((event) ? event : null); var node = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null); if ((evt.keyCode == 13) && ( (node.type=="text") || (node.type=="checkbox") || (node.type=="radio") || (node.type=="select-one") ) ) return false; } catch(ex) { return true; } return true; } //Attach checkCR function to onkeypress event of document document.onkeypress = checkCR; /* JavaScript functions for Preload, Swap and Restore images. */ function QuoteProcessMM_swapImgRestore() { //v3.0 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= 49) || ( ! isNaN(parseInt(txtAgeBand.value)) && parseInt(txtAgeBand.value) > 0 && keyCode >= 48) ) && keyCode <= 57) ) if (keyCode == 0 || keyCode == 8 || keyCode == 9 || keyCode == 13 || keyCode == 16 || (keyCode > 48 && keyCode <= 57) || (keyCode == 48 && ! isNaN(parseInt(txtAgeBand.value)) && parseInt(txtAgeBand.value) > 0 ) ) return true; else { //alert("Please enter a number greater than zero"); //alert("1"); //txtAgeBand.value = ""; alert(errorMessage); txtAgeBand.focus(); //if (document.all) e.returnValue = false; return false; } } /*** Function to validate value in NumericTextBox onKeyDown ***/ function NumberValidator2(e, txtAgeBand, errorMessage) { if (document.all) if((event.keyCode == 86) && (event.ctrlKey)) {alert(errorMessage); txtAgeBand.focus(); return false;} else if((e.which == 86) && (e.ctrlKey)) {alert(errorMessage); txtAgeBand.focus(); return false;} } /*** Function to validate value in NumericTextBox onBlur ***/ function NumberValidator3(e, txtAgeBand, errorMessage) { //alert("3"); if (txtAgeBand.value.length > 0) { if (isNaN(parseInt(txtAgeBand.value)) || parseInt(txtAgeBand.value) == 0) { txtAgeBand.value = ""; alert(errorMessage); txtAgeBand.focus(); return false; } else { txtAgeBand.value = parseInt(txtAgeBand.value); return true; } } } //////////////////////////////END NUMERICTEXTBOX SCRIPT////////////////////////////////////////////////////