function EnableButtonNextStep(cssClassName,nextStepBtnImage){var LinkButtonNext=document.getElementById("LinkButtonNext");LinkButtonNext.href='javascript:WebForm_DoPostBackWithOptions(new%20WebForm_PostBackOptions("LinkButtonNext",%20"",%20true,%20"RegCustomerValidation",%20"",%20false,%20true));CheckValidatorsClientSide();';LinkButtonNext.onclick=function(){return true};LinkButtonNext.onclick="CheckValidatorsClientSide();return true;";LinkButtonNext.className=cssClassName;var img=document.getElementById("NextButton");img.src=nextStepBtnImage}function AutoFillInPostalSingleForAllBrowser(control){var checkcopy;checkcopy=document.getElementById("CbPostal");if(checkcopy!=undefined)if(checkcopy.checked==true){var inputcontrol;inputcontrol=control.id;var selectcontrol;selectcontrol=document.getElementById(inputcontrol);var hiddencontrol;hiddencontrol=selectcontrol.id+"Hidden";var targetcontrol;targetcontrol=document.getElementById(hiddencontrol);MirrorField(control.id,targetcontrol.value,"value");if(Page_Validators&&typeof ValidatorValidate=="function"){var failed=false;for(i=0;i<Page_Validators.length;i++)if(Page_Validators[i].controltovalidate==control.mirror){ValidatorValidate(Page_Validators[i]);if(!Page_Validators[i].isvalid)failed=true}failed&&control.focus()}}}function AutoFillInPostalSingle(control){if(document.forms[0].CbPostal.checked&&control.mirror){MirrorField(control.id,control.mirror,"value");if(Page_Validators&&typeof ValidatorValidate=="function"){var failed=false;for(i=0;i<Page_Validators.length;i++)if(Page_Validators[i].controltovalidate==control.mirror){ValidatorValidate(Page_Validators[i]);if(!Page_Validators[i].isvalid)failed=true}failed&&control.focus()}}}function ValidateControlSingle(control){control.setAttribute("autocomplete","off");if(Page_Validators&&typeof ValidatorValidate=="function"){var failed=false;for(i=0;i<Page_Validators.length;i++)if(Page_Validators[i].controltovalidate==control.id){ValidatorValidate(Page_Validators[i]);if(!Page_Validators[i].isvalid)failed=true}failed&&control.focus()}}function ValidateControlSingleNoFocus(control){if(Page_Validators&&typeof ValidatorValidate=="function"){var failed=false;for(i=0;i<Page_Validators.length;i++)if(Page_Validators[i].controltovalidate==control.id){ValidatorValidate(Page_Validators[i]);if(!Page_Validators[i].isvalid)failed=true}}}function ValidDate(_strDate){var _strDate,_strDateArray,_strDay,_strMonth,_strYear,_intday,_intMonth,_intYear,_booFound=false,_strSeparatorArray=["-"," ","/","."],_intElementNr,_err=0,_strMonthArray=new Array(12);_strMonthArray[0]="Jan";_strMonthArray[1]="Feb";_strMonthArray[2]="Mar";_strMonthArray[3]="Apr";_strMonthArray[4]="May";_strMonthArray[5]="Jun";_strMonthArray[6]="Jul";_strMonthArray[7]="Aug";_strMonthArray[8]="Sep";_strMonthArray[9]="Oct";_strMonthArray[10]="Nov";_strMonthArray[11]="Dec";if(_strDate.length<1)return true;for(_intElementNr=0;_intElementNr<_strSeparatorArray.length;_intElementNr++)if(_strDate.indexOf(_strSeparatorArray[_intElementNr])!=-1){_strDateArray=_strDate.split(_strSeparatorArray[_intElementNr]);if(_strDateArray.length!=3){_err=1;return false}else{_strDay=_strDateArray[0];_strMonth=_strDateArray[1];_strYear=_strDateArray[2]}_booFound=true}if(_booFound==false)if(_strDate.length>5){_strDay=_strDate.substr(0,2);_strMonth=_strDate.substr(2,2);_strYear=_strDate.substr(4)}if(_strYear.length==2)_strYear="20"+_strYear;_intday=parseInt(_strDay,10);if(isNaN(_intday)){_err=2;return false}_intMonth=parseInt(_strMonth,10);if(isNaN(_intMonth)){for(i=0;i<12;i++)if(_strMonth.toUpperCase()==_strMonthArray[i].toUpperCase()){_intMonth=i+1;_strMonth=_strMonthArray[i];i=12}if(isNaN(_intMonth)){_err=3;return false}}_intYear=parseInt(_strYear,10);if(isNaN(_intYear)){_err=4;return false}if(_intMonth>12||_intMonth<1){_err=5;return false}if((_intMonth==1||_intMonth==3||_intMonth==5||_intMonth==7||_intMonth==8||_intMonth==10||_intMonth==12)&&(_intday>31||_intday<1)){_err=6;return false}if((_intMonth==4||_intMonth==6||_intMonth==9||_intMonth==11)&&(_intday>30||_intday<1)){_err=7;return false}if(_intMonth==2){if(_intday<1){_err=8;return false}if(LeapYear(_intYear)==true){if(_intday>29){_err=9;return false}}else if(_intday>28){_err=10;return false}}_strDate=_intday+" "+_strMonthArray[_intMonth-1]+" "+_strYear;return true}function LeapYear(_intYear){if(_intYear%100==0){if(_intYear%400==0)return true}else if(_intYear%4==0)return true;return false}function OpenPopup(_url,_popupType,_width,_height,_resize){var newWin=window.open(_url,_popupType,"height="+_height+",width="+_width+",outerHeight="+_height+",outerWidth="+_width+",screenX=10,screenY=25,left=10,top=25,scrollbars=yes,directories=no,toolbars=no,menubar=no,dependent=no,status=yes,resizable="+_resize);newWin.focus()}function RefreshMainWindow(_url,_popupType,_width,_height){var pWin=window.opener;if(pWin!=null&&!pWin.closed){pWin.location.href=_url;pWin.focus()}else OpenPopup(_url,_popupType,_width,_height)}function SetParentWindowUrl(_url){var pWin=window.opener;if(pWin!=null&&!pWin.closed){pWin.location.href=_url;pWin.focus()}else window.open(_url)}function MirrorField(field1,field2,property){var _field1Element;eval("_field1Element = document.forms[0]."+field1+"."+property+"");eval("document.forms[0]."+field2+"."+property+" = _field1Element")}function DisplayErrorMessage(elementValue,visibilityValue){if(visibilityValue)visibilityValue="visible";else visibilityValue="hidden";if(document.getElementById)eval("document.getElementById(elementValue).style.visibility = '"+visibilityValue+"'");else if(document.all)eval("document.all."+elementValue+".style.visibility = '"+visibilityValue+"'")}function ValidateCountryStateSelections(DropDownState,DropDownCountry,InvalidSelection,StateValidator,CountryValidator){var retValue=true,dropDownState=eval("document.forms[0]."+DropDownState+";"),dropDownCountry=eval("document.forms[0]."+DropDownCountry+";");if(dropDownState.value==InvalidSelection){DisplayErrorMessage(StateValidator,true);retValue=false}else DisplayErrorMessage(StateValidator,false);if(dropDownCountry.value==InvalidSelection){DisplayErrorMessage(CountryValidator,true);retValue=false}else DisplayErrorMessage(CountryValidator,false);return retValue}function ValidateStateSelection(DropDownState,TextboxProvinceState,DropDownCountry,AustraliaCode,OtherStateCode){var _retValue=true,dropDownState=eval("document.forms[0]."+DropDownState+";"),dropDownCountry=eval("document.forms[0]."+DropDownCountry+";"),textboxProvinceState=eval("document.forms[0]."+TextboxProvinceState+";");if(dropDownState.value==OtherStateCode){textboxProvinceState.className="TableFormTextField TableText";textboxProvinceState.disabled=false;if(dropDownCountry.value==AustraliaCode&&dropDownCountry.length>0){dropDownCountry.selectedIndex=0;ValidateControlSingleNoFocus(dropDownCountry)}}else{textboxProvinceState.className="TableFormTextField TableText";textboxProvinceState.disabled=true;textboxProvinceState.value="";if(dropDownCountry.value!=AustraliaCode){dropDownCountry.value=AustraliaCode;ValidateControlSingleNoFocus(dropDownCountry)}}return _retValue}function ValidateCountrySelection(DropDownState,TextboxProvinceState,DropDownCountry,AustraliaCode,OtherStateCode){var _retValue=true,dropDownState=eval("document.forms[0]."+DropDownState+";"),dropDownCountry=eval("document.forms[0]."+DropDownCountry+";"),textboxProvinceState=eval("document.forms[0]."+TextboxProvinceState+";");if(dropDownCountry.value==AustraliaCode){textboxProvinceState.value="";textboxProvinceState.className="TableFormTextField TableText";textboxProvinceState.disabled=true;if(dropDownState.value==OtherStateCode&&dropDownState.length>0){dropDownState.selectedIndex=0;ValidateControlSingleNoFocus(dropDownState)}}else{textboxProvinceState.className="TableFormTextField TableText";textboxProvinceState.disabled=false;if(dropDownState.value!=OtherStateCode){dropDownState.value=OtherStateCode;ValidateControlSingleNoFocus(dropDownState)}}return _retValue}function ExpiryDateSelected(DropDownListMonth,DropDownListCreditCardYear){var month,year;eval("month = document.forms[0]."+DropDownListMonth+".value;");eval("year = document.forms[0]."+DropDownListCreditCardYear+".value;");if(month=="0"|year=="0"|month=="-1"|year=="-1")return false;else return true}function ValidCard(DropDownListOfCardTypes,TextBoxOfCreditCardNumber){var cardType,cardNumber,visaType="1",masterCardType="2";eval("cardType = document.forms[0]."+DropDownListOfCardTypes+".value;");eval("cardNumber = document.forms[0]."+TextBoxOfCreditCardNumber+".value;");var numMC=parseInt(cardNumber.substr(0,2)),numVISA=parseInt(cardNumber.substr(0,1)),numBankCard=parseInt(cardNumber.substr(0,4));if(cardNumber=="")return false;else if(numMC>50&&numMC<56&&cardType==masterCardType)return true;else if(numVISA==4&&cardType==visaType)return true;else if(numBankCard==5610&&cardType=="BC")return true;else return false}function UpdateCountdownTimer(maxSeconds,boolPostback){now=new Date;seconds=(event-now)/1e3+secondsToAdd;seconds=Math.round(seconds);if(seconds>0&&seconds<maxSeconds){document.getElementById(labelTime).innerHTML=seconds+" "+secondWord;ID=window.setTimeout("UpdateCountdownTimer("+maxSeconds+","+boolPostback+");",1e3)}if(boolPostback)seconds<2&&seconds>0&&__doPostBack("LinkButtonRefresh");else if(seconds<=0)document.getElementById(divParentMsg).style.visibility="hidden"}function CheckSearchSelectionsValid(TextBoxSearch,Message){var searchString;eval("searchString = document.forms[0]."+TextBoxSearch+".value;");if(searchString==""){alert(Message);return false}else return true}function ValidateStateJurisdictionSelection(){}function ValidateJurisidictionSelection(objSource,objArgs){objArgs.IsValid=true;var ddlState=document.getElementById(ddlStateId),jurCodes=jurisdictions.split(",");if(objArgs.Value==invalidSelection){objArgs.IsValid=false;for(var i=0;i<jurCodes.length;i++)if(jurCodes[i]==ddlState[ddlState.selectedIndex].value)objArgs.IsValid=true}}function ValidatePhoneNumberLiveOdds(objSource,objArgs){objArgs.IsValid=true;if(document.forms[0].TextboxNumberWork.value.length==0&&document.forms[0].TextboxNumberMobile.value.length==0)objArgs.IsValid=false}function ChangeAccountOpenContactType(mobileI18N){var DropDownPhoneType,tbTextBoxHomeAreaCode,RF_AreaCode,RF_Ast_AreaCode;DropDownPhoneType=document.getElementById("ddlPhoneType");tbTextBoxHomeAreaCode=document.getElementById("TextBoxHomeAreaCode");RF_AreaCode=document.getElementById("RequiredfieldvalidatorArea");RF_Ast_AreaCode=document.getElementById("AreaCodeReqField");if(DropDownPhoneType!=undefined)if(DropDownPhoneType.value==mobileI18N){if(RF_AreaCode!=undefined){RF_AreaCode.enabled=false;RF_AreaCode.style.visibility="hidden"}if(tbTextBoxHomeAreaCode!=undefined){tbTextBoxHomeAreaCode.disabled=true;tbTextBoxHomeAreaCode.value=""}if(RF_Ast_AreaCode!=undefined)RF_Ast_AreaCode.style.visibility="hidden"}else{if(RF_AreaCode!=undefined){RF_AreaCode.enabled=true;RF_AreaCode.style.visibility="visible"}if(tbTextBoxHomeAreaCode!=undefined)tbTextBoxHomeAreaCode.disabled=false;if(RF_Ast_AreaCode!=undefined)RF_Ast_AreaCode.style.visibility="visible"}};