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="Адресът не е намерен, моля опитайте отново.";var bubble_info_select="Моля въведете адрес и натиснете бутона Открий адрес, за да потвърдите адреса си.";var bubble_info_UsernameExists="Съжаляваме, но потребителското име, което сте избрали вече съществува, моля въведете друго.";var bubble_info_UsernameRequired="Моля въведете потребителско име. Има разлика между големи и малки букви, трябва да е между 6-12 символа и да включва само букви и цифри, занака _ също е позволен.";var bubble_info_UsernameInfo="Потребителското ви име трябва да е между 6-12 символа, като има разлика между големи и малки букви, и да включва само букви и цифри, занака _ също е позволен.";var userNameInValid="невалидно";SB.customer.registration.setKeyword=function(){if(document.getElementById("registration_modCustRegKeyword")!=null){var e=document.getElementById("registration_modCustRegKeyword").value;if(e!=null&&e!=""){var f=new SB.customer.registration.KeywordHandler(e);var d=new AjaxService(f);d.GetRequest("/misc/webServices/registration/TrackingService.aspx?action=keyword&item="+encodeURIComponent(e));d=null;f=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 m=document.getElementById("registration_modCustRegDdlTrackingMain").value;var g=document.getElementById("registration_modCustRegDdlTrackingSub");if(m==null||g==null){return;}var o=false;for(var k=0;k<registration.trackingMenuArray.length;k++){if(registration.trackingMenuArray[k]==m){SB.base.RemoveAllOptions(g);childArray=registration.trackingMenuSubArray[k];for(var h=0;h<childArray.length;h++){var l=childArray[h];if(l=="RADIO MARCA"){today=new Date();if(today.getDay()>15){l="R MARCA NACIONAL";}}SB.base.AddOption(g,l,childArray[h]);o=true;}}}if(o==true){if(document.getElementById("ddlTrackingLabel")!=null){document.getElementById("ddlTrackingLabel").innerHTML=m;}SB.base.ShowRow(registration.trHowHearSub);}else{SB.base.RemoveAllOptions(g);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(){Global_processingMessage="Формата се зарежда";var e=document.getElementById("registration_modCustRegDdlCountry").value;var f=new SB.customer.registration.CountryHandler(e);var d=new AjaxService(f);d.GetRequest("/misc/webServices/registration/CountryService.aspx?item="+e,null);d=null;f=null;};SB.customer.registration.CountryHandler=function(e){this.avoidCaching=true;this.traceLevel=3;var c=document.getElementById("registration_modCustRegBtnCountry");var f=document.getElementById("registration_txtLastCountry");this.process=function(a){if(a.xmlHttp.responseXML!=null){var h=a.xmlHttp.responseXML.documentElement;}if(h!=null){var b=h.getElementsByTagName("addressLookup")[0];if(typeof(b)!="undefined"&&b!=null){var d=h.getElementsByTagName("addressLookup")[0].childNodes[0].nodeValue;}if(h.childNodes.length>0||d=="true"){f.value="true";c.click();}else{if(f.value=="true"){f.value="false";c.click();}else{if(document.getElementById("registration_modCustRegAddress")!=null){document.getElementById("registration_modCustRegAddress").focus();}}}}};};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(m){var k=document.getElementById("registration_modCustRegDoorNumber").value;var l=document.getElementById("registration_modCustRegPostcode").value;var q=document.getElementById("registration_ico_doorNumber");var h=document.getElementById("registration_ttt_doorNumber");Global_processingMessage="Моля изчакайте докато намерим адреса.";Global_processingTitle="Търсене на адрес";SB.base.holdingDiv("show");if(SB.customer.registration.ValidateDoorNumber(k)&&SB.customer.registration.ValidatePostcode(l)){var o=new SB.customer.registration.AddressLookupCallback(m);var p=new AjaxService(o);p.GetRequest("/misc/webServices/registration/AddressLookUpService.aspx?doorNumber="+k+"&postcode="+l);p=null;o=null;}else{SB.base.holdingDiv("hide");SB.base.initializeTooltip(q,h,bubble_info_unavailable);}};SB.customer.registration.AddressLookupCallback=function(e){this.avoidCaching=true;this.traceLevel=3;var g=false;var h=new Array();var f=0;this.process=function(a){var t=a.xmlHttp.responseXML;if(t!=null&&t.documentElement!=null){if(t.documentElement.childNodes.length>0){g=true;for(var b=0;b<t.documentElement.childNodes.length;b++){var r=t.documentElement.childNodes[b];if(r.hasChildNodes()&&r.firstChild.nodeType==3){h[f]=r.firstChild.nodeValue;f++;}}if(h.length==1){SB.customer.registration.setAddressInFields(h[0]);if(e){SB.customer.registration.dopostback();}}else{SB.customer.registration.showAddressLookUpResults();var s=new RegExp(", ,","g");for(var u=0;u<h.length;u++){var c=h[u].replace(s,",");SB.base.AddOption(document.getElementById("AddressLookUpListbox"),c,h[u]);}}}}if(g==false){var q=document.getElementById("registration_ico_doorNumber");var d=document.getElementById("registration_ttt_doorNumber");SB.base.holdingDiv("hide");SB.base.initializeTooltip(q,d,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 g=document.getElementById("registration_ico_AddressLookUpListbox");var f=document.getElementById("registration_ttt_AddressLookUpListbox");var h=document.getElementById("AddressLookUpListbox");if(h!=null){if(h.selectedIndex==-1){SB.base.initializeTooltip(g,f,bubble_info_select);}else{var e=h.options[h.selectedIndex].value;SB.customer.registration.setAddressInFields(e);}}};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 l=document.getElementById("registration_modCustRegAddress").value;var g=document.getElementById("registration_modCustRegPostcode").value;var h=document.getElementById("registration_ico_AddressLookUpListbox");var f=document.getElementById("registration_ttt_AddressLookUpListbox");if(document.getElementById("trAddressLookupList").style.display!="none"){var k=document.getElementById("AddressLookUpListbox");if(k.selectedIndex>-1){SB.customer.registration.setAddressInFields(k.options[k.selectedIndex].value);}else{if(k.options.length>0&&document.getElementById("trAddressOne").style.display=="none"){if(h!=null&&f!=null){SB.base.initializeTooltip(h,f,bubble_info_select);}return;}}}else{if(g!=""&&(document.getElementById("AddressLookUpLink").style.display=="block")&&l==""){SB.customer.registration.getAddressLookupList(true);if(h!=null&&f!=null){SB.base.initializeTooltip(h,f,bubble_info_select);}return;}else{if(g!=""&&(document.getElementById("AddressLookUpLink").style.display=="none")&&l==""){SB.customer.registration.getAddressLookupList(false);SB.customer.registration.showAddressLookup();if(h!=null&&f!=null){SB.base.initializeTooltip(h,f,bubble_info_select);}return;}}}__doPostBack("registration$modCustRegisterButton","");};SB.customer.registration.getUsernameCheck=function(o){try{var u=o.value;var q=document.getElementById("registration_ico_username");var l=document.getElementById("registration_ttt_username");if(u!=null&&u!=""){var s=new SB.customer.registration.UsernameCheckHandler(o);var t=new AjaxService(s);var p=encodeURIComponent(u);t.GetRequest("/misc/webServices/registration/UsernameCheckService.aspx?username="+escape(p),null);t=null;s=null;}else{var m="Моля въведете потребителско име. Има разлика между големи и малки букви, трябва да е между 6-12 символа и да включва само букви и цифри, занака _ също е позволен.";q.className="icons icoError";l.className="toolTipText tttError";SB.base.removeExistingTooltipMessage(l);SB.base.createTooltipMessageTag(l,m);if(o.className.indexOf("usrNameTaken")==-1){o.className=(o.className+" usrNameTaken").replace(/^ /,"");}}}catch(r){util.Trace(this.responseHandler.traceLevel,"SB.customer.registration.getUsernameCheck: error = "+r);}};SB.customer.registration.UsernameCheckHandler=function(b){this.avoidCaching=true;this.traceLevel=3;this.process=function(p){if(document.getElementById("registration_ico_username")!=null){var l=document.getElementById("registration_ico_username");}if(document.getElementById("registration_ttt_username")!=null){var m=document.getElementById("registration_ttt_username");}if(p.xmlHttp.responseXML!=null){var a=p.xmlHttp.responseXML.documentElement;}if(a!=null){var r=a.getElementsByTagName("available")[0];if(typeof(r)!="undefined"&&r!=null){var o=a.getElementsByTagName("available")[0].childNodes[0].nodeValue;}if(a.childNodes.length>0&&o=="false"){var q="Съжаляваме, но потребителското име, което сте избрали вече съществува, моля въведете друго.";l.className="icons icoError";m.className="toolTipText tttError";SB.base.removeExistingTooltipMessage(m);SB.base.createTooltipMessageTag(m,q);if(b.className.indexOf("usrNameTaken")==-1){b.className=(b.className+" usrNameTaken").replace(/^ /,"");}}else{if(a.childNodes.length>0&&o==userNameInValid){l.className="icons icoError";m.className="toolTipText tttError";SB.base.removeExistingTooltipMessage(m);SB.base.createTooltipMessageTag(m,p.xmlHttp.responseXML.documentElement.getElementsByTagName("validationErrorMessage")[0].childNodes[0].nodeValue);if(b.className.indexOf("usrNameTaken")==-1){b.className=(b.className+" usrNameTaken").replace(/^ /,"");}}else{var s="Потребителското ви име трябва да е между 6-12 символа, като има разлика между големи и малки букви, и да включва само букви и цифри, занака _ също е позволен.";l.className="icons icoInfo";m.className="toolTipText tttInfo";SB.base.removeExistingTooltipMessage(m);SB.base.createTooltipMessageTag(m,s);b.className=b.className.replace(/usrNameTaken/,"").replace(/ $/,"");}}}};};SB.customer.registration.SetTextMessageOption=function(){var f=document.getElementById("registration_modCustRegCbxSmsContact");var d=document.getElementById("registration_modCustRegMobile");if(f!=null&&d!=null){var e=/\S/;if(e.test(d.value)){f.checked="true";}else{f.checked="";}}};SB.customer.registration.setGlobalProcessingMessage=function(){Global_processingMessage="Формата се зарежда";};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>Формата се зарежда</p>";Global_processingTitle="Моля изчакайте...";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 f=SB.accounts.getSelectedWithdrawPaymentMethod();var d=f.split(".");var e=d[1];return e;};SB.accounts.getUserWithdrawPaymentAccountID=function(){var f=SB.accounts.getSelectedWithdrawPaymentMethod();var e=f.split(".");var d=e[2];if(SB.accounts.isUserWithdrawPaymentAccountSelected()){d=e[2];}return d;};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(e,d){var f=new Object();f.timeout=10000;f.textonly=true;f.Content=d;f.errorHandler=SB.customer.myAccounts.ErrorHandler;HTTP.get(e,SB.customer.myAccounts.CallBackLoadContent,f);};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(f,d,e){if(e.Content){errorInnerHtml=document.getElementById("unhandledServerError").innerHTML;document.getElementById(e.Content).innerHTML=errorInnerHtml;}else{alert(f+": "+d);}};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 t=new SB.customer.myAccounts.visibilityServiceHandler();var u=new AjaxService(t);var r=popupOptions.div;var m=popupOptions.divBar;var o=popupOptions.divLink;var p=popupOptions["switch"];var l=popupOptions.src;var q=document.getElementById(p);var s=document.getElementById(o);if(q.value=="0"){if(isLoggedIn){SB.customer.myAccounts.LoadContent(l+"?"+new Date().getTime(),r);q.value="1";s.innerHTML=popupOptions.cState;document.getElementById(m).className=popupOptions.aClass;document.getElementById(r).style.display="block";}}else{u.GetRequest("/misc/webServices/userControl/setvisibilityservice.aspx?key="+popupOptions.session+"&value=false&"+new Date().getTime());q.value="0";s.innerHTML=popupOptions.oState;document.getElementById(r).style.display="none";document.getElementById(m).className=popupOptions.iClass;if(document.getElementById("dvWaitContentLoading")!=null){document.getElementById(r).innerHTML=document.getElementById("dvWaitContentLoading").innerHTML;}}u=null;t=null;};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(e){SB.funding.loadFundingLabels();document.getElementById("cardID").value=e;document.getElementById("cardAction").value="remove";if(document.getElementById("popBox2")){var d=service.labels.CardDeleteProcessing;var f="<p>"+service.labels.CardDeleteProcessingMessage+"</p>";document.getElementById("popBox2").innerHTML=SB.base.processingAnimationContent(d,f);}__doPostBack("","");};SB.funding.onCardUpdate=function(){SB.funding.loadFundingLabels();document.getElementById("cardAction").value="update";__doPostBack("","");};SB.funding.SetWalletRedirect=function(g,e){var h=document.getElementById("redirectIFrame");var f=document.getElementById("divIframe");if(h!=null&&f!=null&&g!=""){SB.base.reStyler("add","ctrlDepositMethodList_divContent","hide");SB.base.reStyler("add",h,("pm"+e));SB.base.reStyler("add","VbVControl","hide");}f.style.display="block";h.src=g;h.style.display="";SB.base.divPopUp(1,"refresh");};SB.funding.SetVBVRedirect=function(d){var e=document.getElementById("redirectIFrame");var f=document.getElementById("divIframe");if(e!=null&&f!=null&&d!=""){SB.base.reStyler("add","ctrlDepositMethodList_divContent","hide");SB.base.reStyler("add",e,"pmVBV");}f.style.display="block";e.src=d;e.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 f=document.getElementById("popupBox");var g=f.getElementsByTagName("div");for(i=0;i<g.length;i++){if((g[i].id.indexOf("divValidationErrors")>-1)||(g[i].id.indexOf("errCardHolder")>-1)||(g[i].id.indexOf("errStartDate")>-1)||(g[i].id.indexOf("errIssueNo")>-1)||(g[i].id.indexOf("errExpiryDate")>-1)||(g[i].id.indexOf("errCardNo")>-1)||(g[i].id.indexOf("errCvv2")>-1)||(g[i].id.indexOf("errCardCurrency")>-1)||(g[i].id.indexOf("errAmount")>-1)){g[i].style.display=GetHiddenDivStyle();}}oAnchors=SB.base.getElementsByClass("error",f,"a");for(x=0;x<oAnchors.length;x++){SB.base.reStyler("remove",oAnchors[x],"error");}var h=document.getElementsByTagName("select");for(i=0;i<h.length;i++){if((h[i].id.indexOf("ddlValidFromMonth")>-1)||(h[i].id.indexOf("ddlValidToMonth")>-1)||(h[i].id.indexOf("ddlValidFromYear")>-1)||(h[i].id.indexOf("ddlValidToYear")>-1)||(h[i].id.indexOf("ddlCurrency")>-1)){if(h[i].options.length>0){h[i].selectedIndex=0;}else{h[i].selectedIndex=-1;}}}var e=document.getElementsByTagName("input");for(i=0;i<e.length;i++){if((e[i].id.indexOf("txtIssueno")>-1)||(e[i].id.indexOf("txtCardno")>-1)||(e[i].id.indexOf("txtCvv2")>-1)||(e[i].id.indexOf("txtAmount")>-1)||(e[i].id.indexOf("txtDepositConvertedAmount")>-1)){e[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(u,z,H,D){var F=document.getElementById("cardRow1");var s=document.getElementById("cardRow2A");var E=document.getElementById("cardRow2B");var C=document.getElementById("cardRow3A");var G=document.getElementById("cardRow3B");var v=document.getElementById("cardRow4");var w=document.getElementById("cardRow5");var I=document.getElementById("cardRow7");var t=document.getElementById("cvv2_"+u);var B=document.getElementById(fundingGlobals.card.ddlCardTypeID);var y=document.getElementById("cardId"+u);var B=document.getElementById(fundingGlobals.card.ddlCardListID);if(D=="true"){SB.funding.ResetCardForm();}if(SB.funding.isNewCard(u)){document.getElementById("cardAction").value="add";SB.funding.ShowNewCardRows(B,F,s,E,C,G,v,w,I,H);}else{document.getElementById("cardAction").value="deposit";SB.funding.InitialiseExistingCardRows(F,s,E,C,G,v,t,w,I);SB.funding.ShowExistingRetariusMessage(z,u);}SB.funding.onCardTypeChange(H,u,s,E,I);SB.funding.displayDepositAmounts(H,u);F=null;s=null;E=null;C=null;G=null;v=null;w=null;I=null;t=null;B=null;y=null;};SB.funding.onDepositNewCardSelect=function(D,E,y,G){var v=document.getElementById("cardRow1");var r=document.getElementById("cardRow2A");var F=document.getElementById("cardRow2B");var t=document.getElementById("cardRow3A");var z=document.getElementById("cardRow3B");var u=document.getElementById("cardRow4");var s=document.getElementById("cardRow5");var B=document.getElementById("cardRow7");var C=document.getElementById("cvv2_"+D);var w=document.getElementById(fundingGlobals.card.ddlCardListID);if(SB.funding.isNewCard(D)){SB.funding.ShowNewCardRows(w,v,r,F,t,z,u,s,B,y);}v=null;r=null;F=null;t=null;z=null;u=null;s=null;B=null;C=null;w=null;oCardRadio=null;};SB.funding.displayDepositAmounts=function(h,k){var m=document.getElementById(fundingGlobals.card.ddlDepositAmountID);var l=document.getElementById(fundingGlobals.card.txtAmountID);var o=document.getElementById("ctrlDepositMethodList__ctl0_noSymbol");var g=document.getElementById(fundingGlobals.card.lblPPMsgID);if(m!=null){if(m.length>0){if(h=="WM"){m.style.display="none";l.style.display="";o.style.display="";}else{m.style.display="";l.style.display="none";o.style.display="none";}}else{m.style.display="none";l.style.display="";o.style.display="";}}g.innerHTML="";for(i=0;i<fundingGlobals.card.ppLabels.length;i++){if(fundingGlobals.card.ppLabels[i].indexOf(h)>=0){g.innerHTML=fundingGlobals.card.ppLabels[i].substring(fundingGlobals.card.ppLabels[i].indexOf(h)+3);}}};SB.funding.ShowExistingRetariusMessage=function(d,e){var f=fundingGlobals.card.customerCurrency;if(d=="WT"&&f!="GBP"&&f!="EUR"&&f!="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(s,v,t,u,p,q,m,o,r,w){v.style.display=GetVisibleDivStyle();t.style.display=GetVisibleDivStyle();u.style.display=GetVisibleDivStyle();p.style.display=GetVisibleDivStyle();q.style.display=GetVisibleDivStyle();if(m!=null){m.style.display=GetVisibleDivStyle();}if((w=="unknown")&&(s!=null)){s.selectedIndex=0;}o.style.display=GetHiddenDivStyle();r.style.display=GetHiddenDivStyle();};SB.funding.InitialiseExistingCardRows=function(r,p,q,u,l,s,m,t,o){r.style.display=GetHiddenDivStyle();p.style.display=GetHiddenDivStyle();q.style.display=GetHiddenDivStyle();u.style.display=GetHiddenDivStyle();l.style.display=GetHiddenDivStyle();if(s!=null){if((m!=null)&&(m.value=="True")){s.style.display=GetVisibleDivStyle();}else{s.style.display=GetHiddenDivStyle();}}t.style.display=GetHiddenDivStyle();o.style.display=GetHiddenDivStyle();};SB.funding.ShowPaymentProviderLogos=function(f,h){var e=document.getElementById("providerDivs");if(e!=null){var g=e.getElementsByTagName("div");if(f==true){for(i=0;i<g.length;i++){if(g[i].id==h){g[i].style.display=GetVisibleDivStyle();}else{g[i].style.display=GetHiddenDivStyle();}}}else{for(i=0;i<g.length;i++){g[i].style.display=GetHiddenDivStyle();}}g=null;}e=null;};SB.funding.onNewCardTypeChange=function(f){var h=document.getElementById("cardRow2A");var e=document.getElementById("cardRow2B");var g=document.getElementById("cardRow7");SB.funding.onCardTypeChange(f.value,"new",h,e,g);h=null;e=null;g=null;SB.funding.displayDepositAmounts(f.value);};SB.funding.onCardTypeChange=function(f,h,k,l,g){SB.funding.DisplayValidFrom(h,f,k,l);SB.funding.DisplayCurrencyDropdown(f,h);SB.funding.SetDepositAmountCurrency(f,h);SB.funding.DisplayCurrencyConversionLabels(h,f,g);SB.funding.CalculateConversionAmount(h,f);SB.funding.DisplayMaestroLabel(f);SB.funding.HideCCV2(f);SB.funding.DisplayWireCardLabel(h,f,g);SB.funding.ShowPaymentProviderLogos(true,SB.funding.GetCardTypePaymentProviderId(f));};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(g,f,h,e){if(SB.funding.isNewCard(g)&&(f=="MA"||f=="SW"||f=="unknown")){h.style.display=GetVisibleDivStyle();e.style.display=GetVisibleDivStyle();}else{h.style.display=GetHiddenDivStyle();e.style.display=GetHiddenDivStyle();}};SB.funding.DisplayCurrencyDropdown=function(f,d){if(SB.funding.CardTypeDoesCurrencyConversion(f)&&SB.funding.isNewCard(d)){document.getElementById("cardRow5").style.display=GetVisibleDivStyle();var e=document.getElementById(fundingGlobals.card.ddlCurrencyID);SB.base.RemoveAllOptions(e);for(i=0;i<fundingGlobals.card.currencyConvertedCardTypes.length;i++){if(fundingGlobals.card.currencyConvertedCardTypes[i]==f){for(j=0;j<fundingGlobals.card.cardTypeCurrencies[i].length;j++){SB.base.AddOption(e,fundingGlobals.card.cardTypeCurrencies[i][j],fundingGlobals.card.cardTypeCurrencies[i][j]);}}}e.selectedIndex=0;e=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(f,d){if(SB.funding.CardTypeDoesCurrencyConversion(f)){if(SB.funding.isNewCard(d)){var e=document.getElementById(fundingGlobals.card.ddlCurrencyID);return e.options[e.selectedIndex].text;}else{return document.getElementById("currencyCode_"+d).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(g){var f=SB.funding.GetCardType(g);var h=document.getElementById(fundingGlobals.card.ddlCardListID);if(h!=null){for(var e=0;e<h.length;e++){if(h[e].value==f){return h[e].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(e){var d=SB.funding.GetCheckedCardId();if(d!=""){var f=SB.funding.GetCardType(d);SB.funding.SetConvertedAmount(f,d,e);f=null;}d=null;};SB.funding.SetConvertedAmount=function(r,l,q){if(SB.funding.CardTypeDoesCurrencyConversion(r,l)){if(q=="ddlCurrency"){SB.funding.SetDepositAmountCurrency(r,l);}var m=document.getElementById(fundingGlobals.card.txtAmountID);if(m!=null&&m.value!=""&&!isNaN(m.value)){var p=SB.funding.GetSelectedCurrency(r,l);var o=SB.funding.GetSelectedCurrencyConversionRate(p);var k=fundingGlobals.card.customerCurrencyConversionRate;var s=(parseFloat(k)/parseFloat(o))*parseFloat(m.value);document.getElementById(fundingGlobals.card.txtDepositConvertedAmountID).value=s.toFixed(2);p=null;o=null;k=null;s=null;}m=null;}};SB.funding.DisplayCurrencyConversionLabels=function(e,f,d){if(SB.funding.CardTypeDoesCurrencyConversion(f)){d.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(e));document.getElementById("removedFromYourAccount").style.display=GetVisibleDivStyle();document.getElementById("currencyOfYourCard").innerHTML=fundingGlobals.card.currencyOfYourCard.replace("[PLACEHOLDER]",SB.funding.GetCardTypeDescription(e));document.getElementById("currencyOfYourCard").style.display=GetVisibleDivStyle();}else{if(d!=null){d.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(d,f){if(f=="WM"){if(SB.funding.isNewCard(d)){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 e=document.getElementById("wirecardDepositHelp");if(e!=null){e.style.display=GetHiddenDivStyle();}e=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 f=SB.funding.getSelectedPaymentMethod();if(f!=null){var d=f.split("^");var e=d[1];return e;}else{return null;}};SB.funding.getUserPaymentAccountID=function(){if(SB.funding.getSelectedPaymentMethod()!=null){var f=SB.funding.getSelectedPaymentMethod();var e=f.split("^");var d=e[2];if(SB.funding.isUserPaymentAccountSelected()){d=e[2];}return d;}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 d="";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+d),"popBadSelect1","popVeil1","popLayer1");return false;}if(SB.funding.isPopupPaymentProviderSelected()){d="currentPPID="+SB.funding.getCurrentPPID();}else{if(SB.funding.isUserPaymentAccountSelected()){d="currentPPID="+SB.funding.getCurrentPPID()+"&userPaymentAccountID="+SB.funding.getUserPaymentAccountID();}else{if(SB.funding.isSubPaymentProviderSelected()){d="currentPPID="+SB.funding.getCurrentPPID()+"&subPPID="+SB.funding.getUserPaymentAccountID();}else{d="currentPPID="+SB.funding.getCurrentPPID();}}}SB.base.RecallOpenDiv((e+d),"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(k,g){var f=k.id.split("_");var l=f[0]+"__ctl0_"+g;var h=document.getElementById(l);return h;};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.onSubmitDepositOrWithdrawal=function(b){Global_processingMessage="<p>Формата се зарежда</p>";Global_processingTitle="Моля изчакайте...";__doPostBack("","");};SB.funding.showProcessingTransaction=function(){Global_processingMessage="<p>Формата се зарежда</p>";Global_processingTitle="Моля изчакайте...";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(e,d){var f=new Object();f.timeout=2000;f.textonly=true;f.Content=d;HTTP.getText(e,SB.funding.CallBackLoadHTML,f);};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(f){var d="<input id='btnCancel' type='button' value='Cancel' runat='server' onclick='SB.base.hideLayer1();' />";var e=document.getElementById("ctrlDepositMethodList__ctl0_dvBankDetails").innerHTML;document.getElementById("dvLoadPrintDetails").innerHTML=e+d;if(f=="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";};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(f){var e=document.getElementById("cardRow4");var d=document.getElementById("cardRow9");SB.funding.onCardTypeChange(f.value,"new",e,d);oCardRow2=null;oCardRow7=null;SB.funding.displayDepositAmounts(f.value,"new");};SB.funding.cardDeposit.validateCARD=function(c){var d=true;return d;};SB.funding.cardDeposit.disableDepositExpiredCard=function(l,g,m,o){var h=new Date();var k="false";if((o>g)||(o==g&&m>l)){k="true";}if(k=="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="За съжаление картата ви е изтекла.";SB.funding.cardDeposit.createTooltipMessageTag(c);};SB.funding.cardDeposit.ToggleCardExpiry=function(){SB.base.ToggleElement("cardExpired","display","block");};SB.funding.cardDeposit.loadManageCard=function(){var g="";var h="";var f=SB.funding.getCurrentPPID();var e=document.getElementById("cardID").value;Global_processingTitle="Моля изчакайте...";Global_processingMessage="<p>Формата се зарежда</p>";g="currentPPID="+f+"&userPaymentAccountID="+e+"&source=deposit";h="/t/funding/ManageCardPopup.aspx?"+g;SB.base.RecallOpenDiv(h,"popBadSelect1","popVeil1","popLayer1");};SB.funding.cardDeposit.OnDropdownSelectionChange=function(){document.getElementById("lnkActiveCard").style.display="";document.getElementById("lnkExpiredCard").style.display="none";var P=document.getElementById("ctrlDepositMethodList__ctl0_dpdwnCardList");var ad=P.options[P.selectedIndex].value;document.getElementById("dropdownSelection").value=ad;var S=new Array();S=ad.split("_");SB.funding.cardDeposit.createHiddenControls(S);if(S.length>1){var U=S[0];var E=S[1];var Z=S[2];var I=S[3];var W=S[4];var G=S[5];var H=S[6];var O=S[7];var ac=S[8];var K=S[9];var F=S[10];var X=S[11];var L=S[12];document.getElementById("dvSavedCards").style.display="";document.getElementById("ctrlDepositMethodList__ctl0_ddlCardType").value=Z;document.getElementById("cardID").value=U;SB.funding.onDepositCardSelect(U,E,Z,fundingGlobals.card.hasNoErrors);var Q=document.getElementById("ctrlDepositMethodList__ctl0_lblCardType");Q.innerHTML=I;Q.style.display="";document.getElementById("ctrlDepositMethodList__ctl0_spCardType").style.display="";var ab=document.getElementById("ctrlDepositMethodList__ctl0_lblCardNumber");ab.innerHTML=W;ab.style.display="";document.getElementById("ctrlDepositMethodList__ctl0_spCardNumber").style.display="";var T=document.getElementById("ctrlDepositMethodList__ctl0_lblExpiryMonth");T.innerHTML=H;T.style.display="";document.getElementById("ctrlDepositMethodList__ctl0_spExpiryDate").style.display="";var M=document.getElementById("ctrlDepositMethodList__ctl0_lblExpiryYear");M.innerHTML=O;M.style.display="";SB.funding.cardDeposit.disableDepositExpiredCard(H,O,X,L);var G=S[5];if(G!=""&&G!=null){if(Z=="MA"||Z=="SW"||Z=="unknown"){var aa=G.substr(4,2);var J=G.substr(0,4);var Y=document.getElementById("ctrlDepositMethodList__ctl0_lblStartMonth");Y.innerHTML=aa;Y.style.display="";document.getElementById("ctrlDepositMethodList__ctl0_spStartDate").style.display="";var ae=document.getElementById("ctrlDepositMethodList__ctl0_lblStartYear");ae.innerHTML=J;ae.style.display="";var V=document.getElementById("ctrlDepositMethodList__ctl0_lblIssueNumber");V.innerHTML=ac;V.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(P);document.getElementById("ctrlDepositMethodList__ctl0_ddlCardType").value=ad;document.getElementById("cardType").value=ad;}};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(g,f){var e=document.getElementById("placeholderHiddenControls");var h=document.createElement("input");h.setAttribute("type","hidden");h.setAttribute("id","cardProviderID_"+g);h.setAttribute("name","cardProviderID_"+g);h.setAttribute("value",f);e.appendChild(h);};SB.funding.cardDeposit.createHiddenCardType=function(g,f){var e=document.getElementById("placeholderHiddenControls");var h=document.createElement("input");h.setAttribute("type","hidden");h.setAttribute("id","cardType_"+g);h.setAttribute("name","cardType_"+g);h.setAttribute("value",f);e.appendChild(h);};SB.funding.cardDeposit.createHiddenCvv2=function(h,g){var f=document.getElementById("placeholderHiddenControls");var e=document.createElement("input");e.setAttribute("type","hidden");e.setAttribute("id","cvv2_"+h);e.setAttribute("name","cvv2_"+h);e.setAttribute("value",g);f.appendChild(e);};SB.funding.cardDeposit.onCardDeposit=function(f){var e=document.getElementById(fundingGlobals.card.ddlDepositAmountID);var d=document.getElementById(fundingGlobals.card.txtAmountID);if(e!=null){if(e.style.display!="none"){d.value=e.value;}}Global_processingMessage="<p>Транзакцията се обработва...</p>";Global_processingTitle="Моля изчакайте...";__doPostBack("","");};SB.funding.cardDeposit.createHiddenCurrencyCode=function(g,f){var e=document.getElementById("placeholderHiddenControls");var h=document.createElement("input");h.setAttribute("type","hidden");h.setAttribute("id","currencyCode_"+g);h.setAttribute("name","currencyCode_"+g);h.setAttribute("value",f);e.appendChild(h);};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="Данните на картата изглеждат неправилни. Моля, проверете и опитайте отново.";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 d=LuhnCheckUnchecked;SB.funding.cardDeposit.InitialializeCardObjects();document.getElementById("imgCardNumberIncorrect").style.display="none";document.getElementById("imgCardNumberCorrect").style.display="none";d=SB.funding.cardDeposit.CheckNumberOnChange();var f=document.getElementById("ctrlDepositMethodList__ctl0_ico_CardNumber");var e=document.getElementById("ctrlDepositMethodList__ctl0_ttt_CardNumber");if(d==LuhnCheckPassed){f.className="icons icoTrue";e.className="toolTipText";SB.funding.cardDeposit.removeExistingTooltipMessage(e);}else{if(d==LuhnCheckFailed){f.className="icons icoFalse";e.className="toolTipText tttError";SB.funding.cardDeposit.removeExistingTooltipMessage(e);SB.funding.cardDeposit.createTooltipMessageTag(e);}else{if(d==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 k;var h=SB.funding.cardDeposit.CardType.arguments;var m=SB.funding.cardDeposit.CardType.arguments.length;this.objname="object CardType";var o=(m>0)?h[0]:"CardObject";var l=(m>1)?h[1]:"0,1,2,3,4,5,6,7,8,9";var g=(m>2)?h[2]:"13,14,15,16,19";this.setCardNumber=setCardNumber;this.setCardType=setCardType;this.setLen=setLen;this.setRules=setRules;this.setExpiryDate=setExpiryDate;this.setCardType(o);this.setLen(g);this.setRules(l);if(m>4){this.setExpiryDate(h[3],h[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 f=document.getElementById("ctrlDepositMethodList__ctl0_txtCardno").value;var g=document.getElementById("ctrlDepositMethodList__ctl0_ddlValidToYear").value;var e=document.getElementById("ctrlDepositMethodList__ctl0_ddlValidToMonth").value;var h=document.getElementById("ctrlDepositMethodList__ctl0_dpdwnCardList").value;if(f.length==0||g.length==0||e.length==0){return LuhnCheckUnchecked;}else{return SB.funding.cardDeposit.CheckCardNumber(f,g,e,h);}};SB.funding.cardDeposit.CheckCardNumber=function(usrCardNumber,lExpiryYear,lExpiryMonth,lCardType){var tmpyear;if(lExpiryYear.length==0){bubble_info_message="Моля, въведете номер на изтичане на картата.";return LuhnCheckFailed;}tmpyear=lExpiryYear;tmpmonth=lExpiryMonth;if(!(new CardType()).isExpiryDate(tmpyear,tmpmonth)){bubble_info_message="За съжаление, картата ви е с изтекъл срок на валидност.";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="Този номер прилича на card1, не на номера на card2";str_message.replace("card1",cardname);str_message.replace("card2",card);bubble_info_message=str_message;return LuhnCheckFailed;}else{bubble_info_message="Моля, проверете номера на своята карта и опитайте отново.";return LuhnCheckFailed;}}};CardType=function(){var k;var h=CardType.arguments;var m=CardType.arguments.length;this.objname="object CardType";var o=(m>0)?h[0]:"CardObject";var l=(m>1)?h[1]:"0,1,2,3,4,5,6,7,8,9";var g=(m>2)?h[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(o);this.setLen(g);this.setRules(l);if(m>4){this.setExpiryDate(h[3],h[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 f=checkCardNumber.arguments;var g=checkCardNumber.arguments.length;var k=(g>0)?f[0]:this.cardnumber;var l=(g>1)?f[1]:this.year;var h=(g>2)?f[2]:this.month;this.setCardNumber(k);this.setExpiryDate(l,h);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 g=isCardNumber.arguments;var m=isCardNumber.arguments.length;var o=(m>0)?g[0]:this.cardnumber;if(!this.luhnCheck()){return false;}for(var k=0;k<this.len.size;k++){if(o.toString().length==this.len[k]){for(var h=0;h<this.rules.size;h++){var l=o.substring(0,this.rules[h].toString().length);if(l==this.rules[h]){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 s=luhnCheck.arguments;var l=luhnCheck.arguments.length;var m=l>0?s[0]:this.cardnumber;if(!isNum(m)){return false;}var r=m.length;var q=r&1;var p=0;for(var o=0;o<r;o++){var k=parseInt(m.charAt(o));if(!((o&1)^q)){k*=2;if(k>9){k-=9;}}p+=k;}if(p%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(f){if(f.length==0||f==null){f="13,14,15,16,19";}var d=f;n=1;while(d.indexOf(",")!=-1){d=d.substring(d.indexOf(",")+1,d.length);n++;}this.len=new makeArray(n);n=0;while(f.indexOf(",")!=-1){var e=f.substring(0,f.indexOf(","));this.len[n]=e;f=f.substring(f.indexOf(",")+1,f.length);n++;}this.len[n]=f;return this;};setRules=function(d){if(d.length==0||d==null){d="0,1,2,3,4,5,6,7,8,9";}var e=d;n=1;while(e.indexOf(",")!=-1){e=e.substring(e.indexOf(",")+1,e.length);n++;}this.rules=new makeArray(n);n=0;while(d.indexOf(",")!=-1){var f=d.substring(0,d.indexOf(","));this.rules[n]=f;d=d.substring(d.indexOf(",")+1,d.length);n++;}this.rules[n]=d;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 s=true;var l=new Date();var m=l.getMonth();var p=l.getYear();var o=0;var t=0;var r=new Array();o=document.getElementById(fundingGlobals.card.wStartYear).innerText;t=document.getElementById(fundingGlobals.card.wExpiryYear).innerText;var u=document.getElementById(fundingGlobals.card.wStartMonth).innerText;var q=document.getElementById(fundingGlobals.card.wExpiryMonth).innerText;};SB.funding.cardWithdraw.cardValidityDates=function(f){var g=false;var l=new Date();var h=l.getMonth()+1;var k=l.getYear();if(f[0]==null||f[2]==null){g=false;return g;}else{if(f[0]<k){}else{if(f[0]==k){if(h>f[2]||h==f[2]){}else{g=false;return g;}}else{if(f[0]>k){g=false;return g;}}}}if(k<f[1]){}else{if(k==f[1]){if(h<f[3]||h==f[3]){}else{g=false;return g;}}else{if(k>f[1]){g=false;return g;}}}g=true;return g;};OnWithdrawDropdownSelectionChange=function(){if(document.getElementById("lnkActiveCard")){document.getElementById("lnkActiveCard").style.display="";}if(document.getElementById("lnkExpiredCard")){document.getElementById("lnkExpiredCard").style.display="none";}var z=document.getElementById("ctrlWithdrawMethodList__ctl0_dpdwnCardList");var s=z.options[z.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 D=document.getElementById(fundingGlobals.card.wLblCardType);D.innerHTML=t[3];D.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 q=document.getElementById(fundingGlobals.card.wExpiryYear);q.innerHTML=t[7];q.style.display="";var B=t[5];if(B!=""&&B!=null){if(t[2]=="MA"||t[2]=="SW"||t[2]=="unknown"){var C=B.substr(4,2);var r=B.substr(0,4);var y=document.getElementById(fundingGlobals.card.wStartMonth);y.innerHTML=C;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 E=document.getElementById(fundingGlobals.card.wLblIssueNumber);E.innerHTML=t[8];E.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(z);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(g,f){var e=document.getElementById("placeholderHiddenControls");var h=document.createElement("input");h.setAttribute("type","hidden");h.setAttribute("id","cardProviderID_"+g);h.setAttribute("name","cardProviderID_"+g);h.setAttribute("value",f);e.appendChild(h);};SB.funding.cardWithdraw.createHiddenCardType=function(g,f){var e=document.getElementById("placeholderHiddenControls");var h=document.createElement("input");h.setAttribute("type","hidden");h.setAttribute("id","cardType_"+g);h.setAttribute("name","cardType_"+g);h.setAttribute("value",f);e.appendChild(h);};SB.funding.cardWithdraw.createHiddenCvv2=function(h,g){var f=document.getElementById("placeholderHiddenControls");var e=document.createElement("input");e.setAttribute("type","hidden");e.setAttribute("id","cvv2_"+h);e.setAttribute("name","cvv2_"+h);e.setAttribute("value",g);f.appendChild(e);};SB.funding.cardWithdraw.createHiddenCurrencyCode=function(g,f){var e=document.getElementById("placeholderHiddenControls");var h=document.createElement("input");h.setAttribute("type","hidden");h.setAttribute("id","currencyCode_"+g);h.setAttribute("name","currencyCode_"+g);h.setAttribute("value",f);e.appendChild(h);};SB.funding.cardWithdraw.stopWithdrawOnExpiredCard=function(w,m){var s=new Date();var v=false;var t=s.getMonth();var u=s.getFullYear();var p=w.innerHTML;var r=m.innerHTML;if(r>u){}else{if(r==u){if(p<t){v=true;}}else{v=true;}}var o=document.getElementById(fundingGlobals.card.wActiveCardLink);var q=document.getElementById(fundingGlobals.card.wExpiredCardLink);if(v){o.style.display="none";q.style.display="";}else{o.style.display="";q.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(d){var f=this;var e={type:"GET",url:this.balanceUrl+"?forceRefresh="+d+"&cacheBuster="+new Date().getTime(),success:function(a,b){f.refreshBalance(a);},error:function(){alert("error");}};jQuery.ajax(e);},refreshBalance:function(e){var f=this;var d=$("string",e).text();$("span.balance",f.div).html(d);}};$(document).ready(function(){$("div.loginBox").each(function(){new SB.Login(this);});});var gService=true;var gTimeZone=0;function dcsCookie(){if(typeof(dcsOther)=="function"){dcsOther();}else{if(typeof(dcsPlugin)=="function"){dcsPlugin();}else{if(typeof(dcsFPC)=="function"){dcsFPC(gTimeZone);}}}}function dcsGetCookie(e){var g=document.cookie.indexOf(e+"=");if(g!=-1){var h=g+e.length+1;var f=document.cookie.indexOf(";",h);if(f==-1){f=document.cookie.length;}return unescape(document.cookie.substring(h,f));}return null;}function dcsGetCrumb(h,k){var l=dcsGetCookie(h).split(":");for(var g=0;g<l.length;g++){var f=l[g].split("=");if(k==f[0]){return f[1];}}return null;}function dcsGetIdCrumb(o,g){var l=dcsGetCookie(o);var k=l.substring(0,l.indexOf(":lv="));var h=k.split("=");for(var m=0;m<h.length;m++){if(g==h[0]){return h[1];}}return null;}function dcsFPC(u){if(typeof(u)=="undefined"){return;}var D=gFpc;var B=new Date();B.setTime(B.getTime()+(B.getTimezoneOffset()*60000)+(u*3600000));var w=new Date(B.getTime()+315360000000);var q=new Date(B.getTime());if(document.cookie.indexOf(D+"=")!=-1){var E=dcsGetIdCrumb(D,"id");var y=parseInt(dcsGetCrumb(D,"lv"));var z=parseInt(dcsGetCrumb(D,"ss"));if((E==null)||(E=="null")||isNaN(y)||isNaN(z)){return;}WT.co_f=E;var v=new Date(y);q.setTime(z);if((B.getTime()>(v.getTime()+1800000))||(B.getTime()>(q.getTime()+28800000))){q.setTime(B.getTime());WT.vt_f_s="1";}if((B.getDay()!=v.getDay())||(B.getMonth()!=v.getMonth())||(B.getYear()!=v.getYear())){WT.vt_f_d="1";}}else{var s=D+"_TMP=";document.cookie=s+"1";if(document.cookie.indexOf(s)!=-1){document.cookie=s+"; expires=Thu, 01-Jan-1970 00:00:01 GMT";if((typeof(gWtId)!="undefined")&&(gWtId!="")){WT.co_f=gWtId;}else{if((typeof(gTempWtId)!="undefined")&&(gTempWtId!="")){WT.co_f=gTempWtId;WT.vt_f="1";}else{WT.co_f="2";var r=B.getTime().toString();for(var t=2;t<=(32-r.length);t++){WT.co_f+=Math.floor(Math.random()*16).toString(16);}WT.co_f+=r;WT.vt_f="1";}}if(typeof(gWtAccountRollup)=="undefined"){WT.vt_f_a="1";}WT.vt_f_s="1";WT.vt_f_d="1";}else{WT.vt_f="2";WT.vt_f_a="2";return;}}WT.co_f=escape(WT.co_f);WT.vt_sid=WT.co_f+"."+q.getTime();var C="; expires="+w.toGMTString();document.cookie=D+"=id="+WT.co_f+":lv="+B.getTime().toString()+":ss="+q.getTime().toString()+C+"; path=/"+(((typeof(gFpcDom)!="undefined")&&(gFpcDom!=""))?("; domain="+gFpcDom):(""));}var gFpc="WT_FPC";var gWtId="";var gTempWtId="";var gConvert=true;function dcsAdv(){dcsFunc("dcsET");dcsFunc("dcsCookie");dcsFunc("dcsAdSearch");}var gDomain="statse.webtrendslive.com";function dcsMultiTrack(){for(var c=0;c<arguments.length;c++){if(arguments[c].indexOf("WT.")==0){WT[arguments[c].substring(3)]=arguments[c+1];c++;}if(arguments[c].indexOf("DCS.")==0){DCS[arguments[c].substring(4)]=arguments[c+1];c++;}if(arguments[c].indexOf("DCSext.")==0){DCSext[arguments[c].substring(7)]=arguments[c+1];c++;}}var d=new Date();DCS.dcsdat=d.getTime();dcsTag();}var gImages=new Array;var gIndex=0;var DCS=new Object();var WT=new Object();var DCSext=new Object();var gQP=new Array();function dcsVar(){var l=new Date();WT.tz=l.getTimezoneOffset()/60*-1;if(WT.tz==0){WT.tz="0";}WT.bh=l.getHours();WT.ul=navigator.appName=="Netscape"?navigator.language:navigator.userLanguage;if(typeof(screen)=="object"){WT.cd=navigator.appName=="Netscape"?screen.pixelDepth:screen.colorDepth;WT.sr=screen.width+"x"+screen.height;}if(typeof(navigator.javaEnabled())=="boolean"){WT.jo=navigator.javaEnabled()?"Yes":"No";}if(document.title){WT.ti=document.title;}WT.js="Yes";if(typeof(gVersion)!="undefined"){WT.jv=gVersion;}if(document.body&&document.body.addBehavior){document.body.addBehavior("#default#clientCaps");if(document.body.connectionType){WT.ct=document.body.connectionType;}document.body.addBehavior("#default#homePage");WT.hp=document.body.isHomePage(location.href)?"1":"0";}if(parseInt(navigator.appVersion)>3){if((navigator.appName=="Microsoft Internet Explorer")&&document.body){WT.bs=document.body.offsetWidth+"x"+document.body.offsetHeight;}else{if(navigator.appName=="Netscape"){WT.bs=window.innerWidth+"x"+window.innerHeight;}}}WT.fi="No";if(window.ActiveXObject){if((typeof(gFV)!="undefined")&&(gFV.length>0)){WT.fi="Yes";WT.fv=gFV;}}else{if(navigator.plugins&&navigator.plugins.length){for(var k=0;k<navigator.plugins.length;k++){if(navigator.plugins[k].name.indexOf("Shockwave Flash")!=-1){WT.fi="Yes";WT.fv=navigator.plugins[k].description.split(" ")[2];break;}}}}WT.sp="@@SPLITVALUE@@";DCS.dcsdat=l.getTime();DCS.dcssip=window.location.hostname;DCS.dcsuri=window.location.pathname;if(window.location.search){DCS.dcsqry=window.location.search;if(gQP.length>0){for(var k=0;k<gQP.length;k++){var g=DCS.dcsqry.indexOf(gQP[k]);if(g!=-1){var h=DCS.dcsqry.substring(0,g);var f=DCS.dcsqry.substring(g+gQP[k].length,DCS.dcsqry.length);DCS.dcsqry=h+f;}}}}if((window.document.referrer!="")&&(window.document.referrer!="-")){if(!(navigator.appName=="Microsoft Internet Explorer"&&parseInt(navigator.appVersion)<4)){DCS.dcsref=window.document.referrer;}}}function A(c,d){return"&"+c+"="+dcsEscape(d);}function dcsEscape(d){if(typeof(RE)!="undefined"){var c=new String(d);for(R in RE){c=c.replace(RE[R],R);}return c;}else{return escape(d);}}function dcsLoadHref(b){if((typeof(gHref)!="undefined")&&(gHref.length>0)){window.location=gHref;gHref="";}}function dcsCreateImage(b){if(document.images){gImages[gIndex]=new Image;if((typeof(gHref)!="undefined")&&(gHref.length>0)){gImages[gIndex].onload=gImages[gIndex].onerror=dcsLoadHref;}gImages[gIndex].src=b;gIndex++;}else{document.write('<IMG BORDER="0" NAME="DCSIMG" WIDTH="1" HEIGHT="1" SRC="'+b+'">');}}function dcsMeta(){var f;if(document.all){f=document.all.tags("meta");}else{if(document.documentElement){f=document.getElementsByTagName("meta");}}if(typeof(f)!="undefined"){for(var e=1;e<=f.length;e++){var d=f.item(e-1);if(d.name){if(d.name.indexOf("WT.")==0){WT[d.name.substring(3)]=d.content;}else{if(d.name.indexOf("DCSext.")==0){DCSext[d.name.substring(7)]=d.content;}else{if(d.name.indexOf("DCS.")==0){DCS[d.name.substring(4)]=d.content;}}}}}}}function dcsTag(){var b="http"+(window.location.protocol.indexOf("https:")==0?"s":"")+"://"+gDomain+(gDcsId==""?"":"/"+gDcsId)+"/dcs.gif?";for(N in DCS){if(DCS[N]){b+=A(N,DCS[N]);}}for(N in WT){if(WT[N]){b+=A("WT."+N,WT[N]);}}for(N in DCSext){if(DCSext[N]){b+=A(N,DCSext[N]);}}if(b.length>2048&&navigator.userAgent.indexOf("MSIE")>=0){b=b.substring(0,2040)+"&WT.tu=1";}dcsCreateImage(b);}function dcsFunc(b){if(typeof(window[b])=="function"){window[b]();}}$(document).ready(function(){if((typeof gDcsId!="undefined")&&(gDcsId!=null)&&(gDcsId!="")){dcsVar();dcsMeta();dcsFunc("dcsAdv");dcsTag();}if((typeof(gConvert)!="undefined")&&gConvert&&(document.cookie.indexOf(gFpc+"=")==-1)){document.write("<SCRIPT Language='JavaScript' SRC='http"+(window.location.protocol.indexOf("https:")==0?"s":"")+"://"+hostId_orig+"/"+dcsId_orig+"/wtid.js'></SCRIPT>");}});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.ui.WebTrends.prototype={trackUserEvent:function(e,h,g){try{this.trackingFunction("WT.ti",e,"WT.si_n",h,"WT.si_p",g);}catch(f){}}};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(f,d,e){getObjectStyle(f).color=d;getObjectStyle(f).backgroundColor=e;};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(C,w,q,y,r,t){var v=0;var z=w;var p=new RegExp("(?=.*[A-Z])(?=.*[a-z]).*","g");var s=new RegExp("(?=.*[0-9]).*","g");var u=new RegExp("(?=.*[_]).*","g");var B=document.getElementById(C).value;v=B.length*5;if(p.test(B)){v=v+20;}if(s.test(B)){v=v+15;}if(u.test(B)){v=v+10;}if(v<31){showVeryPoor(v);}else{if(v<46){showPoor(v);z=q;}else{if(v<66){showAverage(v);z=y;}else{if(v<91){showGood(v);z=r;}else{if(v>90){z=t;if(v>100){v=100;}showStrong(v);}else{showVeryPoor(v);}}}}}document.getElementById("txtDisplay").innerHTML=z;};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={MakeInlineErrorHandledRequest:function(h,g,e){var f=this;$.ajax({url:h,type:"GET",success:e,error:function(a){var b=$(f.serverErrorSelector);$(g).html(b.html());}});},MakeInlineErrorHandledDivReplacementWithProcessingImg:function(h,g,e){var f=this;$(g).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:h,type:"GET",success:function(b,a){e(b,a);},error:function(a){var b=$(f.serverErrorSelector);$(g).html(b.html());}});},PostPopupFormWithDefaultErrorHandling:function(g,e){var f=this;var h=$(g);SB.base.holdingDiv("show");h.ajaxForm({success:function(a){SB.base.holdingDiv("hide");if(e){e(a);}else{$("#popupContent").html(a);}},error:function(a){SB.base.holdingDiv("hide");f.popupErrorHandler("#popLayer2",2);}});h.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);}}};