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;}}}if (failed){control.focus();}}}}function ValidateControlSingle(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;}}}if (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;var _strDateArray;var _strDay;var _strMonth;var _strYear;var _intday;var _intMonth;var _intYear;var _booFound = false;var _strSeparatorArray = new Array("-"," ","/",".");var _intElementNr;var _err = 0;var _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;var dropDownState = eval("document.forms[0]."+DropDownState+";");var 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;var dropDownState = eval("document.forms[0]."+DropDownState+";");var dropDownCountry = eval("document.forms[0]."+DropDownCountry+";");var textboxProvinceState = eval("document.forms[0]."+TextboxProvinceState+";");if (dropDownState.value == OtherStateCode){textboxProvinceState.className = "accTextField100";textboxProvinceState.disabled = false;if (dropDownCountry.value == AustraliaCode && dropDownCountry.length > 0){dropDownCountry.selectedIndex = 0;ValidateControlSingleNoFocus(dropDownCountry);}}else{textboxProvinceState.className = "accTextField100Dis";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;var dropDownState = eval("document.forms[0]."+DropDownState+";");var dropDownCountry = eval("document.forms[0]."+DropDownCountry+";");var textboxProvinceState = eval("document.forms[0]."+TextboxProvinceState+";");if (dropDownCountry.value == AustraliaCode){textboxProvinceState.value = "";textboxProvinceState.className = "accTextField100Dis";textboxProvinceState.disabled = true;if (dropDownState.value == OtherStateCode && dropDownState.length > 0){dropDownState.selectedIndex = 0;ValidateControlSingleNoFocus(dropDownState);}}else{textboxProvinceState.className = "accTextField100";textboxProvinceState.disabled = false;if (dropDownState.value != OtherStateCode){dropDownState.value = OtherStateCode;ValidateControlSingleNoFocus(dropDownState);}}return _retValue;}function ExpiryDateSelected(DropDownListMonth, DropDownListCreditCardYear){var month;var year;eval("month = document.forms[0]."+ DropDownListMonth+ ".value;");eval("year = document.forms[0]."+DropDownListCreditCardYear+".value;");if( month == "0" | year == "0" ){return false;}else{return true;}}function ValidCard( DropDownListOfCardTypes, TextBoxOfCreditCardNumber ){var cardType;var cardNumber;var visaType = "1"; var masterCardType = "2";eval("cardType = document.forms[0]."+DropDownListOfCardTypes+".value;");eval("cardNumber = document.forms[0]."+TextBoxOfCreditCardNumber+".value;");var numMC = parseInt(cardNumber.substr(0,2));var numVISA = parseInt(cardNumber.substr(0,1));var 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 UpdateCountdown(maxSeconds, boolPostback){now = new Date();seconds = (event - now) / 1000 + secondsToAdd;seconds = Math.round(seconds);if ( seconds > 0 && seconds < maxSeconds ){document.getElementById(labelTime).innerHTML = seconds + " " + secondWord;}ID=window.setTimeout("UpdateCountdown("+maxSeconds+");",1000);if ( boolPostback ){if ( 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( DropDownState, TextboxProvinceState, DropDownCountry, DropDownJurisdiction, ValidatorJurisdiction, AustraliaCode, OtherStateCode, Jurisdictions ){}function ValidateJurisidictionSelection( objSource, objArgs ){objArgs.IsValid = true;var ddlState = document.getElementById(ddlStateId);var 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;}}