Validate.BGMVersionHistory=function(){var b=[];b[b.length]="Version 1.0.0: This is the default Live Validation Library.";b[b.length]="Version 2.0.0: This is the first version of the Live Validation Library with the BGM rules added.";b[b.length]="Version 2.1.0: This version has additional validation for a terms of agreement checkbox. The code works whether or not the checkbox exists.";return b};Validate.BGMVersion=function(){return"2.1.0"};Validate.Warning=function(b){this.message=b;this.name="ValidationWarning"};
setFocus=function(b){var a=true;$("#"+b)?$("#"+b).focus():a=false;return a};setAccountType=function(b,a){$("#"+b).val(a)};$.fn.stripHTML=function(b){b=b.replace(/<BR>/gi,"\n");b=b.replace(/<BR\/>/gi,"\n");return b.replace(/(<([^>]+)>)/ig,"")};
$.fn.launch_jError=function(b,a,d){if(typeof a=="undefined"||!a)a="Application Error:";for(var c="<div style='text-align:center;'>",e=0;e<b.length;e++)typeof b[e]!="undefined"&&(c+=b[e]);c+="</div>";c+="<div class='alert_mini_logo center'>";c+="<img src='"+globalVars.path+"images/mini_logo.jpg' alt='This Has Been A "+globalVars.site_domain+" Tip' title='This Has Been A "+globalVars.site_domain+" Tip'/>";c+="</div>";$.alerts.okButton="&nbsp;OK&nbsp;";jError(c,a,function(){typeof d!="undefined"&&d&&
setFocus(d)})};$.fn.launch_jError_IE6=function(b,a,d){if(typeof a=="undefined"||!a)a="Application Error:\n\n";for(var c="",e=0;e<b.length;e++)typeof b[e]!="undefined"&&(c+=$.fn.stripHTML(b[e])+"\n");c+="\nThis Has Been A Tip From: "+globalVars.site_domain+"\n";b=a+c;typeof d!="undefined"&&d&&setFocus(d);alert(b)};$.fn.set_jError=function(b,a,d){globalVars.browser_name=="MSIE"&&globalVars.browser_version=="6.0"?$.fn.launch_jError_IE6(b,a,d):$.fn.launch_jError(b,a,d)};
$.fn.launch_jAlert=function(b,a,d){if(typeof a=="undefined"||!a)a="Application Tip:";for(var c="<div style='text-align:center;'>",e=0;e<b.length;e++)typeof b[e]!="undefined"&&(c+=b[e]);c+="</div>";c+="<div class='alert_mini_logo center'>";c+="<img src='"+globalVars.path+"images/mini_logo.jpg' alt='This Has Been A "+globalVars.site_domain+" Tip' title='This Has Been A "+globalVars.site_domain+" Tip'/>";c+="</div>";$.alerts.okButton="&nbsp;OK&nbsp;";jAlert(c,a,function(){typeof d!="undefined"&&d&&setFocus(d)})};
$.fn.launch_jAlert_IE6=function(b,a,d){if(typeof a=="undefined"||!a)a="Application Tip:\n\n";for(var c="",e=0;e<b.length;e++)typeof b[e]!="undefined"&&(c+=$.fn.stripHTML(b[e])+"\n");c+="\nThis Has Been A Tip From: "+globalVars.site_domain+"\n";b=a+c;typeof d!="undefined"&&d&&setFocus(d);alert(b)};$.fn.set_jAlert=function(b,a,d){globalVars.browser_name=="MSIE"&&globalVars.browser_version=="6.0"?$.fn.launch_jAlert_IE6(b,a,d):$.fn.launch_jAlert(b,a,d)};
$.fn.launch_jConfirm=function(b,a,d){if(typeof a=="undefined"||!a)a="Application Tip:";for(var c="<div style='text-align:center;'>",e=0;e<b.length;e++)typeof b[e]!="undefined"&&(c+=b[e]);c+="</div>";c+="<div class='alert_mini_logo center'>";c+="<img src='"+globalVars.path+"images/mini_logo.jpg' alt='This Has Been A "+globalVars.site_domain+" Tip' title='This Has Been A "+globalVars.site_domain+" Tip'/>";c+="</div>";$.alerts.okButton="&nbsp;Change your account selection&nbsp;";$.alerts.cancelButton=
"&nbsp;Keep your selection &amp; continue&nbsp;";jConfirm(c,a,function(a){if(a==true){if(typeof d=="object")for(propertyName in d)propertyName=="setAccountType"?setAccountType(d[propertyName].element,d[propertyName].val):propertyName=="setFocus"&&setFocus(d[propertyName].element)}else d.setFocus&&setFocus(d.setFocus.element)})};
$.fn.launch_jConfirm_IE6=function(b,a,d){if(typeof a=="undefined"||!a)a="Application Tip:\n\n";for(var c="",e=0;e<b.length;e++)typeof b[e]!="undefined"&&(c+=$.fn.stripHTML(b[e])+"\n");c+="\nThis Has Been A Tip From: "+globalVars.site_domain+"\n";if(confirm(a+c))d.setFocus&&setFocus(d.setFocus.element);else if(typeof d=="object")for(propertyName in d)propertyName=="setAccountType"?setAccountType(d[propertyName].element,d[propertyName].val):propertyName=="setFocus"&&setFocus(d[propertyName].element)};
$.fn.set_jConfirm=function(b,a,d){globalVars.browser_name=="MSIE"&&globalVars.browser_version=="6.0"?$.fn.launch_jConfirm_IE6(b,a,d):$.fn.launch_jConfirm(b,a,d)};
CheckDateForMinor=function(b,a,d){var c=[false,"MM","DD","YYYY",""],e=[];if(NumberCheck(b)&&NumberCheck(a)&&NumberCheck(d)){var f=new Date,g=f.getFullYear()-18;if(g==d){var g=f.getDate(),f=f.getMonth(),h=b-1;h<f?(c[0]=true,c[1]=b,c[2]=a,c[3]=d):h==f?a<g?(c[0]=true,c[1]=b,c[2]=a,c[3]=d):a==g?(c[0]=true,c[1]=b,c[2]=a,c[3]=d):(c[1]=b,c[3]=d,e[0]="I am sorry, but <span style='font-style:italic;font-weight:bold;'>your birth date: "+b+"/"+a+"/"+d+"</span>, indicates that <span style='font-style:italic;font-weight:bold;'>you are a minor for "+
(a-g)+" more day(s).<br/>You must be currently at least 18 years old to apply.</span>"):(c[2]=a,c[3]=d,e[0]="I am sorry, but <span style='font-style:italic;font-weight:bold;'>your birth date: "+b+"/"+a+"/"+d+"</span>, indicates that <span style='font-style:italic;font-weight:bold;'>you are still a minor for "+(h-f)+" more month(s).<br/>You must be currently at least 18 years old to apply.</span>")}else g<d?e[0]="This date of birth is in the future and is not allowed.":g>d&&(c[0]=true,c[1]=b,c[2]=
a,c[3]=d)}else e[0]="This date is invalid. The month, day and year must be all numbers.\n";if(e[0])document.location.href="application-error.php?src=";return c};DaysArray=function(b){for(var a=1;a<=b;a++){this[a]=31;if(a==4||a==6||a==9||a==11)this[a]=30;a==2&&(this[a]=29)}return this};daysInFebruary=function(b){return b%4==0&&(b%100!=0||b%400==0)?29:28};
extractNumber=function(b){b=String(b);new_value="";len=b.length;for(var a=0;a<len;a++)char_str=b.substr(a,1),/[0-9]/.test(char_str)&&(new_value+=char_str);return new_value};getGroupedValues=function(b,a){var d="";typeof a=="undefined"&&(a=3);for(var c=false,e=1;e<=a;e++)if(typeof $("#"+b+e)!="undefined"&&$("#"+b+e).val())c=true;else{c=false;break}if(c)for(e=1;e<=a;e++)d+=$("#"+b+e).val().toString();else typeof $("#"+b)!="undefined"&&$("#"+b).val()&&(d=$("#"+b).val().toString());return d};
isTheSamePhoneNumbers=function(b,a){var d=false,c="";b&&(c=getGroupedValues(a),b&&NumberCheck(b)&&b.length==10&&c&&NumberCheck(c)&&c.length==10&&b.toString()==c.toString()&&(d=true));return d};NumberCheck=function(b){for(var a=true,d,c=0;c<b.length&&a==true;c++)d=b.charAt(c),"0123456789".indexOf(d)==-1&&(a=false);return a};
sequenceCheck=function(b){var b=extractNumber(String(b)),a=[],d=false;len=b.length;sequence="";for(var c=0;c<len;c++)sequence+=String(c);a[0]=sequence;c=sequence="";for(c=1;c<=len;c++)sequence+=String(c);a[8]=sequence;sequence="";for(c=len;c>=1;c--)sequence+=String(c);a[9]=sequence;sequence="";for(c=len-1;c>=0;c--)sequence+=String(c);a[1]=sequence;a[2]="1234567890";a[3]="123456789";a[4]="987654321";a[5]="9876543210";a[6]="987654321";a[7]="0987654321";for(var e=a.length,c=0;c<=9;c++){sequence="";for(var f=
0;f<len;f++)sequence+=c.toString();a[e]=sequence;e++}var g="";$.each(a,function(a,b){or_char=a?"|":"";g+=or_char+b});re=RegExp(g);re.test(b)&&(d=true);return d};
ValidateDate=function(b,a,d,c,e){var f=[false,"MM","DD","YYYY",""],g=[];if(NumberCheck(b)&&NumberCheck(a)&&NumberCheck(d)){var h=new Date,l=new Date,p=new Date,n,m=b-1,o=(new Date).getFullYear();if(typeof c=="undefined"||c=="")c=80;if(typeof e=="undefined"||e=="")e=0;c=o-c;n=o-e;h.setFullYear(d,m,a);l.setFullYear(c,m,a);p.setFullYear(n,m,a);h>=l&&h<=p?(e=(new Date(d,m,a)).getTime(),c=(new Date(c,m,a)).getTime(),n=(new Date(n,m,a)).getTime(),h.setTime(e),l.setTime(c),p.setTime(n),h.getMonth()==m?h.getDate()==
a?h.getFullYear()==d?(f[0]=true,f[1]=b,f[2]=a,f[3]=d,f[4]=""):(f[0]=false,f[1]="MM",f[2]="DD",f[3]=o,f[4]="",g[0]="This date does not exist.\n"):(f[0]=false,f[1]=b,f[2]="DD",f[3]=d,f[4]="",g[0]="This date does not exist.\n"):(f[0]=false,f[1]="MM",f[2]=a,f[3]=d,f[4]="",g[0]="This date does not exist.\n")):(f[0]=false,f[1]=b,f[2]="01",f[3]=o,f[4]="",g[0]="This date does not exist.\n")}else f[0]=false,f[1]=false,f[2]=false,f[3]=false,f[4]="",g[0]="This date is invalid. The month, day and year must be all numbers.\n";
if(g[0]){b="";for(a=0;a<g.length;a++)b+="<div style='text-align:left;'>"+g[a]+"</div>";f[4]=b}return f};
Validate.Aba=function(b,a){var b=String(b),a=a||{},d=a.checksumMessage||"This is an unknown Routing Number",c=a.travelersMessage||"Please no 'Traveler's Cheques' numbers",e=a.governmentMessage||"Please no 'Government Institution' numbers",f=a.elecMessage||"Please no 'Electronic Transaction Identifier' numbers",g=a.unusedMessage||"This number is not currently in use",h=0;for(i=0;i<b.length;i+=3)h+=parseInt(b.charAt(i),10)*3+parseInt(b.charAt(i+1),10)*7+parseInt(b.charAt(i+2),10);(h==0||h%10!=0)&&Validate.fail(d);
d=b.substr(0,2);switch(d){case "80":Validate.Warning(c);break;case "00":Validate.Warning(e)}c=parseInt(d,10);c>=61&&c<=72&&Validate.Warning(f);c>=1&&c<=12||c>=21&&c<=32||Validate.fail(g);return true};var account_type_alert_counter=0;
Validate.AccountType=function(b,a){var a=a||{},d=a.element||"",c=a.next||"",e=a.show_tip||false;if(!d.length)throw Error("Validate::AccountType - Error :  dom element must be provided.");e&&$("#"+d).val()=="savings"&&account_type_alert_counter==0&&(account_type_alert_counter++,d="<div style='text-align:center;'>",d+="By providing your <b>Checking Account</b> information, your application ",d+="will be presented to more lenders, <span style='text-decoration:underline;'>increasing your chance</span> of getting your maximum loan amount.",
d+="</div>",$.fn.set_jConfirm(Array(d),false,{setAccountType:{element:"account_type",val:"checking"},setFocus:{element:c}}))};
Validate.AllowedChars=function(b,a){a=a||{};if(!a.chars)throw Error("Validate::AllowedChars - Error validating: characters must be provided.");var d=a.chars||"";if(!d.length)throw Error("Validate::AllowedChars - Error validating :  characters must be provided.");var c=a.flags||"";if(d=(c.length>0?RegExp("[^"+d+"]",c):RegExp("[^"+d+"]")).exec(String(b)))d=String(d).substr(0,1),Validate.fail('"'+d+'", is an unauthorized character.');return true};var bank_routing_alert_counter=0;
Validate.BankABA=function(b,a){var b=String(b),a=a||{},d=a.endpoint||"system/leadsystem/lib/check_aba.php",c=a.element||"";if(!c.length)throw Error("Validate::BankABA - Error :  dom element must be provided.");var e=a.next_focus||false,f="",g="",h="";$.ajax({async:false,url:d+"?id="+(new Date).valueOf(),data:{aba:b},dataType:"json",success:function(a){if(a&&a.error)f=a.error,$("#bank_name").removeAttr("disabled"),$("#bank_tel1").removeAttr("disabled"),$("#bank_tel2").removeAttr("disabled"),$("#bank_tel3").removeAttr("disabled");
else if(a&&a.warning){if(!sequenceCheck(b))h=a.warning,$("#bank_name").removeAttr("disabled"),$("#bank_tel1").removeAttr("disabled"),$("#bank_tel2").removeAttr("disabled"),$("#bank_tel3").removeAttr("disabled")}else $("#"+c).attr("validated",b),$("#aba").val(a.aba),a.bank_name&&$("#bank_name")?($("#bank_name").val(a.bank_name),$("#bank_name").attr({disabled:true}),(new LiveValidation("bank_name")).destroy(),$("#bank_name").removeClass("LV_invalid_field").addClass("LV_valid_field")):$("#bank_name").removeAttr("disabled"),
a.bank_address&&$("#bank_address"),a.bank_city&&$("#bank_city"),a.bank_state&&$("#bank_state"),a.bank_zipcode9&&$("#bank_zipcode9"),a.bank_zipcode5&&$("#bank_zipcode5"),a.bank_institution_status_code&&$("#bank_institution_status_code"),a.bank_tel&&$("#bank_tel")&&($("#bank_tel").val(a.bank_tel),g=$("#bank_tel").val().toString()),a.bank_tel1&&$("#bank_tel1")?($("#bank_tel1").val(a.bank_tel1),g=$("#bank_tel1").val().toString(),$("#bank_tel1").attr({disabled:true}),(new LiveValidation("bank_tel1")).destroy(),
$("#bank_tel1").removeClass("LV_invalid_field").addClass("LV_valid_field")):$("#bank_tel1").removeAttr("disabled"),a.bank_tel2&&$("#bank_tel2")?($("#bank_tel2").val(a.bank_tel2),g+=$("#bank_tel2").val().toString(),$("#bank_tel2").attr({disabled:true}),(new LiveValidation("bank_tel2")).destroy(),$("#bank_tel2").removeClass("LV_invalid_field").addClass("LV_valid_field")):$("#bank_tel2").removeAttr("disabled"),a.bank_tel3&&$("#bank_tel3")?($("#bank_tel3").val(a.bank_tel3),g+=$("#bank_tel3").val().toString(),
$("#bank_tel3").attr({disabled:true}),(new LiveValidation("bank_tel3")).destroy(),$("#bank_tel3").removeClass("LV_invalid_field").addClass("LV_valid_field")):$("#bank_tel3").removeAttr("disabled"),a="<div style='text-align:center;'>",isTheSamePhoneNumbers(g,"phone_work")||(isTheSamePhoneNumbers(g,"phone_home")?(a+="<span style='font-weight:bold;'>Bank Phone Number Cannot be the Same as the Employer Phone Number.</span><br/> Please correct this on the next panel.",a+="</div>",$("#phone_home1").removeClass("LV_valid_field").addClass("LV_invalid_field"),
$("#phone_home2").removeClass("LV_valid_field").addClass("LV_invalid_field"),$("#phone_home3").removeClass("LV_valid_field").addClass("LV_invalid_field"),$.fn.set_jError(Array(a),false,false)):($("#phone_home1").removeClass("LV_invalid_field").addClass("LV_valid_field"),$("#phone_home2").removeClass("LV_invalid_field").addClass("LV_valid_field"),$("#phone_home3").removeClass("LV_invalid_field").addClass("LV_valid_field")))}});f.length>0&&Validate.fail(f);h.length>0&&bank_routing_alert_counter==0&&
(bank_routing_alert_counter++,d="<div style='text-align:center;'>",d+=h,d+="It will be accepted with this application but ",d+="there will be a <span style='text-decoration:underline;'>LOWER CHANCE</span> of lenders funding you your ",d+="full requested <span style='text-decoration:underline;'>LOAN AMOUNT</span>.<br/>Please review this field before proceeding.",d+="</div>",$.fn.set_jAlert(Array(d),false,e));return true};
Validate.CaliAgreement=function(b,a){var b=String(b),a=a||{},d=a.state_element||"";if($("#"+d).val().toUpperCase()=="CA"||$("#"+d).val().toUpperCase()=="CALIFORNIA")(b.toUpperCase()=="DISAGREE"||b.toUpperCase()=="NO"||b.toUpperCase()=="FALSE")&&Validate.fail("You have indicated that you live in California. Please agree to the California Residence Agreement.")};
Validate.DateCheck=function(b,a){var a=a||{},d=a.element||"",c=a.element_base||"",e=a.element||false;if(!d.length)throw Error("Validate::DateCheck - Error :  dom element must be provided.");var f="",g="01",h="01",l="1900";if($("#"+d).attr("validated")!=String(b)&&$("#"+c+"month")&&NumberCheck($("#"+c+"month").val())&&$("#"+c+"day")&&NumberCheck($("#"+c+"day").val())&&$("#"+c+"year")&&NumberCheck($("#"+c+"year").val())&&(d=ValidateDate($("#"+c+"month").val(),$("#"+c+"day").val(),$("#"+c+"year").val()))&&
d.length>0)if(g=d[1],h=d[2],l=d[3],f=d[4])$.alerts.okButton="&nbsp;OK&nbsp;",$.fn.set_jError(f,false,false),g&&g=="MM"&&Validate.fail("Birth Date is incorrect."),h&&h=="DD"&&Validate.fail("Birth Date is incorrect."),l&&l=="YYYY"&&Validate.fail("Birth Date is incorrect.");else if(e&&(d=CheckDateForMinor(g,h,l))&&d.length>0)g=d[1],h=d[2],l=d[3],f=d[4],g&&($("#"+c+"month").val(g),NumberCheck(g)||($("#"+c+"month").removeClass("LV_valid_field"),$("#"+c+"month").addClass("LV_invalid_field"))),h&&($("#"+
c+"day").val(h),NumberCheck(h)||($("#"+c+"day").removeClass("LV_valid_field"),$("#"+c+"day").addClass("LV_invalid_field"))),l&&($("#"+c+"year").val(l),NumberCheck(l)||($("#"+c+"year").removeClass("LV_valid_field"),$("#"+c+"year").addClass("LV_invalid_field"))),f&&$.fn.set_jError(Array(f));return true};
Validate.EmailDomain=function(b,a){var b=String(b),a=a||{},d=a.endpoint||"system/leadsystem/lib/check_email.php",c=a.element||"";if(!c.length)throw Error("Validate::EmailDomain - Error :  dom element must be provided.");var e=(new Date).valueOf(),f="",g="";$("#"+c).attr("validated")!=b&&($.ajax({async:false,url:d+"?"+e,data:{email:b},dataType:"json",success:function(a){a&&a.error?f=a.error:a&&a.warn?g=a.warn:$("#"+c).attr("validated",b)}}),f.length>0&&Validate.fail(f),g.length>0&&Validate.Warning(g));
return true};
Validate.ExcludeRepeats=function(b,a){b=String(b);a=a||{};if(!a.specialChars)throw Error("Validate::ExcludeRepeats - Error validating repeats: special characters must be provided.");var d=a.specialChars instanceof Array?a.specialChars:[];if(!d.length)throw Error("Validate::ExcludeRepeats - Error validating repeats: special characters must be provided.");var c="";$.each(d,function(a,b){escape_char=$.inArray(b,"[^$.|?*+()")>=0?"\\":"";or_char=a?"|":"";c+=or_char+"("+escape_char+b+")\\s?\\"+(a+1)});
re=RegExp(c);if(match=re.exec(b))char_str=String(match).substr(0,1),char_names={"-":"Dash"," ":"Space","&":"Ampersand",".":"Period","#":"Hash"},char_name=char_names[char_str]||"",Validate.fail("Multiple Invalid "+char_name+" ("+char_str+") Characters.");return true};
Validate.FraudNumbers=function(b,a){var b=String(b),a=a||{},d=a.element||"",c=a.failureMessage||"This number is unauthorized.",e=true;$("#"+d)&&NumberCheck(b)&&($("#"+d),sequenceCheck(b)&&((new LiveValidation(d)).destroy(),$("#"+d).removeClass("LV_valid_field"),$("#"+d).addClass("LV_invalid_field"),Validate.fail(c),e=false));return e};
Validate.GroupRadio=function(b,a){var a=a||{},d=a.failureMessage||"Please pick a response.",c=a.element||false,e=a.valid;if(!c.length)throw Error("Validate::GroupRadio - Error :  dom element must be provided.");if(!e.length)throw Error("Validate::GroupRadio - Error :  vali value must be provided.");(c=$("#"+c+":radio:checked").val())&&c!=e&&Validate.fail(d);return true};var po_box_alert_counter=0;
Validate.Name=function(b,a){var b=String(b),a=a||{},d=a.failureMessage||"Unauthorized name.";jQuery.each(["[a-z]{2}"],function(a,c){re=RegExp(c,"i");re.test(b)||Validate.fail(d)});var c=0;len=b.length;for(i=0;i<=len;i++)/[a-z]/i.test(b[i])&&c++;return true};var phone_warning_alert_counter=0,phone_error_alert_counter=0;
Validate.Phone=function(b,a){var b=String(b),a=a||{},d=a.errorOnTollFree||false,c=a.required||false,e=a.element||"",f=a.parent||"",g=a.compare_warning||false,h=a.compare_error||false,l=false;if(!e.length)throw Error("Validate::Phone - Error :  dom element must be provided.");if(!f.length)throw Error("Validate::Phone - Error :  dom parent must be provided.");if(!a.piece)throw Error("Validate:Phone - Error : Piece is expected.");var p=a.piece||{},n="",m={},o="";p==4?(o=extractNumber(b),o.length==10?
(m["1"]=o.substr(0,3),m["2"]=o.substr(3,3),m["3"]=o.substr(6,4)):c&&o.length<10&&Validate.fail("Phone number must be 10 digits")):m[p]=b;$.each(m,function(a,b){var c={},e={};switch(a){case "1":n="( XXX ) ### - ####";c["[2-9][0-8][0-9]"]=" is invalid.";d&&(e["800|866|877|888"]=" is unauthorized.");e["900|976"]=" is unauthorized.";e["([0-79])\\1{2}"]=" is unauthorized.";e["(\\d)11"]=" is unauthorized.";e["37\\d|96\\d"]=" is unauthorized.";break;case "2":n="( ### ) XXX - ####";c["[2-9][0-9]{2}"]=" is unauthorized.";
e["(\\d)11"]=" is unauthorized.";e["976"]=" is unauthorized.";e["700|950|958|959"]=" is unauthorized.";break;case "3":n="( ### ) ### - XXXX";c["[0-9]{4}"]=" is unauthorized.";break;default:throw Error("Validate:Phone - Error: Invalid Piece");}$.each(c,function(a,c){re=RegExp(a);re.test(b)||Validate.fail(n+c)});$.each(e,function(a,c){re=RegExp(a);re.test(b)&&Validate.fail(n+c)})});var q="",c={};$("#"+f+" input[type=text]").each(function(a,b){q+=extractNumber(b.value)});if(q.length==10){sequenceCheck(q)&&
Validate.fail("Phone Number is unauthorized.");c["1"]=q.substr(0,3);c["2"]=q.substr(3,3);c["3"]=q.substr(6,4);c["2"]=="555"&&(val=parseInt(c["3"],10),val>=100&&val<=199&&Validate.fail("Phone Number is unauthorized."),(val==5555||val==1212)&&Validate.fail("Phone Number is unauthorized."));for(var r=e.split("_"),s="",k=0;k<r.length;k++)s+=r[k].substr(0,1).toUpperCase()+r[k].substr(1).toLowerCase()+" ";s=s.replace(/^\s+|\s+$/g,"");r=false;k="";if(h)for(var j in h)if(isTheSamePhoneNumbers(q,h[j].element)){(new LiveValidation(e+
"1")).removeMessageAndFieldClass();(new LiveValidation(e+"2")).removeMessageAndFieldClass();(new LiveValidation(e+"3")).removeMessageAndFieldClass();$("#"+e+"1").removeClass("LV_valid_field").addClass("LV_invalid_field");$("#"+e+"2").removeClass("LV_valid_field").addClass("LV_invalid_field");$("#"+e+"3").removeClass("LV_valid_field").addClass("LV_invalid_field");k+="<div style='text-align:center;'>";k+="<span style='font-weight:bold;'>Bank Phone Number "+h[j].failureMessage+"</span><br/> Please correct this on the next panel. ";
k+="</div>";h[j].element=="phone_home"&&phone_error_alert_counter++;$("#"+h[j].element+"1").removeClass("LV_valid_field").addClass("LV_invalid_field");$("#"+h[j].element+"2").removeClass("LV_valid_field").addClass("LV_invalid_field");$("#"+h[j].element+"3").removeClass("LV_valid_field").addClass("LV_invalid_field");Validate.fail(h[j].failureMessage);break}else if(h[j].element=="phone_home"||h[j].element=="bank_tel")$("#"+e+"1").removeClass("LV_invalid_field").addClass("LV_valid_field"),$("#"+e+"2").removeClass("LV_invalid_field").addClass("LV_valid_field"),
$("#"+e+"3").removeClass("LV_invalid_field").addClass("LV_valid_field"),f=$("#"+h[j].element+"1").val()+$("#"+h[j].element+"2").val()+$("#"+h[j].element+"3").val(),f.length==10&&NumberCheck(f)&&($("#"+h[j].element+"1").removeClass("LV_invalid_field").addClass("LV_valid_field"),$("#"+h[j].element+"2").removeClass("LV_invalid_field").addClass("LV_valid_field"),$("#"+h[j].element+"3").removeClass("LV_invalid_field").addClass("LV_valid_field"),$("#bank_tel_parent span.LV_invalid").hide(),$("#phone_home_parent span.LV_invalid").hide())}if(g){for(j in g)if(isTheSamePhoneNumbers(q,
g[j].element)){if(g[j].next_focus)l=g[j].next_focus;r=true;k+="<div style='text-align:center;font-weight:bold;'>";k+=s+" Number is the SAME as "+g[j].failureMessage+". ";k+="</div>";break}r&&phone_warning_alert_counter==0&&(k+="<div style='text-align:center;'>",k+="It will be accepted with this application but ",k+="there will be a <span style='text-decoration:underline;'>lower chance</span> of lenders funding you your ",k+="full requested <span style='text-decoration:underline;'>loan amount</span>.<br/>Please review this field before proceeding.",
k+="</div>",$.fn.set_jError(Array(k),false,l),phone_warning_alert_counter++)}return true};Validate.MilitaryCity=function(b,a){b=String(b).replace(/^\s+|\s+$/g,"");typeof a=="undefined"&&(a={});var d=a.failureMessage||"Please enter a non-military base.";/^[AFD](\.)?P(\.)?O(\.)?$/i.test(b)&&Validate.fail(d)};Validate.MilitaryZipCode=function(b){b=String(b).replace(/^\s+|\s+$/g,"");/\/09d{3}|(?:96[2-6]|987|340)d{2}\//.test(b)&&Validate.fail("Zip code appears to be military.  Please enter a non-military zip code.")};
Validate.SSN=function(b,a){var a=a||{},d=a.element||"",c=$("#"+d+"1").val()+$("#"+d+"2").val()+$("#"+d+"3").val();$("#"+d+"1")&&$("#"+d+"1").val()&&$("#"+d+"2")&&$("#"+d+"2").val()&&$("#"+d+"3")&&$("#"+d+"3").val()&&c.length==9&&(sequenceCheck(c)?((new LiveValidation(d+"1")).destroy(),(new LiveValidation(d+"2")).destroy(),(new LiveValidation(d+"3")).destroy(),$("#"+d+"1").removeClass("LV_valid_field").addClass("LV_invalid_field"),$("#"+d+"2").removeClass("LV_valid_field").addClass("LV_invalid_field"),
$("#"+d+"3").removeClass("LV_valid_field").addClass("LV_invalid_field"),Validate.fail("Social Security Number is unauthorized.")):($("#"+d+"1").removeClass("LV_invalid_field").addClass("LV_valid_field"),$("#"+d+"2").removeClass("LV_invalid_field").addClass("LV_valid_field"),$("#"+d+"3").removeClass("LV_invalid_field").addClass("LV_valid_field")));return true};
Validate.WhiteSpace=function(b,a){var a=a||{},d=a.failureMessage||"Cannot begin or end with a space";re=/^\s|\s$/;re.test(String(b))&&Validate.fail(d);return true};
Validate.ZipCode=function(b,a){var b=String(b),a=a||{},d=a.endpoint||"system/leadsystem/lib/get_city_state.php",c=a.element||"";if(!c.length)throw Error("Validate::ZipCode - Error :  dom element must be provided.");var e="",f="",g;$.ajax({async:false,url:d+"?id="+(new Date).valueOf(),data:{zipcode:b},dataType:"json",success:function(a){if(a&&a.error)e=a.error,c=="zipcode"&&$("#zipcode").val(a.zipcode),$("#city").removeAttr("disabled"),$("#state").removeAttr("disabled");else if(a&&a.warn)c=="zipcode"&&
$("#zipcode").val(a.zipcode),f=a.warn,$("#city").removeAttr("disabled"),$("#state").removeAttr("disabled");else{var d=a.state;$("#"+c).attr("validated",b);if(c=="zipcode"){$("#zipcode").val(a.zipcode);a.city&&$("#city").val(a.city);if(a.state){$("#state").val(a.state);var p=$("#state").val();if($("#state").val()==null||d!=p)$("#state").val("AK"),$("#state").removeAttr("disabled"),$("#city").val(""),$("#city").removeAttr("disabled"),delete a.state,delete a.city,$("#state").removeClass("LV_valid_field"),
$("#zipcode").removeClass("LV_valid_field"),jAlert("You cannot apply for a payday loan from this state at this time","Application Tip:"),g=true;$("#state").val()=="CA"?$("#field_cali_agree").is(":hidden")&&$("#field_cali_agree").show():$("#field_cali_agree").is(":visible")&&$("#field_cali_agree").hide()}a.city?$("#city").attr({disabled:true}):$("#city").removeAttr("disabled");a.state?$("#state").attr({disabled:true}):$("#state").removeAttr("disabled");(new LiveValidation("city")).destroy();a.city&&
$("#city").addClass("LV_valid_field");a.state&&$("#state").addClass("LV_valid_field")}else $("#employer_zipcode").val(a.zipcode)}}});g&&Validate.fail("You cannot apply for a payday loan from this area at this time");e.length>0&&Validate.fail(e);f.length>0&&Validate.Warning(f);return true};Validate.TermsAgree=function(){var b=true;$("#terms_agree").is(":checked")||(Validate.fail(),b=false);return b};
