if(typeof(SB)=="undefined"||SB==null){var SB=new Object();SB.customer=new Object();}else{if(typeof(SB.customer)=="undefined"||SB.customer==null){SB.customer=new Object();}}SB.customer.registration=new Object();var bubble_info_unavailable="##jsTranslationLabels#couldNotFindAddress##";var bubble_info_select="##jsTranslationLabels#selectAddressFromList##";var bubble_info_UsernameExists="##jsTranslationLabels#UserNameNotAvailable##";var bubble_info_UsernameRequired="##jsTranslationLabels#UserNameRequired##";var bubble_info_UsernameInfo="##jsTranslationLabels#UsernameInfo##";var userNameInValid="##jsTranslationLabels#userNameInValid##";SB.customer.registration.setKeyword=function(){if(document.getElementById("registration_modCustRegKeyword")!=null){var f=document.getElementById("registration_modCustRegKeyword").value;if(f!=null&&f!=""){var d=new SB.customer.registration.KeywordHandler(f);var e=new AjaxService(d);e.GetRequest("/misc/webServices/registration/TrackingService.aspx?action=keyword&item="+encodeURIComponent(f));e=null;d=null;}else{SB.customer.registration.ShowHowHear();}}};SB.customer.registration.KeywordHandler=function(b){this.avoidCaching=true;this.traceLevel=3;this.process=function(a){if(a.xmlHttp.responseXML!=null&&a.xmlHttp.responseXML.documentElement!=null){if(a.xmlHttp.responseXML.documentElement.childNodes.length>0){SB.base.HideRow(registration.trHowHearMain);SB.base.HideRow(registration.trHowHearSub);return;}else{SB.customer.registration.ShowHowHear();}}else{SB.customer.registration.ShowHowHear();}};};SB.customer.registration.ShowHowHear=function(){var b=document.getElementById(registration.trHowHearMain);if(b!=null){if(b.style.display=="none"&&document.getElementById("registration_modCustRegDdlTrackingMain")!=null){SB.base.ShowRow(registration.trHowHearMain);}}};SB.customer.registration.setTrackingSelectSub=function(){var h=document.getElementById("registration_modCustRegDdlTrackingMain").value;var l=document.getElementById("registration_modCustRegDdlTrackingSub");if(h==null||l==null){return;}var k=false;for(var o=0;o<registration.trackingMenuArray.length;o++){if(registration.trackingMenuArray[o]==h){SB.base.RemoveAllOptions(l);childArray=registration.trackingMenuSubArray[o];for(var m=0;m<childArray.length;m++){var g=childArray[m];if(g=="RADIO MARCA"){today=new Date();if(today.getDay()>15){g="R MARCA NACIONAL";}}SB.base.AddOption(l,g,childArray[m]);k=true;}}}if(k==true){if(document.getElementById("ddlTrackingLabel")!=null){document.getElementById("ddlTrackingLabel").innerHTML=h;}SB.base.ShowRow(registration.trHowHearSub);}else{SB.base.RemoveAllOptions(l);SB.base.HideRow(registration.trHowHearSub);}};SB.customer.registration.InitialiseTrackingSubMenu=function(){if(document.getElementById("registration_modCustRegDdlTrackingSub")!=null&&document.getElementById("registration_modCustRegDdlTrackingSub").options.length>0){SB.base.ShowRow(registration.trHowHearSub);}};SB.customer.registration.setCountry=function(d){if(SB.customer.registration.handleExcludedCountry(d)){return;}Global_processingMessage="##jsTranslationLabels#ProcessingMessage##";var e=document.getElementById("registration_modCustRegDdlCountry").value;var f={type:"GET",dataType:"json",url:"/misc/webServices/registration/CountryService.aspx?item="+e,timeout:45000,success:function(b,a){new SB.customer.registration.CountryHandler(e,b);},error:function(c,b,a){}};jQuery.ajax(f);};SB.customer.registration.CountryHandler=function(key,response){this.avoidCaching=true;this.traceLevel=3;var c=document.getElementById("registration_modCustRegBtnCountry");var t=document.getElementById("registration_txtLastCountry");var countryResponse=eval(response);if(countryResponse!=null){if(countryResponse.CountryFound||countryResponse.AddressLookup=="true"){t.value="true";c.click();}else{if(t.value=="true"){t.value="false";c.click();}else{if(document.getElementById("registration_modCustRegAddress")!=null){document.getElementById("registration_modCustRegAddress").focus();}}}SB.customer.registration.PersonalIndentityNumberDisplay();}};SB.customer.registration.handleExcludedCountry=function(c){var d=SB.customer.registration.getExclusionInformationFor(c[c.selectedIndex].value.toUpperCase());if(d){c.selectedIndex=0;SB.customer.registration.setCountry(c);SB.customer.registration.setGlobalProcessingMessage();SB.base.OpenDiv(d.warningPopupUrl,"popBadSelect2","popVeil2","popLayer2");return true;}return false;};SB.customer.registration.getExclusionInformationFor=function(b){return SB.customer.registration.excludedCountryCodes[b];};SB.customer.registration.displayAddressLookupFields=function(){if(document.getElementById("registration_modCustRegDdlCountry").value=="GB"&&document.getElementById("registration_modCustRegAddress").value==""){SB.customer.registration.showAddressLookup();}};SB.customer.registration.ValidateDoorNumber=function(b){if(/^[\w\s\-]*$/i.test(b)){return true;}else{return false;}};SB.customer.registration.ValidatePostcode=function(b){if(/^[a-z\s\d]*$/i.test(b)){return true;}else{return false;}};SB.customer.registration.getAddressLookupList=function(p){var m=document.getElementById("registration_modCustRegDoorNumber").value;var o=document.getElementById("registration_modCustRegPostcode").value;var k=document.getElementById("registration_ico_doorNumber");var l=document.getElementById("registration_ttt_doorNumber");Global_processingMessage="##jsTranslationLabels#FindAddressTitleMessage##";Global_processingTitle="##jsTranslationLabels#FindAddressTitle##";SB.base.holdingDiv("show");if(SB.customer.registration.ValidateDoorNumber(m)&&SB.customer.registration.ValidatePostcode(o)){var q=new SB.customer.registration.AddressLookupCallback(p);var h=new AjaxService(q);h.GetRequest("/misc/webServices/registration/AddressLookUpService.aspx?doorNumber="+m+"&postcode="+o);h=null;q=null;}else{SB.base.holdingDiv("hide");SB.base.initializeTooltip(k,l,bubble_info_unavailable);}};SB.customer.registration.AddressLookupCallback=function(g){this.avoidCaching=true;this.traceLevel=3;var e=false;var f=new Array();var h=0;this.process=function(s){var q=s.xmlHttp.responseXML;if(q!=null&&q.documentElement!=null){if(q.documentElement.childNodes.length>0){e=true;for(var t=0;t<q.documentElement.childNodes.length;t++){var c=q.documentElement.childNodes[t];if(c.hasChildNodes()&&c.firstChild.nodeType==3){f[h]=c.firstChild.nodeValue;h++;}}if(f.length==1){SB.customer.registration.setAddressInFields(f[0]);if(g){SB.customer.registration.dopostback();}}else{SB.customer.registration.showAddressLookUpResults();var d=new RegExp(", ,","g");for(var r=0;r<f.length;r++){var u=f[r].replace(d,",");SB.base.AddOption(document.getElementById("AddressLookUpListbox"),u,f[r]);}}}}if(e==false){var b=document.getElementById("registration_ico_doorNumber");var a=document.getElementById("registration_ttt_doorNumber");SB.base.holdingDiv("hide");SB.base.initializeTooltip(b,a,bubble_info_unavailable);SB.customer.registration.AddressLookupFailed();}SB.base.holdingDiv("hide");};};SB.customer.registration.AddressLookupFailed=function(){SB.base.ToggleElement("errorCouldNotFindAddress","display","block");SB.base.ShowRow("trEnterManuallyButton");};SB.customer.registration.setAddressInFields=function(c){var d=c.split(",");document.getElementById("registration_modCustRegAddress").value=SB.base.TrimString(d[0]);document.getElementById("registration_modCustRegAddressTwo").value=SB.base.TrimString(d[1]);document.getElementById("registration_ico_address").className="icons";document.getElementById("registration_modCustRegCity").value=SB.base.TrimString(d[2]);document.getElementById("registration_ico_city").className="icons";document.getElementById("registration_modCustRegCounty").value=SB.base.TrimString(d[3]);document.getElementById("registration_ico_county").className="icons";document.getElementById("registration_modCustRegPostcode").value=SB.base.TrimString(d[4]);document.getElementById("registration_ico_postCode").className="icons";SB.customer.registration.hideAddressLookUp();SB.customer.registration.showFullAddress();};SB.customer.registration.selectAddress=function(){var e=document.getElementById("registration_ico_AddressLookUpListbox");var h=document.getElementById("registration_ttt_AddressLookUpListbox");var f=document.getElementById("AddressLookUpListbox");if(f!=null){if(f.selectedIndex==-1){SB.base.initializeTooltip(e,h,bubble_info_select);}else{var g=f.options[f.selectedIndex].value;SB.customer.registration.setAddressInFields(g);}}};SB.customer.registration.showAddressLookup=function(){SB.base.HideRow("trAddressOne");SB.base.HideRow("HideAddress2");SB.base.HideRow("HideCity");SB.base.HideRow("trCounty");SB.base.ShowRow("trAddressLookup");SB.base.ToggleElement("AddressLookUpLink","display","block");};SB.customer.registration.hideAddressLookUp=function(){SB.base.HideRow("trEnterManuallyButton");SB.base.HideRow("trAddressLookup");SB.base.HideRow("trAddressLookupList");SB.base.HideRow("trAddressLookupButtons");SB.base.ToggleElement("AddressLookUpLink","display","none");};SB.customer.registration.showAddressLookUpResults=function(){SB.base.HideRow("trAddressLookup");SB.base.HideRow("trPostcode");SB.base.HideRow("AddressLookUpLink");SB.base.ShowRow("trAddressLookupList");SB.base.HideRow("AddressLookUpLink");SB.base.ShowRow("trAddressLookupButtons");SB.base.ShowRow("trEnterManuallyButton");};SB.customer.registration.showFullAddress=function(){SB.customer.registration.hideAddressLookUp();SB.customer.registration.populateFirstAddressLine();SB.base.ShowRow("trAddressOne");SB.base.ShowRow("HideAddress2");SB.base.ShowRow("HideCity");SB.base.ShowRow("trCounty");SB.base.ShowRow("trPostcode");SB.base.HideRow("trEnterManuallyButton");};SB.customer.registration.populateFirstAddressLine=function(){var c=document.getElementById("registration_modCustRegDoorNumber");var d=document.getElementById("registration_modCustRegAddress");if(c!=null&&d.value==""){document.getElementById("registration_modCustRegAddress").value=c.value;}};SB.customer.registration.doPostbackWrapper=function(b){if(b.attributes["class"].value=="disableClick"){return;}SB.customer.registration.dopostback();};SB.customer.registration.dopostback=function(){var h=document.getElementById("registration_modCustRegAddress").value;var l=document.getElementById("registration_modCustRegPostcode").value;var f=document.getElementById("registration_ico_AddressLookUpListbox");var k=document.getElementById("registration_ttt_AddressLookUpListbox");if(document.getElementById("trAddressLookupList").style.display!="none"){var g=document.getElementById("AddressLookUpListbox");if(g.selectedIndex>-1){SB.customer.registration.setAddressInFields(g.options[g.selectedIndex].value);}else{if(g.options.length>0&&document.getElementById("trAddressOne").style.display=="none"){if(f!=null&&k!=null){SB.base.initializeTooltip(f,k,bubble_info_select);}return;}}}else{if(l!=""&&(document.getElementById("AddressLookUpLink").style.display=="block")&&h==""){SB.customer.registration.getAddressLookupList(true);if(f!=null&&k!=null){SB.base.initializeTooltip(f,k,bubble_info_select);}return;}else{if(l!=""&&(document.getElementById("AddressLookUpLink").style.display=="none")&&h==""){SB.customer.registration.getAddressLookupList(false);SB.customer.registration.showAddressLookup();if(f!=null&&k!=null){SB.base.initializeTooltip(f,k,bubble_info_select);}return;}}}__doPostBack("registration$modCustRegisterButton","");};SB.customer.registration.getUsernameCheck=function(s){try{var l=s.value;var m=document.getElementById("registration_ico_username");var q=document.getElementById("registration_ttt_username");if(l!=null&&l!=""){var o=encodeURIComponent(l);var r={type:"GET",dataType:"json",url:"/misc/webServices/registration/UsernameCheckService.aspx?username="+escape(o),timeout:45000,success:function(b,a){new SB.customer.registration.UsernameCheckHandler(s,b);},error:function(){}};jQuery.ajax(r);}else{var k="##jsTranslationLabels#UserNameRequired##";m.className="icons icoError";q.className="toolTipText tttError";SB.base.removeExistingTooltipMessage(q);SB.base.createTooltipMessageTag(q,k);if(s.className.indexOf("usrNameTaken")==-1){s.className=(s.className+" usrNameTaken").replace(/^ /,"");}}}catch(p){}};SB.customer.registration.UsernameCheckHandler=function(userNameBox,response){this.avoidCaching=true;this.traceLevel=3;var usernameCheck=eval(response);var ico_username="";var ttt_username="";if(document.getElementById("registration_ico_username")!=null){ico_username=document.getElementById("registration_ico_username");}if(document.getElementById("registration_ttt_username")!=null){ttt_username=document.getElementById("registration_ttt_username");}if(usernameCheck!=null){if(usernameCheck.Available=="false"){var bubble_info_UsernameExists="##jsTranslationLabels#UserNameNotAvailable##";ico_username.className="icons icoError";ttt_username.className="toolTipText tttError";SB.base.removeExistingTooltipMessage(ttt_username);SB.base.createTooltipMessageTag(ttt_username,bubble_info_UsernameExists);if(userNameBox.className.indexOf("usrNameTaken")==-1){userNameBox.className=(userNameBox.className+" usrNameTaken").replace(/^ /,"");}}else{if(usernameCheck.Available==userNameInValid){ico_username.className="icons icoError";ttt_username.className="toolTipText tttError";SB.base.removeExistingTooltipMessage(ttt_username);SB.base.createTooltipMessageTag(ttt_username,usernameCheck.ValidationErrorMessage);if(userNameBox.className.indexOf("usrNameTaken")==-1){userNameBox.className=(userNameBox.className+" usrNameTaken").replace(/^ /,"");}}else{var bubble_info_UsernameInfo="##jsTranslationLabels#UsernameInfo##";ico_username.className="icons icoInfo";ttt_username.className="toolTipText tttInfo";SB.base.removeExistingTooltipMessage(ttt_username);SB.base.createTooltipMessageTag(ttt_username,bubble_info_UsernameInfo);userNameBox.className=userNameBox.className.replace(/usrNameTaken/,"").replace(/ $/,"");}}}};SB.customer.registration.SetTextMessageOption=function(){var d=document.getElementById("registration_modCustRegCbxSmsContact");var e=document.getElementById("registration_modCustRegMobile");if(d!=null&&e!=null){var f=/\S/;if(f.test(e.value)){d.checked="true";}else{d.checked="";}}};SB.customer.registration.setGlobalProcessingMessage=function(){Global_processingMessage="##jsTranslationLabels#ProcessingMessage##";};SB.customer.registration.PersonalIndentityNumberDisplay=function(){var b=document.getElementById("registration_modCustRegDdlCountry");if(document.getElementById("site_code")!=null&&document.getElementById("site_code").value=="miapuesta-cl"&&b.options[b.selectedIndex].value=="CL"){document.getElementById("registration_divPersonalIdentity").style.display="block";return;}if(document.getElementById("registration_divPersonalIdentity")!=null){document.getElementById("registration_divPersonalIdentity").style.display="none";}};SB.customer.registration.FormatRUTNumber=function(){ttSlim.Hide("registration_ico_personalIdentity");if(document.getElementById("site_code")!=null&&document.getElementById("site_code").value=="miapuesta-cl"){var f=document.getElementById("registration_modCustRegPersonalIdentity").value;if(f==""){return;}var e=f;e=e.split(",").join("");e=e.split(".").join("");e=e.split("-").join("");var h=e.length;if(h==8){e="0"+e;h=h+1;}if(h<8){alert("##jsTranslationLabels#RUTNumber##");}var g=h-7;f=e.substring(0,g)+"."+e.substring(g,g+3)+"."+e.substring(g+3,g+6)+"-"+e.substring(h-1);document.getElementById("registration_modCustRegPersonalIdentity").value=f;}};if(typeof(SB)=="undefined"||SB==null){var SB=new Object();}SB.accounts=new Object();SB.accounts.onWithdrawClick=function(){SB.accounts.loadWithdrawlMethod();};SB.accounts.loadWithdrawlMethod=function(){Global_processingMessage="<p>##jsTranslationLabels#LoadWithdrawPPProcessingMessage##</p>";Global_processingTitle="##jsTranslationLabels#LoadWithdrawPPProcessing##";var c="";if(SB.accounts.getSelectedWithdrawPaymentMethod().indexOf("separator")==0){var d="/t/funding/WithdrawalPopUp.aspx";SB.base.RecallOpenDiv(d,"popBadSelect1","popVeil1","popLayer1");}else{if(SB.accounts.isUserWithdrawPaymentAccountSelected()){c="currentPPID="+SB.accounts.getCurrentWithdrawPPID()+"&userPaymentAccountID="+SB.accounts.getUserWithdrawPaymentAccountID();}else{c="currentPPID="+SB.accounts.getCurrentWithdrawPPID();}var d="/t/funding/WithdrawalPopUp.aspx?"+c;SB.base.RecallOpenDiv(d,"popBadSelect1","popVeil1","popLayer1");}};SB.accounts.loadManageCard=function(){var c="";if(SB.accounts.isUserWithdrawPaymentAccountSelected()){c="currentPPID="+SB.accounts.getCurrentWithdrawPPID()+"&userPaymentAccountID="+SB.accounts.getUserWithdrawPaymentAccountID();}else{c="currentPPID="+SB.accounts.getCurrentWithdrawPPID();}var d="/t/funding/ManageCardPopup.aspx?"+c;SB.base.RecallOpenDiv(d,"popBadSelect1","popVeil1","popLayer1");};SB.accounts.isUserWithdrawPaymentAccountSelected=function(){if(SB.accounts.getSelectedWithdrawPaymentMethod().indexOf("userPaymentAccounts")>=0){return true;}else{return false;}};SB.accounts.loadDepositCard=function(){var c="";if(SB.accounts.isUserWithdrawPaymentAccountSelected()){c="currentPPID="+SB.accounts.getCurrentWithdrawPPID()+"&userPaymentAccountID="+SB.accounts.getUserWithdrawPaymentAccountID();}else{c="currentPPID="+SB.accounts.getCurrentWithdrawPPID();}var d="/t/funding/depositPopup.aspx?"+c;SB.base.RecallOpenDiv(d,"popBadSelect1","popVeil1","popLayer1");};SB.accounts.closePage=function(b){if(b=="deposit"){SB.accounts.loadDepositCard();}else{SB.base.divPopUp(1,"hide");}};SB.accounts.getSelectedWithdrawPaymentMethod=function(){var c=document.getElementById("modFundingDepositddlPaymentMethod");var d=c.options[c.selectedIndex].value;return d;};SB.accounts.getCurrentWithdrawPPID=function(){var d=SB.accounts.getSelectedWithdrawPaymentMethod();var e=d.split(".");var f=e[1];return f;};SB.accounts.getUserWithdrawPaymentAccountID=function(){var d=SB.accounts.getSelectedWithdrawPaymentMethod();var f=d.split(".");var e=f[2];if(SB.accounts.isUserWithdrawPaymentAccountSelected()){e=f[2];}return e;};SB.accounts.onCreditCardWithdraw=function(){if(document.getElementById("cardAction").value=="withdraw"){__doPostBack("","");}else{alert(service.labels.selectValidCard);}};if(typeof(SB)=="undefined"||SB==null){var SB=new Object();SB.customer=new Object();}if(typeof(SB.customer)=="undefined"||SB.customer==null){SB.customer=new Object();}SB.customer.myAccounts=new Object();SB.customer.myAccounts.LoadContent=function(f,e){var d=new Object();d.timeout=10000;d.textonly=true;d.Content=e;d.errorHandler=SB.customer.myAccounts.ErrorHandler;HTTP.get(f,SB.customer.myAccounts.CallBackLoadContent,d);};SB.customer.myAccounts.CallBackLoadContent=function(returnOutput,Content){if(returnOutput!=null){document.getElementById(Content).innerHTML=returnOutput;var scripts=SB.base.extractScripts(returnOutput);for(var scriptCount=0;scriptCount<scripts.length;scriptCount++){try{eval(scripts[scriptCount]);}catch(e){}}}};SB.customer.myAccounts.ErrorHandler=function(d,e,f){if(f.Content){errorInnerHtml=document.getElementById("unhandledServerError").innerHTML;document.getElementById(f.Content).innerHTML=errorInnerHtml;}else{alert(d+": "+e);}};SB.customer.myAccounts.Funding=function(b){popupOptions["switch"]="btnFunding";popupOptions.div="dvFunding";popupOptions.session="funding";popupOptions.src="../../t/customer/fundingoptions.aspx";popupOptions.divBar="dvFundingBar";popupOptions.divLink="modLayoutMyaccountTabsFundingLink";popupOptions.aClass="awake bar";popupOptions.iClass="asleep bar";SB.customer.myAccounts.UpdatePage();};SB.customer.myAccounts.PersonalDetails=function(b){popupOptions.divBar="dvPersonalDetailsBar";popupOptions.divLink="modLayoutMyaccountTabPersonalDetailsLink";popupOptions.aClass="awake bar";popupOptions.iClass="asleep bar";popupOptions["switch"]="btnPD";popupOptions.div="dvPersonalDetails";popupOptions.session="details";popupOptions.src="../../t/customer/detailsAndPreference.aspx?Readonly=true";SB.customer.myAccounts.UpdatePage();};SB.customer.myAccounts.PersonalLimits=function(b){popupOptions.divBar="dvLimitsBar";popupOptions.divLink="dvLimitsLink";popupOptions.aClass="awake bar";popupOptions.iClass="asleep bar";popupOptions["switch"]="btnLim";popupOptions.div="dvLimits";popupOptions.session="limits";popupOptions.src="../../t/customer/PersonalLimits.aspx?Readonly=true";SB.customer.myAccounts.UpdatePage();};SB.customer.myAccounts.CngPassword=function(b){popupOptions["switch"]="btnSec";popupOptions.div="dvSecurity";popupOptions.session="security";popupOptions.src="../../t/customer/mySecurity.aspx";popupOptions.divBar="dvSecurityBar";popupOptions.divLink="modLayoutMyaccountTabSecurityLink";popupOptions.aClass="awake bar";popupOptions.iClass="asleep bar";SB.customer.myAccounts.UpdatePage();};SB.customer.myAccounts.EuroPromotions=function(b){popupOptions["switch"]="btnEPromos";popupOptions.div="dvEPromotions";popupOptions.session="promotions";popupOptions.src="../../t/customer/euroPromotions.aspx";popupOptions.divBar="dvEPromotionsBar";popupOptions.divLink="dvEPromotionsLink";popupOptions.aClass="awake bar";popupOptions.iClass="asleep bar";SB.customer.myAccounts.UpdatePage();};AgeVerification=function(){openIFrameInDivRefresh("dvAccHist","../../t/customer/verification.aspx","iFrmReg","Hide","Age Verification",oState,cState);};var isLoggedIn=true;SB.customer.myAccounts.visibilityServiceHandler=function(b){this.avoidCaching=true;this.traceLevel=3;this.process=function(a){if(a.xmlHttp.responseXML!=null&&a.xmlHttp.responseXML.documentElement!=null){if(a.xmlHttp.responseXML.documentElement.childNodes.length>0){if(a.xmlHttp.responseXML.documentElement.childNodes[0].nodeValue=="false"){isLoggedIn=false;SB.base.closeDivRefreshWindow();}}}};};SB.customer.myAccounts.UpdatePage=function(){var q=new SB.customer.myAccounts.visibilityServiceHandler();var r=new AjaxService(q);var o=popupOptions.div;var t=popupOptions.divBar;var u=popupOptions.divLink;var l=popupOptions["switch"];var s=popupOptions.src;var m=document.getElementById(l);var p=document.getElementById(u);if(m.value=="0"){if(isLoggedIn){SB.customer.myAccounts.LoadContent(s+"?"+new Date().getTime(),o);m.value="1";p.innerHTML=popupOptions.cState;document.getElementById(t).className=popupOptions.aClass;document.getElementById(o).style.display="block";}}else{r.GetRequest("/misc/webServices/userControl/setvisibilityservice.aspx?key="+popupOptions.session+"&value=false&"+new Date().getTime());m.value="0";p.innerHTML=popupOptions.oState;document.getElementById(o).style.display="none";document.getElementById(t).className=popupOptions.iClass;if(document.getElementById("dvWaitContentLoading")!=null){document.getElementById(o).innerHTML=document.getElementById("dvWaitContentLoading").innerHTML;}}r=null;q=null;};$(document).ready(function(){var b=window.location.toString();if(b.indexOf("displayPersonalLimits")!=-1){SB.customer.myAccounts.Funding(popupOptions);SB.customer.myAccounts.PersonalLimits(popupOptions);}});fundingGlobals=new Object();fundingGlobals.card=new Object();fundingGlobals.list=new Object();if(typeof(SB)=="undefined"||SB==null){var SB=new Object();}if(typeof(SB.funding)=="undefined"||SB.funding==null){SB.funding=new Object();}GetVisibleDivStyle=function(){return"";};GetHiddenDivStyle=function(){return"none";};SB.funding.loadFundingLabels=function(){var d=new LabelsHandler();var c=new AjaxService(d);c.GetRequest("/config/translation/funding/FundingScriptLabels.xml");c=null;d=null;};SB.funding.onCardDelete=function(f){SB.funding.loadFundingLabels();document.getElementById("cardID").value=f;document.getElementById("cardAction").value="remove";if(document.getElementById("popBox2")){var e=service.labels.CardDeleteProcessing;var d="<p>"+service.labels.CardDeleteProcessingMessage+"</p>";document.getElementById("popBox2").innerHTML=SB.base.processingAnimationContent(e,d);}__doPostBack("","");};SB.funding.onCardUpdate=function(){SB.funding.loadFundingLabels();document.getElementById("cardAction").value="update";__doPostBack("","");};SB.funding.SetWalletRedirect=function(l,h){var g=document.getElementById("divMessage");if(g!=null){g.style.display="none";}var f=document.getElementById("redirectIFrame");var k=document.getElementById("divIframe");if(f!=null&&k!=null&&l!=""){SB.base.reStyler("add","ctrlDepositMethodList_divContent","hide");SB.base.reStyler("add",f,("pm"+h));SB.base.reStyler("add","VbVControl","hide");}k.style.display="block";f.src=l;f.style.display="";SB.base.divPopUp(1,"refresh");};SB.funding.SetSpeedCardRedirect=function(e,f){var d=document.getElementById("speedCardPollerIframe");if(d!=undefined){d.src=f;}SB.funding.SetWalletRedirect(e,"SCD");};SB.funding.SetVBVRedirect=function(e){var f=document.getElementById("redirectIFrame");var d=document.getElementById("divIframe");if(f!=null&&d!=null&&e!=""){SB.base.reStyler("add","ctrlDepositMethodList_divContent","hide");SB.base.reStyler("add",f,"pmVBV");}d.style.display="block";f.src=e;f.style.display="";};SB.funding.SetRedirectIFrameContentURLToPBP=function(b){alert("SetRedirectIFrameContentURLToPBP - change to use generic function! - See funding.js line 86");SetRedirectIFrameContent(b,"PBP");};SB.funding.SetRedirectIFrameContentURLToPaysafe=function(b){alert("SetRedirectIFrameContentURLToPaysafe - change to use generic function! - See funding.js line 94");SetRedirectIFrameContent(b,"PS");};SB.funding.ResetCardForm=function(){var h=document.getElementById("popupBox");var e=h.getElementsByTagName("div");for(i=0;i<e.length;i++){if((e[i].id.indexOf("divValidationErrors")>-1)||(e[i].id.indexOf("errCardHolder")>-1)||(e[i].id.indexOf("errStartDate")>-1)||(e[i].id.indexOf("errIssueNo")>-1)||(e[i].id.indexOf("errExpiryDate")>-1)||(e[i].id.indexOf("errCardNo")>-1)||(e[i].id.indexOf("errCvv2")>-1)||(e[i].id.indexOf("errCardCurrency")>-1)||(e[i].id.indexOf("errAmount")>-1)){e[i].style.display=GetHiddenDivStyle();}}oAnchors=SB.base.getElementsByClass("error",h,"a");for(x=0;x<oAnchors.length;x++){SB.base.reStyler("remove",oAnchors[x],"error");}var f=document.getElementsByTagName("select");for(i=0;i<f.length;i++){if((f[i].id.indexOf("ddlValidFromMonth")>-1)||(f[i].id.indexOf("ddlValidToMonth")>-1)||(f[i].id.indexOf("ddlValidFromYear")>-1)||(f[i].id.indexOf("ddlValidToYear")>-1)||(f[i].id.indexOf("ddlCurrency")>-1)){if(f[i].options.length>0){f[i].selectedIndex=0;}else{f[i].selectedIndex=-1;}}}var g=document.getElementsByTagName("input");for(i=0;i<g.length;i++){if((g[i].id.indexOf("txtIssueno")>-1)||(g[i].id.indexOf("txtCardno")>-1)||(g[i].id.indexOf("txtCvv2")>-1)||(g[i].id.indexOf("txtAmount")>-1)||(g[i].id.indexOf("txtDepositConvertedAmount")>-1)){g[i].value="";}}};SB.funding.onCardWithdraw=function(){if(document.cardForm.cardAction.value=="withdraw"){document.cardForm.submit();}else{alert(service.labels.selectValidCard);}};onWithdrawCardSelect=function(b){};SB.funding.onDepositCardSelect=function(D,F,z,G){var y=document.getElementById("cardRow1");var H=document.getElementById("cardRow2A");var u=document.getElementById("cardRow2B");var w=document.getElementById("cardRow3A");var A=document.getElementById("cardRow3B");var s=document.getElementById("cardRow4");var v=document.getElementById("cardRow5");var B=document.getElementById("cardRow7");var C=document.getElementById("cvv2_"+D);var t=document.getElementById(fundingGlobals.card.ddlCardTypeID);var E=document.getElementById("cardId"+D);var t=document.getElementById(fundingGlobals.card.ddlCardListID);if(G=="true"){SB.funding.ResetCardForm();}if(SB.funding.isNewCard(D)){document.getElementById("cardAction").value="add";SB.funding.ShowNewCardRows(t,y,H,u,w,A,s,v,B,z);}else{document.getElementById("cardAction").value="deposit";SB.funding.InitialiseExistingCardRows(y,H,u,w,A,s,C,v,B);SB.funding.ShowExistingRetariusMessage(F,D);}SB.funding.onCardTypeChange(z,D,H,u,B);SB.funding.displayDepositAmounts(z,D,F);y=null;H=null;u=null;w=null;A=null;s=null;v=null;B=null;C=null;t=null;E=null;};SB.funding.onDepositNewCardSelect=function(z,A,u,B){var r=document.getElementById("cardRow1");var C=document.getElementById("cardRow2A");var E=document.getElementById("cardRow2B");var t=document.getElementById("cardRow3A");var v=document.getElementById("cardRow3B");var F=document.getElementById("cardRow4");var s=document.getElementById("cardRow5");var w=document.getElementById("cardRow7");var y=document.getElementById("cvv2_"+z);var D=document.getElementById(fundingGlobals.card.ddlCardListID);if(SB.funding.isNewCard(z)){SB.funding.ShowNewCardRows(D,r,C,E,t,v,F,s,w,u);}r=null;C=null;E=null;t=null;v=null;F=null;s=null;w=null;y=null;D=null;oCardRadio=null;};SB.funding.displayDepositAmounts=function(p,h,q){var l=document.getElementById(fundingGlobals.card.ddlDepositAmountID);var k=document.getElementById(fundingGlobals.card.txtAmountID);var m=document.getElementById("ctrlDepositMethodList__ctl0_noSymbol");var o=document.getElementById(fundingGlobals.card.lblPPMsgID);if(l!=null){if(l.length>0){if(p=="WM"||q=="IV"){l.style.display="none";k.style.display="";m.style.display="";}else{l.style.display="";k.style.display="none";m.style.display="none";}}else{l.style.display="none";k.style.display="";m.style.display="";}}o.innerHTML="";for(i=0;i<fundingGlobals.card.ppLabels.length;i++){if(fundingGlobals.card.ppLabels[i].indexOf(p)>=0){o.innerHTML=fundingGlobals.card.ppLabels[i].substring(fundingGlobals.card.ppLabels[i].indexOf(p)+3);}}};SB.funding.ShowExistingRetariusMessage=function(e,f){var d=fundingGlobals.card.customerCurrency;if(e=="WT"&&d!="GBP"&&d!="EUR"&&d!="USD"){document.getElementById("existingAccount").style.display=GetVisibleDivStyle();document.getElementById(fundingGlobals.card.currencyLabelID).style.display=GetHiddenDivStyle();}else{document.getElementById("existingAccount").style.display=GetHiddenDivStyle();document.getElementById(fundingGlobals.card.currencyLabelID).style.display=GetVisibleDivStyle();}};SB.funding.ShowNewCardRows=function(m,q,o,p,u,v,s,t,w,r){q.style.display=GetVisibleDivStyle();o.style.display=GetVisibleDivStyle();p.style.display=GetVisibleDivStyle();u.style.display=GetVisibleDivStyle();v.style.display=GetVisibleDivStyle();if(s!=null){s.style.display=GetVisibleDivStyle();}if((r=="unknown")&&(m!=null)){m.selectedIndex=0;}t.style.display=GetHiddenDivStyle();w.style.display=GetHiddenDivStyle();};SB.funding.InitialiseExistingCardRows=function(o,l,m,r,s,p,t,q,u){o.style.display=GetHiddenDivStyle();l.style.display=GetHiddenDivStyle();m.style.display=GetHiddenDivStyle();r.style.display=GetHiddenDivStyle();s.style.display=GetHiddenDivStyle();if(p!=null){if((t!=null)&&(t.value=="True")){p.style.display=GetVisibleDivStyle();}else{p.style.display=GetHiddenDivStyle();}}q.style.display=GetHiddenDivStyle();u.style.display=GetHiddenDivStyle();};SB.funding.ShowPaymentProviderLogos=function(h,f){var g=document.getElementById("providerDivs");if(g!=null){var e=g.getElementsByTagName("div");if(h==true){for(i=0;i<e.length;i++){if(e[i].id==f){e[i].style.display=GetVisibleDivStyle();}else{e[i].style.display=GetHiddenDivStyle();}}}else{for(i=0;i<e.length;i++){e[i].style.display=GetHiddenDivStyle();}}e=null;}g=null;};SB.funding.onNewCardTypeChange=function(h){var f=document.getElementById("cardRow2A");var g=document.getElementById("cardRow2B");var e=document.getElementById("cardRow7");SB.funding.onCardTypeChange(h.value,"new",f,g,e);f=null;g=null;e=null;SB.funding.displayDepositAmounts(h.value);};SB.funding.onCardTypeChange=function(k,f,g,h,l){SB.funding.DisplayValidFrom(f,k,g,h);SB.funding.DisplayCurrencyDropdown(k,f);SB.funding.SetDepositAmountCurrency(k,f);SB.funding.DisplayCurrencyConversionLabels(f,k,l);SB.funding.CalculateConversionAmount(f,k);SB.funding.DisplayMaestroLabel(k);SB.funding.HideCCV2(k);SB.funding.DisplayWireCardLabel(f,k,l);SB.funding.ShowPaymentProviderLogos(true,SB.funding.GetCardTypePaymentProviderId(k));};SB.funding.isNewCard=function(b){if(b=="new"){return true;}else{return false;}};SB.funding.GetCardTypePaymentProviderId=function(d){var c=null;if(fundingGlobals.card.cardTypeData.length==1){c=fundingGlobals.card.cardTypeData[0][3];}else{for(i=0;i<fundingGlobals.card.cardTypeData.length;i++){if(d==fundingGlobals.card.cardTypeData[i][0]){c=fundingGlobals.card.cardTypeData[i][3];break;}}}return c;};SB.funding.CardTypeDoesCurrencyConversion=function(b){for(i=0;i<fundingGlobals.card.currencyConvertedCardTypes.length;i++){if(b==fundingGlobals.card.currencyConvertedCardTypes[i]){return true;}}return false;};SB.funding.DisplayValidFrom=function(e,h,f,g){if(SB.funding.isNewCard(e)&&(h=="MA"||h=="SW"||h=="unknown")){f.style.display=GetVisibleDivStyle();g.style.display=GetVisibleDivStyle();}else{f.style.display=GetHiddenDivStyle();g.style.display=GetHiddenDivStyle();}};SB.funding.DisplayCurrencyDropdown=function(d,e){if(SB.funding.CardTypeDoesCurrencyConversion(d)&&SB.funding.isNewCard(e)){document.getElementById("cardRow5").style.display=GetVisibleDivStyle();var f=document.getElementById(fundingGlobals.card.ddlCurrencyID);SB.base.RemoveAllOptions(f);for(i=0;i<fundingGlobals.card.currencyConvertedCardTypes.length;i++){if(fundingGlobals.card.currencyConvertedCardTypes[i]==d){for(j=0;j<fundingGlobals.card.cardTypeCurrencies[i].length;j++){SB.base.AddOption(f,fundingGlobals.card.cardTypeCurrencies[i][j],fundingGlobals.card.cardTypeCurrencies[i][j]);}}}f.selectedIndex=0;f=null;}else{document.getElementById("cardRow5").style.display=GetHiddenDivStyle();}};SB.funding.SetDepositAmountCurrency=function(d,c){document.getElementById(fundingGlobals.card.currencyLabelID).innerHTML=SB.funding.GetSelectedCurrency(d,c);};SB.funding.GetSelectedCurrency=function(d,e){if(SB.funding.CardTypeDoesCurrencyConversion(d)){if(SB.funding.isNewCard(e)){var f=document.getElementById(fundingGlobals.card.ddlCurrencyID);return f.options[f.selectedIndex].text;}else{return document.getElementById("currencyCode_"+e).value;}}else{return fundingGlobals.card.customerCurrency;}};SB.funding.GetCheckedCardId=function(){var b=document.getElementById("cardID").value;return b;};SB.funding.GetCardType=function(c){if(SB.funding.isNewCard(c)){var d=document.getElementById(fundingGlobals.card.ddlCardTypeID);return d.value;}else{return document.getElementById("cardType_"+c).value;}};SB.funding.GetCardTypeDescription=function(e){var h=SB.funding.GetCardType(e);var f=document.getElementById(fundingGlobals.card.ddlCardListID);if(f!=null){for(var g=0;g<f.length;g++){if(f[g].value==h){return f[g].text;}}}return"";};SB.funding.GetSelectedCurrencyConversionRate=function(b){for(i=0;i<fundingGlobals.card.allCardCurrencies.length;i++){if(fundingGlobals.card.allCardCurrencies[i]==b){return fundingGlobals.card.allCardCurrencyRates[i];}}};SB.funding.CalculateConversionAmount=function(c,d){SB.funding.SetConvertedAmount(d,c,"SB.funding.CalculateConversionAmount");};SB.funding.UpdateConvertedAmount=function(f){var e=SB.funding.GetCheckedCardId();if(e!=""){var d=SB.funding.GetCardType(e);SB.funding.SetConvertedAmount(d,e,f);d=null;}e=null;};SB.funding.SetConvertedAmount=function(s,m,r){if(SB.funding.CardTypeDoesCurrencyConversion(s,m)){if(r=="ddlCurrency"){SB.funding.SetDepositAmountCurrency(s,m);}var o=document.getElementById(fundingGlobals.card.txtAmountID);if(o!=null&&o.value!=""&&!isNaN(o.value)){var q=SB.funding.GetSelectedCurrency(s,m);var p=SB.funding.GetSelectedCurrencyConversionRate(q);var l=fundingGlobals.card.customerCurrencyConversionRate;var k=(parseFloat(l)/parseFloat(p))*parseFloat(o.value);document.getElementById(fundingGlobals.card.txtDepositConvertedAmountID).value=k.toFixed(2);q=null;p=null;l=null;k=null;}o=null;}};SB.funding.DisplayCurrencyConversionLabels=function(f,d,e){if(SB.funding.CardTypeDoesCurrencyConversion(d)){e.style.display=GetVisibleDivStyle();document.getElementById(fundingGlobals.card.lblMinDepositID).style.display=GetHiddenDivStyle();document.getElementById(fundingGlobals.card.lblMaxDepositID).style.display=GetHiddenDivStyle();document.getElementById("removedFromYourAccount").innerHTML=fundingGlobals.card.removedFromYourAccount.replace("[PLACEHOLDER]",SB.funding.GetCardTypeDescription(f));document.getElementById("removedFromYourAccount").style.display=GetVisibleDivStyle();document.getElementById("currencyOfYourCard").innerHTML=fundingGlobals.card.currencyOfYourCard.replace("[PLACEHOLDER]",SB.funding.GetCardTypeDescription(f));document.getElementById("currencyOfYourCard").style.display=GetVisibleDivStyle();}else{if(e!=null){e.style.display=GetHiddenDivStyle();}document.getElementById(fundingGlobals.card.lblMinDepositID).style.display=GetVisibleDivStyle();document.getElementById(fundingGlobals.card.lblMaxDepositID).style.display=GetVisibleDivStyle();document.getElementById("removedFromYourAccount").style.display=GetHiddenDivStyle();document.getElementById("currencyOfYourCard").style.display=GetHiddenDivStyle();}};SB.funding.DisplayWireCardLabel=function(e,d){if(d=="WM"){if(SB.funding.isNewCard(e)){document.getElementById("cardRowHelpText").style.display=GetVisibleDivStyle();}else{document.getElementById("cardRowHelpText").style.display=GetHiddenDivStyle();}document.getElementById(fundingGlobals.card.lblMaxCustomerCxyDeposit).style.display=GetHiddenDivStyle();document.getElementById("wirecardDepositHelp").style.display=GetVisibleDivStyle();}else{document.getElementById("cardRowHelpText").style.display=GetHiddenDivStyle();document.getElementById(fundingGlobals.card.lblMaxCustomerCxyDeposit).style.display=GetVisibleDivStyle();var f=document.getElementById("wirecardDepositHelp");if(f!=null){f.style.display=GetHiddenDivStyle();}f=null;}};SB.funding.getSelectedPaymentMethod=function(){var b=document.getElementById("ctrlWithdrawMethodList_modFundingWithdrawddlPaymentMethod");if(b==null){b=document.getElementById("ctrlDepositMethodList_modFundingDepositddlPaymentMethod");}if(b==null){return null;}else{paymentMethod=b.options[b.selectedIndex].value;}return paymentMethod;};SB.funding.getCurrentPPID=function(){var d=SB.funding.getSelectedPaymentMethod();if(d!=null){var e=d.split("^");var f=e[1];return f;}else{return null;}};SB.funding.getUserPaymentAccountID=function(){if(SB.funding.getSelectedPaymentMethod()!=null){var d=SB.funding.getSelectedPaymentMethod();var f=d.split("^");var e=f[2];if(SB.funding.isUserPaymentAccountSelected()){e=f[2];}return e;}else{return null;}};SB.funding.getSubPaymentProvider=function(){var d=SB.funding.getSelectedPaymentMethod();if(SB.funding.paymentMethod!=null){if(SB.funding.isSubPaymentProviderSelected()){var c=d.split("^");return c[2];}else{return null;}}else{return null;}};SB.funding.getPopupPaymentProviderSelected=function(){var d=SB.funding.getSelectedPaymentMethod();if(d!=null){if(SB.funding.isPopupPaymentProviderSelected()){var c=d.split("^");return c[2];}else{return null;}}else{return null;}};SB.funding.isSubPaymentProviderSelected=function(){if(SB.funding.getSelectedPaymentMethod().indexOf("subMethods")>=0){return true;}else{return false;}};SB.funding.isPopupPaymentProviderSelected=function(){if(SB.funding.getSelectedPaymentMethod().indexOf("popupMethods")>=0){return true;}else{return false;}};SB.funding.isUserPaymentAccountSelected=function(){if(SB.funding.getSelectedPaymentMethod().indexOf("userPaymentAccounts")>=0){return true;}else{return false;}};SB.funding.loadPaymentMethod=function(f){var e=null;var g="";var h="";if($("#processOriginHidden").val()!=""){g="processOrigin="+$("#processOriginHidden").val();}if(f){e="/t/funding/depositPopUp.aspx?";}else{e="/t/funding/WithdrawalPopUp.aspx?";}Global_processingTitle="hidden";document.getElementById("divProcessingAnimation").className="show";document.getElementById("divShowContent").className="hide";if(SB.funding.getSelectedPaymentMethod().indexOf("separator")>=0){SB.base.RecallOpenDiv((e+g),"popBadSelect1","popVeil1","popLayer1");return false;}if(SB.funding.isPopupPaymentProviderSelected()){h="&currentPPID="+SB.funding.getCurrentPPID();}else{if(SB.funding.isUserPaymentAccountSelected()){h="&currentPPID="+SB.funding.getCurrentPPID()+"&userPaymentAccountID="+SB.funding.getUserPaymentAccountID();}else{if(SB.funding.isSubPaymentProviderSelected()){h="&currentPPID="+SB.funding.getCurrentPPID()+"&subPPID="+SB.funding.getUserPaymentAccountID();}else{h="&currentPPID="+SB.funding.getCurrentPPID();}}}SB.base.RecallOpenDiv((e+g+h),"popBadSelect1","popVeil1","popLayer1");if(SB.funding.isPopupPaymentProviderSelected()){SB.funding.openPopUpOnSuccess();}};SB.funding.openPopUpOnSuccess=function(){var b;if(rState==responseState.success){PopNewWindow(SB.funding.getPopupPaymentProviderSelected());}else{if(rState==responseState.waiting){b=setTimeout("SB.funding.openPopUpOnSuccess()",100);}else{clearTimeout(b);}}};SB.funding.getPaymentMethodInputControl=function(g,l){var k=g.id.split("_");var h=k[0]+"__ctl0_"+l;var f=document.getElementById(h);return f;};SB.funding.ValidateAndDeposit=function(b){document.getElementById("ctrlDepositMethodList_divContent").style.display=GetHiddenDivStyle();if(document.getElementById("_ctl0_divValidationErrors")){document.getElementById("_ctl0_divValidationErrors").style.display=GetHiddenDivStyle();}if(document.getElementById("divFailureResult")){document.getElementById("divFailureResult").style.display=GetHiddenDivStyle();}if(document.getElementById("divSuccessResult")){document.getElementById("divSuccessResult").style.display=GetHiddenDivStyle();}document.getElementById("divMessage").style.display=GetHiddenDivStyle();submitDeposit();};SB.funding.submitDeposit=function(){document.depositForm.submit();};SB.funding.showValidationErrorMessage=function(b){if(b){document.getElementById("divValidationErrors").style.display="block";if(document.getElementById("divError")!=null){document.getElementById("divError").style.display="none";}}else{document.getElementById("divValidationErrors").style.display="none";if(document.getElementById("divError")!=null){document.getElementById("divError").style.display="block";}}};SB.funding.HideCancelButton=function(){var b=SB.funding.getCurrentPPID();if(document.getElementById("divDisplayProgress")!=null){document.getElementById("divDisplayProgress").style.display=GetHiddenDivStyle();}if(b=="BW"){document.getElementById("ctrlDepositMethodList_modFundingDepositBtnCancel").style.display="none";}};SB.funding.onDepositRegisterOnly=function(d){var e=document.forms[0];if(e!=null){var f=e.elements.registerOnly;if(f!=null){f.value="true";}}SB.funding.onSubmitDepositOrWithdrawal(d);};SB.funding.onSubmitDepositOrWithdrawal=function(b){Global_processingMessage="<p>##jsTranslationLabels#LoadDepositPPProcessingMessage##</p>";Global_processingTitle="##jsTranslationLabels#LoadDepositPPProcessing##";__doPostBack("","");};SB.funding.showProcessingTransaction=function(){Global_processingMessage="<p>##jsTranslationLabels#LoadDepositPPProcessingMessage##</p>";Global_processingTitle="##jsTranslationLabels#LoadDepositPPProcessing##";SB.base.holdingDiv("show");};SB.funding.refreshBalance=function(c){var d=document.getElementById("modCustDisplayBalance");if(d!=null){d.innerHTML=c;}};SB.funding.iFrameRedirection=function(c){var d=document.getElementById("btnRedirect").value;SB.base.RecallOpenDiv(d,"popBadSelect1","popVeil1","popLayer1");};OpenPageInLayer2=function(b){SB.base.OpenDiv(b,"popBadSelect2","popVeil2","popLayer2");};AgeVerification=function(){location.href="/t/customer/myaccount.aspx";};SB.funding.getBankDetails=function(){var d;var c="/t/funding/BTBankDetails.aspx?BankID=";d=document.getElementById("ctrlDepositMethodList__ctl0_lstCurrencyList").selectedIndex;c=c+document.getElementById("ctrlDepositMethodList__ctl0_lstCurrencyList").options[d].value;SB.funding.LoadHTML(c,"");};SB.funding.LoadHTML=function(f,e){var d=new Object();d.timeout=2000;d.textonly=true;d.Content=e;HTTP.getText(f,SB.funding.CallBackLoadHTML,d);};SB.funding.CallBackLoadHTML=function(d,c){if(d!=null){if(document.getElementById("ctrlDepositMethodList__ctl0_dvBankDetails")!=null){document.getElementById("ctrlDepositMethodList__ctl0_dvBankDetails").innerHTML=d;}else{if(document.getElementById("more_dvBankDetails")!=null){document.getElementById("more_dvBankDetails").innerHTML=d;}}}if(document.getElementById("ctrlDepositMethodList__ctl0_dvBankDetails")!=null){SB.base.divPopUp(1,"refresh");}};SB.funding.getPrintDetails=function(d){var e="<input id='btnCancel' type='button' value='Cancel' runat='server' onclick='SB.base.hideLayer1();' />";var f=document.getElementById("ctrlDepositMethodList__ctl0_dvBankDetails").innerHTML;document.getElementById("dvLoadPrintDetails").innerHTML=f+e;if(d=="False"){document.getElementById("email").value="";document.getElementById("dvLoadPrintDetails").style.display="none";document.getElementById("dvSendEmail").style.display="";}else{document.getElementById("dvLoadPrintDetails").style.display="";document.getElementById("dvSendEmail").style.display="none";window.print();SB.funding.hideLayer2();}};SB.funding.getBankDetailText=function(){var b="";if(document.getElementById("ctrlDepositMethodList__ctl0_dvBankDetails")!=null){b=document.getElementById("ctrlDepositMethodList__ctl0_dvBankDetails").innerHTML;}return b;};SB.funding.sendEmail=function(){var c=document.getElementById("txtEmailAddress").value;if(c!=""){var d="/t/modules/funding/deposit/PrintPopUp.aspx?emailaddress="+c+"&bankDetail="+SB.funding.getBankDetailText();SB.base.RecallOpenDiv(d,"popBadSelect2","popVeil2","popLayer2");}};SB.funding.hideLayer2=function(){SB.base.reStyler("swap","popLayer2, popVeil2, popBadSelect2","show","hide");};PopNewWindow=function(d){var c=window.open(d);c=null;return;};SB.funding.LoadMethodforModule=function(b){switch(b){case"deposit":if(typeof(SB.funding.loadPaymentMethod)=="function"){SB.funding.loadPaymentMethod(true);}else{setTimeout("SB.funding.LoadMethodforModule('"+b+"')",10);}break;case"withdraw":if(typeof(SB.funding.loadPaymentMethod)=="function"){SB.funding.loadPaymentMethod(false);}else{setTimeout("SB.funding.LoadMethodforModule('"+b+"')",10);}break;case"carddeposit":if(typeof(SB.funding.cardDeposit.OnDropdownSelectionChange)=="function"){SB.funding.cardDeposit.OnDropdownSelectionChange();}else{setTimeout("SB.funding.LoadMethodforModule('"+b+"')",10);}break;case"cardwithdraw":if(typeof(OnWithdrawDropdownSelectionChange)=="function"){OnWithdrawDropdownSelectionChange();}else{setTimeout("SB.funding.LoadMethodforModule('"+b+"')",10);}break;default:break;}};SB.funding.DisplayMaestroLabel=function(b){if(b=="MA"||b=="SW"){document.getElementById("issueNumberTip").style.display=GetVisibleDivStyle();}else{document.getElementById("issueNumberTip").style.display=GetHiddenDivStyle();}};SB.funding.HideCCV2=function(b){if(b=="LS"){document.getElementById("ctrlDepositMethodList__ctl0_txtCvv2").value="123";document.getElementById("cardRow4").style.display="none";}};SB.funding.ResetTooltipError=function(){if(fundingGlobals.card.hasNoErrors=="false"){var b=document.getElementById("divFunding").getElementsByTagName("strong");for(i=0;i<b.length;i++){if(b[i].className=="icons icoError"){if(b[i].id.indexOf("cvv2No")!=-1){b[i].className="icons icoInfo";document.getElementById(b[i].id.replace(/ico_?/i,"ttt_")).className="toolTipText tttInfo";document.getElementById(b[i].id.replace(/ico_?/i,"ttt_")).innerHTML='<span class="tttContent">'+SB.funding.CVVInfoMessage+"</span>";continue;}b[i].className="icons";document.getElementById(b[i].id.replace(/ico_?/i,"ttt_")).innerHTML="";}}}};SB.funding.ProcessCardSelectionChange=function(b){switch(b){case"carddeposit":SB.funding.ResetTooltipError();SB.funding.resetErrorState();SB.funding.cardDeposit.clearLuhnCheckIndicator();SB.funding.LoadMethodforModule(b);break;case"cardwithdraw":SB.funding.ResetTooltipError();SB.funding.ResetCardForm();SB.funding.resetErrorState();SB.funding.LoadMethodforModule(b);break;}};SB.funding.resetErrorState=function(){fundingGlobals.card.hasNoErrors="true";};SB.funding.calculateConversionForSpeedCard=function(f){var l=document.getElementById("convertedCurrency");if(l!=null){while(l.hasChildNodes()){l.removeChild(l.firstChild);}var h=NaN;if(f){h=parseFloat(document.getElementById("ctrlDepositMethodList__ctl0_modFundingDepositSCDAmount").value);}else{h=parseFloat(document.getElementById("ctrlWithdrawMethodList__ctl0_modFundingWithdrawSCDAmount").value);}var g=parseFloat(document.getElementById("conversionRate").value);if(isNaN(h)||isNaN(g)){l.appendChild(document.createTextNode("0"));}else{var k=(Math.round(h*g*100)/100);l.appendChild(document.createTextNode(k.toString()));}}};SB.funding.BankTranfer=function(b){this.div=b;this.setup();};SB.funding.BankTranfer.prototype={setup:function(){var b=this;$("select.bankName",this.div).change(function(){b.handleOtherOption(this);});},handleOtherOption:function(f){var d=$(":selected",f).val().toLowerCase();var e=$(":text.bankName",this.div);d=="other"?e.removeClass("hidden"):e.addClass("hidden");}};SB.funding.FragmentChanged=function(s){var p=$("input[id$='txtCardno']");var t=$("input[id$='CardNumber_Fragment1']");var u=$("input[id$='CardNumber_Fragment2']");var e=$("input[id$='CardNumber_Fragment3']");var m=$("input[id$='CardNumber_Fragment4']");var o=(window.event)?window.event:s;var r=o.target?o.target:o.srcElement;var q=o.keyCode;switch(q){case 16:case 20:case 17:case 9:return;break;}if(r.value.length>4){r.value=r.value.substring(0,4);}if(((r.value.length==4&&q!=39)||q==39)&&(SB.funding.GetCursorPosition(r)==r.value.length)){switch(r){case t.get(0):u.get(0).focus();break;case u.get(0):e.get(0).focus();break;case e.get(0):m.get(0).focus();break;}}else{if((q==8||q==37)&&SB.funding.GetCursorPosition(r)==0){switch(r){case m.get(0):e.get(0).focus();SB.funding.SetCursorPosition(e.get(0),e.get(0).value.length);break;case e.get(0):u.get(0).focus();SB.funding.SetCursorPosition(u.get(0),u.get(0).value.length);break;case u.get(0):t.get(0).focus();SB.funding.SetCursorPosition(t.get(0),t.get(0).value.length);break;}}}p.get(0).value=[t.val(),u.val(),e.val(),m.val()].join("");if(p.get(0).value.length==16){SB.funding.cardDeposit.luhnCheckCardNumber();}};SB.funding.SetCursorPosition=function(f,e){if(f.setSelectionRange){f.setSelectionRange(e,e);}else{if(f.createTextRange){var d=f.createTextRange();d.collapse(true);d.moveEnd("character",e);d.moveStart("character",e);d.select();}}};SB.funding.GetCursorPosition=function(f){if(f.selectionStart){var l=f.selectionStart;return l>0?l:0;}else{if(f.createTextRange){f.focus();var k=document.selection.createRange();if(k==null){return"0";}var h=f.createTextRange();var g=h.duplicate();h.moveToBookmark(k.getBookmark());g.setEndPoint("EndToStart",h);return g.text.length;}else{return 0;}}};SB.funding.removeEmptyOptionFromBTWithdraw=function(){var b=document.getElementById("ctrlWithdrawMethodList__ctl0_ddlBankName");if(b!=null&&b.options.length>0&&b.options[0].value==" "){b.remove(0);}};function roundNumber(d,c){return Math.round(d*Math.pow(10,c))/Math.pow(10,c);}SB.funding.calculateAmountWithFee=function(t,v,w,s,o){var u=$("input[id$='withFee']");if(u.length>0){var r=0;var q=u.get(0);try{var m=parseFloat($(t).get(0).value);if(!(isNaN(m)||m==0)){if(w){r=roundNumber(m*(1+v/100),2);}else{r=m+v;}}}catch(p){}q.value=r+s+o;}};var fundingJSLoaded=true;if(typeof(SB)=="undefined"||SB==null){var SB=new Object();}if(typeof(SB.funding)=="undefined"||SB.funding==null){SB.funding=new Object();}SB.funding.cardDeposit=new Object();SB.funding.cardDeposit.onNewCardTypeChange_Card=function(d){var f=document.getElementById("cardRow4");var e=document.getElementById("cardRow9");SB.funding.onCardTypeChange(d.value,"new",f,e);oCardRow2=null;oCardRow7=null;SB.funding.displayDepositAmounts(d.value,"new");};SB.funding.cardDeposit.validateCARD=function(c){var d=true;return d;};SB.funding.cardDeposit.disableDepositExpiredCard=function(g,l,h,k){var m=new Date();var o="false";if((k>l)||(k==l&&h>g)){o="true";}if(o=="true"){document.getElementById("lnkActiveCard").style.display="none";document.getElementById("lnkExpiredCard").style.display="";document.getElementById("lnkUpdateCard").className="show";document.getElementById("ErrorIcon").style.display="";document.getElementById("InfoIcon").style.display="none";SB.funding.cardDeposit.initializeTooltip();SB.funding.cardDeposit.ToggleCardExpiry();}else{document.getElementById("lnkUpdateCard").className="hide";document.getElementById("ErrorIcon").style.display="none";document.getElementById("InfoIcon").style.display="";}};SB.funding.cardDeposit.initializeTooltip=function(){SB.base.holdingDiv("hide");var d=document.getElementById("ctrlDepositMethodList__ctl0_ico_expiryDate");var c=document.getElementById("ctrlDepositMethodList__ctl0_ttt_expiryDate");d.className="icons icoError";c.className="toolTipText tttError";SB.funding.cardDeposit.removeExistingTooltipMessage(c);bubble_info_message="##jsTranslationLabels#ExpiredCardMessage##";SB.funding.cardDeposit.createTooltipMessageTag(c);};SB.funding.cardDeposit.ToggleCardExpiry=function(){SB.base.ToggleElement("cardExpired","display","block");};SB.funding.cardDeposit.loadManageCard=function(){var e="";var f="";var h=SB.funding.getCurrentPPID();var g=document.getElementById("cardID").value;Global_processingTitle="##jsTranslationLabels#ProcessingTitle##";Global_processingMessage="<p>##jsTranslationLabels#ProcessingMessage##</p>";e="currentPPID="+h+"&userPaymentAccountID="+g+"&source=deposit";f="/t/funding/ManageCardPopup.aspx?"+e;SB.base.RecallOpenDiv(f,"popBadSelect1","popVeil1","popLayer1");};SB.funding.cardDeposit.OnDropdownSelectionChange=function(){document.getElementById("lnkActiveCard").style.display="";document.getElementById("lnkExpiredCard").style.display="none";var W=document.getElementById("ctrlDepositMethodList__ctl0_dpdwnCardList");var S=W.options[W.selectedIndex].value;document.getElementById("dropdownSelection").value=S;var Z=new Array();Z=S.split("_");SB.funding.cardDeposit.createHiddenControls(Z);if(Z.length>1){var H=Z[0];var X=Z[1];var P=Z[2];var O=Z[3];var I=Z[4];var K=Z[5];var N=Z[6];var F=Z[7];var R=Z[8];var E=Z[9];var Y=Z[10];var L=Z[11];var U=Z[12];document.getElementById("dvSavedCards").style.display="";document.getElementById("ctrlDepositMethodList__ctl0_ddlCardType").value=P;document.getElementById("cardID").value=H;document.getElementById("ctrlDepositMethodList__ctl0_InvoiceHelpDiv").style.display=(X=="IV")?"block":"none";SB.funding.onDepositCardSelect(H,X,P,fundingGlobals.card.hasNoErrors);var G=document.getElementById("ctrlDepositMethodList__ctl0_lblCardType");G.innerHTML=O;G.style.display="";document.getElementById("ctrlDepositMethodList__ctl0_spCardType").style.display="";var M=document.getElementById("ctrlDepositMethodList__ctl0_lblCardNumber");M.innerHTML=I;M.style.display="";document.getElementById("ctrlDepositMethodList__ctl0_spCardNumber").style.display="";var aa=document.getElementById("ctrlDepositMethodList__ctl0_lblExpiryMonth");aa.innerHTML=N;aa.style.display="";document.getElementById("ctrlDepositMethodList__ctl0_spExpiryDate").style.display="";var V=document.getElementById("ctrlDepositMethodList__ctl0_lblExpiryYear");V.innerHTML=F;V.style.display="";SB.funding.cardDeposit.disableDepositExpiredCard(N,F,L,U);var K=Z[5];if(K!=""&&K!=null){if(P=="MA"||P=="SW"||P=="unknown"){var Q=K.substr(4,2);var D=K.substr(0,4);var J=document.getElementById("ctrlDepositMethodList__ctl0_lblStartMonth");J.innerHTML=Q;J.style.display="";document.getElementById("ctrlDepositMethodList__ctl0_spStartDate").style.display="";var T=document.getElementById("ctrlDepositMethodList__ctl0_lblStartYear");T.innerHTML=D;T.style.display="";var ab=document.getElementById("ctrlDepositMethodList__ctl0_lblIssueNumber");ab.innerHTML=R;ab.style.display="";document.getElementById("ctrlDepositMethodList__ctl0_spIssueNumber").style.display="";}else{SB.funding.cardDeposit.hideStartDateAndIssueNo();}}else{SB.funding.cardDeposit.hideStartDateAndIssueNo();}}else{document.getElementById("cardID").value="new";SB.funding.onDepositCardSelect("new","unknown",false,fundingGlobals.card.hasNoErrors);SB.funding.cardDeposit.hideSavedCardAttributes();SB.funding.onNewCardTypeChange(W);document.getElementById("ctrlDepositMethodList__ctl0_ddlCardType").value=S;document.getElementById("cardType").value=S;document.getElementById("ctrlDepositMethodList__ctl0_InvoiceHelpDiv").style.display="none";}};SB.funding.cardDeposit.hideStartDateAndIssueNo=function(){document.getElementById("ctrlDepositMethodList__ctl0_lblStartMonth").style.display="none";document.getElementById("ctrlDepositMethodList__ctl0_spStartDate").style.display="none";document.getElementById("ctrlDepositMethodList__ctl0_lblStartYear").style.display="none";document.getElementById("ctrlDepositMethodList__ctl0_lblIssueNumber").style.display="none";document.getElementById("ctrlDepositMethodList__ctl0_spIssueNumber").style.display="none";};SB.funding.cardDeposit.hideSavedCardAttributes=function(){document.getElementById("dvSavedCards").style.display="none";document.getElementById("ctrlDepositMethodList__ctl0_lblCardType").style.display="none";document.getElementById("ctrlDepositMethodList__ctl0_spCardType").style.display="none";document.getElementById("ctrlDepositMethodList__ctl0_lblCardNumber").style.display="none";document.getElementById("ctrlDepositMethodList__ctl0_spCardNumber").style.display="none";document.getElementById("ctrlDepositMethodList__ctl0_spExpiryDate").style.display="none";document.getElementById("ctrlDepositMethodList__ctl0_lblExpiryMonth").style.display="none";document.getElementById("ctrlDepositMethodList__ctl0_lblExpiryYear").style.display="none";document.getElementById("ctrlDepositMethodList__ctl0_spStartDate").style.display="none";document.getElementById("ctrlDepositMethodList__ctl0_lblStartMonth").style.display="none";document.getElementById("ctrlDepositMethodList__ctl0_lblStartYear").style.display="none";document.getElementById("ctrlDepositMethodList__ctl0_lblIssueNumber").style.display="none";document.getElementById("ctrlDepositMethodList__ctl0_spIssueNumber").style.display="none";};SB.funding.cardDeposit.createHiddenControls=function(d){var c=new Array();c=d;SB.funding.cardDeposit.createHiddenProviderId(c[0],c[1]);SB.funding.cardDeposit.createHiddenCardType(c[0],c[2]);SB.funding.cardDeposit.createHiddenCvv2(c[0],c[9]);SB.funding.cardDeposit.createHiddenCurrencyCode(c[0],c[10]);};SB.funding.cardDeposit.createHiddenProviderId=function(e,h){var g=document.getElementById("placeholderHiddenControls");var f=document.createElement("input");f.setAttribute("type","hidden");f.setAttribute("id","cardProviderID_"+e);f.setAttribute("name","cardProviderID_"+e);f.setAttribute("value",h);g.appendChild(f);};SB.funding.cardDeposit.createHiddenCardType=function(e,h){var g=document.getElementById("placeholderHiddenControls");var f=document.createElement("input");f.setAttribute("type","hidden");f.setAttribute("id","cardType_"+e);f.setAttribute("name","cardType_"+e);f.setAttribute("value",h);g.appendChild(f);};SB.funding.cardDeposit.createHiddenCvv2=function(f,e){var h=document.getElementById("placeholderHiddenControls");var g=document.createElement("input");g.setAttribute("type","hidden");g.setAttribute("id","cvv2_"+f);g.setAttribute("name","cvv2_"+f);g.setAttribute("value",e);h.appendChild(g);};SB.funding.cardDeposit.onCardDeposit=function(d){var f=document.getElementById(fundingGlobals.card.ddlDepositAmountID);var e=document.getElementById(fundingGlobals.card.txtAmountID);if(f!=null){if(f.style.display!="none"){e.value=f.value;}}Global_processingMessage="<p>##jsTranslationLabels#CardDepositProcessingMessage##</p>";Global_processingTitle="##jsTranslationLabels#CardDepositProcessing##";__doPostBack("","");};SB.funding.cardDeposit.createHiddenCurrencyCode=function(e,h){var g=document.getElementById("placeholderHiddenControls");var f=document.createElement("input");f.setAttribute("type","hidden");f.setAttribute("id","currencyCode_"+e);f.setAttribute("name","currencyCode_"+e);f.setAttribute("value",h);g.appendChild(f);};SB.funding.cardDeposit.clearLuhnCheckIndicator=function(){var d=document.getElementById("ctrlDepositMethodList__ctl0_ico_CardNumber");d.className="icons";var c=document.getElementById("ctrlDepositMethodList__ctl0_ttt_CardNumber");c.className="toolTipText";SB.funding.cardDeposit.removeExistingTooltipMessage(c);};var Cards;var MC;var VI;var AmExCard;var DinersClubCard;var DiscoverCard;var enRouteCard;var JCBCard;var LuhnCheckSum;var MA;var SW;var VE;var MD;var VD;var bubble_info_message="##jsTranslationLabels#defaultLuhnErrorMessage##";SB.funding.cardDeposit.InitialializeCardObjects=function(){Cards=new Array(13);Cards[0]=new SB.funding.cardDeposit.CardType("MC","51,52,53,54,55","16");MC=Cards[0];Cards[1]=new SB.funding.cardDeposit.CardType("VI","4","13,16");VI=Cards[1];Cards[2]=new SB.funding.cardDeposit.CardType("AmExCard","34,37","15");AmExCard=Cards[2];Cards[3]=new SB.funding.cardDeposit.CardType("DinersClubCard","30,36,38","14");DinersClubCard=Cards[3];Cards[4]=new SB.funding.cardDeposit.CardType("DiscoverCard","6011","16");DiscoverCard=Cards[4];Cards[5]=new SB.funding.cardDeposit.CardType("enRouteCard","2014,2149","15");enRouteCard=Cards[5];Cards[6]=new SB.funding.cardDeposit.CardType("JCBCard","3088,3096,3112,3158,3337,3528","16");JCBCard=Cards[6];LuhnCheckSum=Cards[7]=new SB.funding.cardDeposit.CardType();Cards[8]=new SB.funding.cardDeposit.CardType("MA","50,56,57,58,6","16");MA=Cards[8];Cards[9]=new SB.funding.cardDeposit.CardType("SW","4903,4905,4911,4936,564182,633110,6333,6759","16,18,19");SW=Cards[9];Cards[10]=new SB.funding.cardDeposit.CardType("VE","4","13,16");VE=Cards[10];Cards[11]=new SB.funding.cardDeposit.CardType("MD","51,52,53,54,55","16");MD=Cards[11];Cards[12]=new SB.funding.cardDeposit.CardType("VD","4","13,16");VD=Cards[12];};var LuhnCheckUnchecked="unchecked";var LuhnCheckPassed="passed";var LuhnCheckFailed="failed";SB.funding.cardDeposit.luhnCheckCardNumber=function(){var e=LuhnCheckUnchecked;SB.funding.cardDeposit.InitialializeCardObjects();document.getElementById("imgCardNumberIncorrect").style.display="none";document.getElementById("imgCardNumberCorrect").style.display="none";e=SB.funding.cardDeposit.CheckNumberOnChange();var d=document.getElementById("ctrlDepositMethodList__ctl0_ico_CardNumber");var f=document.getElementById("ctrlDepositMethodList__ctl0_ttt_CardNumber");if(e==LuhnCheckPassed){d.className="icons icoTrue";f.className="toolTipText";SB.funding.cardDeposit.removeExistingTooltipMessage(f);}else{if(e==LuhnCheckFailed){d.className="icons icoFalse";f.className="toolTipText tttError";SB.funding.cardDeposit.removeExistingTooltipMessage(f);SB.funding.cardDeposit.createTooltipMessageTag(f);}else{if(e==LuhnCheckUnchecked){SB.funding.cardDeposit.clearLuhnCheckIndicator();}}}};SB.funding.cardDeposit.removeExistingTooltipMessage=function(b){b.innerHTML="";};SB.funding.cardDeposit.createTooltipMessageTag=function(b){b.innerHTML='<span class="tttContent">'+bubble_info_message+"</span>";};SB.funding.cardDeposit.CardType=function(){var o;var m=SB.funding.cardDeposit.CardType.arguments;var h=SB.funding.cardDeposit.CardType.arguments.length;this.objname="object CardType";var k=(h>0)?m[0]:"CardObject";var g=(h>1)?m[1]:"0,1,2,3,4,5,6,7,8,9";var l=(h>2)?m[2]:"13,14,15,16,19";this.setCardNumber=setCardNumber;this.setCardType=setCardType;this.setLen=setLen;this.setRules=setRules;this.setExpiryDate=setExpiryDate;this.setCardType(k);this.setLen(l);this.setRules(g);if(h>4){this.setExpiryDate(m[3],m[4]);}this.checkCardNumber=checkCardNumber;this.getExpiryDate=SB.funding.cardDeposit.getExpiryDate;this.getCardType=SB.funding.cardDeposit.getCardType;this.isCardNumber=isCardNumber;this.isExpiryDate=isExpiryDate;this.luhnCheck=luhnCheck;return this;};SB.funding.cardDeposit.CheckNumberOnChange=function(){var h=document.getElementById("ctrlDepositMethodList__ctl0_txtCardno").value.split("-").join("");var e=document.getElementById("ctrlDepositMethodList__ctl0_ddlValidToYear").value;var g=document.getElementById("ctrlDepositMethodList__ctl0_ddlValidToMonth").value;var f=document.getElementById("ctrlDepositMethodList__ctl0_dpdwnCardList").value;if(h.length==0||e.length==0||g.length==0){return LuhnCheckUnchecked;}else{return SB.funding.cardDeposit.CheckCardNumber(h,e,g,f);}};SB.funding.cardDeposit.CheckCardNumber=function(usrCardNumber,lExpiryYear,lExpiryMonth,lCardType){var tmpyear;if(lExpiryYear.length==0){bubble_info_message="##jsTranslationLabels#noExpiryLuhnErrorMessage##";return LuhnCheckFailed;}tmpyear=lExpiryYear;tmpmonth=lExpiryMonth;if(!(new CardType()).isExpiryDate(tmpyear,tmpmonth)){bubble_info_message="##jsTranslationLabels#expiredCardLuhnErrorMessage##";return LuhnCheckFailed;}var card=lCardType;var retval=eval(card+'.checkCardNumber("'+usrCardNumber+'", '+tmpyear+", "+tmpmonth+");");cardname="";if(retval){return LuhnCheckPassed;}else{for(var n=0;n<Cards.size;n++){if(Cards[n].checkCardNumber(usrCardNumber,tmpyear,tmpmonth)){cardname=Cards[n].SB.funding.cardDeposit.getCardType();break;}}if(cardname.length>0){var str_message="##jsTranslationLabels#doubtfulCardLuhnErrorMessage##";str_message.replace("card1",cardname);str_message.replace("card2",card);bubble_info_message=str_message;return LuhnCheckFailed;}else{bubble_info_message="##jsTranslationLabels#invalidNumberLuhnErrorMessage##";return LuhnCheckFailed;}}};CardType=function(){var o;var m=CardType.arguments;var h=CardType.arguments.length;this.objname="object CardType";var k=(h>0)?m[0]:"CardObject";var g=(h>1)?m[1]:"0,1,2,3,4,5,6,7,8,9";var l=(h>2)?m[2]:"13,14,15,16,19";this.setCardNumber=setCardNumber;this.setCardType=setCardType;this.setLen=setLen;this.setRules=setRules;this.setExpiryDate=SB.funding.cardDeposit.setExpiryDate;this.setCardType(k);this.setLen(l);this.setRules(g);if(h>4){this.setExpiryDate(m[3],m[4]);}this.checkCardNumber=checkCardNumber;this.getExpiryDate=SB.funding.cardDeposit.getExpiryDate;this.getCardType=SB.funding.cardDeposit.getCardType;this.isCardNumber=isCardNumber;this.isExpiryDate=isExpiryDate;this.luhnCheck=luhnCheck;return this;};checkCardNumber=function(){var k=checkCardNumber.arguments;var l=checkCardNumber.arguments.length;var g=(l>0)?k[0]:this.cardnumber;var h=(l>1)?k[1]:this.year;var f=(l>2)?k[2]:this.month;this.setCardNumber(g);this.setExpiryDate(h,f);if(!this.isCardNumber()){return false;}if(!this.isExpiryDate()){return false;}return true;};SB.funding.cardDeposit.getCardType=function(){return this.cardtype;};SB.funding.cardDeposit.getExpiryDate=function(){return this.month+"/"+this.year;};isCardNumber=function(){var l=isCardNumber.arguments;var h=isCardNumber.arguments.length;var k=(h>0)?l[0]:this.cardnumber;if(!this.luhnCheck()){return false;}for(var o=0;o<this.len.size;o++){if(k.toString().length==this.len[o]){for(var m=0;m<this.rules.size;m++){var g=k.substring(0,this.rules[m].toString().length);if(g==this.rules[m]){return true;}}return false;}}return false;};isExpiryDate=function(){var d=isExpiryDate.arguments;var c=isExpiryDate.arguments.length;year=c>0?d[0]:this.year;month=c>1?d[1]:this.month;if(!isNum(year+"")){return false;}if(!isNum(month+"")){return false;}today=new Date();expiry=new Date(year,month);if(today.getTime()>expiry.getTime()){return false;}else{return true;}};isNum=function(d){d=d.toString();if(d.length==0){return false;}for(var c=0;c<d.length;c++){if(d.substring(c,c+1)<"0"||d.substring(c,c+1)>"9"){return false;}}return true;};luhnCheck=function(){var k=luhnCheck.arguments;var m=luhnCheck.arguments.length;var o=m>0?k[0]:this.cardnumber;if(!isNum(o)){return false;}var s=o.length;var r=s&1;var q=0;for(var p=0;p<s;p++){var l=parseInt(o.charAt(p));if(!((p&1)^r)){l*=2;if(l>9){l-=9;}}q+=l;}if(q%10==0){return true;}else{return false;}};makeArray=function makeArray(b){this.size=b;return this;};setCardNumber=function(b){this.cardnumber=b;return this;};setCardType=function(b){this.cardtype=b;return this;};setExpiryDate=function(d,c){this.year=d;this.month=c;return this;};setLen=function(d){if(d.length==0||d==null){d="13,14,15,16,19";}var e=d;n=1;while(e.indexOf(",")!=-1){e=e.substring(e.indexOf(",")+1,e.length);n++;}this.len=new makeArray(n);n=0;while(d.indexOf(",")!=-1){var f=d.substring(0,d.indexOf(","));this.len[n]=f;d=d.substring(d.indexOf(",")+1,d.length);n++;}this.len[n]=d;return this;};setRules=function(e){if(e.length==0||e==null){e="0,1,2,3,4,5,6,7,8,9";}var f=e;n=1;while(f.indexOf(",")!=-1){f=f.substring(f.indexOf(",")+1,f.length);n++;}this.rules=new makeArray(n);n=0;while(e.indexOf(",")!=-1){var d=e.substring(0,e.indexOf(","));this.rules[n]=d;e=e.substring(e.indexOf(",")+1,e.length);n++;}this.rules[n]=e;return this;};var cardJSLoaded=true;if(typeof(SB)=="undefined"||SB==null){var SB=new Object();}if(typeof(SB.funding)=="undefined"||SB.funding==null){SB.funding=new Object();}SB.funding.cardWithdraw=new Object();SB.funding.cardWithdraw.validateWithdrawExpiry=function(){var p=true;var s=new Date();var t=s.getMonth();var l=s.getYear();var u=0;var q=0;var o=new Array();u=document.getElementById(fundingGlobals.card.wStartYear).innerText;q=document.getElementById(fundingGlobals.card.wExpiryYear).innerText;var r=document.getElementById(fundingGlobals.card.wStartMonth).innerText;var m=document.getElementById(fundingGlobals.card.wExpiryMonth).innerText;};SB.funding.cardWithdraw.cardValidityDates=function(k){var l=false;var h=new Date();var f=h.getMonth()+1;var g=h.getYear();if(k[0]==null||k[2]==null){l=false;return l;}else{if(k[0]<g){}else{if(k[0]==g){if(f>k[2]||f==k[2]){}else{l=false;return l;}}else{if(k[0]>g){l=false;return l;}}}}if(g<k[1]){}else{if(g==k[1]){if(f<k[3]||f==k[3]){}else{l=false;return l;}}else{if(g>k[1]){l=false;return l;}}}l=true;return l;};OnWithdrawDropdownSelectionChange=function(){if(document.getElementById("lnkActiveCard")){document.getElementById("lnkActiveCard").style.display="";}if(document.getElementById("lnkExpiredCard")){document.getElementById("lnkExpiredCard").style.display="none";}var A=document.getElementById("ctrlWithdrawMethodList__ctl0_dpdwnCardList");var s=A.options[A.selectedIndex].value;document.getElementById("dropdownSelection").value=s;var t=new Array();t=s.split("_");SB.funding.cardWithdraw.createHiddenControls(t);if(t.length>1){document.getElementById(fundingGlobals.card.wDdlCardType).value=t[2];document.getElementById("cardID").value=t[0];var C=document.getElementById(fundingGlobals.card.wLblCardType);C.innerHTML=t[3];C.style.display="";var w=document.getElementById(fundingGlobals.card.wLblCardNumber);w.innerHTML=t[4];w.style.display="";var u=document.getElementById(fundingGlobals.card.wExpiryMonth);u.innerHTML=t[6];u.style.display="";var B=document.getElementById(fundingGlobals.card.wExpiryYear);B.innerHTML=t[7];B.style.display="";var z=t[5];if(z!=""&&z!=null){if(t[2]=="MA"||t[2]=="SW"||t[2]=="unknown"){var q=z.substr(4,2);var r=z.substr(0,4);var y=document.getElementById(fundingGlobals.card.wStartMonth);y.innerHTML=q;y.style.display="";if(document.getElementById(fundingGlobals.card.wDivspStartDate)){document.getElementById(fundingGlobals.card.wDivspStartDate).style.display="";}var v=document.getElementById(fundingGlobals.card.wStartYear);v.innerHTML=r;v.style.display="";var D=document.getElementById(fundingGlobals.card.wLblIssueNumber);D.innerHTML=t[8];D.style.display="";if(document.getElementById(fundingGlobals.card.wDivspIssueNumber)){document.getElementById(fundingGlobals.card.wDivspIssueNumber).style.display="";}}else{SB.funding.cardWithdraw.hideStartDateAndIssueNo();}}else{SB.funding.cardWithdraw.hideStartDateAndIssueNo();}}else{document.getElementById("cardID").value="new";SB.funding.onDepositCardSelect("new","unknown",false,fundingGlobals.card.hasNoErrors);SB.funding.cardDeposit.hideSavedCardAttributes();SB.funding.onNewCardTypeChange(A);document.getElementById(fundingGlobals.card.wDdlCardType).value=s;document.getElementById("cardType").value=s;}SB.funding.cardWithdraw.stopWithdrawOnExpiredCard(document.getElementById(fundingGlobals.card.wExpiryMonth),document.getElementById(fundingGlobals.card.wExpiryYear));};SB.funding.cardWithdraw.hideStartDateAndIssueNo=function(){document.getElementById(fundingGlobals.card.wDivspStartDate).style.display="none";document.getElementById(fundingGlobals.card.wDivspIssueNumber).style.display="none";};SB.funding.cardWithdraw.createHiddenControls=function(d){var c=new Array();c=d;SB.funding.cardWithdraw.createHiddenProviderId(c[0],c[1]);SB.funding.cardWithdraw.createHiddenCardType(c[0],c[2]);SB.funding.cardWithdraw.createHiddenCvv2(c[0],c[9]);SB.funding.cardWithdraw.createHiddenCurrencyCode(c[0],c[10]);};SB.funding.cardWithdraw.createHiddenProviderId=function(e,h){var g=document.getElementById("placeholderHiddenControls");var f=document.createElement("input");f.setAttribute("type","hidden");f.setAttribute("id","cardProviderID_"+e);f.setAttribute("name","cardProviderID_"+e);f.setAttribute("value",h);g.appendChild(f);};SB.funding.cardWithdraw.createHiddenCardType=function(e,h){var g=document.getElementById("placeholderHiddenControls");var f=document.createElement("input");f.setAttribute("type","hidden");f.setAttribute("id","cardType_"+e);f.setAttribute("name","cardType_"+e);f.setAttribute("value",h);g.appendChild(f);};SB.funding.cardWithdraw.createHiddenCvv2=function(f,e){var h=document.getElementById("placeholderHiddenControls");var g=document.createElement("input");g.setAttribute("type","hidden");g.setAttribute("id","cvv2_"+f);g.setAttribute("name","cvv2_"+f);g.setAttribute("value",e);h.appendChild(g);};SB.funding.cardWithdraw.createHiddenCurrencyCode=function(e,h){var g=document.getElementById("placeholderHiddenControls");var f=document.createElement("input");f.setAttribute("type","hidden");f.setAttribute("id","currencyCode_"+e);f.setAttribute("name","currencyCode_"+e);f.setAttribute("value",h);g.appendChild(f);};SB.funding.cardWithdraw.stopWithdrawOnExpiredCard=function(r,s){var m=new Date();var q=false;var o=m.getMonth();var p=m.getFullYear();var u=r.innerHTML;var w=s.innerHTML;if(w>p){}else{if(w==p){if(u<o){q=true;}}else{q=true;}}var t=document.getElementById(fundingGlobals.card.wActiveCardLink);var v=document.getElementById(fundingGlobals.card.wExpiredCardLink);if(q){t.style.display="none";v.style.display="";}else{t.style.display="";v.style.display="none";}};SB.Login=function(b){this.balanceUrl="/misc/webservices/funding/balanceservice.aspx";this.div=b;this.triggerLoginStatus();this.setupBalanceRefresh();this.setupUserStateRefresh();};SB.Login.prototype={triggerLoginStatus:function(){var b=this;$("input.loginStatus",b.div).each(function(){SB.EventHub.trigger("login-status",$(this).val());});},setupBalanceRefresh:function(){var b=this;SB.EventHub.bind("balance-refresh",function(a){if(b!=a){b.forceBalance(a.forceRefresh==true);}});},setupUserStateRefresh:function(){var b=this;if($(b.div).hasClass("inPlayLoginBox")){SB.EventHub.bind("user-state-refresh",function(a){if(b!=a){window.location.href=window.location.href;}});}},forceBalance:function(e){var d=this;var f={type:"GET",url:this.balanceUrl+"?forceRefresh="+e+"&cacheBuster="+new Date().getTime(),success:function(a,b){d.refreshBalance(a);},error:function(){alert("error");}};jQuery.ajax(f);},refreshBalance:function(f){var d=this;var e=$("string",f).text();$("span.balance",d.div).html(e);}};$(document).ready(function(){$("div.loginBox").each(function(){new SB.Login(this);});});SB.ui.WebTrends=function(b){if(typeof(b)!="undefined"){this.trackingFunction=b;}else{if(typeof(dcsMultiTrack)!="undefined"){this.trackingFunction=dcsMultiTrack;}else{this.trackingFunction=function(){SB.framework.Logger.getInstance().error("WebTrends no tracking function defined");};}}};SB.ui.WebTrends.prototype={trackUserEvent:function(g,f,e){try{SB.framework.Logger.getInstance().info("WebTrends.trackUserEvent(): pageTitle = "+g+", scenarioName = "+f+", stepName = "+e);this.trackingFunction("WT.ti",g,"WT.si_n",f,"WT.si_p",e);}catch(h){SB.framework.Logger.getInstance().error("WebTrends.trackUserEvent(): "+h);}},trackEvent:function(d){try{SB.framework.Logger.getInstance().info("WebTrends.trackEvent(): pageUrl = "+d.pageUrl+", pageTitle = "+d.pageTitle+", contentGroup = "+d.contentGroup+", contentSubGroup = "+d.contentSubGroup+", scenarioReport = "+d.scenarioReport+", scenarioReportStep = "+d.scenarioReportStep+", dcsextLogin = "+d.dcsextLogin);this.trackingFunction("DCS.dcsuri",d.pageUrl,"WT.ti",d.pageTitle,"WT.cg_n",d.contentGroup,"WT.cg_s",d.contentSubGroup,"WT.si_n",d.scenarioReport,"WT.si_p",d.scenarioReportStep,"DCSext.login",d.dcsextLogin);}catch(c){SB.framework.Logger.getInstance().error("WebTrends.trackUserEvent(): "+c);}}};SB.ui.Gomez=function(gomezPageId){var gomez={gs:new Date().getTime(),acctId:"62CFD0",pgId:gomezPageId,grpId:""};window.gomez=gomez;gomez=gomez?gomez:{};gomez.h3=function(d,s){for(var p in s){d[p]=s[p];}return d;};gomez.h3(gomez,{b3:function(r){if(r<=0){return false;}return Math.random()<=r&&r;},b0:function(n){var c=document.cookie;var v=c.match(new RegExp(";[ ]*"+n+"=([^;]*)"));if(!v){v=c.match(new RegExp(n+"=([^;]*)"));}if(v){return unescape(v[1]);}return"";},c2:function(n,v,e,p,d,s){try{var t=this,a=location.hostname;var c=n+"="+escape(v)+(e?";expires="+e.toGMTString():"")+(p?";path="+p:";path=/")+(d?";domain="+d:";domain="+a)+(s?";secure":"");document.cookie=c;}catch(e){}},z0:function(n){var t=this;if(n){var s=t.b0("__g_c");if(!s){return"";}var v=s.match(new RegExp(n+":([^|]*)"));if(v){return unescape(v[1]);}return"";}else{return"";}},z1:function(n,m){var t=this;if(n){var s=t.b0("__g_c");if(s){if(s.indexOf(n+":")!=-1){s=s.replace(new RegExp("("+n+":[^|]*)"),n+":"+m);}else{s=s==" "?n+":"+m:s+"|"+n+":"+m;}t.c2("__g_c",s);}else{t.c2("__g_c",n+":"+m);}}}});if(gomez.wrate){gomez.i0=gomez.z0("w");if(gomez.i0){gomez.runFlg=parseInt(gomez.i0)>0?true:false;}else{if(gomez.b3(parseFloat(gomez.wrate))){gomez.runFlg=true;gomez.z1("w",1);}else{gomez.runFlg=false;gomez.z1("w",0);}}}else{if(gomez.wrate==undefined){gomez.runFlg=true;gomez.z1("w",1);}else{gomez.runFlg=false;gomez.z1("w",0);}}if(gomez.runFlg){gomez.h1=function(v,d){return v?v:d;};gomez.gs=gomez.h1(gomez.gs,new Date().getTime());gomez.acctId=gomez.h1(gomez.acctId,"");gomez.pgId=gomez.h1(gomez.pgId,"");gomez.grpId=gomez.h1(gomez.grpId,"");gomez.E=function(c){this.s=c;};gomez.E.prototype={g1:function(e){var t=gomez,i=t.g6(e);if(i){i.e=t.b5();}}};gomez.L=function(m){this.a=m;};gomez.L.prototype={g2:function(m){var t=gomez,n=t.b5();var s=document.getElementsByTagName(m);var e=t.k;if(m=="script"){e=t.j;}if(m=="iframe"){e=t.l;}if(s){var l=s.length;for(var i=0;i<l;i++){var u=s[i].src||s[i].href;if(u&&!e[u]){var r=new gomez.E(e);t.grm[u]=r;e[u]=new t.c7(u,n);if(t.gIE&&m=="script"){t.e2(s[i],"readystatechange",t.d2,false);}else{t.e2(s[i],"load",r.g1,false);}}}}}};gomez.L.m=new Object;gomez.L.m.script=new gomez.L();gomez.L.m.link=new gomez.L();gomez.L.m.iframe=new gomez.L();gomez.S=function(){var t=this,h=gomez.acctId+".r.axf8.net";t.x=location.protocol+"//"+h+"/mr/b.gif?";t.y=location.protocol+"//"+h+"/mr/a.gif?";};gomez.h2=function(){var t=this;t.gIE=false;t.f=new Object;t._h=0;t.j=new Object;t.k=new Object;t.l=new Object;t.m=location.href;t.p=-1;t.q=-1;t.t=new Array;t.u=new Array;t._w=false;t.gSfr=/KHTML|WebKit/i.test(navigator.userAgent);t.gc={n:"c"};t.grm=new Object;t.b;t.a=0;t.d=false;t.x=false;t.s=new gomez.S;t._a=false;t.h6=false;};gomez.h3(gomez,{h5:function(u){try{var s=document.createElement("script");s.src=u;s.type="text/javascript";if(document.body){document.body.appendChild(s);}else{if(document.documentElement.getElementsByTagName("head")[0]){document.documentElement.getElementsByTagName("head")[0].appendChild(s);}}}catch(e){}},a9:function(){var t=gomez,i=t.z0("a"),g=t.b0("__g_u");t.gc.h=t.z0("b");if(!t.gc.h){t.gc.h=1;}t.z1("b",parseInt(t.gc.h)+1);if(i){t.a=parseInt(i);if(t.a==1){t._w=true;}else{if(t.a==3){t.x=true;t._w=true;}}t.d=true;t.gc.c=t.z0("c");t.gc.d=t.z0("d");t.gc.i=t.z0("e");t.gc.j=t.z0("f");if(t._w&&!t._a){t.h7();t._a=true;}}else{if(!t.gc.a){return;}var s="v=1";t.c2("__g_u","1",new Date(t.gt()+1000));if(t.b0("__g_u")&&g&&g!="1"&&g.indexOf("NaN")==-1&&g.indexOf("undefined")==-1){s="v=0";var r=g.split("_");t.b2(parseInt(r[0]),parseInt(r[1])+1);if(r[4]&&r[4]!="0"&&t.gt()<parseInt(r[5])&&r[2]&&r[2]!="0"){t.b1(parseFloat(r[2]),parseFloat(r[3]),parseFloat(r[4]),parseInt(r[5]));return;}}t.h6=true;s=t.s.y+"a="+t.gc.a+"&"+s;if(t.gSfr){document.write("<script src='"+s+"'><\/script>");}else{t.h5(s);}}t.b=t.z0("g");},h7:function(){var t=gomez,u=t.tloc?t.tloc:location.protocol+"//"+t.acctId+".t.axf8.net/js/gtag4.js";if(t.gSfr){document.write("<script src='"+u+"'><\/script>");}else{t.h5(u);}},b1:function(v,s,q,f){var t=this;if(t._a){return;}if(t.b3(v)){t._w=true;t.a=1;var p=parseFloat(s/v);if(t.b3(p)){t.x=true;t.a=3;}}t.d=true;t.z1("a",t.a);t.z1("e",v);t.z1("f",s);t.gc.i=v;t.gc.j=s;t.h4(v,s,q,f);if(t._w){t.h7();t._a=true;}},b2:function(v,s){var t=this,f=new Date(t.gt()+946080000000),g=""+v+"_"+s;if(t._a){return;}t.c2("__g_u",g,f);t.gc.c=v;t.gc.d=s;t.z1("c",v);t.z1("d",s);},h4:function(o,p,q,d){var t=this,f=new Date(t.gt()+946080000000),g=t.b0("__g_u");if(g&&g!="1"&&g.indexOf("NaN")==-1&&g.indexOf("undefined")==-1){var r=g.split("_"),s;if(d){s=d;}else{if(q&&q>=0){s=new Date(t.gt()+parseInt(q*86400000)).getTime();}else{q=5;s=new Date(t.gt()+432000000).getTime();}}g=""+r[0]+"_"+r[1]+"_"+o+"_"+p+"_"+q+"_"+s;t.c2("__g_u",g,f);}},gt:function(){return new Date().getTime();},b5:function(){return new Date().getTime()-gomez.gs;},b6:function(){var t=gomez;t.p=t.b5();},f8:function(){var t=this;if(t.pollId1){clearInterval(t.pollId1);}if(t.pollId2){clearInterval(t.pollId2);}if(t.pollId3){clearInterval(t.pollId3);}if(t.pollId4){clearInterval(t.pollId4);}},b7:function(){var t=gomez;t.f8();t.q=t.b5();},c7:function(u,s){var t=this;t.m=u;t.s=s;},c8:function(){var t=gomez,n=t.b5(),l=document.images.length;if(l>t._h){for(var i=t._h;i<l;++i){var u=document.images[i].src;if(u){var r=new gomez.E(t.f);t.grm[u]=r;t.f[u]=new t.c7(u,n);t.e2(document.images[i],"load",t.c4,false);t.e2(document.images[i],"error",t.c5,false);t.e2(document.images[i],"abort",t.c6,false);}}}t._h=l;},c4:function(e){var t=gomez,i=t.g6(e);if(i){i.e=t.b5();}},c5:function(e){var t=gomez,i=t.g6(e);if(i){i.e=t.b5();i.b=1;}},c6:function(e){var t=gomez,i=t.g6(e);if(i){i.a=t.b5();}},g6:function(e){var t=gomez,e=window.event?window.event:e,a=t.d8(e),i;if(t.grm[a.src||a.href]&&t.grm[a.src||a.href].s){i=t.grm[a.src||a.href].s[a.src||a.href];}return i;},d2:function(){var t=gomez;var e=window.event?window.event:e,s=t.d8(e);if(s.readyState=="loaded"||s.readyState=="complete"){var o=t.j[s.src];if(o){o.e=t.b5();}}},setPair:function(name,value){var t=this;t.t[t.t.length]={n:"p",a:name,b:value};},nameEvent:function(n){var t=this;t.f6(n,1);},startInterval:function(n){var t=this;t.f6(n,2,1);},endInterval:function(n){var t=this;t.f6(n,2,2);},f6:function(n,p,b){if(n&&n.length>20){n=n.substring(0,20);}var t=this,f=t.u;f[f.length]={n:"a",a:n,b:t.b5(),e:p,f:b};},d8:function(e){if(gomez.gIE){return e.srcElement||{};}else{return e.currentTarget||e.target||{};}},e2:function(e,p,f,c){var n="on"+p;if(e.addEventListener){e.addEventListener(p,f,c);}else{if(e.attachEvent){e.attachEvent(n,f);}else{var x=e[n];if(typeof e[n]!="function"){e[n]=f;}else{e[n]=function(a){x(a);f(a);};}}}},i1:function(){var d=window.document,done=false,i2=function(){if(!done){done=true;gomez.b6();gomez.a9();}};(function(){try{d.documentElement.doScroll("left");}catch(e){setTimeout(arguments.callee,50);return;}i2();})();d.onreadystatechange=function(){if(d.readyState=="complete"){d.onreadystatechange=null;i2();}};},g7:function(){try{var t=gomez;t.gc.a=t.acctId;
/*@cc_ont.gIE = true; @*/
if(t.gIE){t.i1();window.attachEvent("onload",t.b7);}else{if(t.gSfr){var m=setInterval(function(){if(/loaded|complete/.test(document.readyState)){clearInterval(m);delete m;t.b6();t.b7();}},10);}else{if(window.addEventListener){window.addEventListener("DOMContentLoaded",t.b6,false);window.addEventListener("load",t.b7,false);}else{return;}}}t.c8();t.pollId1=setInterval(t.c8,1);gomez.L.m.link.g2("link");t.pollId3=setInterval("gomez.L.m['link'].g2('link')",1);gomez.L.m.iframe.g2("iframe");t.pollId4=setInterval("gomez.L.m['iframe'].g2('iframe')",1);if(!t.gIE){t.a9();}}catch(e){return;}}});gomez.h2();gomez.g7();}};SB.ui.GomezAjax=function(b){this.gomezPageId=b;this.gomezAjax=gomez;};SB.ui.GomezAjax.prototype={ajaxStart:function(){this.gomezAjax.startInterval(this.gomezPageId);},ajaxFinish:function(){this.gomezAjax.endInterval(this.gomezPageId);}};var ieDOM=false,nsDOM=false;var stdDOM=document.getElementById;initMethod=function(){if(!stdDOM){ieDOM=document.all;if(!ieDOM){nsDOM=((navigator.appName.indexOf("Netscape")!=-1)&&(parseInt(navigator.appVersion)==4));}}passwordChanged();};getObject=function(b){if(stdDOM){return document.getElementById(b);}if(ieDOM){return document.all[b];}if(nsDOM){return document.layers[b];}};getObjectStyle=function(d){if(nsDOM){return getObject(d);}var c=getObject(d);return c.style;};showDefault=function(b){showCell(b,"#E2E2E2","#E2E2E2");};showCell=function(d,e,f){getObjectStyle(d).color=e;getObjectStyle(d).backgroundColor=f;};changeCells=function(d,c){c=(c/5);c=c+1;for(i=1;i<c;i++){showCell("TD"+i,"Black",d);}for(i=c;i<21;i++){showDefault("TD"+i);}};showVeryPoor=function(c,d){changeCells("#EE0000",c);};showPoor=function(c,d){changeCells("#FF6103",c);};showAverage=function(c,d){changeCells("#FFE303",c);};showGood=function(c,d){changeCells("#98FB98",c);};showStrong=function(c,d){changeCells("#228B22",c);};showUndetermined=function(){showVeryPoor(0,"#EE0000");};passwordChanged=function(r,p,t,z,u,y){var A=0;var q=p;var s=new RegExp("(?=.*[A-Z])(?=.*[a-z]).*","g");var v=new RegExp("(?=.*[0-9]).*","g");var w=new RegExp("(?=.*[_]).*","g");var B=document.getElementById(r).value;A=B.length*5;if(s.test(B)){A=A+20;}if(v.test(B)){A=A+15;}if(w.test(B)){A=A+10;}if(A<31){showVeryPoor(A);}else{if(A<46){showPoor(A);q=t;}else{if(A<66){showAverage(A);q=z;}else{if(A<91){showGood(A);q=u;}else{if(A>90){q=y;if(A>100){A=100;}showStrong(A);}else{showVeryPoor(A);}}}}}document.getElementById("txtDisplay").innerHTML=q;};if(typeof SB=="undefined"){var SB={};}if(typeof SB.sharedWallet=="undefined"){SB.sharedWallet={};}SB.accounts.Login=function(){};SB.accounts.Login.BindPopup=function(){$("div.loginContent").each(function(){var b=new SB.sharedWallet.LoginPopup(this);b.setupEnterSubmit();b.bindLoginClick();});};SB.sharedWallet.LoginPopup=function(b){this.div=b;};SB.sharedWallet.LoginPopup.prototype={setupEnterSubmit:function(){var b=this;$("input").keydown(function(a){if(a.keyCode==13){b.handleLogin();return false;}});},bindLoginClick:function(){var b=this;$("#modCustLoginIFrameLogin").click(function(){b.handleLogin();});},handleLogin:function(){$("#requestedPopupUrl").val(popUpDivURL);new SB.sharedWallet.AhahFormSubmitter("#dvpage form[name='loginBox']").withHoldingDivEnabled(true).withSuccessTarget("#popLayer1").execute();return false;}};$(document).ready(function(){$("#modCustLoginLogin").click(function(){$("form[name='loginBox']").submit();return false;});$("#modCustLoginLogout").click(function(){$("form[name='logout']").submit();return false;});$("#modCustLoginRegister").click(function(){var d=location.href.split(":")[0];var c=$(this).attr("popup");if(d=="http"){SB.base.deferWindowCommand(c+"","popup",false);}else{SB.base.OpenDivCheckLoginStatus(c+"","popBadSelect1","popVeil1","popLayer1",false);}return false;});$("#modCustLoginForgottenPw.notOnHttps").click(function(){SB.base.deferWindowCommand(this.href+"","popup",false);return false;});$("#modCustLoginForgottenPw.onHttps").click(function(){SB.base.OpenDivCheckLoginStatus(this.href+"","popBadSelect1","popVeil1","popLayer1",false);return false;});$("#usernameLabel").focus(function(){$(this).hide();$("#modCustLoginUsername").show().focus();});$("#passwordLabel").focus(function(){$(this).hide();$("#modCustLoginPassword").show().focus();});$("#modCustLoginUsername").blur(function(){if(this.value==""){$(this).hide();$("#usernameLabel").show();}});$("#modCustLoginPassword").blur(function(){if(this.value==""){$(this).hide();$("#passwordLabel").show();}});$('input[name="showThePopup"]').each(function(){SB.base.OpenDiv(this.value,"popBadSelect1","popVeil1","popLayer1");});});if(typeof SB=="undefined"){var SB={};}if(typeof SB.sharedWallet=="undefined"){SB.sharedWallet={};}SB.sharedWallet.AhahRequest=function(){this.serverErrorSelector="#unhandledServerError";};SB.sharedWallet.AhahRequest.prototype={MakeGeneralAhahRequest:function(e,f){var d=this;$.ajax({url:e,type:"POST",success:f});},MakeInlineErrorHandledRequest:function(f,e,g){var h=this;$.ajax({url:f,type:"POST",success:g,error:function(a){var b=$(h.serverErrorSelector);$(e).html(b.html());}});},MakeInlineErrorHandledDivReplacementWithProcessingImg:function(f,e,g){var h=this;$(e).html("<img src='/modules/customer/myAccounts/loader/ajax-loader-round.gif' style='margin-left: 250px; margin-top: 50px;margin-bottom: 50px;' alt='Loading Content'/>");$.ajax({url:f,type:"POST",success:function(b,a){g(b,a);},error:function(a){var b=$(h.serverErrorSelector);$(e).html(b.html());}});},PostPopupFormWithDefaultErrorHandling:function(e,g){var h=this;var f=$(e);SB.base.holdingDiv("show");f.ajaxForm({success:function(a){SB.base.holdingDiv("hide");if(g){g(a);}else{$("#popupContent").html(a);}},error:function(a){SB.base.holdingDiv("hide");h.popupErrorHandler("#popLayer2",2);}});f.submit();},popupErrorHandler:function(c,d){$(c).html($(this.serverErrorSelector).html());$(".popupHead a",c).attr("id","closeServerError");$(".popupHead a",c).removeAttr("onclick");$("a#closeServerError",c).click(function(){SB.base.divPopUp(d,"hide");return false;});SB.base.divPopUp(d,"show");SB.base.centerPopWin(d);},defaultDivErrorHandler:function(d){var c=$(this.serverErrorSelector);$(d).html(c.html());},defaultDivSuccessHandler:function(c,d){$(c).html(d);}};SB.sharedWallet.AhahRequest=new SB.sharedWallet.AhahRequest();SB.sharedWallet.AhahDivReplacer=function(d,c){this.url=d;this.targetDiv=c;this.postSuccessHandler=function(){};this.postErrorHandler=function(){};this.successHandler=SB.sharedWallet.AhahRequest.defaultDivSuccessHandler;this.errorHandler=SB.sharedWallet.AhahRequest.defaultDivErrorHandler;this.hasProcessingImg=false;this.processingHandler=function(){};};SB.sharedWallet.AhahDivReplacer.prototype={withPostSuccessHandler:function(b){this.postSuccessHandler=b;return this;},withSuccessHandler:function(b){this.successHandler=b;return this;},withErrorHandler:function(b){this.errorHandler=b;return this;},withPostErrorHandler:function(b){this.postErrorHandler=b;return this;},withFrameErrorHandler:function(){this.errorHandler=function(b){SB.sharedWallet.AhahRequest.popupErrorHandler("#popLayer2",2);};return this;},withProcessingImg:function(){this.hasProcessingImg=true;return this;},withProcessingHandler:function(b){this.processingHandler=b;return this;},execute:function(){var b=this;if(this.hasProcessingImg){$(this.targetDiv).html("<img src='/modules/customer/myAccounts/loader/ajax-loader-round.gif' style='margin-left: 250px; margin-top: 50px;margin-bottom: 50px;' alt='Loading Content'/>");}else{this.processingHandler();}$.ajax({url:b.url,type:"GET",success:function(a){b.successHandler(b.targetDiv,a);b.postSuccessHandler(a);},error:function(a){b.errorHandler(b.targetDiv);b.postErrorHandler(a);}});}};SB.sharedWallet.AhahFormSubmitter=function(b){this.formSelector=b;this.successHandler=function(a){$("#popupContent").html(a);};};SB.sharedWallet.AhahFormSubmitter.prototype={withSuccessHandler:function(b){this.successHandler=b;this.holdingDivEnabled=true;return this;},withSuccessTarget:function(b){this.successHandler=function(a){$(b).html(a);};return this;},withHoldingDivEnabled:function(b){this.holdingDivEnabled=b;return this;},execute:function(){var d=this;var c=$(this.formSelector);this.holdingDivIfRequired("show");c.ajaxForm({success:function(a){d.holdingDivIfRequired("hide");d.successHandler(a);SB.base.centerPopWin();},error:function(a){d.holdingDivIfRequired("hide");SB.sharedWallet.AhahRequest.popupErrorHandler("#popLayer2",2);SB.base.centerPopWin();}});c.submit();},holdingDivIfRequired:function(b){if(this.holdingDivEnabled){SB.base.holdingDiv(b);}}};
