usingNamespace("Biz.Shopping")["Common"]={_msg:  "______________________________________________________\n\n"+Web.Lang.shopping001+"\n"+Web.Lang.shopping002+"\n"+"______________________________________________________\n\n",schoolLogin:function(){var wuf=Web.UI.Form;var studentName=wuf.getValue("form1","StudentName").trim();var schoolName=wuf.getValue("form1","SchoolName").trim();var schoolID=wuf.getValue("form1","SchoolID").trim();var zipCode=wuf.getValue("form1","ZipCode").trim();if(String.isNullOrEmpty(studentName)){alert(Web.Lang.shopping003);wuf.getElements("form1","StudentName").focus();return false;};if(String.isNullOrEmpty(schoolName)){alert(Web.Lang.shopping004);wuf.getElements("form1","SchoolName").focus();return false;};if(String.isNullOrEmpty(schoolID)){alert(Web.Lang.shopping005);wuf.getElements("form1","SchoolID").focus();return false;};if(!String.isNullOrEmpty(zipCode) && Biz.Common.Validation.notZipCode(zipCode)){alert(Web.Lang.shopping006);wuf.getElements("form1","ZipCode").focus();return false;};return true;}};usingNamespace("Biz.Shopping")["AgreeOrNot"]={checkFld:function(){if (document.form1.agreed[1].checked){document.location.href ="ShoppingCart.aspx";Web.UI.Form.submit("form1");}else{Web.UI.Form.submit("form1");};}};usingNamespace("Biz.Shopping")["Login"]={chageValidateCode:function(){var imageLink = document.getElementById("imgValidCode").src;var temp = "?temp=";var captcha=document.getElementById("CaptchaS");if(captcha){captcha.innerHTML ="";};var indexOfTemp = imageLink.indexOf(temp);if(indexOfTemp!=-1){document.getElementById("imgValidCode").src = imageLink.substring(0,indexOfTemp + temp.length) + new Date().getTime();return;};document.getElementById("imgValidCode").src = imageLink + "?temp=" + new Date().getTime() ;},LoadAudio:function(audioPage){var audioLink = audioPage + '?temp=' + new Date().getTime();var objectSrc = "<embed src='" + audioLink + "' hidden='true' autostart='true'>";document.getElementById("CaptchaS").innerHTML = objectSrc;},submitLogin:function(){var errorMsg=new Sys.Text.StringBuilder();var errorMsg=Biz.Account.Customer.quickRegister("registerForm");if(!errorMsg){Web.UI.Form.submit("registerForm");return;};errorMsg += "\n\n";alert(Biz.Shopping.Common._msg+errorMsg.toString());}};usingNamespace("Biz.Shopping")["EmailCart"]={verify:function(f){var errorMsg=new Sys.Text.StringBuilder();var wuf=Web.UI.Form;var cat=Biz.Shopping.EmailCart;var val=Biz.Common.Validation;var send=wuf.getValue(f,"SendAddress");var from=wuf.getValue(f,"FromAddress");var comment=wuf.getValue(f,"Comments");var denyList=Biz.Shopping.Config.denyEmailList;if(String.isNullOrEmpty(send)){errorMsg.append("- " + Web.Lang.shopping007 + "\n");};if(String.isNullOrEmpty(from)){errorMsg.append("- " + Web.Lang.shopping008 + "\n");};if(!String.isNullOrEmpty(send) && !val.isEmail(send)){errorMsg.append("- " + String.format(Web.Lang.shopping009,send) + "\n");};if(!String.isNullOrEmpty(from) && !val.isEmail(from)){errorMsg.append("- " + String.format(Web.Lang.shopping010,from) + "\n");};if(!cat.checkdenyemail(from,'s')||!cat.checkdenyemail(send,'r')){errorMsg.append("- " + String.format(Web.Lang.shopping011,denyList) + "\n");};if(comment.length>500){errorMsg.append("- " + Web.Lang.shopping012 + "\n");};if(!errorMsg.toString()){wuf.setValue(f,"Submit","emailCart");wuf.submit(f);return;};alert(Biz.Shopping.Common._msg+errorMsg.toString());},checkdenyemail:function(email,action){var cat=Biz.Shopping.EmailCart;var cfg=Biz.Shopping.Config;var domainlist=cfg.denyEmailList;var adomain,istep;var ret=true;var domainlen,emaillen;if (String.isNullOrEmpty(domainlist)){return true;};adomain=domainlist.split(';');emaillen=email.length;for(istep=0;istep<adomain.length;istep++){domainlen=adomain[istep].length;if(email.substring(emaillen-domainlen).toLowerCase()==adomain[istep].toLowerCase()){ret=cat.checkdenyemailbydomain(adomain[istep],email,action);break;};};return ret;},checkdenyemailbydomain:function(sdomain,email,action){var cfg=Biz.Shopping.Config;var exceptemail=cfg.exceptionEmailList;var saction=cfg.exceptionEmailActionList;var amail,aaction,i;amail=exceptemail.split(';');aaction=saction.split(';');if(amail.length!=aaction.length){return false;};for(i=0;i<amail.length;i++){if(amail[i].toLowerCase()==email.toLowerCase()){break;};};if(i==amail.length){return false;};if(aaction[i].toLowerCase()=='f'.toLowerCase()||aaction[i].toLowerCase()==action.toLowerCase()){return true;};return false;}};usingNamespace("Biz.Shopping")["CorelGuide"]={checkFld:function(f){var wuf=Web.UI.Form;var agree=wuf.getValue(f,"IsQualified").trim();if(agree=="no"){alert("The corel academic software will be removed from your shopping cart.");document.form1.action="";wuf.submit(f);return false;};if(Biz.Shopping.Common.schoolLogin()){wuf.setValue(f,"CorelSFSign","1");wuf.submit(f);return true;};}};usingNamespace("Biz.Shopping")["MicrosoftCorelGuide"]={checkFld:function(f){var wuf=Web.UI.Form;var agree=wuf.getValue("form1","IsQualified");if(agree=="no"){alert(Web.Lang.shopping013);wuf.submit(f);return false;};if(Biz.Shopping.Common.schoolLogin()){wuf.setValue(f,"CorelSFSign","1");wuf.submit(f);return true;};}};usingNamespace("Biz.Shopping")["OtherAcademicSFGuide"]={checkFld:function(f){var errorMsg=new Sys.Text.StringBuilder();var wuf=Web.UI.Form;var agree=wuf.getValue(f,"IsQualified");if(agree=="no"){alert(Web.Lang.shopping014);document.form1.action="";document.form1.submit();return false;};if(Biz.Shopping.Common.schoolLogin()){wuf.setValue(f,"OtherAcademicSFSign","1");wuf.submit(f);return true;};}};usingNamespace("Biz.Shopping")["CheckOutCell"]={changePurchaseType:function(i,v){var wuc=Web.UI.Control;var upgradePanel = "numberUpgradePanel"+v;var portPanel = "numberPortPanel"+v;if (i=="Upgrade"){if ($(upgradePanel)){wuc.setAttribute($(upgradePanel),{"style.display":"block"});};if ($(portPanel)){wuc.setAttribute($(portPanel),{"style.display":"none"});};}else if(i=="Port"){if ($(upgradePanel)){wuc.setAttribute($(upgradePanel),{"style.display":"none"});};if ($(portPanel)){wuc.setAttribute($(portPanel),{"style.display":"block"});};}else{if ($(upgradePanel)){wuc.setAttribute($(upgradePanel),{"style.display":"none"});};if ($(portPanel)){wuc.setAttribute($(portPanel),{"style.display":"none"});};};},checkSingleCell:function(f,i,flag){var wuf=Web.UI.Form;var errorMsg=new Sys.Text.StringBuilder();var val=Biz.Common.Validation;if (flag){var upnum1=wuf.getValue(f,"UPNUM1"+"_"+i);var upnum2=wuf.getValue(f,"UPNUM2"+"_"+i);var upnum3=wuf.getValue(f,"UPNUM3"+"_"+i);var isCellNumber=val.isCellPhone(upnum1,upnum2,upnum3,i);var upgradeAccount=wuf.getValue(f,"upgradeAccount"+"_"+i);var month=wuf.getValue(f,"preferredActivationDateDatePicker_Month"+i);var day=wuf.getValue(f,"preferredActivationDateDatePicker_Day"+i);var year=wuf.getValue(f,"preferredActivationDateDatePicker_Year"+i);if(isCellNumber){errorMsg.append(isCellNumber);};if(String.isNullOrEmpty(upgradeAccount)){errorMsg.append("\n - Your Line "+i+" Options"+" Account"+" is empty.");};if(!val.isDate(year,month,day)){errorMsg.append("\n - Your Line "+i+" Options"+" Preferred Activation Date"+" is invalid.");} else if ($('currentYear').value > year ||($('currentYear').value == year && $('currentMonth').value > month) ||($('currentYear').value == year && $('currentMonth').value == month && $('currentDay').value > day)){errorMsg.append("\n - Your Line "+i+" Options Preferred Activation Date is expired.");};}else{var upnum1=wuf.getValue(f,"PORTNUM1"+"_"+i);var upnum2=wuf.getValue(f,"PORTNUM2"+"_"+i);var upnum3=wuf.getValue(f,"PORTNUM3"+"_"+i);var isCellNumber=val.isCellPhone(upnum1,upnum2,upnum3,i);var upgradeAccount=wuf.getValue(f,"portAccount"+"_"+i);if(isCellNumber){errorMsg.append(isCellNumber);};if(String.isNullOrEmpty(upgradeAccount)){errorMsg.append("\n - Your Line "+i+" Options"+" Account"+" is empty.");};};return errorMsg.toString();},checkAllCell:function(f,i){var errorMsg=new Sys.Text.StringBuilder();var bsc=Biz.Shopping.CheckOutCell;var wuf=Web.UI.Form;for(var k=1;k<=i;k++){var purchaseType=wuf.getValue(f,"purchaseType"+k);if(purchaseType=="Upgrade"){errorMsg.append(bsc.checkSingleCell(f,k,true));};if(purchaseType=="Port"){errorMsg.append(bsc.checkSingleCell(f,k,false));};};return errorMsg.toString();},continueCheckOut:function(f,i){var driverLicense, driverState;var ssn_1, ssn_2, ssn_3, confirmSSN_1, confirmSSN_2, confirmSSN_3;var dob_mm, dob_dd, dob_yyyy;var cellErrorMsg,cellEmptyMsg = "";var dInputMonth,dInputYear,dDate;var wuf=Web.UI.Form;var val=Biz.Common.Validation;var bsc=Biz.Shopping.CheckOutCell;var providerID,pinNumber;driverLicense = wuf.getValue(f,"driverLicense");driverState = wuf.getValue(f,"driverLisenseState");ssn_1 = wuf.getValue(f,"SSN_1");ssn_2 = wuf.getValue(f,"SSN_2") ;ssn_3 = wuf.getValue(f,"SSN_3") ;confirmSSN_1 = wuf.getValue(f,"RESSN_1");confirmSSN_2 = wuf.getValue(f,"RESSN_2");confirmSSN_3 = wuf.getValue(f,"RESSN_3");dob_mm = wuf.getValue(f,"birthdayDatePicker_Month");dob_dd = wuf.getValue(f,"birthdayDatePicker_Day");dob_yyyy = wuf.getValue(f,"birthdayDatePicker_Year");dInputYear = wuf.getValue(f,"driverLisenseExpiredDatePicker_Year");dInputMonth = wuf.getValue(f,"driverLisenseExpiredDatePicker_Month");dInputDay = wuf.getValue(f,"driverLisenseExpiredDatePicker_Day");providerID = wuf.getValue(f,"providerID");pinNumber = wuf.getValue(f,"pinNumber");if ((confirmSSN_1 == null) || (confirmSSN_1 == "") || (confirmSSN_2 == null) || (confirmSSN_2 == "") || (confirmSSN_3 == null) || (confirmSSN_3 == "")){cellEmptyMsg = "\n - Confirm Social Security Number is not completed, please fill in the information required.";}else{if (!val.isInteger(confirmSSN_1) || !val.isInteger(confirmSSN_2) || !val.isInteger(confirmSSN_3)){cellEmptyMsg = "\n - Please enter numeric character only for Confirm Social Security Number.";}else{if (confirmSSN_1.length<3||confirmSSN_2.length<2||confirmSSN_3.length<4){cellEmptyMsg = "\n - Please enter a valid 9 digit for Confirm Social Security Number.";};};};if ((ssn_1 == null) || (ssn_1 == "") || (ssn_2 == null) || (ssn_2 == "") || (ssn_3 == null) || (ssn_3 == "")){cellEmptyMsg = "\n - Social Security Number is not completed, please fill in the information required.";}else{if (!val.isInteger(ssn_1) || !val.isInteger(ssn_2) || !val.isInteger(ssn_3)){cellEmptyMsg = "\n - Please enter numeric character only for Social Security Number.";}else{if (ssn_1.length<3||ssn_2.length<2||ssn_3.length<4){cellEmptyMsg = "\n - Please enter a valid 9 digit for Social Security Number.";};};};if ((driverLicense == null) || (driverLicense == "")){cellEmptyMsg += "\n - Your Drivers License is empty.";};if ((dInputYear == null) || (dInputYear == "") || (dInputMonth == null) || (dInputMonth == "") || (dInputDay == null) || (dInputDay == "")){cellEmptyMsg += "\n - Your Driver License Exp. Date is invalid.";};if ((driverState == null) || (driverState == "")){cellEmptyMsg += "\n - Your Drivers State is empty.";};if ((dob_mm == null) || (dob_mm == "") || (dob_dd == null) || (dob_dd == "") || (dob_yyyy == null) || (dob_yyyy == "")){cellEmptyMsg += "\n - Your Birthday is invalid.";};if((cellEmptyMsg == "") && ((ssn_1 != confirmSSN_1) || (ssn_2 != confirmSSN_2) || (ssn_3 != confirmSSN_3))){cellEmptyMsg = "\n - The SSN# you have entered does not match, please try again.";};if(!val.isDate(dob_yyyy,dob_mm,dob_dd)){cellEmptyMsg += "\n - Your Birthday is invalid.";};if(!val.isDate(dInputYear,dInputMonth,dInputDay)){cellEmptyMsg += "\n - Your Driver License Exp. Date is invalid.";}else if ($('currentYear').value > dInputYear ||($('currentYear').value == dInputYear && $('currentMonth').value > dInputMonth) ||($('currentYear').value == dInputYear && $('currentMonth').value == dInputMonth && $('currentDay').value > dInputDay)){cellEmptyMsg = "\n - Your Driver License Expire Date is expired.";};var isCell=bsc.checkAllCell(f,i);if(isCell){cellEmptyMsg+=isCell;};if(providerID != "" && providerID == 12317){if(pinNumber=="" || !val.isInteger(pinNumber) || pinNumber.length != 6){cellEmptyMsg += "\n - Enter your account's 6 digits PIN or Create your 6 digit PIN # to Continue.";};};if (cellEmptyMsg != ""){cellErrorMsg  = "______________________________________________________\n\n";cellErrorMsg += "Your request cannot continue because of the following error(s).\n";cellErrorMsg += "Please correct these error(s) and re-submit:\n";cellErrorMsg += "______________________________________________________\n\n";cellErrorMsg += cellEmptyMsg + "\n";alert(cellErrorMsg);return;}else{wuf.submit(f);};},checkLen:function(o,n,i){var originalControl = $(o+i);var nextControl = $(n+i);if (originalControl && nextControl){if (originalControl.value.length == originalControl.maxLength){nextControl.focus();};};},wirelessTermCheck:function(n){if( $("IsAgree") && $("IsAgree").checked){if(($("IsAgreeSprint")&&$("IsAgreeSprint").checked)||(!n)){var wuf=Web.UI.Form;wuf.submit("wirelessterms");return;}else{alert("You must check the terms & conditions agreement box in order to continue purchase.");return;};}else{alert("You must check the terms & conditions agreement box in order to continue purchase.");return;};},loadCellPage:function(){var j =  $('lineCount').value;var bsc=Biz.Shopping.CheckOutCell;for(var i =1;i <= j;i++){bsc.changePurchaseType($("purchaseType"+i).selectedIndex,i);};}};usingNamespace("Biz.Shopping")["CheckOut"]={Tabs:Sys.Enum.create("CreditCard","PreferredAccount","BillLater","PayPal","MailOrBank","NetTerm","WireTransfer"),pageInit:function(){var sco=Biz.Shopping.CheckOut;sco.showPanel(null,sco.Tabs.CreditCard);var wuf=Web.UI.Form;var snumber=wuf.getValue("checkout","sel_SNumber");var cfg=Biz.Shopping.Config;var al=cfg.address.addressList;if(al[snumber]&&al[snumber].isDisabled){Biz.Shopping.CheckOut.disableB2BShipping(true);}else{Biz.Shopping.CheckOut.disableB2BShipping(false);}},showPanel:function(o,t,f){var wuc=Web.UI.Control;var sco=Biz.Shopping.CheckOut;if(o)o.blur();if(f){t=sco.tabIndexMapping[t];};sco.showPanelBase(t);},billingInfo:function(f){var name,firstName,middleName,lastName,address,city,zip,day1,day2,day3;var wuf=Web.UI.Form;var errorMsg=new Sys.Text.StringBuilder();name=wuf.getValue(f,"BContactWithForNPA");if(String.isNullOrEmpty(name)){errorMsg.append("\n     - Your name field is empty.");};address=wuf.getValue(f,"BAddress1ForNPA").trim();city=wuf.getValue(f,"BCityForNPA").trim();zip=wuf.getValue(f,"BZipForNPA").trim();day1=wuf.getValue(f,"BNightPhoneForNPA_tel1").trim();day2=wuf.getValue(f,"BNightPhoneForNPA_tel2").trim();day3=wuf.getValue(f,"BNightPhoneForNPA_tel3").trim();day4=wuf.getValue(f,"BNightPhoneForNPA_ext1").trim();if(String.isNullOrEmpty(address)){errorMsg.append("\n     - Your billing address field is empty.");};if(String.isNullOrEmpty(city)){errorMsg.append("\n     - Your billing city field is empty.");};if(String.isNullOrEmpty(zip)){errorMsg.append("\n     - Your billing zip field is empty.");}else if(Biz.Common.Validation.notZipCode(wuf.getValue(f,"BZipForNPA"))){errorMsg.append("\n     - Please input a valid zip code.");};errorMsg.append(Biz.Common.Validation.isPhone(f,"BNightPhoneForNPA","evening",true,'',true));if(!String.isNullOrEmpty(day1) || !String.isNullOrEmpty(day2) || !String.isNullOrEmpty(day3)){if(!Number.isNumeric(day1) || day1.length<3 ||(Biz.Common.Validation.isCheckFirstLetter(f,"BNightPhoneForNPA") && Biz.Common.Validation.isZeroFirstLetter(day1)) || !Number.isNumeric(day2) || day2.length<3 ||!Number.isNumeric(day3) || day3.length<4 || !Number.isNumeric(day4)){errorMsg.append("\n     - Please enter a valid evening  phone number.");};};return errorMsg.toString();},openAddrCheckwin:function(f,g){var state,city,add1,add2,zip,company;var wuf=Web.UI.Form;var paymentType = $("paymentType").value;if (String.isNullOrEmpty($("isCellPhone").value)){state= wuf.getValue(f,"SState_Option");city= wuf.getValue(f,"SCity");add1= wuf.getValue(f,"SAddress1");add2= wuf.getValue(f,"SAddress2");zip= wuf.getValue(f,"SZip");company= wuf.getValue(f,"SCompanyName");}else {if (paymentType == "CreditCard"){state= wuf.getValue(f,"BState");city= wuf.getValue(f,"BCity");add1= wuf.getValue(f,"BAddress1");add2= wuf.getValue(f,"BAddress2");zip= wuf.getValue(f,"BZip");company="";}else{state= wuf.getValue(f,"BStateForNPA");city= wuf.getValue(f,"BCityForNPA");add1= wuf.getValue(f,"BAddress1ForNPA");add2= wuf.getValue(f,"BAddress2ForNPA");zip= wuf.getValue(f,"BZipForNPA");company="";};};if ( state.length >= 2 ){state = state.substring(state.length-2,state.length);}else{state = "";};window.open ((g + "?ShippingState=" + escape(state.replace("'","\'")) + "&ShippingCity=" + escape(city.replace("'","\'")) + "&ShippingAddress1=" + escape(add1.replace("'","\'")) + "&ShippingAddress2="  + escape(add2.replace("'","\'")) + "&ShippingZipCode=" + (zip.replace("'","\'")) + "&CompanyName=" + escape(company.replace("'","\'"))), "newwindow", "height=650, width=550, left=10,top=10,toolbar =no, menubar=no, scrollbars=yes, resizable=no, location=no, status=no");},showPanelBase:function(t){var sco=Biz.Shopping.CheckOut;sco.resetAll();sco.showCurrent(t);},resetAll:function(){var sco=Biz.Shopping.CheckOut;var wuc=Web.UI.Control;for(var name in sco.Tabs){var elt=sco.getTabElement(name);var elp=sco.getOptionElement(name);var elb=sco.getButtonElement(name);if(!Object.isNull(elt)){wuc.clearCss(elt);};if(!Object.isNull(elp)){wuc.setAttribute(elp,{"style.display":"none"});};if(!Object.isNull(elb)){wuc.setAttribute(elb,{"style.display":"none"});};};},showCurrent:function(t){var sco=Biz.Shopping.CheckOut;var wuc=Web.UI.Control;var wuf=Web.UI.Form;var elt=sco.getTabElement(t);var elp=sco.getOptionElement(t);var elb=sco.getButtonElement(t);if(!Object.isNull(elt)){wuc.addCss(elt,"current");};if(!Object.isNull(elp)){wuc.setAttribute(elp,{"style.display":"block"});};if(!Object.isNull(elb)){wuc.setAttribute(elb,{"style.display":"block"});};if(t==sco.Tabs.PayPal){wuc.setAttribute($("txtFirstName"),{"style.display":"none"});wuc.setAttribute($("txtLastName"),{"style.display":"none"});wuc.setAttribute($("txtAddress"),{"style.display":"none"});wuc.setAttribute($("txtCity"),{"style.display":"none"});wuc.setAttribute($("txtState"),{"style.display":"none"});wuc.setAttribute($("txtZipcode"),{"style.display":"none"});wuc.setAttribute($("txtPhone"),{"style.display":"none"});sco.disableShipping(true);wuf.setValue("checkout","Card_CCTYPE","020");if(wuf.getValue("checkout","sel_SNumber")=="0"){$("saveShipping").checked=false;};}else{wuc.setAttribute($("txtFirstName"),{"style.display":""});wuc.setAttribute($("txtLastName"),{"style.display":""});wuc.setAttribute($("txtAddress"),{"style.display":""});wuc.setAttribute($("txtCity"),{"style.display":""});wuc.setAttribute($("txtState"),{"style.display":""});wuc.setAttribute($("txtZipcode"),{"style.display":""});wuc.setAttribute($("txtPhone"),{"style.display":""});var snumber=wuf.getValue("checkout","sel_SNumber");var cfg=Biz.Shopping.Config;var al=cfg.address.addressList;sco.disableShipping(false);if(al[snumber] && al[snumber].isDisabled){Biz.Shopping.CheckOut.disableB2BShipping(true);}else{Biz.Shopping.CheckOut.disableB2BShipping(false);}wuf.setValue("checkout","Card_CCTYPE","");};if ($("paymentType")){if (t==sco.Tabs.CreditCard){$("paymentType").value = "CreditCard";}else{$("paymentType").value = "others";};};if(t==sco.Tabs.NetTerm){var onlyGCPaymentSelected=$("gcPaymentSelected")!=null&&$("gcPaymentSelected").checked;if(onlyGCPaymentSelected){wuc.replaceInnerHTML($("lbNetTerm"),Web.Lang.noPaymentSelected);$("opBtnLnkNetTerm").className="lgBtn orangeBtn";}else{sco.resertNetTerm();}};},resertNetTerm:function(){if(Biz.Shopping.NetTerm==null||Biz.Shopping.NetTerm=="undefined") return;var cfgNetTerm=Biz.Shopping.NetTerm.Config;var wuc=Web.UI.Control;if(cfgNetTerm.netTermStatus=="Solicited"){wuc.setAttribute($("lbNetTerm"),{"innerHTML":Web.Lang.checkOut001});wuc.setAttribute($("opBtnLnkNetTerm"),{"href":"javascript:void(0);"});$("opBtnLnkNetTerm").className="lgBtn greyBtn";}else if(cfgNetTerm.netTermStatus=="Good"){wuc.setAttribute($("lbNetTerm"),{"innerHTML":Web.Lang.netTermSelected});}else if(cfgNetTerm.netTermStatus=="Exceeded"){wuc.setAttribute($("lbNetTerm"),{"innerHTML":Web.Lang.checkOut002});wuc.setAttribute($("opBtnLnkNetTerm"),{"href":"javascript:void(0);"});$("opBtnLnkNetTerm").className="lgBtn greyBtn";}else if(cfgNetTerm.netTermStatus=="Locked"){wuc.setAttribute($("lbNetTerm"),{"innerHTML":Web.Lang.checkOut001});wuc.setAttribute($("opBtnLnkNetTerm"),{"href":"javascript:void(0);"});$("opBtnLnkNetTerm").className="lgBtn greyBtn";}},disableShipping:function(flag){var wuc=Web.UI.Control;var wuf=Web.UI.Form;var isCellPhone=wuf.getValue("checkout","isCellPhone");if(!String.isNullOrEmpty(isCellPhone)){flag=true;};wuc.setAttribute(wuf.getElement("checkout","sel_SNumber"),{"disabled":flag});wuc.setAttribute(wuf.getElement("checkout","SLabel"),{"disabled":flag});wuc.setAttribute(wuf.getElement("checkout","SFirstName"),{"disabled":flag});wuc.setAttribute(wuf.getElement("checkout","SMI"),{"disabled":flag});wuc.setAttribute(wuf.getElement("checkout","SLastName"),{"disabled":flag});wuc.setAttribute(wuf.getElement("checkout","SCompanyName"),{"disabled":flag});wuc.setAttribute(wuf.getElement("checkout","SAddress1"),{"disabled":flag});wuc.setAttribute(wuf.getElement("checkout","SAddress2"),{"disabled":flag});wuc.setAttribute(wuf.getElement("checkout","SCity"),{"disabled":flag});wuc.setAttribute(wuf.getElement("checkout","SState_Option"),{"disabled":flag});wuc.setAttribute(wuf.getElement("checkout","SZip"),{"disabled":flag});wuc.setAttribute(wuf.getElement("checkout","ShippingPhone_tel1"),{"disabled":flag});wuc.setAttribute(wuf.getElement("checkout","ShippingPhone_tel2"),{"disabled":flag});wuc.setAttribute(wuf.getElement("checkout","ShippingPhone_tel3"),{"disabled":flag});wuc.setAttribute(wuf.getElement("checkout","ShippingPhone_ext1"),{"disabled":flag});wuc.setAttribute(wuf.getElement("checkout","saveShipping"),{"disabled":flag});if(flag && String.isNullOrEmpty($("isCellPhone").value)){wuc.addCss($("address"),"disabled");wuc.setAttribute($("addrCheckLink"),{"style.display":"none"});wuc.setAttribute($("addrCheckLabel"),{"style.display":"inline"});wuc.setAttribute($("btnEnabled"),{"style.display":"none"});wuc.setAttribute($("btnDisabled"),{"style.display":"block"});}else{wuc.removeCss($("address"),"disabled");wuc.setAttribute($("addrCheckLink"),{"style.display":"inline"});wuc.setAttribute($("addrCheckLabel"),{"style.display":"none"});wuc.setAttribute($("btnEnabled"),{"style.display":"block"});wuc.setAttribute($("btnDisabled"),{"style.display":"none"});};},getTabElement:function(name){return $("tab"+name);},getOptionElement:function(name){return $("opt"+name);},getButtonElement:function(name){return $("btn"+name);},checkBillingAddress:function(index,isCA){var wuf=Web.UI.Form;var f=wuf.get("checkout");var val=Biz.Common.Validation;var empty_fields="";var error_msg="";var sign1,sign2,sign3;var checkList1=Sys.Enum.create("SFirstName","SLastName","SAddress1","SCity","SZip","ShippingPhone_tel1","ShippingPhone_tel2","ShippingPhone_tel3");var checkList2=Sys.Enum.create("BContactWith","BFirstName","BLastName","BAddress1","BCity","BZip");var checkList3=Sys.Enum.create("Card_CCNUMBERNEW","bankphone","Card_HolderName");var isBilling=false;var isCellPhone=wuf.getValue("checkout","isCellPhone");var onlyGCPaymentSelected=$("gcPaymentSelected")!=null&&$("gcPaymentSelected").checked;for(var i=0;i<f.length;i++){var e=f.elements[i];sign1=!Object.isNull(checkList1[e.name]);if(index==1&&!onlyGCPaymentSelected){sign2=!Object.isNull(checkList2[e.name]);sign3=!Object.isNull(checkList3[e.name]);};if(sign1||sign2||sign3){var vTemp=e.value;if(String.isNullOrEmpty(vTemp)){if (String.isNullOrEmpty(isCellPhone)){switch(e.name){case checkList1.SFirstName:error_msg=Web.Lang.shopping015;break;case checkList1.SLastName:error_msg=Web.Lang.shopping016;break;case checkList1.SAddress1:error_msg=Web.Lang.shopping017;break;case checkList1.SCity:error_msg=Web.Lang.shopping018;break;case checkList1.SZip:error_msg=Web.Lang.shopping019;break;case checkList3.Card_CCNUMBERNEW:error_msg=Web.Lang.shopping020;break;case checkList3.bankphone:error_msg=Web.Lang.shopping021;break;case checkList3.Card_HolderName:error_msg=Web.Lang.shopping022;break;case checkList2.BAddress1:error_msg=Web.Lang.shopping023;break;case checkList2.BCity:error_msg=Web.Lang.shopping024;break;case checkList2.BZip:error_msg=Web.Lang.shopping025;break;case checkList2.BContactWith:error_msg=Web.Lang.shopping026;break;case checkList2.BFirstName:error_msg=Web.Lang.shopping058;break;case checkList2.BLastName:error_msg=Web.Lang.shopping059;break;default:error_msg="";break;};}else{switch(e.name){case checkList3.Card_CCNUMBERNEW:error_msg=Web.Lang.shopping020;break;case checkList3.bankphone:error_msg=Web.Lang.shopping021;break;case checkList3.Card_HolderName:error_msg=Web.Lang.shopping022;break;case checkList2.BAddress1:error_msg=Web.Lang.shopping023;break;case checkList2.BCity:error_msg=Web.Lang.shopping024;break;case checkList2.BZip:error_msg=Web.Lang.shopping025;break;case checkList2.BContactWith:error_msg=Web.Lang.shopping026;break;case checkList2.BFirstName:error_msg=Web.Lang.shopping058;break;case checkList2.BLastName:error_msg=Web.Lang.shopping059;break;default:error_msg="";break;};};if(!String.isNullOrEmpty(error_msg)){empty_fields += "\n     " + error_msg;};};};};if (String.isNullOrEmpty(isCellPhone)){var strContactWith="";if(String.isNullOrEmpty(wuf.getValue("checkout","SMI").trim())){strContactWith=wuf.getValue("checkout","SFirstName").trim()+" "+wuf.getValue("checkout","SLastName").trim();}else{strContactWith=wuf.getValue("checkout","SFirstName").trim()+" "+wuf.getValue("checkout","SMI").trim()+" "+wuf.getValue("checkout","SLastName").trim();};if(!val.isInLength(strContactWith,30)){empty_fields+="\n     "+Web.Lang.shopping027;};isBilling=!Object.isNull($("IsBilling"))&&$("IsBilling").checked;empty_fields+=val.isPhone("checkout","ShippingPhone","Shipping",true,true,true);wuf.setValue("checkout","SState",wuf.getValue("checkout","SState_Option"));var strzipcode;strzipcode=wuf.getValue("checkout","SZip").trim();if(val.isNotZipCode(strzipcode,isCA)){empty_fields += "\n     "+Web.Lang.shopping028;};};return empty_fields;},nextStep:function(index,isCA){var wuf=Web.UI.Form;var val=Biz.Common.Validation;var sco=Biz.Shopping.CheckOut;var msg;var empty_fields="";var error_msg="";var f=wuf.get("checkout");var chkSaveShipping=$("saveShipping").checked;var paypalNewCheckout=wuf.getValue("checkout","PaypalNewCheckout");var gomezFlag=wuf.getValue("checkout","GomezFlag");wuf.setValue("checkout","PanelIndex",index);if(index==0){var ccnumber,cclength;ccnumber="4000000000000002";cclength=16;wuf.setValue("checkout","Card_CCNUMBERNEW",ccnumber);cclength = ccnumber.length;wuf.setValue("checkout","Card_CCTYPE","001");var cvv2code,CardLabel;cvv2code="123";CardLabel="visa";wuf.setValue("checkout","cvv2code",cvv2code);wuf.submit("checkout");return;};var onlyGCPaymentSelected=$("gcPaymentSelected")!=null&&$("gcPaymentSelected").checked;var isCellPhone=wuf.getValue("checkout","isCellPhone");empty_fields+=sco.checkBillingAddress(index,isCA);if(index==1){if(!onlyGCPaymentSelected){if (!val.isInLength(wuf.getValue("checkout","BFirstName").trim()+wuf.getValue("checkout","BMI").trim()+wuf.getValue("checkout","BLastName").trim(),30)){empty_fields += "\n     "+Web.Lang.shopping055;};empty_fields+=val.isPhone("checkout","BNightPhone","Evening",true,false,true);strzipcode=wuf.getValue("checkout","BZip").trim();if(val.isNotZipCode(strzipcode,isCA)){empty_fields += "\n     "+Web.Lang.shopping030;};};var dt = new Date();var inputYear,inputMonth;inputYear=parseInt($("Card_exp_year").value,10);inputMonth=parseInt($("Card_exp_month").value,10);if(!onlyGCPaymentSelected){if(!inputYear||!inputMonth){empty_fields+="\n     "+Web.Lang.shopping031;}else{if(gomezFlag.toUpperCase()=="FALSE"){if((dt.getFullYear()>inputYear)||(dt.getFullYear()==inputYear&&dt.getMonth()+1>inputMonth))empty_fields += "\n     "+Web.Lang.shopping032;};};};var ccnumber,cclength;ccnumber=wuf.getValue("checkout","Card_CCNUMBERNEW").trim();cclength=ccnumber.length;for(var i=0;i<=cclength;i++){if(wuf.getValue("checkout","Number").trim()!="0"){ccnumber=ccnumber.replace(/[^0-9*]/,"");}else{ccnumber=ccnumber.replace(/[^0-9]/,"");};};wuf.setValue("checkout","Card_CCNUMBERNEW",ccnumber);cclength = ccnumber.length;if(onlyGCPaymentSelected){wuf.setValue("checkout","Card_CCTYPE","001");}else	if(ccnumber.substring(0,1)=='4'){if(cclength!=16){empty_fields+="\n     "+Web.Lang.shopping033;}else{wuf.setValue("checkout","Card_CCTYPE","001");};}else if(ccnumber.substring(0,1)=='5'){if(cclength!=16){empty_fields+="\n     "+Web.Lang.shopping033;}else{wuf.setValue("checkout","Card_CCTYPE","002");};}else if(!isCA & ccnumber.substring(0,1)=='6'){if(cclength!=16){empty_fields+="\n     "+Web.Lang.shopping033;}else{wuf.setValue("checkout","Card_CCTYPE","003");};}else if(ccnumber.substring(0,1)=='3'){if(cclength!=15){empty_fields+="\n     "+Web.Lang.shopping034;}else{wuf.setValue("checkout","Card_CCTYPE","004");};}else{empty_fields += "\n     "+Web.Lang.shopping035;};if(!onlyGCPaymentSelected&&ccnumber.indexOf("****")==-1){if(!Biz.Common.Validation.mod10CheckCCNO(ccnumber)){empty_fields += "\n     "+Web.Lang.shopping056;}}var cvv2code,CardLabel;cvv2code=wuf.getValue("checkout","cvv2code").trim();cvv2code=cvv2code.replace(/\s*/g, "");CardLabel=wuf.getValue("checkout","Card_PaytermLabel").trim();wuf.setValue("checkout","cvv2code",cvv2code);if(!onlyGCPaymentSelected){if(String.isNullOrEmpty(cvv2code)){if (String.isNullOrEmpty(CardLabel)){empty_fields+="\n     "+Web.Lang.shopping036;}else{empty_fields+="\n     "+String.format(Web.Lang.shopping037,CardLabel);};eval(" $(\"cvv2code\").focus();");}else if(!val.isInteger(cvv2code)){empty_fields+="\n     "+Web.Lang.shopping038;eval(" $(\"cvv2code\").focus();");}else{var cvv2codelength = cvv2code.length;if(ccnumber.substring(0,1)=='3'){if(cvv2codelength != 4){empty_fields+="\n     "+Web.Lang.shopping057;eval(" $(\"cvv2code\").focus();");}}else{if(cvv2codelength != 3){empty_fields+="\n     "+Web.Lang.shopping057;eval(" $(\"cvv2code\").focus();");}}}};}else if(index==2){if(!String.isNullOrEmpty(isCellPhone)){empty_fields+=Biz.Shopping.CheckOut.billingInfo("checkout");};}else if(index==5&&wuf.getValue("checkout","ECheckFlag").trim().toUpperCase()=="TRUE"){if ($("ECheckConfirm").checked){if (String.isNullOrEmpty(wuf.getValue("checkout","Echeck_FullName").trim())){empty_fields+="\n     "+Web.Lang.shopping039;};var rountingNumber="",accountingNumber="";rountingNumber=wuf.getValue("checkout","Echeck_RoutingNumber").trim();accountingNumber=wuf.getValue("checkout","Echeck_AccountNumber").trim();if(String.isNullOrEmpty(rountingNumber)){empty_fields+="\n     "+Web.Lang.shopping040;}else if(rountingNumber.length!=9||!val.isInteger(rountingNumber)){empty_fields+="\n     "+Web.Lang.shopping041;};if(String.isNullOrEmpty(accountingNumber)){empty_fields+="\n     "+Web.Lang.shopping041;}else if(!val.isNumberWithinLength(accountingNumber,19)){empty_fields+="\n     "+Web.Lang.shopping042;};if(String.isNullOrEmpty(wuf.getValue("checkout","Echeck_DriverLicense").trim())){empty_fields+="\n     "+Web.Lang.shopping043;};if (wuf.getValue("checkout","ECheck_DriverLicenseState").trim()=="0"){empty_fields+="\n     "+Web.Lang.shopping044;};};}else if(index==4){if(onlyGCPaymentSelected){empty_fields = "\n-To redeem entire order by Gift Card, select payment methods other than PayPal to insert the shipping address.";}else{empty_fields = "";};};if(paypalNewCheckout.toUpperCase()=="FALSE")chkSaveShipping=true;if(empty_fields){msg="______________________________________________________\n\n";msg+=Web.Lang.shopping001+"\n";msg+=Web.Lang.shopping002+"\n";msg+="______________________________________________________\n";msg+=empty_fields+"\n\n";alert(msg);return;};if(index==2){wuf.setValue("checkout","Card_CCTYPE","024");};if(index==3){wuf.setValue("checkout","Card_CCTYPE","022");};if(index==4){wuf.setValue("checkout","Card_CCTYPE","020");};if(index==5){if(wuf.getValue("checkout","ECheckFlag").trim().toUpperCase()=="TRUE"){if($("ECheckConfirm").checked){wuf.setValue("checkout","Card_CCTYPE","025");}else{wuf.setValue("checkout","Card_CCTYPE","014");};}else{wuf.setValue("checkout","Card_CCTYPE","014");};};if(index==6){wuf.setValue("checkout","Card_CCTYPE","026");};if(index==7){wuf.setValue("checkout","Card_CCTYPE","013");};if(onlyGCPaymentSelected){wuf.setValue("checkout","Card_CCTYPE","028");};wuf.submit("checkout");return;},switchAddr:function(v){var cfg=Biz.Shopping.Config;var wuf=Web.UI.Form;var al=cfg.address.addressList;wuf.setValue("checkout","SLabel",al[v].label);wuf.setValue("checkout","SFirstName",al[v].firstName);wuf.setValue("checkout","SMI",al[v].middleName);wuf.setValue("checkout","SLastName",al[v].lastName);wuf.setValue("checkout","SCompanyName",al[v].companyName);wuf.setValue("checkout","SAddress1",al[v].address1);wuf.setValue("checkout","SAddress2",al[v].address2);wuf.setValue("checkout","SCity",al[v].city);wuf.setValue("checkout","SState",al[v].state);wuf.setValue("checkout","SState_Option",al[v].state);wuf.setValue("checkout","SZip",al[v].zipCode);wuf.setValue("checkout","ShippingPhone_tel1",al[v].phone0);wuf.setValue("checkout","ShippingPhone_tel2",al[v].phone1);wuf.setValue("checkout","ShippingPhone_tel3",al[v].phone2);wuf.setValue("checkout","ShippingPhone_ext1",al[v].phone3);wuf.setValue("checkout","STransNumber",al[v].transactionNumber);wuf.setValue("checkout","ShippingPhone_originalTel1",al[v].phone0);var paypalNewCheckout=wuf.getValue("checkout","PaypalNewCheckout");var Card_CCTYPE=wuf.getValue("checkout","Card_CCTYPE");if ((v==0)&&(paypalNewCheckout.toUpperCase()=="TRUE")&&(Card_CCTYPE=="020")){$("saveShipping").checked=false;}else{$("saveShipping").checked=true;};$("saveShipping").disabled=false;Biz.Shopping.CheckOut.setBillingInfo(1);if(al[v] && al[v].isDisabled){Biz.Shopping.CheckOut.disableB2BShipping(true);wuf.setValue("checkout","disableFlag",1);}else{Biz.Shopping.CheckOut.disableB2BShipping(false);wuf.setValue("checkout","disableFlag",0);}wuf.setValue("checkout","HdZipcode",al[v].zipCode);},disableB2BShipping:function(flag){var wuc=Web.UI.Control;var wuf=Web.UI.Form;wuc.setAttribute(wuf.getElement("checkout","SLabel"),{"disabled":flag});wuc.setAttribute(wuf.getElement("checkout","SFirstName"),{"disabled":flag});wuc.setAttribute(wuf.getElement("checkout","SMI"),{"disabled":flag});wuc.setAttribute(wuf.getElement("checkout","SLastName"),{"disabled":flag});wuc.setAttribute(wuf.getElement("checkout","SCompanyName"),{"disabled":flag});wuc.setAttribute(wuf.getElement("checkout","SAddress1"),{"disabled":flag});wuc.setAttribute(wuf.getElement("checkout","SAddress2"),{"disabled":flag});wuc.setAttribute(wuf.getElement("checkout","SCity"),{"disabled":flag});wuc.setAttribute(wuf.getElement("checkout","SState_Option"),{"disabled":flag});wuc.setAttribute(wuf.getElement("checkout","SZip"),{"disabled":flag});wuc.setAttribute(wuf.getElement("checkout","ShippingPhone_tel1"),{"disabled":flag});wuc.setAttribute(wuf.getElement("checkout","ShippingPhone_tel2"),{"disabled":flag});wuc.setAttribute(wuf.getElement("checkout","ShippingPhone_tel3"),{"disabled":flag});wuc.setAttribute(wuf.getElement("checkout","ShippingPhone_ext1"),{"disabled":flag});wuc.setAttribute(wuf.getElement("checkout","saveShipping"),{"disabled":flag});},setBillingInfo:function(v){var wuf=Web.UI.Form;var ext_length,strContactWith;if($("IsBilling")){if($("IsBilling").checked){$("BFirstName").value=$("SFirstName").value.trim();$("BMI").value=$("SMI").value.trim();$("BLastName").value=$("SLastName").value.trim();$("BAddress1").value=$("SAddress1").value;$("BAddress2").value=$("SAddress2").value;$("BCity").value=$("SCity").value;wuf.setValue("checkout","BState",wuf.getValue("checkout","SState_Option"));$("BZip").value=$("SZip").value;wuf.setValue("checkout","BNightPhone_tel1",wuf.getValue("checkout","ShippingPhone_tel1"));wuf.setValue("checkout","BNightPhone_tel2",wuf.getValue("checkout","ShippingPhone_tel2"));wuf.setValue("checkout","BNightPhone_tel3",wuf.getValue("checkout","ShippingPhone_tel3"));if (wuf.getValue("checkout","ShippingPhone_ext1").length>3){wuf.setValue("checkout","BNightPhone_ext1",wuf.getValue("checkout","ShippingPhone_ext1").substring(0,3));}else{wuf.setValue("checkout","BNightPhone_ext1",wuf.getValue("checkout","ShippingPhone_ext1"));};if (Biz.Common.Validation.isCheckFirstLetter("checkout","ShippingPhone")&& Biz.Common.Validation.isZeroFirstLetter(wuf.getValue("checkout","ShippingPhone_tel1"))){}else{wuf.setValue("checkout","BNightPhone_originalTel1",wuf.getValue("checkout","ShippingPhone_tel1"));wuf.setValue("checkout","BNightPhone_originalTel2",wuf.getValue("checkout","ShippingPhone_tel2"));wuf.setValue("checkout","BNightPhone_originalTel3",wuf.getValue("checkout","ShippingPhone_tel3"));if(wuf.getValue("checkout","ShippingPhone_ext1") != ""){wuf.setValue("checkout","BNightPhone_originalExt1",wuf.getValue("checkout","ShippingPhone_ext1").substring(0,3));}};};if(!$("IsBilling").checked && (v==0)){Biz.Shopping.CheckOut.switchCard($('sel_CNumber').value);};};Biz.Shopping.CheckOut.checkIsNYState();},checkIsNYState:function(){if (Biz.Shopping.Config.newYorkTaxAnnouncementFlag){if($("sippingTaxInfoForNY")){var isNY=false;isNY=Web.UI.Form.getValue("checkout","SState_Option")=="NY";if(Biz.Shopping.Config.isCellPhone=="1"){isNY=Web.UI.Form.getValue("checkout","BState")=="NY";};if(isNY){$("sippingTaxInfoForNY").style.display="block";}else{$("sippingTaxInfoForNY").style.display="none";};};};},switchCard:function(v){var cfg=Biz.Shopping.Config;var wuf=Web.UI.Form;var cType;var cl=cfg.creditCard.creditList;if(Object.isNull(cl)||cl.length==0){return;}wuf.setValue("checkout","Card_PaytermLabel",cl[v].label);wuf.setValue("checkout","Card_HolderName",cl[v].holderName);wuf.setValue("checkout","Card_CCNUMBERNEW",cl[v].creditCardNumber);cType=this.getCCTypeByCartNumber(cl[v].creditCardNumber);wuf.setValue("checkout","CCTYPE_OLD",cType);wuf.setValue("checkout","Card_CCTYPE",cType);if(cl[v].month=="0" && cl[v].year=="0"){wuf.setValue("checkout","Card_exp_year","Year");wuf.setValue("checkout","Card_exp_month","Month");}else{wuf.setValue("checkout","Card_exp_month",cl[v].month);wuf.setValue("checkout","Card_exp_year",cl[v].year);};wuf.setValue("checkout","cvv2code","");wuf.setValue("checkout","bankphone",cl[v].bankPhone);wuf.setValue("checkout","Number",cl[v].transactionNumber);if(($("IsBilling")&&!$("IsBilling").checked) || Object.isNull($("IsBilling"))){wuf.setValue("checkout","BAddress1",cl[v].address1);wuf.setValue("checkout","BAddress2",cl[v].address2);wuf.setValue("checkout","BCity",cl[v].city);wuf.setValue("checkout","BState",cl[v].state);wuf.setValue("checkout","BZip",cl[v].zipCode);wuf.setValue("checkout","BNightPhone_tel1",cl[v].phone0);wuf.setValue("checkout","BNightPhone_tel2",cl[v].phone1);wuf.setValue("checkout","BNightPhone_tel3",cl[v].phone2);wuf.setValue("checkout","BNightPhone_ext1",cl[v].phone3);wuf.setValue("checkout","BZip",cl[v].zipCode);wuf.setValue("checkout","BFirstName",cl[v].firstName);wuf.setValue("checkout","BMI",cl[v].mI);wuf.setValue("checkout","BLastName",cl[v].lastName);if (Biz.Common.Validation.isCheckFirstLetter("checkout","ShippingPhone")&& Biz.Common.Validation.isZeroFirstLetter(cl[v].phone0)){}else{wuf.setValue("checkout","BNightPhone_originalTel1",cl[v].phone0);wuf.setValue("checkout","BNightPhone_originalTel2",wuf.getValue("checkout","ShippingPhone_tel2"));wuf.setValue("checkout","BNightPhone_originalTel3",wuf.getValue("checkout","ShippingPhone_tel3"));if(wuf.getValue("checkout","ShippingPhone_ext1") != ""){wuf.setValue("checkout","BNightPhone_originalExt1",wuf.getValue("checkout","ShippingPhone_ext1").substring(0,3));}};};$("saveCard").checked = true;$("saveCard").disabled = false;wuf.setValue("checkout","CCBillingAddressID",cl[v].billingNumber);},setCardImage:function(){var img_Discover,img_Mastercard,img_Visa,img_Amex;var ccnumber,cclength;var wuc=Web.UI.Control;var wuf=Web.UI.Form;var res=Web.UI.ResourceManager;var cType;img_Discover="img_ccDnetwork_v1";img_Mastercard="img_ccMastercard";img_Visa="img_ccVisa";img_Amex="img_ccAmex";wuc.setAttribute($("ImgDiscover"),{"src":res.Image.build(img_Discover+"_grey.gif")});wuc.setAttribute($("ImgMastercard"),{"src":res.Image.build(img_Mastercard+"_grey.gif")});wuc.setAttribute($("ImgVisa"),{"src":res.Image.build(img_Visa+"_grey.gif")});wuc.setAttribute($("ImgAmex"),{"src":res.Image.build(img_Amex+"_grey.gif")});ccnumber=wuf.getValue("checkout","Card_CCNUMBERNEW").trim();cclength=ccnumber.length;for(var i=0;i<=cclength;i++){ccnumber=ccnumber.replace(/[^0-9*]/,"");};$("Card_CCNUMBERNEW").value=ccnumber;cType=this.getCCTypeByCartNumber(ccnumber);switch(cType){case "001":wuc.setAttribute($("ImgVisa"),{"src":res.Image.build(img_Visa+".gif")});break;case "002":wuc.setAttribute($("ImgMastercard"),{"src":res.Image.build(img_Mastercard+".gif")});break;case "003":wuc.setAttribute($("ImgDiscover"),{"src":res.Image.build(img_Discover+".gif")});break;case "004":wuc.setAttribute($("ImgAmex"),{"src":res.Image.build(img_Amex+".gif")});break;default:break;};},getCCTypeByCartNumber:function(num){var cclength=num.length;var cType=num.substring(0,1);var CCTYPE="";if((cType=='4')&&(cclength==16)){CCTYPE="001";}else if((cType=='5')&&(cclength==16)){CCTYPE="002";}else if((cType=='6')&&(cclength==16)){CCTYPE="003";}else if((cType=='3')&&(cclength==15)){CCTYPE="004";};return CCTYPE;},changePaymentTitle:function(){if ($("ECheckConfirm").checked){Web.UI.Control.replaceInnerHTML($("lblbankaccount"),"Bank Account");}else{Web.UI.Control.replaceInnerHTML($("lblbankaccount"),"Mail Payment");};},cellphoneStartupScript:function(){var wuf=Web.UI.Form;var wuc=Web.UI.Control;var sco=Biz.Shopping.CheckOut;var isCellPhone=wuf.getValue("checkout","isCellPhone");if(!String.isNullOrEmpty(isCellPhone)){sco.showPanel(null,sco.Tabs.CreditCard);Biz.Shopping.CheckOut.disableShipping(true);wuc.setAttribute(wuf.getElement("checkout","paymentType"),{"value":"CreditCard"});wuc.setAttribute(wuf.getElement("checkout","IsBilling"),{"disabled":"true"});}},fake:function(){},changeGCPayment:function(){var wuf=Web.UI.Form;var wuc=Web.UI.Control;var sco=Biz.Shopping.CheckOut;if($("gcPaymentSelected").checked){wuc.replaceInnerHTML($("lbCreditCard"),Web.Lang.noPaymentSelected);wuc.replaceInnerHTML($("lbNPA"),Web.Lang.noPaymentSelected);wuc.replaceInnerHTML($("lbBML"),Web.Lang.noPaymentSelected);wuc.replaceInnerHTML($("lbPaypal"),Web.Lang.noPaymentSelected);wuc.replaceInnerHTML($("lblbankaccount"),Web.Lang.noPaymentSelected);wuc.replaceInnerHTML($("lbNetTerm"),Web.Lang.noPaymentSelected);wuc.replaceInnerHTML($("lbWireTransfer"),Web.Lang.noPaymentSelected);wuc.setAttribute($("opBtnLnkNetTerm"),{"href":"javascript:attachDelegateEvent((function(){Biz.Shopping.CheckOut.nextStep('6',false);}));"});$("opBtnLnkNetTerm").className="lgBtn orangeBtn";}else{wuc.replaceInnerHTML($("lbCreditCard"),Web.Lang.creditCardPaymentSelected);wuc.replaceInnerHTML($("lbNPA"),Web.Lang.preferredAccountSelected);wuc.replaceInnerHTML($("lbBML"),Web.Lang.billMeLaterSelected);wuc.replaceInnerHTML($("lbPaypal"),Web.Lang.payPalPaymentSelected);if(wuf.getValue("checkout","ECheckFlag")=='true'){wuc.replaceInnerHTML($("lblbankaccount"),Web.Lang.bankAccountSelected);}else{wuc.replaceInnerHTML($("lblbankaccount"),Web.Lang.mailPaymentSelected);}sco.resertNetTerm();wuc.replaceInnerHTML($("lbWireTransfer"),Web.Lang.wireTransferSelected);};}};usingNamespace("Biz.Shopping.CheckOut")["tabIndexMapping"]={"1":Biz.Shopping.CheckOut.Tabs.CreditCard,"2":Biz.Shopping.CheckOut.Tabs.PreferredAccount,"3":Biz.Shopping.CheckOut.Tabs.BillLater,"4":Biz.Shopping.CheckOut.Tabs.PayPal,"5":Biz.Shopping.CheckOut.Tabs.MailOrBank,"6":Biz.Shopping.CheckOut.Tabs.NetTerm,"7":Biz.Shopping.CheckOut.Tabs.WireTransfer};usingNamespace("Biz.Shopping")["CheckOut2"]={submitOrder:function(SelectShippingMethodSign){Web.StateManager.Cookies.clear(Web.StateManager.Cookies.Name.CARTPAGEINFO);var wuf=Web.UI.Form;var wuc=Web.UI.Control;var isNetTermExceeded = wuf.getValue("checkout","NetTermExceeded").trim();if(!Object.isNull(isNetTermExceeded)&&isNetTermExceeded=="1"){return;}if(!String.isNullOrEmpty(SelectShippingMethodSign)&&SelectShippingMethodSign.toUpperCase()=="TRUE"){alert (Web.Lang.shopping045);return;}else if(wuf.getElements("checkout","AgreeOrNot").checked!=true){alert(Web.Lang.shopping046);return;}else{wuf.setValue("checkout","SubmitTypeValue","Submit");wuc.addCss($("btnDisabled"),"disabled");wuc.setAttribute($("btnEnabled"),{"style.display":"none"});wuc.setAttribute($("btnDisabled"),{"style.display":"inline"});wuf.submit("checkout");};},submitSelf:function(a){Web.UI.Form.submit("checkout");},pcmagCheck:function(paramString){Web.UI.Form.setValue("checkout","SubmitTypeValue","CheckPCMag");Web.UI.Form.submit("checkout");},changeShipMethod:function(o){if(o.value=='018'){alert('The APO/FPO shipping method can only be used when shipping to military \042states\042.(AA, AE, AP) Please modify your selection before continuing.');};if(o){var name="For"+o.name;Web.UI.Form.setValue("checkout",name,"M");};Web.UI.Form.setValue("checkout","SubmitTypeValue","ShippingMethod");Web.UI.Form.submit("checkout");},checkRushOrder:function(paramString){Web.UI.Form.setValue("checkout","SubmitTypeValue","RushOrder");Web.UI.Form.submit("checkout");},popupUSPSErrorWindow:function(uspsErrorType){var message="";if(uspsErrorType==1){message = "Some of items in this order will be shipped from a location that does not support USPS Priority as a shipping option at this time.  Please select another shipping method. We apologize for any inconvenience this may cause.";}else if(uspsErrorType==2){message = "The desired shipping location for this order is not eligible for USPS Priority shipping method at this time. Please select another shipping method.";}else if(uspsErrorType==3){message = "We're sorry, the selected shipping method (USPS Priority) is no longer available for this particular order as our shipment settings have recently been updated. Please select another shipping method. We apologize for any inconvenience this may have caused.";};if(message!=""){alert(message);};}};usingNamespace("Biz.Shopping")["ShoppingCart"]={showPrintPage:function(){window.open("ShoppingCartPrintVersion.aspx","shoppingCartPrint","width=800,toolbar=no, menubar=no, resizable=no,scrollbars=yes");},clearExamplePromotionCode:function (text){if(text.value=="code1,code2,code3,code4,code5"){text.value="";}},setExamplePromotionCode:function (text){if(text.value.trim()==""){text.value="code1,code2,code3,code4,code5";}},checkOut:function(site,onlyPreOrder){var wuf=Web.UI.Form;var gc=wuf.getValue("form1","GiftCode").trim();var sc=wuf.getValue("form1","SecurityCode").trim();var agc=wuf.getValue("form1","AllGiftCodes").trim();var agp=wuf.getValue("form1","AllGiftPwds").trim();if(!String.isNullOrEmpty(gc) && !String.isNullOrEmpty(sc)){if(!String.isNullOrEmpty(agc)){wuf.setValue("form1","AllGiftCodes",agc+","+gc);wuf.setValue("form1","AllGiftPwds",agp+","+sc);}else{wuf.setValue("form1","AllGiftCodes",gc);wuf.setValue("form1","AllGiftPwds",sc);};wuf.setValue("form1","GiftCode","");wuf.setValue("form1","SecurityCode","");};wuf.setValue("form1","SubmitTypeValue","CHECKOUT");wuf.submit("form1");},addGiftCode:function(){var wuf=Web.UI.Form;var gc=wuf.getValue("form1","GiftCode").trim();var sc=wuf.getValue("form1","SecurityCode").trim();var agc=wuf.getValue("form1","AllGiftCodes").trim();var agp=wuf.getValue("form1","AllGiftPwds").trim();if(!String.isNullOrEmpty(gc) && !String.isNullOrEmpty(sc)){if(!String.isNullOrEmpty(agc)){wuf.setValue("form1","AllGiftCodes",agc+","+gc);wuf.setValue("form1","AllGiftPwds",agp+","+sc);}else{wuf.setValue("form1","AllGiftCodes",gc);wuf.setValue("form1","AllGiftPwds",sc);};wuf.setValue("form1","GiftCode","");wuf.setValue("form1","SecurityCode","");wuf.setValue("form1","SubmitTypeValue","GCSUBMIT");wuf.submit("form1");return;}else{if(String.isNullOrEmpty(gc)){alert(Web.Lang.shopping047+"\n "+Web.Lang.shopping048);wuf.getElements("form1","GiftCode").focus();return;};if(String.isNullOrEmpty(sc)){alert(Web.Lang.shopping049+"\n "+Web.Lang.shopping050);document.form1.SecurityCode.focus();return;};};},addExtendWarranty:function(){Web.UI.Form.submit("form1");},applyPromotion:function(site,itemSign){var wuf=Web.UI.Form;var zip;if(itemSign==0){zip=wuf.getValue("form1","zipcode1");}else{zip="00000";};var pc=wuf.getValue("form1","PromotionCode");if(!String.isNullOrEmpty(zip) && (pc!="")){wuf.setValue("form1","SubmitTypeValue","PROMOTCODESUBMIT");wuf.submit("form1");return;}else{if(String.isNullOrEmpty(zip)){alert(Web.Lang.shopping051+"\n"+Web.Lang.shopping052);}else{alert(Web.Lang.shopping053+"\n"+Web.Lang.shopping054);};};},checkNewsLetterPCode:function(){var wuf=Web.UI.Form;wuf.setValue("form1","chkNewsLetterPCode",$("chkNewsLetterPCode").value);wuf.setValue("form1","SubmitTypeValue","UNAGREENEWSLETTERPCODE");wuf.submit("form1");},checkAutoSplit:function(){var wuf=Web.UI.Form;wuf.setValue("form1","SubmitTypeValue","PREORDERCLICK");wuf.submit("form1");},clearGiftCode:function(gcno){var wuf=Web.UI.Form;var allgcs=new Array();allgcs=wuf.getValue("form1","AllGiftCodes").split(",");var allpws=new Array();allpws=wuf.getValue("form1","AllGiftPwds").split(",");for(i = 0;i<allgcs.length;i++){if(allgcs[i]==gcno){allgcs[i]="";allpws[i]="";}}var allgc="";var allpw="";for(i=0;i<allgcs.length;i++){if(allgcs[i].length>0){allgc+=allgcs[i]+",";allpw+=allpws[i]+",";}}wuf.setValue("form1","AllGiftCodes",allgc);wuf.setValue("form1","AllGiftPwds",allpw);wuf.setValue("form1","GiftMethodAction","1");wuf.setValue("form1","SubmitTypeValue","CLEARGIFTCODE");wuf.submit("form1");},calShippingCharge:function(site,itemType,o){var wuf=Web.UI.Form;if($("zipcode" + itemType).value!=""){if(o){var name="For"+o.name;wuf.setValue("form1",name,"M");};wuf.setValue("form1","SubmitTypeValue","PRICEBOXSUBMIT");wuf.submit("form1");return;};},clearPromotionCode:function(site){var wuf=Web.UI.Form;wuf.setValue("form1","SubmitTypeValue","CLEARPROMOTCODE");wuf.submit("form1");return;},selectAllOrNone:function(objFld,objSelect){var obj=eval(document.form1);if(obj.elements[objFld]){var wuf=Web.UI.Form;};if(wuf.getElements("form1",objFld).checked){Biz.Shopping.ShoppingCart.SelectOne(objSelect, true);}else{Biz.Shopping.ShoppingCart.SelectOne(objSelect, false);};},selectOne:function(objFld, blnChecked){var obj =Web.UI.Form.get("form1");if(obj.elements[objFld]==undefined){return;};obj.elements["chkItemHeader"].checked = blnChecked ;if(obj.elements[objFld].length == undefined){obj.elements[objFld].checked = blnChecked;}else{var itemLen = obj.elements[objFld].length;for(i = 0; i < itemLen; i++){obj.elements[objFld][i].checked = blnChecked;};};},selectSingleItem:function(objFld){var obj =Web.UI.Form.get("form1");if(obj.elements[objFld] == undefined){return;};if(obj.elements[objFld].length == undefined){if (obj.elements[objFld].checked == true){obj.elements["chkItemHeader"].checked = true ;}else{obj.elements["chkItemHeader"].checked = false ;};}else{itemLen = obj.elements[objFld].length;var num = 0;for(i = 0; i < itemLen; i++){if (obj.elements[objFld][i].checked == true){num += 1;};};if (Number.parse(num) < Number.parse(i)){obj.elements["chkItemHeader"].checked = false ;}else if (Number.parse(num) == Number.parse(i)){obj.elements["chkItemHeader"].checked = true ;};};Biz.Shopping.ShoppingCart.reclaimWishListOption();},reclaimWishListOption:function(){var list=Web.UI.Form.getValue("form1","sltWishList");if(Number.parse(list)>=0){Web.UI.Form.setValue("form1","sltWishList","-1");return;};},shoppingCartSubmit:function(site){var wuf=Web.UI.Form;wuf.submit("form1");},selectAllOrNone:function(objFld,objSelect){var wuf=Web.UI.Form;var obj = eval("document.form1");if(obj.elements[objFld] == undefined){return;};if(obj.elements[objFld].checked == true){Biz.Shopping.ShoppingCart.selectOne(objSelect, true);}else{Biz.Shopping.ShoppingCart.selectOne(objSelect, false);};if(wuf.getValue("form1","sltWishList")>=0){wuf.setValue("form1","sltWishList","-1");};return;},shoppingCartOperation:function(itemNumber,choice,objFld){var wuf=Web.UI.Form;wuf.setValue("form1","SelectedSNETItemNumber",itemNumber);if(objFld != ""){if(Biz.Shopping.ShoppingCart.verifyChkedItem(objFld)){if (choice=="MOVETOWISHLIST"){if (Number.parse(wuf.getValue("form1","sltWishList"))<0){wuf.setValue("form1","ShoppingCartOperateWishList","");};};wuf.setValue("form1","SubmitTypeValue",choice);wuf.submit("form1");}else{wuf.setValue("form1","ShoppingCartOperateWishList","");};}else{wuf.setValue("form1","SubmitTypeValue",choice);wuf.submit("form1");};},removeFeatures:function(name,num,choice){var wuf=Web.UI.Form;wuf.setValue("form1",name,num);wuf.setValue("form1","SubmitTypeValue",choice);wuf.submit("form1");},verifyChkedItem:function(objFld){var obj =Web.UI.Form.get("form1");if(obj.elements[objFld] == undefined){return false;};if(obj.elements[objFld].length == undefined){if (obj.elements[objFld].checked == true){return true;};}else{itemLen = obj.elements[objFld].length;for(i = 0; i < itemLen; i++){if (obj.elements[objFld][i].checked == true){return true;};};};},extendedWarrantyToggle:function(link,id,selectedID,selected){var opt=$(id);var optSelected=$(selectedID);var linkobj=$(link);if(opt.style.display!='inline'){if(selected=="True"){optSelected.style.display='none';};opt.style.display='inline';linkobj.style.display='none';linkobj.nextSibling.nextSibling.style.display='inline';}else{if(selected=="True"){optSelected.style.display='inline';};opt.style.display='none';linkobj.style.display='none';linkobj.previousSibling.previousSibling.style.display='inline';}linkobj.blur();}};usingNamespace("Biz.Shopping")["BMLBilling"]={updateBilling:function(){Web.UI.Form.setValue("BML","UpdateBilling","yes");Web.UI.Form.submit("BML");},verifyBirth:function(){var y,m,d;var wuf=Web.UI.Form;var today=new Date();var errorMsg=new Sys.Text.StringBuilder();y=wuf.getValue("BML","bdyear").trim();m=wuf.getValue("BML","bdmonth").trim();d=wuf.getValue("BML","bdday").trim();if (y=="" || y=="Year" || m=="" || m=="Month"|| d=="" || d=="Day" || !Biz.Shopping.BMLBilling.checkDirth(y,m,d)){errorMsg.append("- Your Date of Birth is invalid.\n");};if((today.getFullYear()-18)==y){if((today.getMonth()+1)<m){errorMsg.append("- Your request cannot continue because the date of birth you entered indicates that you are less than 18 years of age. \n");}else if((today.getMonth()+1)==m){if(today.getDate()<d){errorMsg.append("- Your request cannot continue because the date of birth you entered indicates that you are less than 18 years of age. \n");};};};return errorMsg.toString();},checkDirth:function(year,month,day){try{var isLeap,startDay,endDay,isRightDate;isLeap=false;isRightDate=false;startDay=1;if(month<1||month>12){return isRightDate;};if(year%400==0){isLeap=true;}else if(year%4==0&&year%100!= 0){isLeap = true;};if(month==2){endDay=28;if(isLeap==true){endDay = 29;};}else if(month<8){endDay=31;if(month%2==0){endDay = 30;};}else if(month>=8){endDay=30;if(month%2==0){endDay=31;};};if(day>=startDay&&day<=endDay){isRightDate=true;};return isRightDate;}catch(e){return false;};},allowSubmit:function(flag){var msg="";var errorMsg=new Sys.Text.StringBuilder();var wuf=Web.UI.Form;var val=Biz.Common.Validation;var ssn,birth,agree;ssn=wuf.getValue("BML","ssn").trim();birth=Biz.Shopping.BMLBilling.verifyBirth();agree=wuf.getElements("BML","consent");if(!agree.checked){alert(Web.Lang.bMLBilling001 + "\n\n" + Web.Lang.bMLBilling003);return;};if(birth){errorMsg.append(birth);};if (ssn==""||!Biz.Common.Validation.isInteger(ssn)||(ssn).length != 4){errorMsg.append(Web.Lang.bMLBilling002 + "\n");};if(!errorMsg.toString()){Web.UI.Form.submit("BML");}else{msg+=Biz.Account.Customer._msg;msg += errorMsg + "\n";alert(msg);};}};usingNamespace("Biz.Shopping")["CellPhone"]={checkSubmit:function(){var wuf=Web.UI.Form;if(wuf.getElements("wirelessterms","IsAgree").checked){wuf.setValue("wirelessterms","SubmitFlag","yes");wuf.submit("wirelessterms");return;}else{alert("You must check the terms & conditions agreement box in order to continue purchase.");return;};},cancelPurchase:function(){var wuf=Web.UI.Form;wuf.setValue("wirelessterms","SubmitFlag","no");wuf.submit("wirelessterms");return;}};usingNamespace("Biz.Shopping")["CheckOut3"]={printFriendly:function(){var sb=new Sys.Text.StringBuilder();sb.appendLine("<html>");sb.appendLine("<head>");sb.appendLine("<title>"+document.title+"</title>");sb.appendLine(Biz.Common.SSLCommon.printStyle());sb.appendLine("</head>");sb.appendLine("<body>");sb.appendLine("<div id=\"logo\">"+$("logo").innerHTML+"</div>");sb.appendLine("<div id=\"checkOut\"><input style=\"float:right;\" type=\"button\" name=\"Print\" class=\"printButton\" value=\""+Web.Lang.print+"\" onclick=\"window.print();\">" + $("checkOut").innerHTML +"</div>");sb.appendLine("<div id=\"disclaimer\">"+$("disclaimer").innerHTML+"</div>");sb.appendLine("</body>");sb.appendLine("</html>");var pfw = window.open("","PrintFriendly");pfw.document.writeln(sb.toString());pfw.document.close();}};