validZIP=/^\d{5}(-\d{4})?$/;function validate1(b){var d;if(window.event){d=b.keyCode}else{if(b.which){d=b.which}}if(b.ctrlKey||d==null||d<32){return true}var a=/^[\w\s;.\[\]\-'@]*$/i;var c=String.fromCharCode(d);return a.test(c)}function validate2(c,d,b){var a=(/^(((((\w+ )+|(\((\w+( \w+)?)+\) ?)|(\'(\w+( \w+)?)+\' ?))?([\w-]+(?:\.[\w-]+)*))((@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?))|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?)))( *\; *\b|( *;?$)))+$/i).test(c.email.value);if(!a){alert("Invalid email format!")}if(a&&d){ShowWaitIcon(c,b)}return a}function validate_form(b){var a="";if(!b.firstName.value){a+="First Name is required.<br/>"}if(!b.lastName.value){a+="Last Name is required.<br/>"}if(!validZIP.test(b.zip.value)){a+="Please enter a valid ZIP code (Example: 12345 or 12345-1234).<br/>"}if(a){var c=document.getElementById("error");c.innerHTML=a;c.style.display="block"}return !a}ShowWaitIcon=function(g,f){var a=typeof(f)=="Object"?f:((f&&document.getElementById(f))||g.parentNode.parentNode);var h=a.childNodes,c;for(var e=0;e<h.length;++e){if((c=h[e].style)&&typeof(c.visibility)!="undefined"){c.visibility="hidden"}}a.style.backgroundColor="#ffffff";a.style.position="relative";var d=document.createElement("div");d.style.cssText="top: 0px; left: 0px; text-align: center; padding-top: "+(a.offsetHeight-32)/2+"px; padding-left: "+(a.offsetWidth-32)/2+"px;";var b=document.getElementById("waitImage");b.width=32;b.height=32;b.style.display="block";d.appendChild(b);a.appendChild(d);d.style.position="absolute"};addEvent=function(c,b,a){if(typeof(a)!="function"){a=new Function(a)}if(c.addEventListener){c.addEventListener(b,a,false)}else{if(c.attachEvent){c.attachEvent("on"+b,a)}}};function loadImage(aPath){var img=document.createElement("IMG");with(img){src=aPath;style.display="none"}document.body.appendChild(img)}preloadImage=function(){var img=document.createElement("IMG");with(img){id="waitImage";alt="Processing...";src="Images/loading.gif";style.display="none"}document.body.appendChild(img)};addEvent(window,"load",preloadImage);selectItem=function(c,a){var b=document.getElementById(c);if(b){b.selectedIndex=a}};var digits="0123456789";var phoneNumberDelimiters="()- ";var validWorldPhoneChars=phoneNumberDelimiters+"+";var minDigitsInIPhoneNumber=10;function isInteger(b){var a;for(a=0;a<b.length;a++){var d=b.charAt(a);if(((d<"0")||(d>"9"))){return false}}return true}function stripCharsInBag(d,e){var b;var a="";for(b=0;b<d.length;b++){var f=d.charAt(b);if(e.indexOf(f)==-1){a+=f}}return a}function checkInternationalPhone(a){s=stripCharsInBag(a,validWorldPhoneChars);if(isInteger(s)&&s.length>=minDigitsInIPhoneNumber){if(s<=19999999999){return true}else{return false}}return false}function ValidatePhone(b,a,c){return/^[^\d]*1?([-\.\+]?|\s*)\(?\d{3}\)?([\-\.\+]?|\s*)\d{3}([\-\.\+]?|\s*)\d{4}[\s]*$/.test(c.toString())};
