var validEmail=/^[\w!#\$%'\*\+\-=\?\^_`\{\|\}~]+(\.{1}[\w!#\$%'\*\+\-=\?\^_`\{\|\}~]+)*@[A-Za-z0-9]+((\.|-|_)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/i;var validZIP=/^\d{5}([-\+\x20]?\d{4})?$/;var validZIP5=/^\d{5}$/;var validName=/^[a-zA-Z\x20]([-\s\.a-zA-Z\x20]*('(?!'))?[-\s\.a-zA-Z\x20]*)*$/;var validNameWithNumbers=/^[\-\ \'\.a-zA-Z0-9]*$/;var validNameAnyChar=/^[^\s\x20]+/;var validCardName=/^[a-zA-Z\x20][\-\'\.a-zA-Z]*\x20[a-zA-Z\x20][\-\ \'\.a-zA-Z]*$/;var validPhoneExt=/^[^\d]*1?([-\.\+]?|\s*)\(?\d{3}\)?([\-\.\+]?|\s*)\d{3}([\-\.\+]?|\s*)\d{4}[\s]*$/;var validSecurityCode=/^\d{3,4}$/;var validAddress=/^[,\/\-\x20\'\.\#a-zA-Z0-9]*$/;var emptyOrWhitespaces=/^[\x20,\xA0,\s]*$/;var validateAreaCode=/^[0-9]{3}$/;var validCompanyName=/^[\%\$\#\~\@\!\&amp;\-\x20\'\.a-zA-Z0-9]*$/;var EmailErrorMessage="Please enter a valid email address";var AddressErrorMessage="a-z, 0-9, /, #, dash, period, spaces only";var NameErrorMessage="Letters, spaces or dashes";var CompanyNameErrorMessage="letters and symbols only";var NameWithNumbersErrorMessage="Letters, numbers, spaces or dashes";var NameAnyCharErrorMessage="Please enter a name";var CardNameErrorMessage="Full name as it appears on your credit card";var ZipCodeErrorMessage="Enter a valid ZIP or ZIP+4 code";var ZipCodeErrorMessage5="Enter a valid ZIP";var CommonErrorMessage="Oops! There's a problem with your search.\nPlease correct errors marked in red and try again.";var NpaErrorMessage="Area code must be a 3-digit number";var NxxErrorMessage="Local number exchange must be a 3-digit number";var Error_Message_ID="Error_Message_ID";var ValidateTypeReqName="ReqName";var ValidateTypeReqAddresses="ReqAddresses";var ValidateTypeReqNameWithNumbers="ReqNameWithNumbers";var ValidateTypeReqNameAnyChars="ReqNameAnyChars";var ValidateTypeName="Name";var ValidateTypeReqCompanyName="ReqCompanyName";var ValidateTypeReqList="ReqList";var ValidateTypePastYear="PastYear";var ValidateTypePastYear1900="PastYear1900";var ValidateTypeReqPastYear="ReqPastYear";var ValidateTypeReqDay="ValidReqDay";var ValidateTypeDay="ValidDay";var ValidateTypeMonth="Month";var ValidateTypeReqMonth="ReqMonth";var ValidateTypeLessThan="LessThan";var ValidateTypeMoreThan="MoreThan";var ValidateTypeBetween="Between";var ValidateTypeAge="Age";var ValidateTypeReqEmail="Email";var ValidateTypeReq="Req";var ValidateTypeMatch="Match";var ValidateTypeRelativeNames="Relatives";var ValidateTypeNumber="ValidateTypeNumber";var ValidateTypeReqNumber="ValidateTypeReqNumber";var ValidateTypeReqZIP="ValidateTypeReqZIP";var ValidateTypeReqZIP5="ValidateTypeReqZIP5";var ValidateTypePhoneReq="ValidateTypePhoneReq";var ValidateTypePhone="ValidateTypePhone";var ValidateTypeReqDate="ValidateTypeReqDate";var ValidateTypeReqPassword="ValidateTypeReqPassword";var ValidateTypeComboBoxReq="ValidateTypeComboBoxReq";var ValidateTypeReqSocSecNumber="ValidateTypeReqSocSecNumber";var MIN_YEAR=1750;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 validateEmail(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!#\$%'\*\+\-=\?\^_`\{\|\}~\.@]*$/i;var c=String.fromCharCode(d);return a.test(c)}function validateZip(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=/[\d\-]/;var c=String.fromCharCode(d);return a.test(c)}function validateForm(b){var a="";if(!b.firstName.value){a+="First Name is required.<br/>"}if(!b.lastName.value){a+="Last Name is required.<br/>"}if(b.email&&!validEmail.test(b.email.value)){a+=EmailErrorMessage+"<br/>"}if(b.zip&&!validZIP.test(b.zip.value)){a+=ZipCodeErrorMessage+"<br/>"}if(a){var c=document.getElementById("error");c.innerHTML=a;c.style.display="block"}return !a}ClearErrorMessage=function(a){};function divFieldErrorText(c,a,d,n){ClearErrorMessage(c);var o=c.getAttribute("idErrorText")||(c.id&&(c.id+"_err")),h=c.getAttribute("idErrorTextBox");if(o&&(o=document.getElementById(o))){o.parentNode.removeChild(o)}for(var g=c;!h&&g&&g.getAttribute;g=g.parentNode){h=g.getAttribute("idErrorTextBox")}if(h&&(h=document.getElementById(h))&&(h.firstChild&&h.firstChild.nodeName=="#text")){h.removeChild(h.firstChild)}if(a){o=document.createElement("DIV");o.className="FieldErrorText";var b=d?h||c.parentNode:c.parentNode;b.appendChild(o);c.setAttribute("iderrortext",o.id=getPK());var r=c.getAttribute("errorprefix")||"";o.innerHTML=r+a;o.style.display="block"}if(h){var f;for(var j=h.childNodes.length-1;j>=0;--j){if((f=(h.childNodes[j].nodeName!="#text"&&h.childNodes[j].style.display!="none"))){break}}h.style.display=f?"block":"none"}if(n){var q=c.type;if(q=="text"||q=="select-one"||q=="password"||q=="textarea"){if(a){if((c.className).search(n)==-1){c.className+=" "+n}}else{c.className=c.className.replace(n,"")}}}return a}String.prototype.Trim=function(){var a={L:/^\s*/g,R:/\s*$/g,A:/(^\s*)|(\s*$)/g};return function(b){return this.replace(a[b||"A"],"")}}();UpdateDoubleCheckErrorBar=function(b,a){var d=a||document.getElementById("doubleCheckErrorBar");if(d){var c=d.getAttribute("defaulterrormessage");if(c){(document.getElementById("doubleCheckErrorBarText")||d).innerHTML=c}d.style.display=b?"block":"none"}};ShowAlertError=function(a){var b=document.getElementById("doubleCheckErrorBar");if(b){UpdateDoubleCheckErrorBar(a,b)}else{if(a){alert(CommonErrorMessage)}}};function validateForm2(a,i,j,c,e,f){var d,b,h;if((d=a.firstName||a[j+"FirstName"]||document.getElementById("FirstName"))){h=divFieldErrorText(d,d.value.Trim()?(validName.test(d.value)?null:NameErrorMessage):(a.firstNameReq||"First Name is required"),null,e)||h}if((d=a.lastName||a[j+"LastName"]||document.getElementById("LastName"))){h=divFieldErrorText(d,d.value.Trim()?(validName.test(d.value)?null:NameErrorMessage):(a.lastNameReq||"Last Name is required"),null,e)||h}if((d=a[j+"SearchedFirstName"])){h=divFieldErrorText(d,d.value.Trim()?(validName.test(d.value)?null:NameErrorMessage):"Searched First Name is required",null,e)||h}if((d=a[j+"SearchedLastName"])){h=divFieldErrorText(d,d.value.Trim()?(validName.test(d.value)?null:NameErrorMessage):"Searched Last Name is required",null,e)||h}if((d=a.email||a[j+"Email"]||(!f&&a[j+"SearchCriteria"]))){h=divFieldErrorText(d,d.value.Trim()?(validEmail.test(d.value.Trim())?null:EmailErrorMessage):a.emailReq||"Email is required",null,e)||h}if((d=(f&&a[j+"SearchCriteria"]))){h=divFieldErrorText(d,d.value.Trim()?(validPhoneExt.test(d.value.Trim())?null:"Please enter a valid 10-digit US phone number"):"Search This Number is required",null,e)||h}if((d=a.zip||a[j+"ZIPCode"])){h=divFieldErrorText(d,d.value.Trim()?(validZIP.test(d.value)?null:ZipCodeErrorMessage):"Zip is required",null,e)||h}if((d=a[j+"NewPassword1"])&&(b=a[j+"NewPassword2"])&&!d.getAttribute("vlerror")&&!b.getAttribute("vlerror")){var g=c?(d.value==""||b.value!=d.value):(d.value!=b.value);h=divFieldErrorText(d,(g&&d.value=="")?(a.passwordReq||"New password is required"):null,null,e)||h;h=divFieldErrorText(b,(d.value!=b.value)?"New passwords must match each other":null,null,e)||h}if((d=a[j+"AgreeToTerms"])){h=divFieldErrorText(d.parentNode,d.checked?null:"Agree To Terms is required",null,e)||h}if((d=a[j+"CommunityNickname"])){h=divFieldErrorText(d,d.value.Trim()?null:"Community nickname is required",null,e)||h}if(!a.getAttribute("noalert")){UpdateDoubleCheckErrorBar(h)}return !h}getPK=(function(){var a="p"+(new Date()*1).toString(32),b=0;return function(c){if(c){return c}if(b>99999){b=0;a="p"+(new Date()*1).toString(32)}return a+(++b).toString(32)}}());function validateForm3(c,b,e){var a,d;if((d=c.firstName||c.FirstName)){a=divFieldErrorText(d,d.value.Trim()?(validName.test(d.value)?null:NameErrorMessage):"First Name is required.")||a}if((d=c.middleName||c.MiddleName)){a=divFieldErrorText(d,!d.value.Trim()||validName.test(d.value)?null:NameErrorMessage)||a}if((d=c.lastName||c.LastName)){a=divFieldErrorText(d,d.value.Trim()?(validName.test(d.value)?null:NameErrorMessage):"Last Name is required.")||a}if((d=c.companyName||c.CompanyName)){a=divFieldErrorText(d,!d.value.Trim()||validCompanyName.test(d.value)?null:NameErrorMessage)||a}if((d=c.city||c.City)){a=divFieldErrorText(d,!d.value.Trim()||validName.test(d.value)?null:NameErrorMessage)||a}if((d=c.zipCode||c.ZIPCode)){a=divFieldErrorText(d,d.value.Trim()?(validZIP.test(d.value)?null:ZipCodeErrorMessage):null)||a}if((d=c.age||c.Age)){a=divFieldErrorText(d,(!d.value||(d.value>0&&d.value<=120))?null:"Value is not in the correct format")||a}if((d=c.npa||c.Npa)){a=divFieldErrorText(d,d.value.Trim()?(validateAreaCode.test(d.value)?null:NpaErrorMessage):"Area code is required.")||a}if((d=c.nxx||c.Nxx)){a=divFieldErrorText(d,d.value.Trim()?(validateAreaCode.test(d.value)?null:NxxErrorMessage):"Local number exchange is required.")||a}if(a){b?showErrorMessage(Error_Message_ID,CommonErrorMessage):alert(CommonErrorMessage)}if(!a&&e){ShowWaitIcon(c,e)}return !a}function validateForm4(a,l,m,g,e,k){var d,c,j;if(g&&(d=document.getElementById(m+"SearchCriteria")||a[m+"Email"])){if(g=="FieldTypeEmail"){j=divFieldErrorText(d,d.value.Trim()?(validEmail.test(d.value.Trim())?null:(a.emailErr||EmailErrorMessage)):(a.emailReq||"Email To Search is required"),null,e)||j}}if(a&&(isValidFormName(a.id))){if((d=a[m+"CCName"])){j=divFieldErrorText(d,d.value.Trim()?(validCardName.test(d.value)?null:CardNameErrorMessage):(a.nameReq||"Your Name is required"),null,e)||j}if((d=a[m+"CCNumber"])){var b=d.value.replace(/\D+/g,"");var f=b.substring(0,4);var n;switch(b.length){case 13:if(f>=4000&&f<5000){n=true}break;case 14:if((f>=3600&&f<3700)||(f>=3800&&f<3900)||(f>=3000&&f<3060)){n=true}break;case 15:if((f>=3400&&f<3600)||(f>=3700&&f<3800)){n=true}break;case 16:if((f>=3500&&f<3600)||(f>=4000&&f<5000)||(f>=5100&&f<5620)||(f==6011)){n=true}}j=divFieldErrorText(d,d.value.Trim()?(n?null:(a.numberErr||"Credit card number is not valid")):(a.numberReq||"Card Number is required"),null,e)||j}if((d=a[m+"CCExpMonth"])&&(c=a[m+"CCExpYear"])){dateNow=new Date();var i=dateNow.getMonth()+1;var h=dateNow.getFullYear();j=divFieldErrorText(document.getElementById(d.getAttribute("iderrortext")||d.id+"_err")?d:c,(d.value.Trim()&&c.value.Trim())?(h>c.value||(h==c.value&&i>d.value))?"Credit card has expired":null:"Expiration Date is required",null,e)||j}if((d=a[m+"CCSecurityCode"])){j=divFieldErrorText(d,d.value.Trim()?(validSecurityCode.test(d.value)?null:"3 or 4 digit number"):(a.securityReq||"Security Code is required"),null,e)||j}if((d=a[m+"PostalCode"])){j=divFieldErrorText(d,d.value.Trim()?(validZIP.test(d.value)?null:ZipCodeErrorMessage):(a.zipReq||"Zip is required"),null,e)||j}}if((d=a[m+"External.Agree"]||a[m+"AgreeToTerms"])){j=divFieldErrorText(d,d.checked?null:(a.agreeReq||"You must agree to the terms and conditions before purchase."),null,e)||j}if(l&&j){a.id=="Purchase"?showErrorMessage(Error_Message_ID):showErrorMessage(Error_Message_ID,j,null,e)}if(!j&&!k){HideSubmitButtons()}UpdateDoubleCheckErrorBar(j);return !j}function HideSubmitButtons(){if((obj=document.getElementById("submitButton"))&&(obj2=document.getElementById("processingDiv"))){obj.style.display="none";obj2.style.display=""}if(typeof jQuery!="undefined"){jQuery(".hideOnSubmit").hide();jQuery(".showOnSubmit").show()}else{if(typeof Effect!="undefined"){$$(".hideOnSubmit").invoke("fade",{duration:0});$$(".showOnSubmit").invoke("appear",{duration:0})}}}function validate2_FE(d,e,c,a){var b=validEmail.test(d.email.value.replace(/^\s+|\s+$/g,""));if(!b){alert(EmailErrorMessage)}if(b&&e){ShowWaitIcon(d,c,a)}return b}function validate2(e,d,b){var a="Invalid email or domain format!";var g=e.email.value.replace(/^\s+|\s+$/g,"");if(d&&!g.match("@")){g="user@"+g}var c=validEmail.test(g),f;if(!c){b?showErrorMessage(Error_Message_ID,d?a:EmailErrorMessage):alert(d?a:EmailErrorMessage)}if(c&&((f=e.getAttribute("updateContainerId"))||e.getAttribute("showWait"))){ShowWaitIcon(e,f)}return c}function validate3(a,g){var j=a.tbEmails.value.split("\n"),f,c,b=10,k,e=0,h=[];for(var d=0;d<j.length;++d){if(!j[d]){continue}if(e>b){e++;break}c=j[d].replace("\r","").replace("^ | $","");if(c){f=validEmail.test(c);if(!f){g?showErrorMessage(Error_Message_ID,EmailErrorMessage+"<br/>Check this e-mail: '"+c+"'"):alert(EmailErrorMessage+"\nCheck this e-mail: '"+c+"'");return false}else{e++;h.push(c)}}}if(h.length==0){g?showErrorMessage(Error_Message_ID,EmailErrorMessage):alert(EmailErrorMessage);return false}if(f&&(e>b)){alert("You enetered more then "+b+" emails! Only first "+b+" emails will be validated.");a.tbEmails.value=h.join("\n")}if(f&&((k=a.getAttribute("updateContainerId"))||a.getAttribute("showWait"))){ShowWaitIcon(a,k)}return f}ValidatePhoneNum=function(b){var a=b.value.replace(/[^\d]/g,"");if(a.length==11&&a.charAt(0)=="1"){a=a.substr(1)}if(a.length==10){b.value=[a.substr(0,3),a.substr(3,3),a.substr(6)].join("-");return true}return false};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)}selectItem=function(c,a){var b=document.getElementById(c);if(b){b.selectedIndex=a}};function wopen(c,b,a,d){a+=32;d+=96;var e=window.open(c,b,"width="+a+", height="+d+", location=no, menubar=no, status=no, toolbar=no, scrollbars=yes, resizable=no");e.focus()}clearFlag=false;function showInfo(b){var a=document.getElementById(b),c;if(c=a.parentNode.selectedItemId){document.getElementById(c).style.display="none"}if(c==b){a.parentNode.selectedItemId=""}else{a.parentNode.selectedItemId=b;if(a.offsetHeight){a.parentNode.selectedItemId=""}else{a.style.display="block"}}return false}swapImg=function(b,j,d,l,i,a,m,h){if(b.className=="lnk1"&&(d=document.getElementById(d))&&(l=document.getElementById(l))){if(b.parentNode.getAttribute("imageIndex")==null){b.parentNode.setAttribute("imageIndex",0)}var g=b.parentNode.parentNode.getElementsByTagName("DIV")[0].getElementsByTagName("IMG"),f=parseInt(b.parentNode.getAttribute("imageIndex")),k=f+j,c=g.length-1;g[f].style.display="none";if(f==0&&k==1||f==c&&k==c-1){var e=b.parentNode.getElementsByTagName("A")[j==1?0:1];e.className="lnk1";e.href="javascript:void(0)"}if(k==c||k==0){b.className="lnk0";b.removeAttribute("href");if(k==c){l.src=h;d.src=i}if(k==0){l.src=m;d.src=a}}if(k!=c&&k!=0){l.src=m;d.src=i}g[k].style.display="block";b.parentNode.setAttribute("imageIndex",k)}if(window.event){event.cancelBubble=true;event.returnValue=false}return false};scale=function(b){if(b.className=="hiddenImg"){b.style.cssText="position: absolute; top: -10000px; display:block;"}var c=b.width/b.parentNode.clientWidth,a=b.height/b.parentNode.clientHeight;if(c>1||a>1){if(c>a){b.width=b.parentNode.clientWidth}else{b.height=b.parentNode.clientHeight}}b.style.cssText=""};imgError404=function(f){f.onerror=null;var c=f.parentNode,b=document.getElementById(c.id+"_nav").getElementsByTagName("A");var e=f.getAttribute("imageIndex");f.parentNode.removeChild(f);if(b.length==0){return}e=0;var d=c.getElementsByTagName("IMG")[e];if(d){d.style.display="block"}d=(e>0)?1:0;if(b[0].className!="lnk"+d){b[0].className="lnk"+d;if(d){b[0].href="javascript:void(0)"}else{b[0].removeAttribute("href")}b[0].getElementsByTagName("IMG")[0].src=b[0].getElementsByTagName("IMG")[0].src.toLowerCase().replace(d?"_off.gif":".gif",d?".gif":"_off.gif")}d=(c.getElementsByTagName("IMG").length<=1||e>=c.getElementsByTagName("IMG").length-1)?0:1;if(b[1].className!="lnk"+d){b[1].className="lnk"+d;if(d){b[1].href="javascript:void(0)"}else{b[1].removeAttribute("href")}b[1].getElementsByTagName("IMG")[0].src=b[1].getElementsByTagName("IMG")[0].src.toLowerCase().replace(d?"_off.gif":".gif",d?".gif":"_off.gif")}if(c.getElementsByTagName("IMG").length<=1){b[0].style.display=b[1].style.display="none"}};ShowWaitIconInForm=function(c,b){var a=(c&&c.target)||(event&&event.srcElement);if(a){ShowWaitIcon(a,b)}};showToolTip=function(d,b,a){var c;if(d.getAttribute("haveToolTip")){c=d.parentNode.lastChild;c.style.display="block"}else{if(b){d.setAttribute("haveToolTip","true");c=document.createElement("DIV");c.className="toolTip";c.innerHTML=b;d.parentNode.appendChild(c);if(c.clientWidth>d.parentNode.parentNode.clientWidth-20){c.style.whiteSpace="normal";if(d.parentNode.parentNode.clientWidth>20){c.style.width=(d.parentNode.parentNode.clientWidth-20)+"px"}else{c.style.width=(d.parentNode.parentNode.offsetWidth-20)+"px"}}}else{return}}if(a){c.style.top=(a.offsetY||a.layerY||0)+25+"px"}if(d.parentNode.parentNode.nodeName.toLowerCase()=="div"&&d.parentNode.parentNode.clientWidth>20){c.style.left=Math.min(0,d.parentNode.parentNode.clientWidth-c.clientWidth-d.parentNode.offsetLeft)+"px"}};hideToolTip=function(a){a.parentNode.lastChild.style.display="none"};preloadImage=function(){var o=document.getElementById("waitImage");if(o){var b=o.parentNode;var name=b.tagName.toUpperCase();if(name=="BODY"){b.removeChild(o)}else{o=b.parentNode;o.removeChild(b);for(o=o.firstChild;o;o=o.nextSibling){if((b=o.style)&&typeof(b.visibility)!="undefined"){b.visibility="visible"}}}}with((o=document.createElement("IMG"))){id="waitImage";alt="Processing...";src=(window.location.pathname.indexOf("/freeservices/")>=0?"../":"")+"images/loading.gif";style.display="none"}document.body.appendChild(o)};ShowWaitIcon=function(h,k,d){var c=false;if(typeof(event)=="object"&&(c=true)){event.returnValue=false}var b;if(d){b=typeof(d)=="Object"?d:(d&&document.getElementById(d))}if(!b){b=typeof(k)=="Object"?k:((k&&document.getElementById(k))||h.parentNode.parentNode)}var j=b.childNodes,e;for(var g=0;g<j.length;++g){if((e=j[g].style)&&typeof(e.visibility)!="undefined"){e.visibility="hidden"}}b.style.position="relative";var a=document.createElement("div");a.style.cssText="position:absolute;top: 0px; left: 0px; text-align: center; padding-top: "+(b.offsetHeight-32)/2+"px; padding-left: "+(b.offsetWidth-32)/2+"px;";var f=document.getElementById("waitImage");if(f){f.width=32;f.height=32;f.style.display="block";a.appendChild(f);b.appendChild(a)}if(c){if(h){h.submit()}f.src=f.src}};function ShowWaitTimeout(j,b,a,g){if(b==null||validateUniversal(a,b)){var d;if(d=document.getElementById(j)){var h=d.childNodes,e;for(var f=0;f<h.length;++f){if(h[f].style){h[f].style.display="none"}}var c=document.createElement("div");c.className="align_center";c.innerHTML='<h1>Searching...</h1><p>&#160;</p><p><img src="images/loading.gif" alt="Searching.." width="32" height="32" /></p><p><br />Please wait a moment. If this page does not refresh, <a href="#" onclick="getElementById(\''+a.id+"').submit()\">click here</a>.</p>";d.appendChild(c)}setTimeout("document.getElementById('"+a.id+"').submit();",10);return true}return false}GetNewDate=function(c,a,b){return(new Date((parseInt(c,10)+1000),((a-1)-1000*12),b))};FormFieldValueGet=function(c){var a=c.value.Trim(),b=c.getAttribute("watermarkvalue");return(b&&a==b?"":a)};function validateUniversal(aq,D,B){var ab,g,S={},Q,u,Z,L;for(var M in D){if((typeof D[M]!="undefined")&&!S[D[M][0]]&&(g=aq.elements[D[M][0]])&&!g.getAttribute("vlerror")){var af;af=Q=u=null;Z=true;L=FormFieldValueGet(g);if(g.type){var T=g.getAttribute("relatedField");if(T){T=(T=aq[T])&&FormFieldValueGet((T.options?T.options[T.selectedIndex]:T))}switch(D[M][1]){case ValidateTypeReqName:if(g.offsetWidth){Q=D[M][2]?D[M][2]:"Value is required.";u=D[M][3]?D[M][3]:NameErrorMessage;af=divFieldErrorText(g,L?(validName.test(L)?null:u):(T?null:Q),null,B)}break;case ValidateTypeReqAddresses:if(g.offsetWidth){Q=D[M][2]?D[M][2]:"Value is required.";u=D[M][3]?D[M][3]:AddressErrorMessage;af=divFieldErrorText(g,L?(validAddress.test(L)?null:u):(T?null:Q),null,B)}break;case ValidateTypeReqNameWithNumbers:if(g.offsetWidth){Q=D[M][2]?D[M][2]:"Value is required.";u=D[M][3]?D[M][3]:NameWithNumbersErrorMessage;af=divFieldErrorText(g,L?(validNameWithNumbers.test(L)?null:u):(T?null:Q),null,B)}break;case ValidateTypeReqNameAnyChars:if(g.offsetWidth){Q=D[M][2]?D[M][2]:"Value is required.";u=D[M][3]?D[M][3]:NameAnyCharErrorMessage;af=divFieldErrorText(g,L?(validNameAnyChar.test(L)?null:u):(T?null:Q),null,B)}break;case ValidateTypeName:af=divFieldErrorText(g,!g.disabled&&L?(validName.test(L)?null:NameErrorMessage):null,null,B);break;case ValidateTypeReqCompanyName:if(g.offsetWidth){Q=D[M][2]?D[M][2]:"Value is required.";u=D[M][3]?D[M][3]:CompanyNameErrorMessage;af=divFieldErrorText(g,L?(validCompanyName.test(L)?null:u):(T?null:Q),null,B)}break;case ValidateTypeReqList:L=(g.type=="hidden"?L:g.options[g.selectedIndex].value.Trim());Q=D[M][2]?D[M][2]:"Value is required.";af=divFieldErrorText(g,(L||T)?null:Q,null,B);break;case ValidateTypePastYear:case ValidateTypePastYear1900:var Y=L;if(g.offsetWidth){var t=(new Date()).getFullYear();if(!Y||/^\d+$/.test(Y)){if(D[M][1]==ValidateTypePastYear1900){minYear=1900}else{minYear=1}var O=parseInt(Y,10),ad=false;af=divFieldErrorText(g,g.disabled?null:(((g.getAttribute("isRequired")=="true"&&!Y&&!T)?"Value is required.":null)||(ad=((O>=minYear&&O<=t)||!Y?null:minYear+" - "+t))),ad,B)}else{var U=g.getAttribute("errorprefix");if(U){g.removeAttribute("errorprefix")}af=divFieldErrorText(g,"Year is not valid.",null,B);if(U){g.setAttribute("errorprefix",U)}}}else{divFieldErrorText(g,null,null,B)}break;case ValidateTypeReqPastYear:var E=(new Date()).getFullYear();var h=parseInt(L,10);if(g.offsetWidth){af=divFieldErrorText(g,L?(isNaN(L)?"Year is not valid.":((h>=1&&h<=E)||!L?null:"Year between 1 - "+E+".")):"Year is required.",null,B)}break;case ValidateTypeReqDay:af=divFieldErrorText(g,L?!L||(L>0&&L<=31)?null:"Day must be in range 01 - 31.":"Day is required.",null,B);break;case ValidateTypeDay:af=divFieldErrorText(g,!L||(L>0&&L<=31)?null:"Day must be in range 01 - 31.",null,B);break;case ValidateTypeReqMonth:af=divFieldErrorText(g,L?(L>0&&L<=12?null:"Month must be in range 01 - 12."):"Month is required.",null,B);break;case ValidateTypeMonth:af=divFieldErrorText(g,L?(L>0&&L<=12?null:"Month must be in range 01 - 12."):null,null,B);break;case ValidateTypeLessThan:if(!S[D[M][2]]){var aj=aq.elements[D[M][2]];if(aj&&aj.offsetWidth&&!aj.getAttribute("vlerror")){var F=parseInt(L,10);var E=parseInt(FormFieldValueGet(aj),10);if(!isNaN(F)&&!isNaN(E)){var U=g.getAttribute("errorprefix"),ae=aj.getAttribute("errorprefix");if(U){g.removeAttribute("errorprefix")}af=divFieldErrorText(g,(F>E)?D[M][3]+(ae?" of "+ae.toLowerCase():""):null,true,B);if(U){g.setAttribute("errorprefix",U)}}}}break;case ValidateTypeMoreThan:if(!S[D[M][2]]){var aj=aq.elements[D[M][2]];if(aj&&aj.offsetWidth&&!aj.getAttribute("vlerror")){var F=parseInt(L,10);var E=parseInt(FormFieldValueGet(aj),10);if(!isNaN(F)&&!isNaN(E)){var U=g.getAttribute("errorprefix"),ae=aj.getAttribute("errorprefix");if(U){g.removeAttribute("errorprefix")}af=divFieldErrorText(g,(F<E)?D[M][3]+(ae?" of "+ae.toLowerCase():""):null,true,B);if(U){g.setAttribute("errorprefix",U)}}}}break;case ValidateTypeBetween:var o=D[M][2],n=D[M][3],s,r;if(!S[o]&&!S[n]&&(s=aq.elements[o])&&s.offsetWidth&&!s.getAttribute("vlerror")&&(r=aq.elements[n])&&r.offsetWidth&&!r.getAttribute("vlerror")){var t=parseInt(L,10);af=divFieldErrorText(g,(t<parseInt(FormFieldValueGet(s),10)||t>parseInt(FormFieldValueGet(r),10))?D[M][4]:null,null,B)}break;case ValidateTypeAge:var p=L;af=divFieldErrorText(g,(p==""||/^\d+$/.test(p)&&(parseInt(p,10)<151)&&(parseInt(p,10)>0))?null:"Age is not valid.",null,B);break;case ValidateTypeReqEmail:Q=D[M][2]?D[M][2]:"Value is required.";u=D[M][3]?D[M][3]:"Email is not valid.";af=divFieldErrorText(g,L?(validEmail.test((aq.id=="LoginForm"?L:L))?null:u):Q,g.getAttribute("idErrorTextBox"),B);break;case ValidateTypeReq:Q=D[M][2]?D[M][2]:"Value is required.";var A=D[M][3]||[];A.unshift(g);for(var ah=0;ah<A.length;++ah){var x=(ah==0?g:aq.elements[A[ah]]);if(af||g.getAttribute("isdisabled")){divFieldErrorText(x,null,null,B)}else{if(x.type=="checkbox"){af=divFieldErrorText(x,x.checked?null:Q,null,B)}else{if(x.type=="text"||x.type=="textarea"||x.type=="password"||x.type=="file"){af=divFieldErrorText(x,FormFieldValueGet(x)?null:Q,x.getAttribute("idErrorTextBox"),B)}}if(x.type=="select-one"){af=divFieldErrorText(x,!emptyOrWhitespaces.test(FormFieldValueGet(x))?null:(T?null:Q),null,B)}}}break;case ValidateTypePhone:Z=false;u=D[M][3]||"Phone Number is not valid <nobr>(Ex: 555-555-5555)</nobr>";af=divFieldErrorText(g,L?(ValidatePhoneNum(g)?null:u):(Z?Q:null),null,B);case ValidateTypePhoneReq:Q=D[M][2]||"Phone Number is required";u=D[M][3]||"Phone Number is not valid <nobr>(Ex: 555-555-5555)</nobr>";af=divFieldErrorText(g,L?(ValidatePhoneNum(g)?null:u):(Z?Q:null),null,B);break;case ValidateTypeMatch:var C=D[M][2];if(!S[C]){var am=L,al=FormFieldValueGet((C=aq[C]));af=divFieldErrorText(C,(D[M][4]=="ignorecase"?(am.toLowerCase()==al.toLowerCase()):(am==al))?null:(D[M][3]||"The two value must match."),null,B)}break;case ValidateTypeRelativeNames:var V=/^[\-\ \'\.a-zA-Z]{0,255}(,[\-\ \'\.a-zA-Z]{0,255})?(,[\-\ \'\.a-zA-Z]{0,255})?$/;af=divFieldErrorText(g,V.test(L)?null:D[M][2],null,B);break;case ValidateTypeReqSocSecNumber:var f=L;var d=FormFieldValueGet(document.getElementById(D[M][2]));var c=FormFieldValueGet(document.getElementById(D[M][3]));var ap=document.getElementById(D[M][4]);af=divFieldErrorText(ap,((f&&d&&c)?((/^\d{3}$/.test(f)&&/^\d{2}$/.test(d)&&/^\d{4}$/.test(c))?null:"Number is not valid"):"Social Security Number is required"),null,B);break;case ValidateTypeNumber:af=divFieldErrorText(g,/^\d*$/.test(L)?null:"Number is not valid",null,B);break;case ValidateTypeReqNumber:Q=D[M][2]||"Value is required.";u=D[M][3]||"Number is not valid";var ao=L;af=divFieldErrorText(g,ao?(/^\d*$/.test(L)?null:u):(Z?Q:null),null,B);break;case"ValidateTypePOBox":u=D[M][2]||"Apt/PO Box is not valid";af=divFieldErrorText(g,L?(/^\d*\w*$/.test(L)?null:u):null,null,B);break;case"ValidateTypeZIP":Z=false;case ValidateTypeReqZIP:var G=L;Q=D[M][2]||"Value is required.";af=divFieldErrorText(g,G?(validZIP.test(G)?null:ZipCodeErrorMessage):(Z?Q:null),null,B);break;case ValidateTypeReqZIP5:var G=L;Q=D[M][2]||"Value is required.";af=divFieldErrorText(g,G?(validZIP5.test(G)?null:ZipCodeErrorMessage5):(Z?Q:null),null,B);break;case"ValidateTypeFullName":Z=false;case"ValidateTypeReqFullName":var N=L;af=divFieldErrorText(g,N?(validName.test(N)?(/\s/.test(N)?null:"Please enter both first and last name"):"Value is not valid"):(Z?"Value is required.":null),null,B);break;case"ValidateTypePassword":Z=false;case ValidateTypeReqPassword:var P=L,w=document.getElementById(D[M][2]);af=divFieldErrorText(g,(Z&&!P)?"Password is required":null,null,B);if(w&&!w.getAttribute("vlerror")){af=divFieldErrorText(w,(P==FormFieldValueGet(w))?null:"Passwords must match each other",null,B)||af}break;case"ValidateTypeDate":Z=false;case ValidateTypeReqDate:if(g.disabled){af=divFieldErrorText(g,null,null,null)}else{var I=aq[D[M][2]],H=aq[D[M][3]],R=(g.type=="text"?g:g.options[g.selectedIndex]).value.Trim()||(Z?"":1000),X=I.options[I.selectedIndex].value.Trim()||(Z?"":1),z=H.options[H.selectedIndex].value.Trim()||(Z?"":1),v=GetNewDate(R,z,X),l=new Date();u=(Z&&(!R||!z||!X))?"Value is required.":"Invalid Date";af=divFieldErrorText(g,((v.getMonth()+1==z)&&(v.getDate()==X)&&(v.getFullYear()==R))?((v.getTime()<l.getTime())?null:"Invalid Date"):u,null,null)}break;case"ValidateTypeDateLessThan":var e=aq[D[M][4]],ar=L,an=FormFieldValueGet(e);if(e.getAttribute("vlerror")||S[D[M][4]]){break}if(!e.offsetWidth||!(ar&&an)){af=divFieldErrorText(g,null,null,null);break}var K=aq[D[M][2]],b=aq[D[M][5]],ak=K.options[K.selectedIndex].value.Trim(),ai=b.options[b.selectedIndex].value.Trim(),y=D[M][7]||"Invalid date range";if(ak&&ai){var J=aq[D[M][3]],a=aq[D[M][6]],ac=J.options[J.selectedIndex].value.Trim()||1,aa=a.options[a.selectedIndex].value.Trim()||1;date1=GetNewDate(ar,ak,ac),date2=GetNewDate(an,ai,aa);af=divFieldErrorText(g,((date1.getTime()<=date2.getTime())?null:y),null,null)}else{af=divFieldErrorText(g,((ar<=an)?null:y),null,null)}break;case ValidateTypeComboBoxReq:var W=g.options[g.selectedIndex].value.Trim();Q=D[M][2]?D[M][2]:"Choose at least one value.";af=divFieldErrorText(g,W.Trim()?null:(Z?Q:null),null,B);break}}else{af=D[M][1]?D[M][1]:"Value is required.";for(var ag=g.length;ag>0;--ag){if(g[ag-1].checked){af=null;break}}af=divFieldErrorText(g[g.length-1],af)}S[D[M][0]]=af;ab=af||ab}}if(window.LightviewOpened&&!aq.getAttribute("noresize")){Lightview.Resize()}else{if(!aq.getAttribute("noalert")){ShowAlertError(ab)}}return !ab}(function(d,c){if(window.addEventListener){window.addEventListener("unload",d,false);window.addEventListener("load",c,false)}else{if(window.attachEvent){window.attachEvent("onunload",d);window.attachEvent("onload",c)}}})(function(){},preloadImage);ClearForm=function(aName,aDoc,aIgnoredElements){var doc=aDoc||document,e=doc[aName];e.reset();e=e.elements;for(var i=0,t;i<e.length;++i){if(aIgnoredElements){if(aIgnoredElements[e[i].name]!=undefined||aIgnoredElements[e[i].id]!=undefined){continue}}if(e[i].getAttribute("stable")){continue}t=e[i].type;if(t=="text"||t=="password"){e[i].value=""}else{if(t=="checkbox"){e[i].checked=e[i].defaultChecked=false}else{if(e[i].className.indexOf("InError")!=-1){e[i].className=e[i].className.replace(new RegExp("InError"),"")}else{if(t=="select-one"){if(e[i].name=="Location"){with(e[i]){for(var j=0;j<e[i].length;++j){with(options[j]){if(value=="US"){selected=true;break}}}}if(aName=="SearchAnyName"||aName=="VitalRecords"||aName=="SearchCensus"){e[i].setAttribute("isClear",true);e[i].onchange()}}else{if(e[i].name=="RecordType"){e[i].options[4].selected=true}else{e[i].options[0].selected=true}}}}}}if(e[i].nodeName.toLowerCase()=="textarea"){e[i].value=""}e[i].className=e[i].className.replace("InError","")}var arr=doc[aName].getElementsByTagName("div");for(var i=0;i<arr.length;i++){if(arr[i].className=="FieldErrorText"){arr[i].parentNode.removeChild(arr[i]);i--}}var errorBar=doc.getElementById(aName+"ErrorBar");if(errorBar){errorBar.style.display="none"}if(window.event){event.cancelBubble=true;event.returnValue=false}return false};SetFocusForm=function(c){var d,a=document.forms[c];if(a&&a.elements[0]){for(var b=0;b<a.elements.length;b++){if((d=a.elements[b])&&d.style.display!="none"&&d.type!="hidden"){d.focus();if(d.type=="text"){d.select()}break}}}};function isValidFormName(a){return/checkout|purchase|registrationorr|orrbuy|ccupdate|VitalCertificateCheckout|GiftMemberships/i.test(a.toString())}function validateOptionalFields(b,a){var e=true;for(var c in a){if(typeof a[c]!="undefined"){var d=b[a[c][0]];if(d.style.display!="none"){e=validateOptionalField(b,a[c],e)}}}return e}function validateOptionalField(b,d,c){var a=[[d[0],d[1],d[2]]];if(!validateUniversal(b,a)){return false}return c}function clearErrorMessages(b,a){for(var c in a){if(typeof a[c]!="undefined"){var d=b[a[c][0]];if(d){divFieldErrorText(d,null,null,null)}}}}CancelBubble=function(b){if(!b){return}if(b.cancelable){if(b.preventDefault&&b.cancelable){b.preventDefault()}if(b.stopPropagation){b.stopPropagation()}return false}else{if(b.keyCode!=17&&b.keyCode!=16){b.cancelBubble=true;var a;try{b.keyCode=0}catch(a){}return b.returnValue=false}}};
