usingNamespace("Biz.CellPhone")["initialize"]=function(){window.attachEvent("onload",(function(){var oZip;if (null!=(oZip=$("cpInputZipCode"))){oZip.maxlength=5;oZip.attachEvent("onkeyup",(function(){if(window.event.keyCode==13){return Biz.CellPhone.ZipCode.update(true);}return false;}));};Web.UI.Form.Radio.allowCancelForm("frmCellPhoneList","frmCellPhonePlanList","frmCellPhoneKitList","frmCellPhoneOptionList");}));}();usingNamespace("Biz.CellPhone")["Utility"]={toggleItem:function(tag,image){if(null!=tag && null!=image){if(tag.className.split(" ").contains("hdn")){Web.UI.Control.replaceCss(tag,"hdn","dbk");Web.UI.Control.setAttribute(image,{"src":Web.UI.ResourceManager.Image.build("minus.gif"),"alt":"-"});}else{Web.UI.Control.replaceCss(tag,"dbk","hdn");Web.UI.Control.setAttribute(image,{"src":Web.UI.ResourceManager.Image.build("plus.gif"),"alt":"+"});};};}};usingNamespace("Biz.CellPhone")["ZipCode"]={cancel:function(){Web.UI.Control.setAttribute($("cpDisplayZipCode"),{"style.display":"inline"});Web.UI.Control.setAttribute($("cpEditZipCode"),{"style.display":"none"});},edit:function(){Web.UI.Control.setAttribute($("cpDisplayZipCode"),{"style.display":"none"});Web.UI.Control.setAttribute($("cpEditZipCode"),{"style.display":"inline"});var oZip;if (null!=(oZip=$("cpInputZipCode"))){oZip.focus();oZip.select();};},update:function(isRefresh,id){var oZip;id=(null!=id)?"_"+id:"";if (null!=(oZip=$("cpInputZipCode"+id))){var zipCode=oZip.value.trim();if(Number.isNumeric(zipCode)&&zipCode.length==5){Biz.CellPhone.ZipCode.save(oZip.value);if(isRefresh){window.location.replace(window.location.href);};}else{oZip.select();alert("Please input zip code and continue");return false;};};},save:function(zipCode){Web.StateManager.Cookies.save(Web.StateManager.Cookies.Name.CFG,{"CellPhoneZipCode":zipCode});},converageViewer:function(zipCode,plantype){var wur=Web.UI.ResourceManager;var url=wur.Url.www("ProductSort/CoverageView.aspx");var qsb=new Web.QueryStringBuilder();qsb.add("zip",zipCode);qsb.add("plantype",plantype);Web.UI.Control.openWindow(wur.Url.combine(url,qsb.toString()),"coverageviewer",908,748,0,0,'status=no,resizable=no');}};usingNamespace("Biz.CellPhone")["PhoneList"]={reset:function(){Web.UI.Form.reset("frmCellPhoneList");},changeSort:function(targetUrl,sortField){window.location.href=targetUrl + "SortField="+sortField;},submit:function(){var cpItem,plItem;plItem=Web.UI.Form.getValue("frmCellPhoneList","PlanItem");cpItem=Web.UI.Form.getValue("frmCellPhoneList","PhoneItem");if(String.isNullOrEmpty(cpItem)){alert(" - Please select a phone - ");return;};if (!String.isNullOrEmpty(plItem)){Web.UI.Form.setValue("frmCellPhoneSummarySubmit","ItemList",cpItem+","+plItem);Web.UI.Form.submit("frmCellPhoneSummarySubmit");}else{Web.UI.Form.setValue("frmCellPhonePlanListSubmit","Item",cpItem);Web.UI.Form.submit("frmCellPhonePlanListSubmit");};}};usingNamespace("Biz.CellPhone")["PlanList"]={toggleGroup:function(id,count){},toggleItem:function(groupId,id){var tagId="cpPlanListItemBullet"+groupId+"_"+id;var imageId="cpPlanListItemImage"+groupId+"_"+id;Biz.CellPhone.Utility.toggleItem($(tagId),$(imageId));},goCart:function(v){var gc=$("goCart");if(gc){gc.value=v;};},reset:function(){Web.UI.Form.reset("frmCellPhonePlanList");},submit:function(){var cpItem,plItem;cpItem=Web.UI.Form.getValue("frmCellPhonePlanList","PhoneItem");plItem=Web.UI.Form.getValue("frmCellPhonePlanList","PlanItem");var gcv=Web.UI.Form.getValue("frmCellPhonePlanList","goCart");if(gcv==1){window.location.href=Web.UI.ResourceManager.Url.shopper("Shopping/AddToCart.asp?Submit=ADD&ItemList="+cpItem+"");return;};if(String.isNullOrEmpty(plItem)){alert(" - Please select a plan - ");return;};if (!String.isNullOrEmpty(cpItem)){Web.UI.Form.setValue("frmCellPhoneSummarySubmit","ItemList",cpItem+","+plItem);Web.UI.Form.submit("frmCellPhoneSummarySubmit");}else{if( parseInt(plItem.substring(plItem.length-2,plItem.length)) >6){Web.UI.Form.setValue("frmCellPhoneGoPhoneListSubmit","Item",plItem);Web.UI.Form.submit("frmCellPhoneGoPhoneListSubmit");}else{Web.UI.Form.setValue("frmCellPhoneListSubmit","Item",plItem);Web.UI.Form.submit("frmCellPhoneListSubmit");}};}};usingNamespace("Biz.CellPhone")["Features"]={toggleItem:function(groupId,id){var tagId="cpOptionListItemBullet"+groupId+"_"+id;var imageId="cpOptionListItemImage"+groupId+"_"+id;Biz.CellPhone.Utility.toggleItem($(tagId),$(imageId));},toggleDescription:function(o1,o2){Web.UI.Control.setAttribute($(o1),{"style.display":"none"});Web.UI.Control.setAttribute($(o2),{"style.display":"block"});},reset:function(){Web.UI.Form.reset("frmCellPhoneOptionList");Web.UI.Form.reset("frmCellPhoneKitList");},submit:function(){var opItems,comboId,comboItem,kitItems=[];comboItem=Web.UI.Form.getValue("frmCellPhoneAddtoCartSubmit","ItemList");if((comboItem.split(".")).length==2){comboId=comboItem.split(".")[1];opItems=Web.UI.Form.getValues("frmCellPhoneOptionList");if (opItems && opItems.length>0){var spoList=[];for(var i=0; i<opItems.length; ++i){spoList.add("SPO."+opItems[i]+"."+comboId);}Web.UI.Form.setValue("frmCellPhoneAddtoCartSubmit","SPOList",spoList.join(","));};var f;if(null!=(f=document.forms["frmCellPhoneKitList"])){var itemName;kitItems.add(comboItem);for (var i=0; i<f.elements.length; ++i){if (itemName!=f.elements[i].name){itemName=f.elements[i].name;kitItems.addRange(Web.UI.Form.getValues("frmCellPhoneKitList",itemName));};};Web.UI.Form.setValue("frmCellPhoneAddtoCartSubmit","ItemList",kitItems.join(","));};Web.StateManager.Cookies.clear(Web.StateManager.Cookies.Name.CPCOMBO);Web.UI.Form.submit("frmCellPhoneAddtoCartSubmit");};}};