Type.registerNamespace("Mccp.Basket");Mccp.Basket.AddProduct=function(){Mccp.Basket.AddProduct.initializeBase(this);this.PSP="";this.PSPTermAccepted=false;this.Accessories=[];this.DetourToWarranty=false;this.BundlePSP=[]};
Mccp.Basket.AddProduct.prototype={initialize:function(){Mccp.Basket.AddProduct.callBaseMethod(this,"initialize")},get_ParentProductId:function(){return this.ParentProductId},set_ParentProductId:function(a){this.ParentProductId=a},get_PSP:function(){return this.PSP},set_PSP:function(a){this.PSP=a},get_PSPTermAccepted:function(){return this.PSPTermAccepted},set_PSPTermAccepted:function(a){this.PSPTermAccepted=a},GenericUpdateAccessories:function(a,b){b==true?this.addAccessories(a):this.removeAccessories(a)},
UpdateWarrantyDetour:function(a){this.DetourToWarranty=a.checked},UpdateAccessories:function(a){this.GenericUpdateAccessories(a.getAttribute("ProductID"),a.checked)},addAccessories:function(a){Array.add(this.Accessories,a)},removeAccessories:function(a){Array.remove(this.Accessories,a)},get_Accessories:function(){return this.Accessories},get_BundlePSP:function(){return this.BundlePSP},addAtBundlePSP:function(a,b){this.BundlePSP[a]=b;if(this.BundlePSP.length>0){this.PSP="";for(var c=0;c<this.BundlePSP.length;c++){bPSP=
this.BundlePSP[c];this.PSP=bPSP==""||bPSP==null?this.PSP.concat(","):this.PSP.concat(bPSP+",")}if(this.PSP.charAt(this.PSP.length-1)==",")this.PSP=this.PSP.substr(0,this.PSP.length-1)}},AddProductWithoutWarranty:function(a,b){var c=new Date;c.setDate(c.getDate()+1);document.cookie="AddToCartSet=true;expires="+c.toGMTString()+";path=/;";document.cookie="PreviousShoppingUrl="+document.URL+";expires="+c.toGMTString()+";path=/;";c="";if(b!="")c+="&pcname="+encodeURIComponent(b);$redirect("/Order/AddToCart.ashx?SKU="+
encodeURIComponent(this.ParentProductId)+"&AddParentSku="+encodeURIComponent(a)+c);return false},AddSelectedAccessoriesAndWarranty:function(a,b,c,d,f){if(a){if((this.Accessories==null||this.Accessories=="")&&(this.PSP==null||this.PSP=="")){DisplayTermsNotAcceptedMessage(b);return false}if(this.PSP!=null&&this.PSP!="")if(this.PSP=="0"||this.PSPTermAccepted)this.redirectToBasket(this.ParentProductId,this.Accessories,a,d,f);else{typeof DisplayTermsNotAcceptedMessage!="function"?alert(c):DisplayTermsNotAcceptedMessage(c);
return false}else this.Accessories!=null&&this.Accessories!=""&&this.redirectToBasket(this.ParentProductId,this.Accessories,a,d)}else{if((this.Accessories==null||this.Accessories=="")&&(this.PSP==null||this.PSP=="")){DisplayTermsNotAcceptedMessage(b);return false}if(this.PSP!=null&&this.PSP=="0")this.redirectToBasket(this.ParentProductId,this.Accessories,a,d,f);else if(this.PSP!=null&&this.PSP!=""&&!this.PSPTermAccepted){DisplayTermsNotAcceptedMessage(c);return false}this.PSP!=null&&this.PSP!=""&&
this.PSPTermAccepted&&this.redirectToBasket(this.ParentProductId,this.Accessories,a,d,f)}},ValidateAccessoriesAndWarranty:function(a,b){if((this.Accessories==null||this.Accessories==""||this.Accessories=="0")&&(this.PSP==null||this.PSP==""||this.PSP=="0"))b.IsValid=false},ValidateWarranty:function(a,b){if(this.PSP!=null&&this.PSP!=""&&this.PSP!="0"&&!this.PSPTermAccepted)b.IsValid=false},WarrantyPage_ValidateWarranty:function(a,b){basket.ValidateWarranty(a,b);ManageAllAccSummary(a.validationGroup,
b.IsValid)},redirectToBasketWithDefault:function(a,b){this.redirectToBasket(this.ParentProductId,this.Accessories,a,b)},redirectToBasket:function(a,b,c,d,f){var e=new Date;e.setDate(e.getDate()+1);document.cookie="AddToCartSet=true;expires="+e.toGMTString()+";path=/";document.cookie="PreviousShoppingUrl="+document.URL+";expires="+e.toGMTString()+";path=/;";e="";if(b!="")e+="&Accessories="+encodeURIComponent(b);if(this.PSP!=""&&this.PSP!="0")e+="&PSP="+encodeURIComponent(this.PSP);if(d!=null&&d!="")e+=
"&pcname="+encodeURIComponent(d);a=this.DetourToWarranty&&this.PSP=="0"?"/Catalog/Warranty.aspx?SKU="+encodeURIComponent(a)+"&WarrantyMode=false"+e:"/Order/AddToCart.ashx?SKU="+encodeURIComponent(a)+"&AddParentSku="+encodeURIComponent(c)+e;if(typeof f!="undefined")f.$redirect(a);else window.location.href=a;return false},redirectToWishList:function(a,b){var c="";if(b!=null&&b!="")c+="&pcname="+encodeURIComponent(b);if(window.location.search.indexOf("WLParentURL")<0){c+="&WLParentURL=";c+=encodeURIComponent(window.location.pathname)}var d=
"";d="/Order/OrderWishList.aspx?SKU="+encodeURIComponent(a)+c;$redirect(d);return false},redirectToPriceWatchList:function(a,b){var c="";if(b!=null&&b!="")c+="&pcname="+encodeURIComponent(b);if(window.location.search.indexOf("PWParentURL")<0){c+="&PWParentURL=";c+=encodeURIComponent(window.location.pathname)}var d="";d="/Marketing/PriceWatcher.aspx?SKU="+encodeURIComponent(a)+c;$redirect(d);return false},dispose:function(){this.DefaultToWarranty=this.Accessories=this.PSPTermAccepted=this.PSP=this.ParentProductId=
null;Mccp.Basket.AddProduct.callBaseMethod(this,"dispose")}};Mccp.Basket.AddProduct.registerClass("Mccp.Basket.AddProduct",Sys.Component,Sys.IDisposable);typeof Sys!=="undefined"&&Sys.Application.notifyScriptLoaded();
function AddToCartButton(a){var b=a.getAttribute("ProductID"),c=a.getAttribute("InAccessoriesMode");a=a.getAttribute("PCName");if(b!="")if(c=="True"){basket.addAccessories(b);basket.redirectToBasket(basket.get_ParentProductId(),b,true,a,this.window)}else basket.redirectToBasket(b,basket.get_Accessories(),true,a,this.window)}
function AddToWishListButton(a){var b=a.getAttribute("ProductID"),c=a.getAttribute("PCName");a=a.getAttribute("AuthenticatedUser");b!=""&&basket.redirectToWishList(b,c,a);return false}function AddToPriceWatchListButton(a){var b=a.getAttribute("ProductID"),c=a.getAttribute("PCName");a=a.getAttribute("AuthenticatedUser");b!=""&&basket.redirectToPriceWatchList(b,c,a);return false}function AddPSPToCart(a){a=a.getAttribute("warrantyId");if(a!="")return basket.set_PSP(a)}
function getCookie(a){if(document.cookie.length>0){c_start=document.cookie.indexOf(a+"=");if(c_start!=-1){c_start=c_start+a.length+1;c_end=document.cookie.indexOf(";",c_start);if(c_end==-1)c_end=document.cookie.length;return unescape(document.cookie.substring(c_start,c_end))}}return""}function GetPWItem(){UpdatePriceWatch("ctl00_uchead_PWC")}function showMoreCards(a,b){$get(b).style.display="block";a.onclick=function(){return false};a.style.cursor="default";a.style.color="#CCC"}
function ShowProcessingPageAfterValidate(a,b,c){if(window.postBackSource==null&&c!=null)window.postBackSource=c;ValidtionReset();if(Page_ClientValidate("")&&Page_ClientValidate("GiftCard")){ShowProcessingPage(a,b);return true}else{window.postBackSource=null;return false}}
function ShowProcessingPage(a,b){obj=$get(a);if(obj!=null)obj.style.display="none";obj=$get(b);if(obj!=null){var c=$getElementsByClassName("processing-image","img",$get(b))[0];c.src=c.src+"?"+(new Date).getTime();obj.style.display="block";c.style.display="block"}}function CountLeft(a,b,c){if(a.value.length>c)a.value=a.value.substring(0,c);else b.value=a.value.length}
function ToggleExpandOrCollapse(a,b,c,d){tabObj=$get(a);if(tabObj!=null){imgObjs=tabObj.getElementsByTagName("img");pObjs=tabObj.getElementsByTagName("p");areaObj=$get(b);if(areaObj!=null)if(tabObj!=null)if(d)if(areaObj.style.display=="none"){pObjs[0].className="on";imgObjs[0].src="../images/common/buttons/minus.gif";areaObj.style.display="block"}else{pObjs[0].className="";imgObjs[0].src="../images/common/buttons/plus.gif";areaObj.style.display="none"}else{pObjs[0].className="";imgObjs[0].src="../images/common/buttons/plus.gif";
areaObj.style.display="none"}}}function TabSelected(a,b,c,d,f,e,g){ToggleExpandOrCollapse(b,f,false,false);ToggleExpandOrCollapse(c,e,false,false);ToggleExpandOrCollapse(a,d,g,true)}function InitializeTab(a,b){targetControl=$get(b);imgControl=$get(a);if(targetControl!=null&&imgControl!=null)if(parentObj=imgControl.parentNode)targetControl.style.display=="none"?parentObj.className="":parentObj.className="on"}
function ToggleOnOff(a,b){targetControl=$get(b);if(targetControl!=null&&a!=null)if(targetControl.style.display=="none"){a.src="../images/common/buttons/minus.gif";targetControl.style.display="block";targetControl.Visible="true"}else{a.src="../images/common/buttons/plus.gif";targetControl.style.display="none";targetControl.Visible="false"}}
function KioskPrint(a,b){if(b=="True")$get("Duplicate").style.display="block";if(a=="True")window.external.print();else{document.body.insertAdjacentHTML("beforeEnd",'<object id="WebBrowser1" width="0" height="0" classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></object>');if(WebBrowser1!=null){WebBrowser1.ExecWB(6,2,3);WebBrowser1.outerHTML=""}}if(b=="True")$get("Duplicate").style.display="none"}
function KioskAutoPrint(a,b){a=="False"&&document.body.insertAdjacentHTML("beforeEnd",'<object id="WebBrowser1" width="0" height="0" classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></object>');for(i=0;i<b;i++)if(a=="True")window.external.print();else WebBrowser1!=null&&WebBrowser1.ExecWB(6,2,3);WebBrowser1.outerHTML=""}function OnProcessing(){ShowProcessingPage("pagecontentfull","divprocessing");document.aspnetForm.submit()}
function OpenReturnFormConfirmationPopUp(){popUp("ReturnFormPopUp.aspx",null,"left=200,top=200,height=300,width=600,status=yes,toolbar=no,scrollbar=yes,menubar=no,location=no")}function UpdateWishList(a){a=$get(a);if(userInformation.WishListItems>0){if(a!=null){a.innerHTML="("+userInformation.WishListItems+")";a.style.display="block"}}else if(a!=null){a.style.display="none";a.innerHTML=""}}
function UpdatePriceWatch(a){a=$get(a);var b=getCookie("PriceWatchCookie");if(b!=null&&getCookie("FirstName")!="")if(b>0){if(a!=null){a.innerHTML="("+escape(b)+")";a.style.display="block"}}else{if(a!=null){a.style.display="none";a.innerHTML=""}}else if(a!=null){a.style.display="none";a.innerHTML=""}}
function UpdateWishListFromCookie(a){a=$get(a);if(getCookie("WishListItems")>0&&getCookie("FirstName")!=""){if(a!=null){a.innerHTML="("+escape(getCookie("WishListItems"))+")";a.style.display="block"}}else if(a!=null){a.style.display="none";a.innerHTML=""}}
function UpdateQuickCart(a,b){var c=$get("itemqty"),d=$get(a),f=$get(b),e=$get("cartitemqty");if(userInformation.CartItems>0){if(d!=null)d.innerHTML=userInformation.CartItems;if(c!=null)c.style.display="block"}else{if(d!=null)d.innerHTML="";if(c!=null)c.style.display="none";if(e!=null){e.onmouseover=null;e.onmouseout=null}}if(f!=null)f.innerHTML=unescape(userInformation.CartTotal)}
function UpdateQuickCartFromCookie(a,b){var c=$get("itemqty"),d=$get(a),f=$get(b),e=$get("cartitemqty");if(getCookie("CartItems")>0){if(d!=null)d.innerHTML=escape(getCookie("CartItems"));if(c!=null)c.style.display="block"}else{if(d!=null)d.innerHTML="";if(c!=null)c.style.display="none";if(e!=null){e.onmouseover=null;e.onmouseout=null}}if(f!=null)f.innerHTML=unescape(getCookie("CartTotal"))}
function UpdateCartPreviewRollOverSubtotal(a){a=$get(a);if(a!=null)a.innerHTML=unescape(userInformation.CartTotal)}function UpdateCartPreviewRollOverSubtotalFromCookie(a){a=$get(a);if(a!=null)a.innerHTML=unescape(getCookie("CartTotal"))}function CallupBankUrl(a,b,c,d){document.BankRequestForm.PaReq.value=c;document.BankRequestForm.MD.value=d;document.BankRequestForm.TermUrl.value=b;document.BankRequestForm.action=a;document.BankRequestForm.submit();window.focus()}
function ValidateBankResponse(){parent.OnProcessing()}function PopupPrintBasket(){winStats="width=800,height=700,location=0,menubar=0,scrollbars=yes,status=0,toolbar=0";popUp("PrintableCart.aspx","_new",winStats);return false}function PopulateCartPreviewRollover(){getCookie("CartItems")>0&&JsLib.UI.InjectHTML("/Order/CartRolloverContent.aspx?QuickCartItemsIterationId="+getCookie("QuickCartItemsIterationId"),"CartPreviewRolloverItemsDiv","CartPreviewRolloverItemsDiv")};
