categoryDisplayJS={entitledItems:[],selectedProducts:new Object(),selectedAttributes:new Object(),errorMessages:new Object(),langId:"-1",storeId:"",catalogId:"",orderId:"",ajaxShopCart:true,ajaxMyAccount:true,contextChanged:false,isHistory:false,merchandisingAssociationItems:[],baseCatalogEntryDetails:[],associationThumbnailIndex:1,totalAssociationCount:0,baseItemAddedToCart:false,merchandisingProductAssociationAddToCart:false,merchandisingProductAssociationForm:"",isParentBundleBean:false,userType:"",allowAccessoryDialog:false,allowZipCodeDialog:false,moreInfoUrl:"",displayPrevAssociation:"",displayNextAssociation:"",defaultItemArray:[],currentPageType:"",currentCatalogEntryId:"",entitledItemJsonObject:null,entitledItemEspotJsonObject:null,quickviewItemId:null,quickviewPairedItemId:null,storeFlow:"",replacementProgramType:"",replacementProgramFrequency:"",setReplacementProgramType:function(replacementProgramType){this.replacementProgramType=replacementProgramType;},getReplacementProgramType:function(){return this.replacementProgramType;},setReplacementProgramFrequency:function(replacementProgramFrequency){this.replacementProgramFrequency=replacementProgramFrequency;},getReplacementProgramFrequency:function(){return this.replacementProgramFrequency;},trackDCSAddToCartClick:function(partNumber,category){var dcsuri="on_release_product_details_add_to_cart_"+partNumber;var ti="on_release_product_details_add_to_cart_"+partNumber;var cg_n="add_to_cart";if(this.getReplacementProgramType()!=""){if(this.getReplacementProgramType()=="oneTime"){dcsuri="on_release_product_details_add_to_cart_one_time_purchase";ti="on_release_product_details_add_to_cart_one_time_purchase_"+category;}else{if(this.getReplacementProgramType()=="frequently"){dcsuri="on_release_product_details_add_to_cart_replacement_program_"+this.getReplacementProgramFrequency()+"months";ti="on_release_product_details_add_to_cart_replacement_program_"+this.getReplacementProgramFrequency()+"months_"+category;}}}dcsMultiTrack("DCS.dcsuri",dcsuri,"WT.ti",ti,"WT.cg_n",cg_n);},setStoreFlow:function(storeFlow){this.storeFlow=storeFlow;},setPriceFunction:function(colorcheck,catalogEntryID){var jsondata=document.getElementById("entitledItem_"+catalogEntryID).innerHTML;var objectArray=dojo.fromJson(jsondata);var entries=objectArray;for(var i=0;i<entries.length;i++){if(colorcheck==entries[i].Attributes1){tempPrice=entries[i].Price1;break;}}document.getElementById("MyParagraphTag").innerHTML=tempPrice;},initHistory:function(elementId,changeUrl){var historyObject=new categoryDisplayJS.HistoryTracker(elementId,changeUrl);dojo.back.setInitialState(historyObject);},setAjaxShopCart:function(ajaxShopCart){this.ajaxShopCart=ajaxShopCart;},setAjaxMyAccount:function(ajaxMyAccount){this.ajaxMyAccount=ajaxMyAccount;},setCommonParameters:function(langId,storeId,catalogId,userType){this.langId=langId;this.storeId=storeId;this.catalogId=catalogId;this.userType=userType;},setEntitledItems:function(entitledItemArray){this.entitledItems=entitledItemArray;},setSelectedAttribute:function(selectedAttributeName,selectedAttributeValue){console.debug(selectedAttributeName+" : "+selectedAttributeValue);this.selectedAttributes[selectedAttributeName]=selectedAttributeValue;this.moreInfoUrl=this.moreInfoUrl+"&"+selectedAttributeName+"="+selectedAttributeValue;},setSelectedAttributeOfProduct:function(productId,selectedAttributeName,selectedAttributeValue){selectedAttributesForProduct=new Object();if(this.selectedProducts[productId]){selectedAttributesForProduct=this.selectedProducts[productId];}selectedAttributesForProduct[selectedAttributeName]=selectedAttributeValue;this.selectedProducts[productId]=selectedAttributesForProduct;},gotoASubCategoryDisplayPage:function(pageNum,totalPages,pageSize,subCatDispUrl){pageNum=trim(pageNum);if(pageNum==""){MessageHelper.formErrorHandleClient(document.getElementById("subCategoriesListDisplayPageNum").id,MessageHelper.messages.ERROR_EMPTY_NUM);return;}if(MessageHelper.IsNumeric(pageNum,false)==false){MessageHelper.formErrorHandleClient(document.getElementById("subCategoriesListDisplayPageNum").id,MessageHelper.messages.ERROR_PAGE_NUM);return;}if(pageNum>=1&&pageNum<=totalPages){MessageHelper.hideAndClearMessage();var url=subCatDispUrl+"&beginIndex="+((pageNum-1)*pageSize);this.loadSubCategoryContentURL(url);}else{MessageHelper.formErrorHandleClient(document.getElementById("subCategoriesListDisplayPageNum").id,MessageHelper.messages.ERROR_PAGE_NUM);return;}},getCatalogEntryId:function(){var attributeArray=[];for(attribute in this.selectedAttributes){attributeArray.push(attribute+"_"+this.selectedAttributes[attribute]);}return this.resolveSKU(attributeArray);},getCatalogEntryIdforProduct:function(selectedAttributes){var attributeArray=[];for(attribute in selectedAttributes){attributeArray.push(attribute+"_"+selectedAttributes[attribute]);}return this.resolveSKU(attributeArray);},resolveSKU:function(attributeArray){console.debug("Resolving SKU >> "+attributeArray+">>"+this.entitledItems);var catentry_id="";var attributeArrayCount=attributeArray.length;for(x in this.entitledItems){var catentry_id=this.entitledItems[x].catentry_id;var Attributes=this.entitledItems[x].Attributes;var attributeCount=0;for(index in Attributes){attributeCount++;}if(attributeArrayCount==0&&attributeCount==0){return catentry_id;}if(attributeCount!=0&&attributeArrayCount>=attributeCount){var matchedAttributeCount=0;for(attributeName in attributeArray){var attributeValue=attributeArray[attributeName];if(attributeValue in Attributes){matchedAttributeCount++;}}if(attributeCount==matchedAttributeCount){console.debug("CatEntryId:"+catentry_id+" for Attribute: "+attributeArray);return catentry_id;}}}return null;},updateParamObject:function(params,key,value,toArray,index){if(params==null){params=[];}if(params[key]!=null&&toArray){if(dojo.lang.isArrayLike(params[key])){if(index!=null&&index!=""){params[key][index]=value;}else{params[key].push(value);}}else{var tmpValue=params[key];params[key]=[];params[key].push(tmpValue);params[key].push(value);}}else{if(index!=null&&index!=""&&index!=-1){params[key+"_"+index]=value;}else{if(index==-1){var i=1;while(params[key+"_"+i]!=null){i++;}params[key+"_"+i]=value;}else{params[key]=value;}}}return params;},setDefaultItem:function(productId,entitledItemId){this.defaultItemArray[productId]=entitledItemId;},getDefaultItem:function(productId){return this.defaultItemArray[productId];},AddBundle2ShopCartAjax:function(form){var params=[];params.storeId=this.storeId;params.catalogId=this.catalogId;params.langId=this.langId;params.orderId=".";params.calculationUsage="-1,-2,-3,-4,-5,-6,-7";var productCount=form.numberOfProduct.value;for(var i=1;i<=productCount;i++){var catEntryId=form["catEntryId_"+i].value;if(this.selectedProducts[catEntryId]){catEntryId=this.getCatalogEntryIdforProduct(this.selectedProducts[catEntryId]);}var qty=form["quantity_"+i].value;if(qty==null||qty==""||qty<=0){MessageHelper.displayErrorMessage(MessageHelper.messages.QUANTITY_INPUT_ERROR);return;}if(qty!=null&&qty!=""&&catEntryId!=null){this.updateParamObject(params,"catEntryId",catEntryId,false,-1);this.updateParamObject(params,"quantity",qty,false,-1);this.baseItemAddedToCart=true;}else{MessageHelper.displayErrorMessage(MessageHelper.messages.ERR_RESOLVING_SKU);return;}var contractIdElements=document.getElementsByName("contractSelectForm_contractId_"+catEntryId);if(contractIdElements!=null&&contractIdElements!="undefined"){for(j=0;j<contractIdElements.length;j++){if(contractIdElements[j].checked){form["contractId_"+i].value=contractIdElements[j].value;break;}}}var contractId=form["contractId_"+i].value;if(contractId!=null&&contractId!=""){this.updateParamObject(params,"contractId",contractId,false,-1);}}if(!submitRequest()){return;}cursor_wait();wc.service.invoke("AjaxAddOrderItem",params);},AddBundle2ShopCart:function(form){form.URL.value="AjaxOrderItemDisplayView";var productCount=form.numberOfProduct.value;for(var i=1;i<=productCount;i++){var catEntryId=form["catEntryId_"+i].value;if(this.selectedProducts[catEntryId]){catEntryId=this.getCatalogEntryIdforProduct(this.selectedProducts[catEntryId]);if(catEntryId!=null){form["catEntryId_"+i].value=catEntryId;}else{MessageHelper.displayErrorMessage(MessageHelper.messages.ERR_RESOLVING_SKU);return;}}var qty=form["quantity_"+i].value;if(qty==null||qty==""||qty<=0){MessageHelper.displayErrorMessage(MessageHelper.messages.QUANTITY_INPUT_ERROR);return;}var contractIdElements=document.getElementsByName("contractSelectForm_contractId_"+catEntryId);if(contractIdElements!=null&&contractIdElements!="undefined"){for(j=0;j<contractIdElements.length;j++){if(contractIdElements[j].checked){form["contractId_"+i].value=contractIdElements[j].value;break;}}}}if(!submitRequest()){return;}form.submit();},Add2ShopCart:function(entitledItemId,form,quantity,isPopup){var entitledItemJSON;if(dojo.byId(entitledItemId)!=null){entitledItemJSON=eval("("+dojo.byId(entitledItemId).innerHTML+")");}else{entitledItemJSON=this.getEntitledItemJsonObject();}this.setEntitledItems(entitledItemJSON);var catalogEntryId=this.getCatalogEntryId();if(catalogEntryId!=null){if(this.merchandisingProductAssociationAddToCart){this.AddAssociation2ShopCart(catalogEntryId,quantity);return;}form.catEntryId.value=catalogEntryId;form.productId.value=catalogEntryId;this.AddItem2ShopCart(form,quantity);if(dijit.byId("second_level_category_popup")!=null){hidePopup("second_level_category_popup");}}else{if(isPopup==true){if(dijit.byId("second_level_category_popup")!=null){dojo.byId("second_level_category_popup").style.zIndex="1";}MessageHelper.formErrorHandleClient("addToCartLink",MessageHelper.messages.ERR_RESOLVING_SKU);}else{MessageHelper.displayErrorMessage(MessageHelper.messages.ERR_RESOLVING_SKU);}}},AddItem2ShopCart:function(form,quantity){if(!isPositiveInteger(quantity)){MessageHelper.displayErrorMessage(MessageHelper.messages.QUANTITY_INPUT_ERROR);return;}form.quantity.value=quantity;var contractIdElements=document.getElementsByName("contractSelectForm_contractId");if(contractIdElements!=null&&contractIdElements!="undefined"){for(i=0;i<contractIdElements.length;i++){if(contractIdElements[i].checked){form.contractId.value=contractIdElements[i].value;break;}}}if(!submitRequest()){return;}form.submit();},Add2ShopCartAjax:function(entitledItemId,quantity,isPopup){var entitledItemJSON;if(dojo.byId(entitledItemId)!=null){entitledItemJSON=eval("("+dojo.byId(entitledItemId).innerHTML+")");}else{entitledItemJSON=this.getEntitledItemJsonObject();}this.setEntitledItems(entitledItemJSON);var catalogEntryId=this.getCatalogEntryId();if(catalogEntryId!=null){this.AddItem2ShopCartAjax(catalogEntryId,quantity);this.baseItemAddedToCart=true;if(dijit.byId("second_level_category_popup")!=null){hidePopup("second_level_category_popup");}}else{if(isPopup==true){if(dijit.byId("second_level_category_popup")!=null){dojo.byId("second_level_category_popup").style.zIndex="1";}MessageHelper.formErrorHandleClient("addToCartLinkAjax",MessageHelper.messages.ERR_RESOLVING_SKU);}else{MessageHelper.displayErrorMessage(MessageHelper.messages.ERR_RESOLVING_SKU);this.baseItemAddedToCart=false;}}},setEntitledItemJsonObject:function(jsonObject){this.entitledItemJsonObject=jsonObject;},getEntitledItemJsonObject:function(){return this.entitledItemJsonObject;},ReplaceItemAjax:function(entitledItemId,quantity){var entitledItemJSON;if(dojo.byId(entitledItemId)!=null){entitledItemJSON=eval("("+dojo.byId(entitledItemId).innerHTML+")");}else{entitledItemJSON=this.getEntitledItemJsonObject();}this.setEntitledItems(entitledItemJSON);var catalogEntryId=this.getCatalogEntryId();var removeOrderItemId="";var removeOrderItemId=replaceOrderItemId;var typeId=document.getElementById("shipmentTypeId");var addressId="";var shipModeId="";if(typeId!=null&&typeId!=""){if(typeId.value=="2"){addressId=document.getElementById("MS_ShipmentAddress_"+removeOrderItemId).value;shipModeId=document.getElementById("MS_ShippingMode_"+removeOrderItemId).value;}else{addressId=document.getElementById("addressId_all").value;shipModeId=document.getElementById("shipModeId_all").value;}}if(catalogEntryId!=null){if(removeOrderItemId==""){}else{this.ReplaceItemAjaxHelper(catalogEntryId,quantity,removeOrderItemId,addressId,shipModeId);}}else{MessageHelper.displayErrorMessage(MessageHelper.messages.ERR_RESOLVING_SKU);}},ReplaceItemNonAjax:function(entitledItemId,quantity,form){var entitledItemJSON;if(dojo.byId(entitledItemId)!=null){entitledItemJSON=eval("("+dojo.byId(entitledItemId).innerHTML+")");}else{entitledItemJSON=this.getEntitledItemJsonObject();}this.setEntitledItems(entitledItemJSON);var catalogEntryId=this.getCatalogEntryId();var removeOrderItemId="";var removeOrderItemId=replaceOrderItemId;if(catalogEntryId!=null){if(removeOrderItemId==""){}else{form.orderItemId.value=removeOrderItemId;var addressId,shipModeId;if(quantity==0){console.debug("An invalid quantity was selected");}if(form.shipmentTypeId!=null&&form.shipmenTypeId!=""){if(form.shipmentTypeId.value=="2"){addressId=document.getElementById("MS_ShipmentAddress_"+removeOrderItemId).value;shipModeId=document.getElementById("MS_ShippingMode_"+removeOrderItemId).value;}else{addressId=document.getElementById("addressId_all").value;shipModeId=document.getElementById("shipModeId_all").value;}form.URL.value="OrderChangeServiceItemAdd?calculationUsage=-1,-2,-3,-4,-5,-6,-7&catEntryId="+catalogEntryId+"&quantity="+quantity+"&addressId="+addressId+"&shipModeId="+shipModeId+"&URL=OrderChangeServiceShipInfoUpdate?URL="+form.URL.value;}else{form.URL.value="OrderChangeServiceItemAdd?calculationUsage=-1,-2,-3,-4,-5,-6,-7&catEntryId="+catalogEntryId+"&quantity="+quantity+"&URL="+form.URL.value;}if(!submitRequest()){return;}form.submit();}}else{MessageHelper.displayErrorMessage(MessageHelper.messages.ERR_RESOLVING_SKU);}},AddItem2ShopCartAjax:function(catEntryIdentifier,quantity){if(!isPositiveInteger(quantity)){MessageHelper.displayErrorMessage(MessageHelper.messages.QUANTITY_INPUT_ERROR);return;}var params=[];params.storeId=this.storeId;params.catalogId=this.catalogId;params.langId=this.langId;params.orderId=".";params.catEntryId=catEntryIdentifier;params.quantity=quantity;params.calculationUsage="-1,-2,-3,-4,-5,-6,-7";var contractIdElements=document.getElementsByName("contractSelectForm_contractId");if(contractIdElements!=null&&contractIdElements!="undefined"){for(i=0;i<contractIdElements.length;i++){if(contractIdElements[i].checked){params.contractId=contractIdElements[i].value;break;}}}params.zipCode=this.getCurrentUserZipCode();if(params.zipCode==null){if(this.allowZipCodeDialog){var zipCodePopup=dijit.byId("zip_code_popup");zipCodePopup.show();var args=arguments;var handle=dojo.connect(zipCodePopup,"onZipCodeSelected",null,dojo.hitch(this,function(){this.AddItem2ShopCartAjax.apply(this,args);}));var handle2=dojo.connect(zipCodePopup,"hide",null,function(){dojo.disconnect(handle);dojo.disconnect(handle2);});return;}}if(!submitRequest()){return;}cursor_wait();if(this.ajaxShopCart){wc.service.invoke("AjaxAddOrderItem",params);this.baseItemAddedToCart=true;}else{wc.service.invoke("AjaxAddOrderItem_shopCart",params);this.baseItemAddedToCart=true;}if(document.getElementById("shoppingCartBar")){document.getElementById("shoppingCartBar").focus();}},ReplaceItemAjaxHelper:function(catalogEntryId,qty,removeOrderItemId,addressId,shipModeId){var params=[];params.storeId=this.storeId;params.catalogId=this.catalogId;params.langId=this.langId;params.orderItemId=removeOrderItemId;params.orderId=(this.orderId!=null&&this.orderId!="undefined"&&this.orderId!="")?this.orderId:".";params.calculationUsage="-1,-2,-3,-4,-5,-6,-7";var params2=[];params2.storeId=this.storeId;params2.catalogId=this.catalogId;params2.langId=this.langId;params2.catEntryId=catalogEntryId;params2.quantity=qty;params2.orderId=(this.orderId!=null&&this.orderId!="undefined"&&this.orderId!="")?this.orderId:".";params2.calculationUsage="-1,-2,-3,-4,-5,-6,-7";var params3=[];params3.storeId=this.storeId;params3.catalogId=this.catalogId;params3.langId=this.langId;params3.orderId=(this.orderId!=null&&this.orderId!="undefined"&&this.orderId!="")?this.orderId:".";params3.calculationUsage="-1,-2,-3,-4,-5,-6,-7";params3.allocate="***";params3.backorder="***";params3.remerge="***";params3.check="*n";var shipInfoUpdateNeeded=false;if(addressId!=null&&addressId!=""&&shipModeId!=null&&shipModeId!=""){params3.addressId=addressId;params3.shipModeId=shipModeId;shipInfoUpdateNeeded=true;}wc.service.declare({id:"AjaxReplaceItem",actionId:"AjaxReplaceItem",url:"AjaxOrderChangeServiceItemDelete",formId:"",successHandler:function(serviceResponse){if(!shipInfoUpdateNeeded){wc.service.invoke("AjaxAddOrderItem",params2);}else{wc.service.invoke("AjaxAddOrderItemTemp",params2);}},failureHandler:function(serviceResponse){if(serviceResponse.errorMessage){MessageHelper.displayErrorMessage(serviceResponse.errorMessage);}else{if(serviceResponse.errorMessageKey){MessageHelper.displayErrorMessage(serviceResponse.errorMessageKey);}}cursor_clear();}});wc.service.declare({id:"AjaxAddOrderItemTemp",actionId:"AjaxAddOrderItemTemp",url:"AjaxOrderChangeServiceItemAdd",formId:"",successHandler:function(serviceResponse){wc.service.invoke("OrderItemAddressShipMethodUpdate",params3);},failureHandler:function(serviceResponse){MessageHelper.displayErrorMessage(serviceResponse.errorMessageKey);}});if(!submitRequest()){return;}cursor_wait();wc.service.invoke("AjaxReplaceItem",params);},AddBundle2WishList:function(form){var productCount=form.numberOfProduct.value;for(var i=1;i<=productCount;i++){var catEntryId=form["catEntryId_"+i].value;if(this.selectedProducts[catEntryId]){catEntryId=this.getCatalogEntryIdforProduct(this.selectedProducts[catEntryId]);if(catEntryId!=null){form["catEntryId_"+i].value=catEntryId;}else{MessageHelper.displayErrorMessage(MessageHelper.messages.ERR_RESOLVING_SKU);return;}}}form.action="InterestItemAdd";form.page.value="customerlinkwishlist";if(this.ajaxMyAccount){if(this.userType=="G"){form.URL.value="InterestItemDisplay";}else{form.URL.value="AjaxLogonForm";}}else{if(this.userType=="G"){form.URL.value="InterestItemDisplay";}else{form.URL.value="NonAjaxAccountWishListDisplayView";}}if(!submitRequest()){return;}form.submit();},AddBundle2WishListAjax:function(form){var params=[];params.storeId=this.storeId;params.catalogId=this.catalogId;params.langId=this.langId;params.updateable=0;params.orderId=".";var catEntryArray=[];catEntryArray=form.catEntryIDS.value.toString().split(",");for(var i=0;i<catEntryArray.length;i++){var qty=document.getElementById("quantity_"+catEntryArray[i]).value;var catEntryId=catEntryArray[i];if(this.selectedProducts[catEntryArray[i]]){catEntryId=this.getCatalogEntryIdforProduct(this.selectedProducts[catEntryArray[i]]);}if(qty==0||qty==null){qty=1;}if(qty!=null&&qty!=""&&catEntryId!=null){this.updateParamObject(params,"catEntryId",catEntryId,false,-1);this.updateParamObject(params,"quantity",qty,false,-1);}else{MessageHelper.displayErrorMessage(MessageHelper.messages.ERR_RESOLVING_SKU);return;}}if(!submitRequest()){return;}cursor_wait();wc.service.invoke("AjaxInterestItemAdd",params);},Add2WishListAjaxByID:function(catalogEntryId){if(catalogEntryId!=null){var params=[];params.storeId=this.storeId;params.catalogId=this.catalogId;params.langId=this.langId;params.catEntryId=catalogEntryId;params.updateable=0;params.URL="SuccessfulAJAXRequest";if(document.getElementById("controllerURLWishlist")!=null&&document.getElementById("controllerURLWishlist")!="undefined"){CommonControllersDeclarationJS.setControllerURL("WishlistDisplay_Controller",document.getElementById("controllerURLWishlist").value);}if(!submitRequest()){return;}cursor_wait();if(this.ajaxShopCart){wc.service.invoke("AjaxInterestItemAdd",params);}else{wc.service.invoke("AjaxInterestItemAdd_shopCart",params);}}else{if(this.storeFlow=="ORN"||this.storeFlow=="GRN"){showInterestItemAddError(MessageHelper.messages.ERR_RESOLVING_SKU);}else{MessageHelper.displayErrorMessage(MessageHelper.messages.ERR_RESOLVING_SKU);}}},Add2WishListAjax:function(entitledItemId){var entitledItemJSON;if(dojo.byId(entitledItemId)!=null){entitledItemJSON=eval("("+dojo.byId(entitledItemId).innerHTML+")");}else{entitledItemJSON=this.getEntitledItemJsonObject();}this.setEntitledItems(entitledItemJSON);var catalogEntryId=this.getCatalogEntryId();this.Add2WishListAjaxByID(catalogEntryId);},AddItem2WishListAjax:function(itemId){var params=[];params.storeId=this.storeId;params.catalogId=this.catalogId;params.langId=this.langId;params.catEntryId=itemId;params.updateable=0;params.URL="SuccessfulAJAXRequest";if(document.getElementById("controllerURLWishlist")!=null&&document.getElementById("controllerURLWishlist")!="undefined"){CommonControllersDeclarationJS.setControllerURL("WishlistDisplay_Controller",document.getElementById("controllerURLWishlist").value);}if(!submitRequest()){return;}cursor_wait();if(this.ajaxShopCart){wc.service.invoke("AjaxInterestItemAdd",params);}else{wc.service.invoke("AjaxInterestItemAdd_shopCart",params);}},Add2WishList:function(entitledItemId,form){var entitledItemJSON;if(dojo.byId(entitledItemId)!=null){entitledItemJSON=eval("("+dojo.byId(entitledItemId).innerHTML+")");}else{entitledItemJSON=this.getEntitledItemJsonObject();}this.setEntitledItems(entitledItemJSON);var catalogEntryId=this.getCatalogEntryId();this.Add2WishListByID(catalogEntryId,form);},Add2WishListByID:function(catalogEntryId,form){if(catalogEntryId!=null){form.productId.value=catalogEntryId;form.catEntryId.value=catalogEntryId;form.action="InterestItemAdd";form.page.value="customerlinkwishlist";if(this.ajaxMyAccount){if(this.userType=="G"){form.URL.value="InterestItemDisplay";}else{form.URL.value="AjaxLogonForm";}}else{if(this.userType=="G"){form.URL.value="InterestItemDisplay";}else{form.URL.value="NonAjaxAccountWishListDisplayView";}}form.quantity.value="1";if(!submitRequest()){return;}form.submit();}else{MessageHelper.displayErrorMessage(MessageHelper.messages.ERR_RESOLVING_SKU);}},AddItem2WishList:function(form){form.action="InterestItemAdd";form.quantity.value="1";form.page.value="customerlinkwishlist";if(this.ajaxMyAccount){if(this.userType=="G"){form.URL.value="InterestItemDisplay";}else{form.URL.value="AjaxLogonForm";}}else{if(this.userType=="G"){form.URL.value="InterestItemDisplay";}else{form.URL.value="NonAjaxAccountWishListDisplayView";}}if(!submitRequest()){return;}form.submit();},Add2CompareAjax:function(catEntryIdentifier,dragImagePath,url,dragImageDescription){if(compareProductJS!=null){compareProductJS.Add2CompareAjax(catEntryIdentifier,dragImagePath,url,dragImageDescription);}},loadContentURL:function(contentURL){if(!submitRequest()){return;}cursor_wait();CommonControllersDeclarationJS.setControllerURL("CategoryDisplay_Controller",contentURL);wc.render.updateContext("CategoryDisplay_Context");},loadSubCategoryContentURL:function(contentURL){MessageHelper.hideAndClearMessage();if(!submitRequest()){return;}cursor_wait();CommonControllersDeclarationJS.setControllerURL("SubCategoryDisplay_Controller",contentURL);wc.render.updateContext("SubCategoryDisplay_Context");},goBack:function(){categoryDisplayJS.loadContentURL(this.changeUrl);categoryDisplayJS.isHistory=true;},goForward:function(){categoryDisplayJS.loadContentURL(this.changeUrl);isHistory=true;},HistoryTracker:function(elementId,changeUrl){this.elementId=elementId;this.changeUrl=changeUrl;},processBookmarkURL:function(){var bookmarkId=location.hash;if(bookmarkId){bookmarkId=bookmarkId.substring(1,bookmarkId.length);}if(bookmarkId){var indexOfIdentifier=bookmarkId.indexOf("identifier",0);if(indexOfIdentifier>=0){var realUrl=bookmarkId.substring(0,indexOfIdentifier-1);}}if(bookmarkId==null||bookmarkId==""){}},initializeMerchandisingAssociation:function(thumbnailIndex){var associationDisplay=document.getElementById("marchandisingAssociationDisplay");var totalPriceMsg=document.getElementById("totalPriceMsg").value;var baseCatEntryJSON=eval("("+dojo.byId("baseCatEntryDetails").innerHTML+")");this.baseCatalogEntryDetails=baseCatEntryJSON;var basePrice=this.baseCatalogEntryDetails[0].baseCatEntry_Price;this.totalAssociationCount=this.baseCatalogEntryDetails[0].totalAssociations;var identifierJSON="associatedCatEntries_"+thumbnailIndex;var associationEntryJSON=eval("("+dojo.byId(identifierJSON).innerHTML+")");this.merchandisingAssociationItems=associationEntryJSON;var totalPrice=parseFloat(basePrice)+parseFloat(this.merchandisingAssociationItems[0].catEntry_Price);var dragType="";if(this.merchandisingAssociationItems[0].catEntry_Type=="ProductBean"){dragType="product";}else{if(this.merchandisingAssociationItems[0].catEntry_Type=="ItemBean"){dragType="item";}else{if(this.merchandisingAssociationItems[0].catEntry_Type=="PackageBean"){dragType="package";}else{if(this.merchandisingAssociationItems[0].catEntry_Type=="BundleBean"){dragType="bundle";}}}}var widgetHTML="";if(document.getElementById("addToCartLink")){var url="AjaxOrderItemDisplayView?storeId="+this.storeId+"&catalogId="+this.catalogId+"&langId="+this.langId;widgetHTML=widgetHTML+"<form name='OrderItemAddForm_"+this.merchandisingAssociationItems[0].catEntry_Identifier+"' action='OrderChangeServiceItemAdd' method='post' id='OrderItemAddForm_"+this.merchandisingAssociationItems[0].catEntry_Identifier+"'>\n<input type='hidden' name='storeId' value='"+this.storeId+"' id='OrderItemAddForm_storeId_"+this.merchandisingAssociationItems[0].catEntry_Identifier+"'/>\n<input type='hidden' name='orderId' value='.' id='OrderItemAddForm_orderId_"+this.merchandisingAssociationItems[0].catEntry_Identifier+"'/>\n<input type='hidden' name='catalogId' value='"+this.catalogId+"' id='OrderItemAddForm_orderId_"+this.merchandisingAssociationItems[0].catEntry_Identifier+"'/>\n<input type='hidden' name='URL' value='"+url+"' id='OrderItemAddForm_url_"+this.merchandisingAssociationItems[0].catEntry_Identifier+"'/>\n<input type='hidden' name='errorViewName' value='InvalidInputErrorView' id='OrderItemAddForm_errorViewName_"+this.merchandisingAssociationItems[0].catEntry_Identifier+"'/>\n<input type='hidden' name='catEntryId' value='"+this.merchandisingAssociationItems[0].catEntry_Identifier+"' id='OrderItemAddForm_catEntryId_"+this.merchandisingAssociationItems[0].catEntry_Identifier+"'/>\n<input type='hidden' name='productId' value='"+this.merchandisingAssociationItems[0].catEntry_Identifier+"' id='OrderItemAddForm_productId_"+this.merchandisingAssociationItems[0].catEntry_Identifier+"'/>\n<input type='hidden' value='1' name='quantity' id='OrderItemAddForm_quantity_"+this.merchandisingAssociationItems[0].catEntry_Identifier+"'/>\n<input type='hidden' value='' name='page' id='OrderItemAddForm_page_"+this.merchandisingAssociationItems[0].catEntry_Identifier+"'/>\n<input type='hidden' value='-1,-2,-3,-4,-5,-6,-7' name='calculationUsage' id='OrderItemAddForm_calcUsage_"+this.merchandisingAssociationItems[0].catEntry_Identifier+"'/>\n<input type='hidden' value='0' name='updateable' id='OrderItemAddForm_updateable_"+this.merchandisingAssociationItems[0].catEntry_Identifier+"'/>\n</form>\n";}widgetHTML=widgetHTML+"<div class='scroller' id='WC_CategoryDisplayJS_div_1'>";if(this.totalAssociationCount>1){if(this.associationThumbnailIndex<this.totalAssociationCount){widgetHTML=widgetHTML+"		<a href='Javascript:categoryDisplayJS.showNextAssociation()'  id='WC_ProductAssociation_UpArrow_Link_1'>";}widgetHTML=widgetHTML+"		<img src='"+this.baseCatalogEntryDetails[0].storeImage_Path+"i_up_arrow.png' alt='"+this.displayNextAssociation+"'/></a>";}widgetHTML=widgetHTML+" <br /><div id='baseContent_"+this.merchandisingAssociationItems[0].catEntry_Identifier+"'";if(this.merchandisingAssociationItems[0].showProductQuickView=="true"){widgetHTML=widgetHTML+" onmouseover='showPopupButton("+this.merchandisingAssociationItems[0].catEntry_Identifier+");' onmouseout='hidePopupButton("+this.merchandisingAssociationItems[0].catEntry_Identifier+");'>";}else{widgetHTML=widgetHTML+" >";}if(this.merchandisingAssociationItems[0].productDragAndDrop=="true"){widgetHTML=widgetHTML+" <div dojoType='dojo.dnd.Source' jsId='dndSource' id="+this.merchandisingAssociationItems[0].catEntry_Identifier+" copyOnly='true' dndType='"+dragType+"'>		<div class='dojoDndItem' dndType='"+dragType+"' id='WC_CategoryDisplayJS_div_draganddrop'>";}widgetHTML=widgetHTML+"	<a href='"+this.merchandisingAssociationItems[0].catEntry_ProductLink+"'  id='img"+this.merchandisingAssociationItems[0].catEntry_Identifier+"' onfocus='showPopupButton("+this.merchandisingAssociationItems[0].catEntry_Identifier+");'>";if(this.merchandisingAssociationItems[0].productDragAndDrop=="true"&&dojo.isIE==6){widgetHTML=widgetHTML+"<iframe class='productDnDIFrame' scrolling='no' frameborder='0' src='"+getImageDirectoryPath()+"images/empty.gif'></iframe>";}widgetHTML=widgetHTML+"		<img src='"+this.merchandisingAssociationItems[0].catEntry_Thumbnail+"' alt='"+this.merchandisingAssociationItems[0].catEntry_ShortDescription+"' class='img' width='70' height='70'/>	</a><br />";if(this.merchandisingAssociationItems[0].productDragAndDrop=="true"){widgetHTML=widgetHTML+"		</div>	</div>";}if(this.merchandisingAssociationItems[0].showProductQuickView=="true"){widgetHTML=widgetHTML+" <div id='popupButton_"+this.merchandisingAssociationItems[0].catEntry_Identifier+"' class='main_quickinfo_button'><span class='secondary_button' >\n<span class='button_container' >\n<span class='button_bg' >\n<span class='button_top'>\n<span class='button_bottom'>\n<a id='QuickInfoButton_"+this.merchandisingAssociationItems[0].catEntry_Identifier+"' href='#' onclick='javaScript:var actionListImageAcct = new popupActionProperties(); actionListImageAcct.showWishList="+this.merchandisingAssociationItems[0].associationProductBuyable+"; actionListImageAcct.showAddToCart="+this.merchandisingAssociationItems[0].associationProductBuyable+"; showPopup("+this.merchandisingAssociationItems[0].catEntry_Identifier+","+this.storeId+","+this.langId+","+this.catalogId+",event,null,null,actionListImageAcct);' onkeypress='javaScript:var actionListImageAcct = new popupActionProperties(); actionListImageAcct.showWishList="+this.merchandisingAssociationItems[0].associationProductBuyable+"; actionListImageAcct.showAddToCart="+this.merchandisingAssociationItems[0].associationProductBuyable+"; showPopup("+this.merchandisingAssociationItems[0].catEntry_Identifier+","+this.storeId+","+this.langId+","+this.catalogId+",event,null,null,actionListImageAcct);' onblur='hidePopupButton("+this.merchandisingAssociationItems[0].catEntry_Identifier+");' role='wairole:button' waistate:haspopup='true'>"+this.merchandisingAssociationItems[0].showProductQuickViewLable+"</a></span>\n</span>\n</span>\n</span>\n</span>\n</div>\n";}widgetHTML=widgetHTML+"</div>";if(this.totalAssociationCount>1){if(this.associationThumbnailIndex>1){widgetHTML=widgetHTML+"		<a href='Javascript:categoryDisplayJS.showPreviousAssociation()'  id='WC_ProductAssociation_DownArrow_Link_1'>";}widgetHTML=widgetHTML+"		<img src='"+this.baseCatalogEntryDetails[0].storeImage_Path+"i_down_arrow.png' alt='"+this.displayPrevAssociation+"'/></a>";}var comboText=this.baseCatalogEntryDetails[0].associatedProductsName.replace(/%0/,this.baseCatalogEntryDetails[0].baseCatEntry_Name);comboText=comboText.replace(/%1/,this.merchandisingAssociationItems[0].catEntry_Name);widgetHTML=widgetHTML+"</div><div class='combo_text' id='WC_CategoryDisplayJS_div_2'>\n	<h1 class='status_msg'>"+comboText+"</h1>\n	<span class='grey'>"+totalPriceMsg+dojo.currency.format(totalPrice.toFixed(2),{currency:this.baseCatalogEntryDetails[0].currency})+"</span>\n</div>\n";widgetHTML=widgetHTML+"<input type='hidden' id='compareImgPath_"+this.merchandisingAssociationItems[0].catEntry_Identifier+"' value='"+this.merchandisingAssociationItems[0].catEntry_Thumbnail_compare+"'/><input type='hidden' id='compareProductDetailsPath_"+this.merchandisingAssociationItems[0].catEntry_Identifier+"' value='"+this.merchandisingAssociationItems[0].catEntry_ProductLink+"'/><input type='hidden' id='compareImgDescription_"+this.merchandisingAssociationItems[0].catEntry_Identifier+"' value='"+this.merchandisingAssociationItems[0].catEntry_ShortDescription+"'/>";associationDisplay.innerHTML=null;associationDisplay.innerHTML=widgetHTML;dojo.parser.parse(associationDisplay);},showNextAssociation:function(){if(this.associationThumbnailIndex<this.totalAssociationCount){this.associationThumbnailIndex=this.associationThumbnailIndex+1;this.initializeMerchandisingAssociation(this.associationThumbnailIndex);}},showPreviousAssociation:function(){if(this.associationThumbnailIndex>1){this.associationThumbnailIndex=this.associationThumbnailIndex-1;this.initializeMerchandisingAssociation(this.associationThumbnailIndex);}},AddAssociation2ShopCartAjax:function(baseProductId,baseProductQuantity){var identifierJSON="associatedCatEntries_"+this.associationThumbnailIndex;var associationEntryJSON=eval("("+dojo.byId(identifierJSON).innerHTML+")");this.merchandisingAssociationItems=associationEntryJSON;this.baseItemAddedToCart=false;if(this.merchandisingAssociationItems[0].catEntry_Type=="ProductBean"){this.Add2ShopCartAjax(baseProductId,baseProductQuantity);if(this.baseItemAddedToCart){showPopup(this.merchandisingAssociationItems[0].catEntry_Identifier,this.storeId,this.langId,this.catalogId,function(e){return e;},"marchandisingAssociationDisplay");}}else{if(this.merchandisingAssociationItems[0].catEntry_Type=="ItemBean"||this.merchandisingAssociationItems[0].catEntry_Type=="PackageBean"||this.merchandisingAssociationItems[0].catEntry_Type=="BundleBean"){var entitledItemJSON=eval("("+dojo.byId(baseProductId).innerHTML+")");this.setEntitledItems(entitledItemJSON);var catalogEntryId=this.getCatalogEntryId();var params=[];params.storeId=this.storeId;params.catalogId=this.catalogId;params.langId=this.langId;params.orderId=".";params.calculationUsage="-1,-2,-3,-4,-5,-6,-7";if(catalogEntryId!=null){this.updateParamObject(params,"catEntryId",catalogEntryId,false,-1);this.updateParamObject(params,"quantity",baseProductQuantity,false,-1);if(this.merchandisingAssociationItems[0].catEntry_Type=="BundleBean"){var form=document.getElementById(this.merchandisingAssociationItems[0].catEntry_BundleFormId);var catEntryArray=[];catEntryArray=form.catEntryIDS.value.toString().split(",");for(var i=0;i<catEntryArray.length;i++){var qty=document.getElementById("quantity_"+catEntryArray[i]).value;var catEntryId=catEntryArray[i];if(this.getDefaultItem(catEntryArray[i])){catEntryId=this.getDefaultItem(catEntryArray[i]);}if(qty==0||qty==null){qty=1;}if(qty!=null&&qty!=""&&catEntryId!=null){this.updateParamObject(params,"catEntryId",catEntryId,false,-1);this.updateParamObject(params,"quantity",qty,false,-1);}else{MessageHelper.displayErrorMessage(MessageHelper.messages.ERR_RESOLVING_SKU);return;}}}else{this.updateParamObject(params,"catEntryId",this.merchandisingAssociationItems[0].catEntry_Identifier,false,-1);this.updateParamObject(params,"quantity",1,false,-1);}}else{MessageHelper.displayErrorMessage(MessageHelper.messages.ERR_RESOLVING_SKU);return;}if(!submitRequest()){return;}cursor_wait();wc.service.invoke("AjaxAddOrderItem",params);}}},AddMarchandisingAssociation2ShopCart:function(entitledItemId,form,quantity){var identifierJSON="associatedCatEntries_"+this.associationThumbnailIndex;var associationEntryJSON=eval("("+dojo.byId(identifierJSON).innerHTML+")");this.merchandisingAssociationItems=associationEntryJSON;var entitledItemJSON;if(dojo.byId(entitledItemId)!=null){entitledItemJSON=eval("("+dojo.byId(entitledItemId).innerHTML+")");}else{entitledItemJSON=this.getEntitledItemJsonObject();}this.setEntitledItems(entitledItemJSON);var catalogEntryId_1=this.getCatalogEntryId();if(this.merchandisingAssociationItems[0].catEntry_Type=="ProductBean"){if(catalogEntryId_1!=null){form.catEntryId_1.value=catalogEntryId_1;form.productId_1.value=catalogEntryId_1;form.quantity_1.value=quantity;this.merchandisingProductAssociationAddToCart=true;this.merchandisingProductAssociationForm=form;showPopup(this.merchandisingAssociationItems[0].catEntry_Identifier,this.storeId,this.langId,this.catalogId,function(e){return e;},"marchandisingAssociationDisplay");}else{MessageHelper.displayErrorMessage(MessageHelper.messages.ERR_RESOLVING_SKU);return;}}else{if(this.merchandisingAssociationItems[0].catEntry_Type=="ItemBean"||this.merchandisingAssociationItems[0].catEntry_Type=="PackageBean"||this.merchandisingAssociationItems[0].catEntry_Type=="BundleBean"){if(catalogEntryId_1!=null){form.catEntryId_1.value=catalogEntryId_1;form.productId_1.value=catalogEntryId_1;form.quantity_1.value=quantity;if(this.merchandisingAssociationItems[0].catEntry_Type=="BundleBean"){var bundleForm=document.getElementById(this.merchandisingAssociationItems[0].catEntry_BundleFormId);var catEntryArray=[];catEntryArray=bundleForm.catEntryIDS.value.toString().split(",");var catEntryCount=3;for(var i=0;i<catEntryArray.length;i++){var qty=document.getElementById("quantity_"+catEntryArray[i]).value;var catEntryId=catEntryArray[i];if(this.getDefaultItem(catEntryArray[i])){catEntryId=this.getDefaultItem(catEntryArray[i]);}if(qty==0||qty==null){qty=1;}if(qty!=null&&qty!=""&&catEntryId!=null){if(i==0){form.catEntryId_2.value=catEntryId;form.productId_2.value=catEntryId;form.quantity_2.value=qty;}else{var input1=document.createElement("input");input1.setAttribute("id","OrderAssociationItemAddForm_catEntryId_"+catEntryId);input1.setAttribute("type","hidden");input1.setAttribute("name","catEntryId_"+catEntryCount);input1.setAttribute("value",catEntryId);form.appendChild(input1);var input2=document.createElement("input");input2.setAttribute("id","OrderAssociationItemAddForm_productId_"+catEntryId);input2.setAttribute("type","hidden");input2.setAttribute("name","productId_"+catEntryCount);input2.setAttribute("value",catEntryId);form.appendChild(input2);var quantity1=document.createElement("input");quantity1.setAttribute("id","OrderAssociationItemAddForm_quantity_"+catEntryId);quantity1.setAttribute("type","hidden");quantity1.setAttribute("name","quantity_"+catEntryCount);quantity1.setAttribute("value","1");form.appendChild(quantity1);catEntryCount=catEntryCount+1;}}else{MessageHelper.displayErrorMessage(MessageHelper.messages.ERR_RESOLVING_SKU);return;}}}else{form.catEntryId_2.value=this.merchandisingAssociationItems[0].catEntry_Identifier;form.productId_2.value=this.merchandisingAssociationItems[0].catEntry_Identifier;form.quantity_2.value="1";}if(!submitRequest()){return;}form.submit();}else{MessageHelper.displayErrorMessage(MessageHelper.messages.ERR_RESOLVING_SKU);return;}}}},AddAssociation2ShopCart:function(associatedItemId,quantity){var form=this.merchandisingProductAssociationForm;this.merchandisingProductAssociationAddToCart=false;if(this.isParentBundleBean){var catEntryArray=[];catEntryArray=form.catEntryIDS.value.toString().split(",");var bundleItemsCount=1;for(var i=0;i<catEntryArray.length;i++){var qty=document.getElementById("quantity_"+catEntryArray[i]).value;var catEntryId=catEntryArray[i];if(this.selectedProducts[catEntryArray[i]]){catEntryId=this.getCatalogEntryIdforProduct(this.selectedProducts[catEntryArray[i]]);}if(qty==0||qty==null){qty=1;}if(qty!=null&&qty!=""&&catEntryId!=null){var input1=document.createElement("input");input1.setAttribute("id","OrderItemAddForm_catEntryId_"+catEntryId);input1.setAttribute("type","hidden");input1.setAttribute("name","catEntryId_"+bundleItemsCount);input1.setAttribute("value",catEntryId);bundleItemsCount=bundleItemsCount+1;form.appendChild(input1);}else{MessageHelper.displayErrorMessage(MessageHelper.messages.ERR_RESOLVING_SKU);return;}}var input2=document.createElement("input");input2.setAttribute("id","OrderItemAddForm_catEntryId_"+associatedItemId);input2.setAttribute("type","hidden");input2.setAttribute("name","catEntryId_"+bundleItemsCount);input2.setAttribute("value",associatedItemId);form.appendChild(input2);var quantity1=document.createElement("input");quantity1.setAttribute("id","OrderItemAddForm_quantity_"+associatedItemId);quantity1.setAttribute("type","hidden");quantity1.setAttribute("name","quantity_"+bundleItemsCount);quantity1.setAttribute("value",quantity);form.appendChild(quantity1);form.URL.value="AjaxOrderItemDisplayView";this.isParentBundleBean=false;}else{form.catEntryId_2.value=associatedItemId;form.productId_2.value=associatedItemId;form.quantity_2.value=quantity;}if(!submitRequest()){return;}form.submit();this.merchandisingProductAssociationForm="";},AddAssociationItem2ShopCartAjax:function(baseItemId,baseItemQuantity){var identifierJSON="associatedCatEntries_"+this.associationThumbnailIndex;var associationEntryJSON=eval("("+dojo.byId(identifierJSON).innerHTML+")");this.merchandisingAssociationItems=associationEntryJSON;this.baseItemAddedToCart=false;if(this.merchandisingAssociationItems[0].catEntry_Type=="ProductBean"){this.AddItem2ShopCartAjax(baseItemId,baseItemQuantity);if(this.baseItemAddedToCart){showPopup(this.merchandisingAssociationItems[0].catEntry_Identifier,this.storeId,this.langId,this.catalogId,function(e){return e;},"marchandisingAssociationDisplay");}}else{if(this.merchandisingAssociationItems[0].catEntry_Type=="ItemBean"||this.merchandisingAssociationItems[0].catEntry_Type=="PackageBean"||this.merchandisingAssociationItems[0].catEntry_Type=="BundleBean"){var params=[];params.storeId=this.storeId;params.catalogId=this.catalogId;params.langId=this.langId;params.orderId=".";params.calculationUsage="-1,-2,-3,-4,-5,-6,-7";this.updateParamObject(params,"catEntryId",baseItemId,false,-1);this.updateParamObject(params,"quantity",baseItemQuantity,false,-1);if(this.merchandisingAssociationItems[0].catEntry_Type=="BundleBean"){var form=document.getElementById(this.merchandisingAssociationItems[0].catEntry_BundleFormId);var catEntryArray=[];catEntryArray=form.catEntryIDS.value.toString().split(",");for(var i=0;i<catEntryArray.length;i++){var qty=document.getElementById("quantity_"+catEntryArray[i]).value;var catEntryId=catEntryArray[i];if(this.getDefaultItem(catEntryArray[i])){catEntryId=this.getDefaultItem(catEntryArray[i]);}if(qty==0||qty==null){qty=1;}if(qty!=null&&qty!=""&&catEntryId!=null){this.updateParamObject(params,"catEntryId",catEntryId,false,-1);this.updateParamObject(params,"quantity",qty,false,-1);}else{MessageHelper.displayErrorMessage(MessageHelper.messages.ERR_RESOLVING_SKU);return;}}}else{this.updateParamObject(params,"catEntryId",this.merchandisingAssociationItems[0].catEntry_Identifier,false,-1);this.updateParamObject(params,"quantity",1,false,-1);}if(!submitRequest()){return;}cursor_wait();wc.service.invoke("AjaxAddOrderItem",params);}}},AddAssociationItem2ShopCart:function(form,quantity){var identifierJSON="associatedCatEntries_"+this.associationThumbnailIndex;var associationEntryJSON=eval("("+dojo.byId(identifierJSON).innerHTML+")");this.merchandisingAssociationItems=associationEntryJSON;if(this.merchandisingAssociationItems[0].catEntry_Type=="ProductBean"){if(quantity){form.quantity_1.value=quantity;}this.merchandisingProductAssociationAddToCart=true;this.merchandisingProductAssociationForm=form;showPopup(this.merchandisingAssociationItems[0].catEntry_Identifier,this.storeId,this.langId,this.catalogId,function(e){return e;},"marchandisingAssociationDisplay");}else{if(this.merchandisingAssociationItems[0].catEntry_Type=="ItemBean"||this.merchandisingAssociationItems[0].catEntry_Type=="PackageBean"||this.merchandisingAssociationItems[0].catEntry_Type=="BundleBean"){if(quantity){form.quantity_1.value=quantity;}if(this.merchandisingAssociationItems[0].catEntry_Type=="BundleBean"){var bundleForm=document.getElementById(this.merchandisingAssociationItems[0].catEntry_BundleFormId);var catEntryArray=[];catEntryArray=bundleForm.catEntryIDS.value.toString().split(",");var catEntryCount=3;for(var i=0;i<catEntryArray.length;i++){var qty=document.getElementById("quantity_"+catEntryArray[i]).value;var catEntryId=catEntryArray[i];if(this.getDefaultItem(catEntryArray[i])){catEntryId=this.getDefaultItem(catEntryArray[i]);}if(qty==0||qty==null){qty=1;}if(i==0){form.catEntryId_2.value=catEntryId;form.productId_2.value=catEntryId;form.quantity_2.value=qty;}else{var input1=document.createElement("input");input1.setAttribute("id","OrderAssociationItemAddForm_catEntryId_"+catEntryId);input1.setAttribute("type","hidden");input1.setAttribute("name","catEntryId_"+catEntryCount);input1.setAttribute("value",catEntryId);form.appendChild(input1);var input2=document.createElement("input");input2.setAttribute("id","OrderAssociationItemAddForm_productId_"+catEntryId);input2.setAttribute("type","hidden");input2.setAttribute("name","productId_"+catEntryCount);input2.setAttribute("value",catEntryId);form.appendChild(input2);var quantity1=document.createElement("input");quantity1.setAttribute("id","OrderAssociationItemAddForm_quantity_"+catEntryId);quantity1.setAttribute("type","hidden");quantity1.setAttribute("name","quantity_"+catEntryCount);quantity1.setAttribute("value","1");form.appendChild(quantity1);catEntryCount=catEntryCount+1;}}}else{form.catEntryId_2.value=this.merchandisingAssociationItems[0].catEntry_Identifier;form.productId_2.value=this.merchandisingAssociationItems[0].catEntry_Identifier;form.quantity_2.value="1";}if(!submitRequest()){return;}form.submit();}}},AddAssociationBundle2ShopCartAjax:function(form){var identifierJSON="associatedCatEntries_"+this.associationThumbnailIndex;var associationEntryJSON=eval("("+dojo.byId(identifierJSON).innerHTML+")");this.merchandisingAssociationItems=associationEntryJSON;this.baseItemAddedToCart=false;var params=[];params.storeId=this.storeId;params.catalogId=this.catalogId;params.langId=this.langId;params.orderId=".";params.calculationUsage="-1,-2,-3,-4,-5,-6,-7";var catEntryArray=[];catEntryArray=form.catEntryIDS.value.toString().split(",");for(var i=0;i<catEntryArray.length;i++){var qty=document.getElementById("quantity_"+catEntryArray[i]).value;var catEntryId=catEntryArray[i];if(this.getDefaultItem(catEntryArray[i])){catEntryId=this.getDefaultItem(catEntryArray[i]);}if(qty==0||qty==null){qty=1;}if(qty!=null&&qty!=""&&catEntryId!=null){this.updateParamObject(params,"catEntryId",catEntryId,false,-1);this.updateParamObject(params,"quantity",qty,false,-1);this.baseItemAddedToCart="true";}else{MessageHelper.displayErrorMessage(MessageHelper.messages.ERR_RESOLVING_SKU);return;}}if(this.merchandisingAssociationItems[0].catEntry_Type=="BundleBean"){var bundleForm=document.getElementById(this.merchandisingAssociationItems[0].catEntry_BundleFormId);var innerCatEntryArray=[];innerCatEntryArray=bundleForm.catEntryIDS.value.toString().split(",");for(var i=0;i<innerCatEntryArray.length;i++){var qty=document.getElementById("quantity_"+innerCatEntryArray[i]).value;var innerCatEntryId=innerCatEntryArray[i];if(this.getDefaultItem(innerCatEntryArray[i])){innerCatEntryId=this.getDefaultItem(innerCatEntryArray[i]);}if(qty==0||qty==null){qty=1;}if(qty!=null&&qty!=""&&innerCatEntryId!=null){this.updateParamObject(params,"catEntryId",innerCatEntryId,false,-1);this.updateParamObject(params,"quantity",qty,false,-1);}else{MessageHelper.displayErrorMessage(MessageHelper.messages.ERR_RESOLVING_SKU);return;}}}else{if(this.merchandisingAssociationItems[0].catEntry_Type=="PackageBean"||this.merchandisingAssociationItems[0].catEntry_Type=="ItemBean"){this.updateParamObject(params,"catEntryId",this.merchandisingAssociationItems[0].catEntry_Identifier,false,-1);this.updateParamObject(params,"quantity",1,false,-1);}}if(!submitRequest()){return;}cursor_wait();wc.service.invoke("AjaxAddOrderItem",params);if(this.merchandisingAssociationItems[0].catEntry_Type=="ProductBean"){showPopup(this.merchandisingAssociationItems[0].catEntry_Identifier,this.storeId,this.langId,this.catalogId,function(e){return e;},"marchandisingAssociationDisplay");}},setOrderId:function(orderId){this.orderId=orderId;},AddAssociationBundle2ShopCart:function(form){var identifierJSON="associatedCatEntries_"+this.associationThumbnailIndex;var associationEntryJSON=eval("("+dojo.byId(identifierJSON).innerHTML+")");this.merchandisingAssociationItems=associationEntryJSON;this.isParentBundleBean=true;if(this.merchandisingAssociationItems[0].catEntry_Type=="ProductBean"){this.merchandisingProductAssociationAddToCart=true;this.merchandisingProductAssociationForm=form;var catEntryArray=[];catEntryArray=form.catEntryIDS.value.toString().split(",");var bundleItemsCount=1;for(var i=0;i<catEntryArray.length;i++){var qty=document.getElementById("quantity_"+catEntryArray[i]).value;var catEntryId=catEntryArray[i];if(this.getDefaultItem(catEntryArray[i])){catEntryId=this.getDefaultItem(catEntryArray[i]);}if(catEntryId!=null){form["catEntryId_"+catEntryArray[i]].value=catEntryId;}else{MessageHelper.displayErrorMessage(MessageHelper.messages.ERR_RESOLVING_SKU);return;}bundleItemsCount=bundleItemsCount+1;}showPopup(this.merchandisingAssociationItems[0].catEntry_Identifier,this.storeId,this.langId,this.catalogId,function(e){return e;},"marchandisingAssociationDisplay");}else{if(this.merchandisingAssociationItems[0].catEntry_Type=="ItemBean"||this.merchandisingAssociationItems[0].catEntry_Type=="PackageBean"||this.merchandisingAssociationItems[0].catEntry_Type=="BundleBean"){var catEntryArray=[];catEntryArray=form.catEntryIDS.value.toString().split(",");var bundleItemsCount=1;for(var i=0;i<catEntryArray.length;i++){var qty=document.getElementById("quantity_"+catEntryArray[i]).value;var catEntryId=catEntryArray[i];if(this.getDefaultItem(catEntryArray[i])){catEntryId=this.getDefaultItem(catEntryArray[i]);}if(catEntryId!=null){form["catEntryId_"+catEntryArray[i]].value=catEntryId;}else{MessageHelper.displayErrorMessage(MessageHelper.messages.ERR_RESOLVING_SKU);return;}bundleItemsCount=bundleItemsCount+1;}if(this.merchandisingAssociationItems[0].catEntry_Type=="BundleBean"){var bundleForm=document.getElementById(this.merchandisingAssociationItems[0].catEntry_BundleFormId);var innerCatEntryArray=[];innerCatEntryArray=bundleForm.catEntryIDS.value.toString().split(",");for(var i=0;i<innerCatEntryArray.length;i++){var qty=document.getElementById("quantity_"+innerCatEntryArray[i]).value;var innerCatEntryId=innerCatEntryArray[i];if(this.getDefaultItem(innerCatEntryArray[i])){innerCatEntryId=this.getDefaultItem(innerCatEntryArray[i]);}if(qty==0||qty==null){qty=1;}if(qty!=null&&qty!=""&&innerCatEntryId!=null){var input2=document.createElement("input");input2.setAttribute("id","OrderItemAddForm_catEntryId_"+innerCatEntryId);input2.setAttribute("type","hidden");input2.setAttribute("name","catEntryId_"+bundleItemsCount);input2.setAttribute("value",innerCatEntryId);form.appendChild(input2);var quantity2=document.createElement("input");quantity2.setAttribute("id","OrderItemAddForm_quantity_"+innerCatEntryId);quantity2.setAttribute("type","hidden");quantity2.setAttribute("name","quantity_"+bundleItemsCount);quantity2.setAttribute("value","1");form.appendChild(quantity2);bundleItemsCount=bundleItemsCount+1;}else{MessageHelper.displayErrorMessage(MessageHelper.messages.ERR_RESOLVING_SKU);return;}}}else{var input2=document.createElement("input");input2.setAttribute("id","OrderItemAddForm_catEntryId_"+this.merchandisingAssociationItems[0].catEntry_Identifier);input2.setAttribute("type","hidden");input2.setAttribute("name","catEntryId_"+bundleItemsCount);input2.setAttribute("value",this.merchandisingAssociationItems[0].catEntry_Identifier);form.appendChild(input2);var quantity2=document.createElement("input");quantity2.setAttribute("id","OrderItemAddForm_quantity_"+this.merchandisingAssociationItems[0].catEntry_Identifier);quantity2.setAttribute("type","hidden");quantity2.setAttribute("name","quantity_"+bundleItemsCount);quantity2.setAttribute("value","1");form.appendChild(quantity2);}form.URL.value="AjaxOrderItemDisplayView";if(!submitRequest()){return;}form.submit();}}},addToNewListFromProductDetail:function(entitledItemId,quantityElemId,currentPage){MessageHelper.hideAndClearMessage();var entitledItemJSON;if(dojo.byId(entitledItemId)!=null){entitledItemJSON=eval("("+dojo.byId(entitledItemId).innerHTML+")");}else{entitledItemJSON=this.getEntitledItemJsonObject();}this.setEntitledItems(entitledItemJSON);var catalogEntryId=this.getCatalogEntryId();if(catalogEntryId!=null){this.addItemToNewListFromProductDetail(catalogEntryId,quantityElemId,currentPage);}else{MessageHelper.displayErrorMessage(MessageHelper.messages.ERR_RESOLVING_SKU_REQ_LIST);if(dijit.byId("second_level_category_popup")!=null){hidePopup("second_level_category_popup");}return;}},addItemToNewListFromProductDetail:function(catalogEntryId,quantityElemId,currentPage){MessageHelper.hideAndClearMessage();if(catalogEntryId!=null){var quantity=document.getElementById(quantityElemId).value;if(quantity==null||quantity==""||quantity<=0||!RequisitionList.isNumber(quantity)){MessageHelper.displayErrorMessage(MessageHelper.messages.QUANTITY_INPUT_ERROR);if(dijit.byId("second_level_category_popup")!=null){hidePopup("second_level_category_popup");}return;}if(this.ajaxMyAccount){var URL="AjaxLogonForm?page=createrequisitionlist";}else{var URL="RequisitionListDetailView?editable=true&newList=true";}var formObj=document.createElement("form");formObj.setAttribute("method","POST");var input=document.createElement("input");input.setAttribute("type","hidden");input.setAttribute("value",currentPage);input.setAttribute("name","previousPage");formObj.appendChild(input);formObj.action=URL+"&catEntryId="+catalogEntryId+"&quantity="+quantity+"&storeId="+this.storeId+"&catalogId="+this.catalogId+"&langId="+this.langId;document.body.appendChild(formObj);formObj.submit();}else{MessageHelper.displayErrorMessage(MessageHelper.messages.ERR_RESOLVING_SKU_REQ_LIST);}},addBundleToNewListFromProductDetail:function(form,currentPage){var productCount=form.numberOfProduct.value;var URL="";if(this.ajaxMyAccount){URL="AjaxLogonForm?page=createrequisitionlist";}else{URL="RequisitionListDetailView?editable=true&newList=true";}for(var i=1;i<=productCount;i++){var catEntryId=form["catEntryId_"+i].value;if(this.selectedProducts[catEntryId]){catEntryId=this.getCatalogEntryIdforProduct(this.selectedProducts[catEntryId]);}var qty=form["quantity_"+i].value;if(qty==null||qty==""||qty<=0||!RequisitionList.isNumber(qty)){MessageHelper.displayErrorMessage(MessageHelper.messages.QUANTITY_INPUT_ERROR);return;}else{if(catEntryId!=null){URL=URL+"&catEntryId="+catEntryId+"&quantity="+qty;}else{MessageHelper.displayErrorMessage(MessageHelper.messages.ERR_RESOLVING_SKU_REQ_LIST);return;}}}var input=document.createElement("input");input.setAttribute("type","hidden");input.setAttribute("value",currentPage);input.setAttribute("name","previousPage");form.appendChild(input);URL=URL+"&numberOfProduct="+form.numberOfProduct.value+"&storeId="+this.storeId+"&catalogId="+this.catalogId+"&langId="+this.langId;form.action=URL;form.submit();},addToExistingRequisitionList:function(entitledItemId,quantityElemId,ajaxAddToCart){var entitledItemJSON;if(dojo.byId(entitledItemId)!=null){entitledItemJSON=eval("("+dojo.byId(entitledItemId).innerHTML+")");}else{entitledItemJSON=this.getEntitledItemJsonObject();}this.setEntitledItems(entitledItemJSON);var catalogEntryId=this.getCatalogEntryId();if(catalogEntryId!=null){this.addItemToExistingRequisitionList(catalogEntryId,quantityElemId,ajaxAddToCart);}else{MessageHelper.displayErrorMessage(MessageHelper.messages.ERR_RESOLVING_SKU_REQ_LIST);}},addBundleToExistingRequisitionList:function(form,ajaxAddToCart){var reqListSelection=document.getElementsByName("RequisitionListTableDisplay_RequisitionListSelection");for(var i=0;i<reqListSelection.length;i++){if(reqListSelection.item(i).checked){var requisitionListId=reqListSelection.item(i).value;}}if(ajaxAddToCart){var params=[];params.storeId=this.storeId;params.catalogId=this.catalogId;params.langId=this.langId;params.requisitionListId=requisitionListId;var productCount=form.numberOfProduct.value;for(var i=1;i<=productCount;i++){var catEntryId=form["catEntryId_"+i].value;if(this.selectedProducts[catEntryId]){catEntryId=this.getCatalogEntryIdforProduct(this.selectedProducts[catEntryId]);}var qty=form["quantity_"+i].value;if(qty==null||qty==""||qty<=0||!RequisitionList.isNumber(qty)){MessageHelper.displayeErrorMessage(MessageHelper.messages.QUANTITY_INPUT_ERROR);return;}else{if(qty!=null&&qty!=""&&catEntryId!=null){this.updateParamObject(params,"catEntryId",catEntryId,false,-1);this.updateParamObject(params,"quantity",qty,false,-1);this.baseItemAddedToCart=true;}else{MessageHelper.displayErrorMessage(MessageHelper.messages.ERR_RESOLVING_SKU_REQ_LIST);return;}}}if(!submitRequest()){return;}cursor_wait();wc.service.invoke("requisitionListAddItem_popup",params);}else{form.action="RequisitionListItemUpdate?requisitionListId="+requisitionListId;if(this.ajaxMyAccount){form.URL.value="AjaxLogonForm?page=editrequisitionlist&requisitionListId="+requisitionListId+"&editable=true";}else{form.URL.value="RequisitionListDetailView?requisitionListId="+requisitionListId+"&editable=true";}if(!submitRequest()){return;}cursor_wait();form.submit();}},addItemToExistingRequisitionList:function(catalogEntryId,quantityElemId,ajaxAddToCart){if(catalogEntryId!=null){var quantity=document.getElementById(quantityElemId).value;if(!RequisitionList.isNumber(quantity)||quantity<=0){if(quantityElemId=="productPopUpQty"){MessageHelper.displayErrorMessage(MessageHelper.messages.QUANTITY_INPUT_ERROR);if(dijit.byId("second_level_category_popup")!=null){hidePopup("second_level_category_popup");}return;}else{MessageHelper.formErrorHandleClient(quantityElemId,MessageHelper.messages.QUANTITY_INPUT_ERROR);return;}}var reqListSelection=document.getElementsByName("RequisitionListTableDisplay_RequisitionListSelection");for(var i=0;i<reqListSelection.length;i++){if(reqListSelection.item(i).checked){var requisitionListId=reqListSelection.item(i).value;}}if(ajaxAddToCart){var params={};params.requisitionListId=requisitionListId;params.catEntryId=catalogEntryId;params.quantity=quantity;params.storeId=this.storeId;params.catalogId=this.catalogId;params.langId=this.langId;if(!submitRequest()){return;}cursor_wait();wc.service.invoke("requisitionListAddItem_popup",params);}else{var form=document.forms.RequisitionListPopupForm;form.requisitionListId.value=requisitionListId;form.quantity.value=quantity;form.catEntryId.value=catalogEntryId;if(this.ajaxMyAccount){form.URL.value="AjaxLogonForm?page=editrequisitionlist&requisitionListId="+requisitionListId+"&editable=true";}else{form.URL.value="RequisitionListDetailView?requisitionListId="+requisitionListId+"&editable=true";}if(!submitRequest()){return;}cursor_wait();form.submit();}}else{MessageHelper.displayErrorMessage(MessageHelper.messages.ERR_RESOLVING_SKU_REQ_LIST);}},setCurrentPageType:function(pageType){this.currentPageType=pageType;},setCurrentCatalogEntryId:function(catalogEntryId){this.currentCatalogEntryId=catalogEntryId;},setEntitledItemEspotJsonObject:function(jsonObject){this.entitledItemEspotJsonObject=jsonObject;},getEntitledItemEspotJsonObject:function(){return this.entitledItemEspotJsonObject;},UpdateEspotContent:function(emsName,destinationId,entitledItemId,entitledItemEspotId){var entitledItemSpotJSON;if(dojo.byId(entitledItemEspotId)!=null){entitledItemSpotJSON=eval("("+dojo.byId(entitledItemEspotId).innerHTML+")");}else{entitledItemSpotJSON=this.getEntitledItemEspotJsonObject();}var entitledItemJSON;if(dojo.byId(entitledItemId)!=null){entitledItemJSON=eval("("+dojo.byId(entitledItemId).innerHTML+")");}else{entitledItemJSON=this.getEntitledItemJsonObject();}this.setEntitledItems(entitledItemJSON);var catalogEntryId=this.getCatalogEntryId();if(catalogEntryId!=null&&document.getElementById(destinationId)){for(var i in entitledItemSpotJSON){if(entitledItemSpotJSON[i].catentry_id==catalogEntryId){for(var j in entitledItemSpotJSON[i].content){if(entitledItemSpotJSON[i].content[j].key==emsName){var newcontent=entitledItemSpotJSON[i].content[j].value;if(newcontent!=null){newcontent=unescape(newcontent);newcontent=newcontent.replace(/&lt;/gi,"<");newcontent=newcontent.replace(/&gt;/gi,">");newcontent=newcontent.replace(/&amp;/gi,"&");document.getElementById(destinationId).innerHTML=newcontent;}}}}}}},DeleteItemFromCart:function(orderItemId){if(!this.ajaxShopCart){return;}var params=[];params.storeId=this.storeId;params.catalogId=this.catalogId;params.langId=this.langId;params.orderId=(this.orderId!=null&&this.orderId!="undefined"&&this.orderId!="")?this.orderId:".";params.orderItemId=orderItemId;params.calculationUsage="-1,-2,-3,-4,-5,-6,-7";if(!submitRequest()){return;}cursor_wait();wc.service.invoke("AjaxDeleteOrderItem",params);},getCurrentUserZipCode:function(){var zipRegCookie=dojo.cookie("WHR_zipreg");if(zipRegCookie!=null&&zipRegCookie!=""){var zipCdRegionArr=zipRegCookie.split("|");return zipCdRegionArr[0];}return null;},accessoriesPopupContentStrings:{},allowAccessoryDialogRemove:false,setupAccessoriesPopup:function(){var params=dojo.fromJson(dojo.byId("category_accessory_popup_params").innerHTML);var mainOrderItemId=params.mainOrderItemId;var mainOrderItemQty=params.mainOrderItemQty;var functionRegistry={ACC:{functionAdd:dojo.hitch(this,this.accessoryAddToCartClick),functionRemove:dojo.hitch(this,this.accessoryRemoveFromCartClick)},ESP:{functionAdd:dojo.hitch(this,this.espAddToCartClick),functionRemove:dojo.hitch(this,this.espRemoveFromCartClick)}};MessageHelper.setMessage("ACCDLG_PLEASE_CHOOSE_PLAN",this.accessoriesPopupContentStrings.ACCDLG_PLEASE_CHOOSE_PLAN);var allowRemove=this.allowAccessoryDialogRemove;var ts=new Date().getTime();var controllerName="accessoryPopupController"+ts;var refreshAreaName="accessoryPopupArea"+ts;var accessoryPopupRenderContext=wc.render.getContextById("accessoryPopupContext");if(!accessoryPopupRenderContext||accessoryPopupRenderContext==null){wc.render.declareContext("accessoryPopupContext",{itemUpdatingId:"",triggeringButton:null,context:null},"");}var contentStrings=this.accessoriesPopupContentStrings;wc.render.declareRefreshController({id:controllerName,renderContext:wc.render.getContextById("accessoryPopupContext"),url:"",formId:"",modelChangedHandler:function(message,widget){var controller=this;var renderContext=this.renderContext;if(message.actionId==="AjaxAddOrderItem"){var buttonObj=renderContext.properties.triggeringButton;if(buttonObj!=null){dojo.removeClass(buttonObj,"ui-button");dojo.addClass(buttonObj,"ui-button gray");if(allowRemove){var context=renderContext.properties.context;var orderItemId=message.orderItemId[0];buttonObj.onclick=function(evt){functionRegistry[context].functionRemove(this,orderItemId,mainOrderItemId);};}else{if(buttonObj.id=="esp_add_cart_button"){document.getElementById("modal_esp_add_button").innerHTML=contentStrings.ACCDLG_BUTTON_ADDED;}else{document.getElementById("modal_button_added_"+renderContext.properties.itemUpdatingId).innerHTML=contentStrings.ACCDLG_BUTTON_ADDED;}buttonObj.onclick=function(evt){};}}}else{if(message.actionId==="AjaxDeleteOrderItem"){var buttonObj=renderContext.properties.triggeringButton;if(buttonObj!=null){dojo.removeClass(buttonObj,"button_2");dojo.addClass(buttonObj,"button_5");var context=renderContext.properties.context;var nodeList=dojo.query("> div.accdlg_original_item_id",buttonObj.parentNode);var itemId=dojo.fromJson(nodeList[0].innerHTML).itemId;buttonObj.onclick=function(evt){functionRegistry[context].functionAdd(this,itemId,mainOrderItemId,mainOrderItemQty);};}cursor_clear();}}}});var refreshArea=new wc.widget.RefreshArea({id:refreshAreaName,widgetId:refreshAreaName,controllerId:controllerName});refreshArea.startup();},popup_AddAccessory2ShopCartAjax:function(itemId,fromPage){var subscriptionSelect=$("#category_accessory_popup_subscr_freq_"+itemId);var subscription;if(subscriptionSelect.length>0){var selectedVal=subscriptionSelect[0].options[subscriptionSelect[0].selectedIndex].value;if(selectedVal!="0"){subscription=selectedVal;}}var params={};params.storeId=this.storeId;params.catalogId=this.catalogId;params.langId=this.langId;params.orderId=".";params.quantity=1;params.calculationUsage="-1,-2,-3,-4,-5,-6,-7";params.frequency=subscription;params.zipCode=this.getCurrentUserZipCode();if(params.zipCode==null){if(this.allowZipCodeDialog){var zipCodePopup=dijit.byId("zip_code_popup");zipCodePopup.show();var args=arguments;var handle=dojo.connect(zipCodePopup,"onZipCodeSelected",null,dojo.hitch(this,function(){this.popup_AddAccessory2ShopCartAjax.apply(this,args);}));var handle2=dojo.connect(zipCodePopup,"hide",null,function(){dojo.disconnect(handle);dojo.disconnect(handle2);});return;}}if(fromPage=="productdetail"){var entitledItemId="entitledItem_"+itemId;var entitledItemJSON;if(dojo.byId(entitledItemId)!=null){entitledItemJSON=eval("("+dojo.byId(entitledItemId).innerHTML+")");}else{entitledItemJSON=this.getEntitledItemJsonObject();}this.setEntitledItems(entitledItemJSON);var catalogEntryId=this.getCatalogEntryId();itemId=catalogEntryId;}params.catEntryId=itemId;if(!submitRequest()){return;}cursor_wait();wc.service.invoke("AjaxAddOrderItem",params);},accessoryAddToCartClick:function(button,itemId,mainOrderItemId,mainOrderItemQty){wc.render.updateContext("accessoryPopupContext",{itemUpdatingId:itemId,triggeringButton:button,context:"ACC"});setCurrentId(button.id);this.popup_AddAccessory2ShopCartAjax(itemId);},replacementprogramAddToCartClick:function(itemId,fromPage){this.popup_AddAccessory2ShopCartAjax(itemId,fromPage);},accessoryRemoveFromCartClick:function(button,orderItemId,mainOrderItemId){wc.render.updateContext("accessoryPopupContext",{itemUpdatingId:orderItemId,triggeringButton:button,context:"ACC"});setCurrentId(button.id);this.DeleteItemFromCart(orderItemId);},popup_AddESP2ShopCartAjax:function(espCatEntryId,mainOrderItemId,mainOrderItemQty){var params={};params.storeId=this.storeId;params.catalogId=this.catalogId;params.langId=this.langId;params.orderId=".";params.catEntryId=espCatEntryId;params.quantity=mainOrderItemQty;params.zipCode=this.getCurrentUserZipCode();params.mainOrderItemId=mainOrderItemId;MessageHelper.alternateErrorTextId="ESPErrorMessageText";MessageHelper.alternateMessageTextId="ESPMessageArea";if(!submitRequest()){return;}cursor_wait();wc.service.invoke("AjaxAddOrderItem",params);},espAddToCartClick:function(button,itemId,mainOrderItemId,mainOrderItemQty){var selectBox=document.getElementById("ESPPlanLengthSelect");itemId=selectBox.options[selectBox.selectedIndex].value;if("0"==itemId){MessageHelper.formErrorHandleClient(document.getElementById("ESPPlanLengthSelect"),MessageHelper.messages.ACCDLG_PLEASE_CHOOSE_PLAN);return;}wc.render.updateContext("accessoryPopupContext",{itemUpdatingId:itemId,triggeringButton:button,context:"ESP"});setCurrentId(button.id);this.popup_AddESP2ShopCartAjax(itemId,mainOrderItemId,mainOrderItemQty);},espRemoveFromCartClick:function(button,orderItemId,mainOrderItemId){wc.render.updateContext("accessoryPopupContext",{itemUpdatingId:orderItemId,triggeringButton:button,context:"ESP"});setCurrentId(button.id);this.DeleteItemFromCart(orderItemId);},hideAccessoriesPopup:function(){dijit.byId("category_accessory_popup").hide();},updateSubscriptionFrequency:function(button,freqBox,orderItemId,closeOnComplete){var frequency=freqBox.options[freqBox.selectedIndex].value;var params=[];params.orderId=".";params.storeId=this.storeId;params.catalogId=this.catalogId;params.langId=this.langId;params.orderItemId=orderItemId;params.frequency=frequency;params.invCheck="false";params.zipCode=this.getCurrentUserZipCode();setCurrentId(button.id);if(!submitRequest()){return;}cursor_wait();var service=wc.service.getServiceById("AjaxUpdateOrderItem");var handle2=null;var handle=dojo.connect(service,"successHandler",this,function(){dojo.disconnect(handle);dojo.disconnect(handle2);if(closeOnComplete){this.hideAccessoriesPopup();}else{button.innerHTML=this.accessoriesPopupContentStrings.ACCDLG_BUTTON_SUBSCRIBED;button.onclick=function(evt){};}});handle2=dojo.connect(service,"failureHandler",this,function(){dojo.disconnect(handle);dojo.disconnect(handle2);if(closeOnComplete){this.hideAccessoriesPopup();}});service.invoke(params);},loadBundleURL:function(bundleURL){if(!submitRequest()){return;}cursor_wait();CommonControllersDeclarationJS.setControllerURL("bundleDisplay_Controller",bundleURL);wc.render.updateContext("bundleDisplay_Context");},setQuickviewItemId:function(quickviewItemId){this.quickviewItemId=quickviewItemId;},setQuickviewPairedItemId:function(quickviewPairedItemId){this.quickviewPairedItemId=quickviewPairedItemId;},getQuickviewItemId:function(){return this.quickviewItemId;},getQuickviewPairedItemId:function(){return this.quickviewPairedItemId;},quickviewAddtoWishlist:function(quickViewTab){if(quickViewTab=="main"){this.Add2WishListAjaxByID(this.quickviewItemId);}if(quickViewTab=="paired"){this.Add2WishListAjaxByID(this.quickviewPairedItemId);}},quickviewAddtoShoppingCart:function(quickViewTab){if(quickViewTab=="main"){this.AddItem2ShopCartAjax(this.quickviewItemId,1);}if(quickViewTab=="paired"){this.AddItem2ShopCartAjax(this.quickviewPairedItemId,1);}}};categoryDisplayJS.HistoryTracker.prototype.back=categoryDisplayJS.goBack;categoryDisplayJS.HistoryTracker.prototype.forward=categoryDisplayJS.goForward;function contactUS(){var ContactURL=document.getElementById("ContactURL");var params="width=2000,height=4000,location=1,status=1,scrollbars=1";var url=$("#ContactURL").text();newwin=window.open(url,"_blank",params);return false;}
