categoryDisplayJS={entitledItems:[],selectedProducts:{},selectedAttributes:{},errorMessages:{},langId:"-1",storeId:"",catalogId:"",ajaxShopCart:true,ajaxMyAccount:true,contextChanged:false,isHistory:false,merchandisingAssociationItems:[],baseCatalogEntryDetails:[],associationThumbnailIndex:1,totalAssociationCount:0,baseItemAddedToCart:false,merchandisingProductAssociationAddToCart:false,merchandisingProductAssociationForm:"",isParentBundleBean:false,userType:"",displayPrevAssociation:"",displayNextAssociation:"", defaultItemArray:[],itemSellerMap:[],setItemSellerMap:function(a,c){this.itemSellerMap[a]=c},initHistory:function(a,c){var d=new categoryDisplayJS.HistoryTracker(a,c);dojo.back.setInitialState(d)},setAjaxShopCart:function(a){this.ajaxShopCart=a},setAjaxMyAccount:function(a){this.ajaxMyAccount=a},setCommonParameters:function(a,c,d,b){this.langId=a;this.storeId=c;this.catalogId=d;this.userType=b},setEntitledItems:function(a){this.entitledItems=a},setSelectedAttribute:function(a,c){console.debug(a+" : "+ c.replace("&",""));c=c.replace("&","");c=c.replace(/^[\s]+/,"").replace(/[\s]+$/,"").replace(/[\s]{2,}/," ");this.selectedAttributes[a]=c},setSelectedAttributeOfProduct:function(a,c,d){selectedAttributesForProduct={};if(this.selectedProducts[a])selectedAttributesForProduct=this.selectedProducts[a];selectedAttributesForProduct[c]=d;this.selectedProducts[a]=selectedAttributesForProduct},gotoASubCategoryDisplayPage:function(a,c,d,b){a=trim(a);if(a=="")MessageHelper.formErrorHandleClient(document.getElementById("subCategoriesListDisplayPageNum").id, MessageHelper.messages.ERROR_EMPTY_NUM);else if(MessageHelper.IsNumeric(a,false)==false)MessageHelper.formErrorHandleClient(document.getElementById("subCategoriesListDisplayPageNum").id,MessageHelper.messages.ERROR_PAGE_NUM);else if(a>=1&&a<=c){MessageHelper.hideAndClearMessage();this.loadSubCategoryContentURL(b+"&beginIndex="+(a-1)*d)}else MessageHelper.formErrorHandleClient(document.getElementById("subCategoriesListDisplayPageNum").id,MessageHelper.messages.ERROR_PAGE_NUM)},getCatalogEntryId:function(){var a= [];for(attribute in this.selectedAttributes)a.push(attribute+"_"+this.selectedAttributes[attribute]);return this.resolveSKU(a)},getCatalogEntryIdforProduct:function(a){var c=[];for(attribute in a)c.push(attribute+"_"+a[attribute]);return this.resolveSKU(c)},resolveSKU:function(a){console.debug("Resolving SKU >> "+a+">>"+this.entitledItems);var c="",d=a.length;for(x in this.entitledItems){c=this.entitledItems[x].catentry_id;var b=this.entitledItems[x].Attributes,e=0;for(index in b)e++;if(d==0&&e== 0)return c;if(e!=0&&d>=e){var f=0;for(attributeName in a)a[attributeName]in b&&f++;if(e==f){console.debug("CatEntryId:"+c+" for Attribute: "+a);return c}}}return null},updateParamObject:function(a,c,d,b,e){if(a==null)a=[];if(a[c]!=null&&b)if(dojo.lang.isArrayLike(a[c]))if(e!=null&&e!="")a[c][e]=d;else a[c].push(d);else{b=a[c];a[c]=[];a[c].push(b);a[c].push(d)}else if(e!=null&&e!=""&&e!=-1)a[c+"_"+e]=d;else if(e==-1){for(b=1;a[c+"_"+b]!=null;)b++;a[c+"_"+b]=d}else a[c]=d;return a},setDefaultItem:function(a, c){this.defaultItemArray[a]=c},getDefaultItem:function(a){return this.defaultItemArray[a]},AddBundle2ShopCartAjax:function(a){var c=[];c.storeId=this.storeId;c.catalogId=this.catalogId;c.langId=this.langId;c.orderId=".";for(var d=a.numberOfProduct.value,b=1;b<=d;b++){var e=a["catEntryId_"+b].value;if(this.selectedProducts[e])e=this.getCatalogEntryIdforProduct(this.selectedProducts[e]);var f=a["quantity_"+b].value;if(f==null||f==""||f<=0){MessageHelper.displayErrorMessage(MessageHelper.messages.QUANTITY_INPUT_ERROR); return}if(f!=null&&f!=""&&e!=null){this.updateParamObject(c,"catEntryId",e,false,-1);this.updateParamObject(c,"quantity",f,false,-1);this.baseItemAddedToCart=true}else{MessageHelper.displayErrorMessage(MessageHelper.messages.ERR_RESOLVING_SKU);return}}if(submitRequest()){cursor_wait();wc.service.invoke("AjaxAddOrderItem",c)}},AddBundle2ShopCart:function(a){a.URL.value="AjaxOrderItemDisplayView";for(var c=a.numberOfProduct.value,d=1;d<=c;d++){var b=a["catEntryId_"+d].value;if(this.selectedProducts[b]){b= this.getCatalogEntryIdforProduct(this.selectedProducts[b]);if(b!=null)a["catEntryId_"+d].value=b;else{MessageHelper.displayErrorMessage(MessageHelper.messages.ERR_RESOLVING_SKU);return}}b=a["quantity_"+d].value;if(b==null||b==""||b<=0){MessageHelper.displayErrorMessage(MessageHelper.messages.QUANTITY_INPUT_ERROR);return}}submitRequest()&&a.submit()},Add2ShopCart:function(a,c,d){this.setEntitledItems(eval("("+dojo.byId(a).innerHTML+")"));a=this.getCatalogEntryId();if(a!=null)if(this.merchandisingProductAssociationAddToCart)this.AddAssociation2ShopCart(a, d);else{c.catEntryId.value=a;c.productId.value=a;this.AddItem2ShopCart(c,d)}else MessageHelper.displayErrorMessage(MessageHelper.messages.ERR_RESOLVING_SKU)},AddItem2ShopCart:function(a,c){if(c)a.quantity.value=c;var d=RegExp(/^\d*$/);if(a.quantity.value==0||a.quantity.value==""||!d.test(a.quantity.value))MessageHelper.displayErrorMessage(MessageHelper.messages.QUANTITY_INPUT_ERROR);else submitRequest()&&a.submit()},Add2ShopCartAjax:function(a,c){this.setEntitledItems(eval("("+dojo.byId(a).innerHTML+ ")"));var d=this.getCatalogEntryId();if(d!=null){this.AddItem2ShopCartAjax(d,c,this.itemSellerMap[d]);this.baseItemAddedToCart=true}else{MessageHelper.displayErrorMessage(MessageHelper.messages.ERR_RESOLVING_SKU);alert(MessageHelper.messages.ERR_RESOLVING_SKU);document.getElementById("hidepopupall").value="2";this.baseItemAddedToCart=false}},ReplaceItemAjax:function(a,c){this.setEntitledItems(eval("("+dojo.byId(a).innerHTML+")"));var d=this.getCatalogEntryId(),b="";b=replaceOrderItemId;var e=document.getElementById("shipmentTypeId"), f="",g="";if(e!=null&&e!="")if(e.value=="2"){f=document.getElementById("MS_ShipmentAddress_"+b).value;g=document.getElementById("MS_ShippingMode_"+b).value}else{f=document.getElementById("addressId_all").value;g=document.getElementById("shipModeId_all").value}if(d!=null)b!=""&&this.ReplaceItemAjaxHelper(d,c,b,f,g);else MessageHelper.displayErrorMessage(MessageHelper.messages.ERR_RESOLVING_SKU)},ReplaceItemNonAjax:function(a,c,d){this.setEntitledItems(eval("("+dojo.byId(a).innerHTML+")"));a=this.getCatalogEntryId(); var b="";b=replaceOrderItemId;if(a!=null){if(b!=""){d.orderItemId.value=b;var e;c==0&&console.debug("An invalid quantity was selected");if(d.shipmentTypeId!=null&&d.shipmenTypeId!=""){if(d.shipmentTypeId.value=="2"){e=document.getElementById("MS_ShipmentAddress_"+b).value;b=document.getElementById("MS_ShippingMode_"+b).value}else{e=document.getElementById("addressId_all").value;b=document.getElementById("shipModeId_all").value}d.URL.value="OrderChangeServiceItemAdd?catEntryId="+a+"&quantity="+c+"&addressId="+ e+"&shipModeId="+b+"&URL=OrderChangeServiceShipInfoUpdate?URL="+d.URL.value}else d.URL.value="OrderChangeServiceItemAdd?catEntryId="+a+"&quantity="+c+"&URL="+d.URL.value;submitRequest()&&d.submit()}}else MessageHelper.displayErrorMessage(MessageHelper.messages.ERR_RESOLVING_SKU)},AddItem2ShopCartAjax:function(a,c,d){var b=[];b.storeId=this.storeId;b.catalogId=this.catalogId;b.langId=this.langId;b.orderId=".";b.catEntryId=a;b.quantity=c;for(c=0;c<skuArr.length;c++)if(a==skuArr[c]){alert("Item is already present in your shopping cart"); return}a="";if(d!=""&&d.length!=0)a=d.split("-")[1];b.sellId=a;d=RegExp(/^\d*$/);if(b.quantity==0||b.quantity==""||!d.test(b.quantity)){alert("Enter a valid Quantity");MessageHelper.displayErrorMessage(MessageHelper.messages.QUANTITY_INPUT_ERROR)}else if(submitRequest()){cursor_wait();this.ajaxShopCart?wc.service.invoke("AjaxAddOrderItem",b):wc.service.invoke("AjaxAddOrderItem_shopCart",b);this.baseItemAddedToCart=true}},ReplaceItemAjaxHelper:function(a,c,d,b,e){var f=[];f.storeId=this.storeId;f.catalogId= this.catalogId;f.langId=this.langId;f.orderItemId=d;f.orderId=".";var g=[];g.storeId=this.storeId;g.catalogId=this.catalogId;g.langId=this.langId;g.catEntryId=a;g.quantity=c;g.orderId=".";var h=[];h.storeId=this.storeId;h.catalogId=this.catalogId;h.langId=this.langId;h.orderId=".";var j=false;if(b!=null&&b!=""&&e!=null&&e!=""){h.addressId=b;h.shipModeId=e;j=true}wc.service.declare({id:"AjaxReplaceItem",actionId:"AjaxReplaceItem",url:"AjaxOrderChangeServiceItemDelete",formId:"",successHandler:function(){j? wc.service.invoke("AjaxAddOrderItemTemp",g):wc.service.invoke("AjaxAddOrderItem",g)},failureHandler:function(i){if(i.errorMessage)MessageHelper.displayErrorMessage(i.errorMessage);else i.errorMessageKey&&MessageHelper.displayErrorMessage(i.errorMessageKey);cursor_clear()}});wc.service.declare({id:"AjaxAddOrderItemTemp",actionId:"AjaxAddOrderItemTemp",url:"AjaxOrderChangeServiceItemAdd",formId:"",successHandler:function(){wc.service.invoke("OrderItemAddressShipMethodUpdate",h)},failureHandler:function(i){MessageHelper.displayErrorMessage(i.errorMessageKey)}}); if(submitRequest()){cursor_wait();wc.service.invoke("AjaxReplaceItem",f)}},AddBundle2WishList:function(a){for(var c=a.numberOfProduct.value,d=1;d<=c;d++){var b=a["catEntryId_"+d].value;if(this.selectedProducts[b]){b=this.getCatalogEntryIdforProduct(this.selectedProducts[b]);if(b!=null)a["catEntryId_"+d].value=b;else{MessageHelper.displayErrorMessage(MessageHelper.messages.ERR_RESOLVING_SKU);return}}}a.action="InterestItemAdd";a.page.value="customerlinkwishlist";a.URL.value=this.ajaxMyAccount?this.userType== "G"?"InterestItemDisplay":"AjaxLogonForm":this.userType=="G"?"InterestItemDisplay":"NonAjaxAccountWishListDisplayView";submitRequest()&&a.submit()},AddBundle2WishListAjax:function(a){var c=[];c.storeId=this.storeId;c.catalogId=this.catalogId;c.langId=this.langId;c.orderId=".";var d=[];d=a.catEntryIDS.value.toString().split(",");for(a=0;a<d.length;a++){var b=document.getElementById("quantity_"+d[a]).value,e=d[a];if(this.selectedProducts[d[a]])e=this.getCatalogEntryIdforProduct(this.selectedProducts[d[a]]); if(b==0||b==null)b=1;if(b!=null&&b!=""&&e!=null){this.updateParamObject(c,"catEntryId",e,false,-1);this.updateParamObject(c,"quantity",b,false,-1)}else{MessageHelper.displayErrorMessage(MessageHelper.messages.ERR_RESOLVING_SKU);return}}if(submitRequest()){cursor_wait();wc.service.invoke("AjaxInterestItemAdd",c)}},Add2WishListAjaxByID:function(a){if(a!=null){var c=[];c.storeId=this.storeId;c.catalogId=this.catalogId;c.langId=this.langId;c.catEntryId=a;c.URL="SuccessfulAJAXRequest";document.getElementById("controllerURLWishlist")!= null&&document.getElementById("controllerURLWishlist")!="undefined"&&CommonControllersDeclarationJS.setControllerURL("WishlistDisplay_Controller",document.getElementById("controllerURLWishlist").value);if(submitRequest()){cursor_wait();this.ajaxShopCart?wc.service.invoke("AjaxInterestItemAdd",c):wc.service.invoke("AjaxInterestItemAdd_shopCart",c)}}else MessageHelper.displayErrorMessage(MessageHelper.messages.ERR_RESOLVING_SKU)},Add2WishListAjax:function(a){this.setEntitledItems(eval("("+dojo.byId(a).innerHTML+ ")"));this.Add2WishListAjaxByID(this.getCatalogEntryId())},AddItem2WishListAjax:function(a){var c=[];c.storeId=this.storeId;c.catalogId=this.catalogId;c.langId=this.langId;c.catEntryId=a;c.URL="SuccessfulAJAXRequest";if(submitRequest()){cursor_wait();this.ajaxShopCart?wc.service.invoke("AjaxInterestItemAdd",c):wc.service.invoke("AjaxInterestItemAdd_shopCart",c)}},Add2WishList:function(a,c){this.setEntitledItems(eval("("+dojo.byId(a).innerHTML+")"));this.Add2WishListByID(this.getCatalogEntryId(),c)}, Add2WishListByID:function(a,c){if(a!=null){c.productId.value=a;c.catEntryId.value=a;c.action="InterestItemAdd";c.page.value="customerlinkwishlist";c.URL.value=this.ajaxMyAccount?this.userType=="G"?"InterestItemDisplay":"AjaxLogonForm":this.userType=="G"?"InterestItemDisplay":"NonAjaxAccountWishListDisplayView";c.quantity.value="1";submitRequest()&&c.submit()}else MessageHelper.displayErrorMessage(MessageHelper.messages.ERR_RESOLVING_SKU)},AddItem2WishList:function(a){a.action="InterestItemAdd";a.quantity.value= "1";a.page.value="customerlinkwishlist";a.URL.value=this.ajaxMyAccount?this.userType=="G"?"InterestItemDisplay":"AjaxLogonForm":this.userType=="G"?"InterestItemDisplay":"NonAjaxAccountWishListDisplayView";submitRequest()&&a.submit()},Add2CompareAjax:function(a,c,d,b){compareProductJS!=null&&compareProductJS.Add2CompareAjax(a,c,d,b)},loadContentURL:function(a){if(submitRequest()){cursor_wait();CommonControllersDeclarationJS.setControllerURL("CategoryDisplay_Controller",a);wc.render.updateContext("CategoryDisplay_Context")}}, loadSubCategoryContentURL:function(a){MessageHelper.hideAndClearMessage();if(submitRequest()){cursor_wait();CommonControllersDeclarationJS.setControllerURL("SubCategoryDisplay_Controller",a);wc.render.updateContext("SubCategoryDisplay_Context")}},goBack:function(){categoryDisplayJS.loadContentURL(this.changeUrl);categoryDisplayJS.isHistory=true},goForward:function(){categoryDisplayJS.loadContentURL(this.changeUrl);isHistory=true},HistoryTracker:function(a,c){this.elementId=a;this.changeUrl=c},processBookmarkURL:function(){var a= location.hash;if(a)a=a.substring(1,a.length);if(a){var c=a.indexOf("identifier",0);c>=0&&a.substring(0,c-1)}},initializeMerchandisingAssociation:function(a){var c=document.getElementById("marchandisingAssociationDisplay"),d=document.getElementById("totalPriceMsg").value;this.baseCatalogEntryDetails=eval("("+dojo.byId("baseCatEntryDetails").innerHTML+")");var b=this.baseCatalogEntryDetails[0].baseCatEntry_Price;this.totalAssociationCount=this.baseCatalogEntryDetails[0].toatlAssociations;this.merchandisingAssociationItems= eval("("+dojo.byId("associatedCatEntries_"+a).innerHTML+")");a=parseFloat(b)+parseFloat(this.merchandisingAssociationItems[0].catEntry_Price);var e="";if(this.merchandisingAssociationItems[0].catEntry_Type=="ProductBean")e="product";else if(this.merchandisingAssociationItems[0].catEntry_Type=="ItemBean")e="item";else if(this.merchandisingAssociationItems[0].catEntry_Type=="PackageBean")e="package";else if(this.merchandisingAssociationItems[0].catEntry_Type=="BundleBean")e="bundle";b="";if(document.getElementById("addToCartLink"))b= b+"<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='"+("AjaxOrderItemDisplayView?storeId="+this.storeId+"&catalogId="+this.catalogId+"&langId="+this.langId)+"' 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</form>\n";b+="<div class='scroller' id='WC_CategoryDisplayJS_div_1'>";if(this.totalAssociationCount>1){if(this.associationThumbnailIndex<this.totalAssociationCount)b+="\t\t<a href='Javascript:categoryDisplayJS.showNextAssociation()' id='WC_ProductAssociation_UpArrow_Link_1'>";b=b+"\t\t<img src='"+this.baseCatalogEntryDetails[0].storeImage_Path+ "i_up_arrow.png' alt='"+this.displayNextAssociation+"'/></a>"}b=b+" <br /><div id='baseContent_"+this.merchandisingAssociationItems[0].catEntry_Identifier+"'";if(this.merchandisingAssociationItems[0].showProductQuickView=="true")b=b+" onmouseover='showPopupButton("+this.merchandisingAssociationItems[0].catEntry_Identifier+");' onmouseout='hidePopupButton("+this.merchandisingAssociationItems[0].catEntry_Identifier+");'>";else b+=" >";if(this.merchandisingAssociationItems[0].productDragAndDrop=="true")b= b+" <div dojoType='dojo.dnd.Source' jsId='dndSource' id="+this.merchandisingAssociationItems[0].catEntry_Identifier+" copyOnly='true' dndType='"+e+"'>\t\t<div class='dojoDndItem' dndType='"+e+"' id='WC_CategoryDisplayJS_div_draganddrop'>";b=b+"\t<a href='"+this.merchandisingAssociationItems[0].catEntry_ProductLink+"' id='img"+this.merchandisingAssociationItems[0].catEntry_Identifier+"' onfocus='showPopupButton("+this.merchandisingAssociationItems[0].catEntry_Identifier+");'>\t\t<img src='"+this.merchandisingAssociationItems[0].catEntry_Thumbnail+ "' alt='"+this.merchandisingAssociationItems[0].catEntry_ShortDescription+"' class='img'/>\t</a><br />";if(this.merchandisingAssociationItems[0].productDragAndDrop=="true")b+="\t\t</div>\t</div>";if(this.merchandisingAssociationItems[0].showProductQuickView=="true")b=b+" <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";b+="</div>";if(this.totalAssociationCount>1){if(this.associationThumbnailIndex>1)b+="\t\t<a href='Javascript:categoryDisplayJS.showPreviousAssociation()' id='WC_ProductAssociation_DownArrow_Link_1'>";b=b+"\t\t<img src='"+this.baseCatalogEntryDetails[0].storeImage_Path+"i_down_arrow.png' alt='"+this.displayPrevAssociation+"'/></a>"}e=this.baseCatalogEntryDetails[0].associatedProductsName.replace("{0}",this.baseCatalogEntryDetails[0].baseCatEntry_Name); e=e.replace("{1}",this.merchandisingAssociationItems[0].catEntry_Name);b=b+"</div><div class='combo_text' id='WC_CategoryDisplayJS_div_2'>\n\t<h1 class='status_msg'>"+e+"</h1>\n\t<span class='grey'>"+d+dojo.currency.format(a.toFixed(2),{currency:this.baseCatalogEntryDetails[0].currency})+"</span>\n</div>\n";b=b+"<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_Name+"'/>";c.innerHTML=null;c.innerHTML=b;dojo.parser.parse(c)},showNextAssociation:function(){if(this.associationThumbnailIndex<this.totalAssociationCount){this.associationThumbnailIndex+=1;this.initializeMerchandisingAssociation(this.associationThumbnailIndex)}}, showPreviousAssociation:function(){if(this.associationThumbnailIndex>1){this.associationThumbnailIndex-=1;this.initializeMerchandisingAssociation(this.associationThumbnailIndex)}},AddAssociation2ShopCartAjax:function(a,c){this.merchandisingAssociationItems=eval("("+dojo.byId("associatedCatEntries_"+this.associationThumbnailIndex).innerHTML+")");this.baseItemAddedToCart=false;if(this.merchandisingAssociationItems[0].catEntry_Type=="ProductBean"){this.Add2ShopCartAjax(a,c);this.baseItemAddedToCart&& showPopup(this.merchandisingAssociationItems[0].catEntry_Identifier,this.storeId,this.langId,this.catalogId,function(h){return h},"marchandisingAssociationDisplay")}else if(this.merchandisingAssociationItems[0].catEntry_Type=="ItemBean"||this.merchandisingAssociationItems[0].catEntry_Type=="PackageBean"||this.merchandisingAssociationItems[0].catEntry_Type=="BundleBean"){this.setEntitledItems(eval("("+dojo.byId(a).innerHTML+")"));var d=this.getCatalogEntryId(),b=[];b.storeId=this.storeId;b.catalogId= this.catalogId;b.langId=this.langId;b.orderId=".";if(d!=null){this.updateParamObject(b,"catEntryId",d,false,-1);this.updateParamObject(b,"quantity",c,false,-1);if(this.merchandisingAssociationItems[0].catEntry_Type=="BundleBean"){d=[];d=document.getElementById(this.merchandisingAssociationItems[0].catEntry_BundleFormId).catEntryIDS.value.toString().split(",");for(var e=0;e<d.length;e++){var f=document.getElementById("quantity_"+d[e]).value,g=d[e];if(this.getDefaultItem(d[e]))g=this.getDefaultItem(d[e]); if(f==0||f==null)f=1;if(f!=null&&f!=""&&g!=null){this.updateParamObject(b,"catEntryId",g,false,-1);this.updateParamObject(b,"quantity",f,false,-1)}else{MessageHelper.displayErrorMessage(MessageHelper.messages.ERR_RESOLVING_SKU);return}}}else{this.updateParamObject(b,"catEntryId",this.merchandisingAssociationItems[0].catEntry_Identifier,false,-1);this.updateParamObject(b,"quantity",1,false,-1)}if(submitRequest()){cursor_wait();wc.service.invoke("AjaxAddOrderItem",b)}}else MessageHelper.displayErrorMessage(MessageHelper.messages.ERR_RESOLVING_SKU)}}, AddMarchandisingAssociation2ShopCart:function(a,c,d){this.merchandisingAssociationItems=eval("("+dojo.byId("associatedCatEntries_"+this.associationThumbnailIndex).innerHTML+")");this.setEntitledItems(eval("("+dojo.byId(a).innerHTML+")"));a=this.getCatalogEntryId();if(this.merchandisingAssociationItems[0].catEntry_Type=="ProductBean")if(a!=null){c.catEntryId_1.value=a;c.productId_1.value=a;c.quantity_1.value=d;this.merchandisingProductAssociationAddToCart=true;this.merchandisingProductAssociationForm= c;showPopup(this.merchandisingAssociationItems[0].catEntry_Identifier,this.storeId,this.langId,this.catalogId,function(g){return g},"marchandisingAssociationDisplay")}else MessageHelper.displayErrorMessage(MessageHelper.messages.ERR_RESOLVING_SKU);else if(this.merchandisingAssociationItems[0].catEntry_Type=="ItemBean"||this.merchandisingAssociationItems[0].catEntry_Type=="PackageBean"||this.merchandisingAssociationItems[0].catEntry_Type=="BundleBean")if(a!=null){c.catEntryId_1.value=a;c.productId_1.value= a;c.quantity_1.value=d;if(this.merchandisingAssociationItems[0].catEntry_Type=="BundleBean"){d=[];d=document.getElementById(this.merchandisingAssociationItems[0].catEntry_BundleFormId).catEntryIDS.value.toString().split(",");a=3;for(var b=0;b<d.length;b++){var e=document.getElementById("quantity_"+d[b]).value,f=d[b];if(this.getDefaultItem(d[b]))f=this.getDefaultItem(d[b]);if(e==0||e==null)e=1;if(e!=null&&e!=""&&f!=null)if(b==0){c.catEntryId_2.value=f;c.productId_2.value=f;c.quantity_2.value=e}else{e= document.createElement("input");e.setAttribute("id","OrderAssociationItemAddForm_catEntryId_"+f);e.setAttribute("type","hidden");e.setAttribute("name","catEntryId_"+a);e.setAttribute("value",f);c.appendChild(e);e=document.createElement("input");e.setAttribute("id","OrderAssociationItemAddForm_productId_"+f);e.setAttribute("type","hidden");e.setAttribute("name","productId_"+a);e.setAttribute("value",f);c.appendChild(e);e=document.createElement("input");e.setAttribute("id","OrderAssociationItemAddForm_quantity_"+ f);e.setAttribute("type","hidden");e.setAttribute("name","quantity_"+a);e.setAttribute("value","1");c.appendChild(e);a+=1}else{MessageHelper.displayErrorMessage(MessageHelper.messages.ERR_RESOLVING_SKU);return}}}else{c.catEntryId_2.value=this.merchandisingAssociationItems[0].catEntry_Identifier;c.productId_2.value=this.merchandisingAssociationItems[0].catEntry_Identifier;c.quantity_2.value="1"}submitRequest()&&c.submit()}else MessageHelper.displayErrorMessage(MessageHelper.messages.ERR_RESOLVING_SKU)}, AddAssociation2ShopCart:function(a,c){var d=this.merchandisingProductAssociationForm;this.merchandisingProductAssociationAddToCart=false;if(this.isParentBundleBean){var b=[];b=d.catEntryIDS.value.toString().split(",");for(var e=1,f=0;f<b.length;f++){var g=document.getElementById("quantity_"+b[f]).value,h=b[f];if(this.selectedProducts[b[f]])h=this.getCatalogEntryIdforProduct(this.selectedProducts[b[f]]);if(g==0||g==null)g=1;if(g!=null&&g!=""&&h!=null){g=document.createElement("input");g.setAttribute("id", "OrderItemAddForm_catEntryId_"+h);g.setAttribute("type","hidden");g.setAttribute("name","catEntryId_"+e);g.setAttribute("value",h);e+=1;d.appendChild(g)}else{MessageHelper.displayErrorMessage(MessageHelper.messages.ERR_RESOLVING_SKU);return}}b=document.createElement("input");b.setAttribute("id","OrderItemAddForm_catEntryId_"+a);b.setAttribute("type","hidden");b.setAttribute("name","catEntryId_"+e);b.setAttribute("value",a);d.appendChild(b);b=document.createElement("input");b.setAttribute("id","OrderItemAddForm_quantity_"+ a);b.setAttribute("type","hidden");b.setAttribute("name","quantity_"+e);b.setAttribute("value",c);d.appendChild(b);d.URL.value="AjaxOrderItemDisplayView";this.isParentBundleBean=false}else{d.catEntryId_2.value=a;d.productId_2.value=a;d.quantity_2.value=c}if(submitRequest()){d.submit();this.merchandisingProductAssociationForm=""}},AddAssociationItem2ShopCartAjax:function(a,c){this.merchandisingAssociationItems=eval("("+dojo.byId("associatedCatEntries_"+this.associationThumbnailIndex).innerHTML+")"); this.baseItemAddedToCart=false;if(this.merchandisingAssociationItems[0].catEntry_Type=="ProductBean"){this.AddItem2ShopCartAjax(a,c);this.baseItemAddedToCart&&showPopup(this.merchandisingAssociationItems[0].catEntry_Identifier,this.storeId,this.langId,this.catalogId,function(h){return h},"marchandisingAssociationDisplay")}else if(this.merchandisingAssociationItems[0].catEntry_Type=="ItemBean"||this.merchandisingAssociationItems[0].catEntry_Type=="PackageBean"||this.merchandisingAssociationItems[0].catEntry_Type== "BundleBean"){var d=[];d.storeId=this.storeId;d.catalogId=this.catalogId;d.langId=this.langId;d.orderId=".";this.updateParamObject(d,"catEntryId",a,false,-1);this.updateParamObject(d,"quantity",c,false,-1);if(this.merchandisingAssociationItems[0].catEntry_Type=="BundleBean"){var b=[];b=document.getElementById(this.merchandisingAssociationItems[0].catEntry_BundleFormId).catEntryIDS.value.toString().split(",");for(var e=0;e<b.length;e++){var f=document.getElementById("quantity_"+b[e]).value,g=b[e]; if(this.getDefaultItem(b[e]))g=this.getDefaultItem(b[e]);if(f==0||f==null)f=1;if(f!=null&&f!=""&&g!=null){this.updateParamObject(d,"catEntryId",g,false,-1);this.updateParamObject(d,"quantity",f,false,-1)}else{MessageHelper.displayErrorMessage(MessageHelper.messages.ERR_RESOLVING_SKU);return}}}else{this.updateParamObject(d,"catEntryId",this.merchandisingAssociationItems[0].catEntry_Identifier,false,-1);this.updateParamObject(d,"quantity",1,false,-1)}if(submitRequest()){cursor_wait();wc.service.invoke("AjaxAddOrderItem", d)}}},AddAssociationItem2ShopCart:function(a,c){this.merchandisingAssociationItems=eval("("+dojo.byId("associatedCatEntries_"+this.associationThumbnailIndex).innerHTML+")");if(this.merchandisingAssociationItems[0].catEntry_Type=="ProductBean"){if(c)a.quantity_1.value=c;this.merchandisingProductAssociationAddToCart=true;this.merchandisingProductAssociationForm=a;showPopup(this.merchandisingAssociationItems[0].catEntry_Identifier,this.storeId,this.langId,this.catalogId,function(h){return h},"marchandisingAssociationDisplay")}else if(this.merchandisingAssociationItems[0].catEntry_Type== "ItemBean"||this.merchandisingAssociationItems[0].catEntry_Type=="PackageBean"||this.merchandisingAssociationItems[0].catEntry_Type=="BundleBean"){if(c)a.quantity_1.value=c;if(this.merchandisingAssociationItems[0].catEntry_Type=="BundleBean"){var d=[];d=document.getElementById(this.merchandisingAssociationItems[0].catEntry_BundleFormId).catEntryIDS.value.toString().split(",");for(var b=3,e=0;e<d.length;e++){var f=document.getElementById("quantity_"+d[e]).value,g=d[e];if(this.getDefaultItem(d[e]))g= this.getDefaultItem(d[e]);if(f==0||f==null)f=1;if(e==0){a.catEntryId_2.value=g;a.productId_2.value=g;a.quantity_2.value=f}else{f=document.createElement("input");f.setAttribute("id","OrderAssociationItemAddForm_catEntryId_"+g);f.setAttribute("type","hidden");f.setAttribute("name","catEntryId_"+b);f.setAttribute("value",g);a.appendChild(f);f=document.createElement("input");f.setAttribute("id","OrderAssociationItemAddForm_productId_"+g);f.setAttribute("type","hidden");f.setAttribute("name","productId_"+ b);f.setAttribute("value",g);a.appendChild(f);f=document.createElement("input");f.setAttribute("id","OrderAssociationItemAddForm_quantity_"+g);f.setAttribute("type","hidden");f.setAttribute("name","quantity_"+b);f.setAttribute("value","1");a.appendChild(f);b+=1}}}else{a.catEntryId_2.value=this.merchandisingAssociationItems[0].catEntry_Identifier;a.productId_2.value=this.merchandisingAssociationItems[0].catEntry_Identifier;a.quantity_2.value="1"}submitRequest()&&a.submit()}},AddAssociationBundle2ShopCartAjax:function(a){this.merchandisingAssociationItems= eval("("+dojo.byId("associatedCatEntries_"+this.associationThumbnailIndex).innerHTML+")");this.baseItemAddedToCart=false;var c=[];c.storeId=this.storeId;c.catalogId=this.catalogId;c.langId=this.langId;c.orderId=".";var d=[];d=a.catEntryIDS.value.toString().split(",");for(a=0;a<d.length;a++){var b=document.getElementById("quantity_"+d[a]).value,e=d[a];if(this.getDefaultItem(d[a]))e=this.getDefaultItem(d[a]);if(b==0||b==null)b=1;if(b!=null&&b!=""&&e!=null){this.updateParamObject(c,"catEntryId",e,false, -1);this.updateParamObject(c,"quantity",b,false,-1);this.baseItemAddedToCart="true"}else{MessageHelper.displayErrorMessage(MessageHelper.messages.ERR_RESOLVING_SKU);return}}if(this.merchandisingAssociationItems[0].catEntry_Type=="BundleBean"){d=[];d=document.getElementById(this.merchandisingAssociationItems[0].catEntry_BundleFormId).catEntryIDS.value.toString().split(",");for(a=0;a<d.length;a++){b=document.getElementById("quantity_"+d[a]).value;e=d[a];if(this.getDefaultItem(d[a]))e=this.getDefaultItem(d[a]); if(b==0||b==null)b=1;if(b!=null&&b!=""&&e!=null){this.updateParamObject(c,"catEntryId",e,false,-1);this.updateParamObject(c,"quantity",b,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(c,"catEntryId",this.merchandisingAssociationItems[0].catEntry_Identifier,false,-1);this.updateParamObject(c, "quantity",1,false,-1)}if(submitRequest()){cursor_wait();wc.service.invoke("AjaxAddOrderItem",c);this.merchandisingAssociationItems[0].catEntry_Type=="ProductBean"&&showPopup(this.merchandisingAssociationItems[0].catEntry_Identifier,this.storeId,this.langId,this.catalogId,function(f){return f},"marchandisingAssociationDisplay")}},AddAssociationBundle2ShopCart:function(a){this.merchandisingAssociationItems=eval("("+dojo.byId("associatedCatEntries_"+this.associationThumbnailIndex).innerHTML+")");this.isParentBundleBean= true;if(this.merchandisingAssociationItems[0].catEntry_Type=="ProductBean"){this.merchandisingProductAssociationAddToCart=true;this.merchandisingProductAssociationForm=a;var c=[];c=a.catEntryIDS.value.toString().split(",");for(var d=1,b=0;b<c.length;b++){var e=document.getElementById("quantity_"+c[b]).value,f=c[b];if(this.getDefaultItem(c[b]))f=this.getDefaultItem(c[b]);if(f!=null)a["catEntryId_"+c[b]].value=f;else{MessageHelper.displayErrorMessage(MessageHelper.messages.ERR_RESOLVING_SKU);return}d+= 1}showPopup(this.merchandisingAssociationItems[0].catEntry_Identifier,this.storeId,this.langId,this.catalogId,function(g){return g},"marchandisingAssociationDisplay")}else if(this.merchandisingAssociationItems[0].catEntry_Type=="ItemBean"||this.merchandisingAssociationItems[0].catEntry_Type=="PackageBean"||this.merchandisingAssociationItems[0].catEntry_Type=="BundleBean"){c=[];c=a.catEntryIDS.value.toString().split(",");d=1;for(b=0;b<c.length;b++){e=document.getElementById("quantity_"+c[b]).value; f=c[b];if(this.getDefaultItem(c[b]))f=this.getDefaultItem(c[b]);if(f!=null)a["catEntryId_"+c[b]].value=f;else{MessageHelper.displayErrorMessage(MessageHelper.messages.ERR_RESOLVING_SKU);return}d+=1}if(this.merchandisingAssociationItems[0].catEntry_Type=="BundleBean"){c=[];c=document.getElementById(this.merchandisingAssociationItems[0].catEntry_BundleFormId).catEntryIDS.value.toString().split(",");for(b=0;b<c.length;b++){e=document.getElementById("quantity_"+c[b]).value;f=c[b];if(this.getDefaultItem(c[b]))f= this.getDefaultItem(c[b]);if(e==0||e==null)e=1;if(e!=null&&e!=""&&f!=null){e=document.createElement("input");e.setAttribute("id","OrderItemAddForm_catEntryId_"+f);e.setAttribute("type","hidden");e.setAttribute("name","catEntryId_"+d);e.setAttribute("value",f);a.appendChild(e);e=document.createElement("input");e.setAttribute("id","OrderItemAddForm_quantity_"+f);e.setAttribute("type","hidden");e.setAttribute("name","quantity_"+d);e.setAttribute("value","1");a.appendChild(e);d+=1}else{MessageHelper.displayErrorMessage(MessageHelper.messages.ERR_RESOLVING_SKU); return}}}else{e=document.createElement("input");e.setAttribute("id","OrderItemAddForm_catEntryId_"+this.merchandisingAssociationItems[0].catEntry_Identifier);e.setAttribute("type","hidden");e.setAttribute("name","catEntryId_"+d);e.setAttribute("value",this.merchandisingAssociationItems[0].catEntry_Identifier);a.appendChild(e);e=document.createElement("input");e.setAttribute("id","OrderItemAddForm_quantity_"+this.merchandisingAssociationItems[0].catEntry_Identifier);e.setAttribute("type","hidden"); e.setAttribute("name","quantity_"+d);e.setAttribute("value","1");a.appendChild(e)}a.URL.value="AjaxOrderItemDisplayView";submitRequest()&&a.submit()}}};categoryDisplayJS.HistoryTracker.prototype.back=categoryDisplayJS.goBack;categoryDisplayJS.HistoryTracker.prototype.forward=categoryDisplayJS.goForward;
