﻿//BOOKMARK CURRENT PAGEfunction BookmarkPage(url,title){	if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4)) {		window.external.AddFavorite(url,title);	} else {		alert("Unfortunately your browser does not support this function.\n\nPlease use one of the following methods... \n CTRL-D (Netscape)\n CMD-D (Safari)\n CTRL-T (Opera)");	}}//LIMIT ALLOWABLE INPUTfunction LimitKey(keyString, evt) {	var charCode = (evt.which) ? evt.which : event.keyCode	var allowed = false;			for(var key=0;key<keyString.length;key++) {		if( keyString.charCodeAt(key) == charCode ){			allowed = true;		}			}			if (charCode == 127 || charCode == 8) 		allowed = true;			return allowed;	  }//VALIDATE PROPERLY FORMATTED FIELDSvar outputResponse = "";function ValidateInput(nodeList) {	if(nodeList) {						if( nodeList.nodeName == "INPUT" ) {					if( nodeList.getAttribute("validateType") ) {										if( nodeList.getAttribute("validateType") == "Phone") {												validPhone = new RegExp("^[0-9]{3}-[0-9]{3}-[0-9]{4}$");					if( !nodeList.value.match(validPhone) ) {														outputResponse += nodeList.name + " (" + nodeList.value + ") is not formatted correctly.\n      format: (###-###-####)\n\n";							nodeList.focus();					}				}				if( nodeList.getAttribute("validateType") == "Date") {											validDate = new RegExp("^[0-9]{2}/[0-9]{2}/[0-9]{4}$");					if( !nodeList.value.match(validDate) ) {						outputResponse += nodeList.name + " (" + nodeList.value + ") is not formatted correctly.\n      format: (mm/dd/yyyy)\n\n";						nodeList.focus();					}				}				if( nodeList.getAttribute("validateType") == "Time") {											validTime = new RegExp("^[0-9]{1,2}:[0-9]{2}$");					if( !nodeList.value.match(validTime) ) {						outputResponse += nodeList.name + " (" + nodeList.value + ") is not formatted correctly.\n      format: (hh:mm)\n\n";						nodeList.focus();					}				}					if( nodeList.getAttribute("validateType") == "Email") {											validEmail = new RegExp("^[a-zA-Z]+[.\-a-zA-Z0-9_]*[a-zA-Z]+@([a-zA-Z].)+[a-zA-Z]{2,5}$");					if( !nodeList.value.match(validEmail) ) {						outputResponse += nodeList.name + " (" + nodeList.value + ") is not formatted correctly.\n      format: (address@doman.class)\n\n";						nodeList.focus();					}				}																											}		}		else if(nodeList.hasChildNodes) {			for(var i=0;i<nodeList.childNodes.length;i++) {				ValidateInput(nodeList.childNodes[i]);			}		}	}}//VALIDATE FORM FIELDSfunction ValidateFields(frm) {	outputResponse = "";	ValidateInput(frm);}//CALL DO-ACTIONfunction DoAction(formName, formAction, params, confirmText) {			if(confirmText != undefined) {				if(confirm(confirmText) ) {					document.forms[formName].Action.value = formAction;			document.forms[formName].Params.value = params;			document.forms[formName].submit(); 				}		} else { 		document.forms[formName].Action.value = formAction;		document.forms[formName].Params.value = params;		document.forms[formName].submit(); 	}			            }//CHANGE OBJECT DISPLAYfunction ChangeDisplay(objID) {	obj = document.getElementById(objID);		if( obj.style.display == "block") 		obj.style.display = "none";	else		obj.style.display = "block";}//CHANGE OBJECT DISPLAY ONfunction ChangeDisplayOn(objID) {	obj = document.getElementById(objID);	obj.style.display = "block";}//CHANGE OBJECT DISPLAY OFFfunction ChangeDisplayOff(objID) {	obj = document.getElementById(objID);	obj.style.display = "none";}	