
if(!dojo._hasResource["dojo.NodeList-traverse"]){dojo._hasResource["dojo.NodeList-traverse"]=true;dojo.provide("dojo.NodeList-traverse");dojo.extend(dojo.NodeList,{_buildArrayFromCallback:function(_1){var _2=[];for(var i=0;i<this.length;i++){var _3=_1.call(this[i],this[i],_2);if(_3){_2=_2.concat(_3);}}return _2;},_filterQueryResult:function(_4,_5){var _6=dojo.filter(_4,function(_7){return dojo.query(_5,_7.parentNode).indexOf(_7)!=-1;});var _8=this._wrap(_6);return _8;},_getUniqueAsNodeList:function(_9){var _a=[];for(var i=0,_b;_b=_9[i];i++){if(_b.nodeType==1&&dojo.indexOf(_a,_b)==-1){_a.push(_b);}}return this._wrap(_a,null,this._NodeListCtor);},_getUniqueNodeListWithParent:function(_c,_d){var _e=this._getUniqueAsNodeList(_c);_e=(_d?this._filterQueryResult(_e,_d):_e);return _e._stash(this);},_getRelatedUniqueNodes:function(_f,_10){return this._getUniqueNodeListWithParent(this._buildArrayFromCallback(_10),_f);},children:function(_11){return this._getRelatedUniqueNodes(_11,function(_12,ary){return dojo._toArray(_12.childNodes);});},closest:function(_13){var _14=this;return this._getRelatedUniqueNodes(_13,function(_15,ary){do{if(_14._filterQueryResult([_15],_13).length){return _15;}}while((_15=_15.parentNode)&&_15.nodeType==1);return null;});},parent:function(_16){return this._getRelatedUniqueNodes(_16,function(_17,ary){return _17.parentNode;});},parents:function(_18){return this._getRelatedUniqueNodes(_18,function(_19,ary){var _1a=[];while(_19.parentNode){_19=_19.parentNode;_1a.push(_19);}return _1a;});},siblings:function(_1b){return this._getRelatedUniqueNodes(_1b,function(_1c,ary){var _1d=[];var _1e=(_1c.parentNode&&_1c.parentNode.childNodes);for(var i=0;i<_1e.length;i++){if(_1e[i]!=_1c){_1d.push(_1e[i]);}}return _1d;});},next:function(_1f){return this._getRelatedUniqueNodes(_1f,function(_20,ary){var _21=_20.nextSibling;while(_21&&_21.nodeType!=1){_21=_21.nextSibling;}return _21;});},nextAll:function(_22){return this._getRelatedUniqueNodes(_22,function(_23,ary){var _24=[];var _25=_23;while((_25=_25.nextSibling)){if(_25.nodeType==1){_24.push(_25);}}return _24;});},prev:function(_26){return this._getRelatedUniqueNodes(_26,function(_27,ary){var _28=_27.previousSibling;while(_28&&_28.nodeType!=1){_28=_28.previousSibling;}return _28;});},prevAll:function(_29){return this._getRelatedUniqueNodes(_29,function(_2a,ary){var _2b=[];var _2c=_2a;while((_2c=_2c.previousSibling)){if(_2c.nodeType==1){_2b.push(_2c);}}return _2b;});},andSelf:function(){return this.concat(this._parent);},first:function(){return this._wrap(((this[0]&&[this[0]])||[]),this);},last:function(){return this._wrap((this.length?[this[this.length-1]]:[]),this);},even:function(){return this.filter(function(_2d,i){return i%2!=0;});},odd:function(){return this.filter(function(_2e,i){return i%2==0;});}});}if(!dojo._hasResource["LEE.view.catalog.CatalogFilters"]){dojo._hasResource["LEE.view.catalog.CatalogFilters"]=true;dojo.provide("LEE.view.catalog.CatalogFilters");dojo.provide("LEE.ui.global.Accordion");dojo.declare("LEE.view.catalog.CatalogFilters",LEE.ui.global.Accordion,{expandCollapse:null,filters:null,constructor:function(_2f){if(_2f){this.node=dojo.byId(_2f);}else{this.node=dojo.byId(LEE.view.catalog.CatalogFilters.IDS.FILTERS_CONTAINER);}this.startup();},startup:function(){if(!this._initialized&&this.node){this._initializeParameters();this._createChildren();this._findAccordions();this._findButtons();this._subscribed();this._findExpandCollapseAllButtons();this._initialized=true;}},_initializeParameters:function(){if(!this.connections){this.connections=[];}if(!this.classNames){this.classNames=LEE.view.catalog.CatalogFilters.CLASSES;}if(!this.idNames){this.idNames=LEE.view.catalog.CatalogFilters.IDS;}if(!this.accordions){this.accordions=LEE.view.catalog.CatalogFilters.ACCORDIANS;}if(!this.closedHeight){this.closedHeight=0;}if(!this.optionsOpen){this.optionsOpen=[];}if(!this.toggle){this.toggle=false;}if(!this.container){this.container=this.node;}if(!this.expandCollapse){this.expandCollapse=[];}if(!this.filters){this.filters=dojo.query("."+this.classNames.OPTIONSCLASS);}},_findExpandCollapseAllButtons:function(){this.expandCollapse=dojo.query("#"+this.idNames.EXPANDCOLLAPSENODE+" > "+"a");for(var j=0;j<this.expandCollapse.length;j++){var _30=this.expandCollapse[j];dojo.connect(_30,"onclick",this,this.expandCollapseAll);}},expandCollapseAll:function(evt){dojo.stopEvent(evt);if(evt.target.id==this.idNames.OPENALLID){for(var i=this.filters.length-1;i>=0;i--){var _31=this.filters[i];this._openMenu(_31);dojo.addClass(dojo.query(_31).siblings(".filter_button")[0],this.classNames.ACTIVE);}}else{for(var i=this.filters.length-1;i>=0;i--){dojo.removeClass(dojo.query(this.filters[i]).siblings(".filter_button")[0],this.classNames.ACTIVE);}for(var i=this.optionsOpen.length-1;i>=0;i--){this._closeMenu(this.optionsOpen[i]);}}}});LEE.view.catalog.CatalogFilters.ACCORDIANS=[];LEE.view.catalog.CatalogFilters.CLASSES={ACTIVE:"active",BUTTONCLASS:"filter_button",CLOSED:"closedatstart",LOCKED:"toggle_locked",OPTIONSCLASS:"filter_options"};LEE.view.catalog.CatalogFilters.IDS={FILTERS_CONTAINER:"filters_bottom",OPENALLID:"btn_expandall",EXPANDCOLLAPSENODE:"expand_collapse"};}if(!dojo._hasResource["LEE.view.product.Pagination"]){dojo._hasResource["LEE.view.product.Pagination"]=true;dojo.provide("LEE.view.product.Pagination");dojo.declare("LEE.view.product.Pagination",null,{_connections:[],items:[],totalElement:null,filters:[],form:null,nextButtons:[],queryFilters:[],pageNumbers:[],pageQueryStringName:"",pageQueryStringRegEx:null,pageSize:12,perPage:null,perRow:0,prevButtons:[],serviceUrl:"",sortSelect:null,sortState:"",swatchContainer:null,templateItem:null,templateNumber:null,totalPages:3,viewAngle:"",viewOptions:[],constructor:function(){this.product=LEE.model.ModelLocator.getModel(LEE.model.ModelNames.PRODUCT_MODEL);this.node=dojo.byId(LEE.view.product.Pagination.PAGINATION_CONTAINER_ID);this.formFieldData=dojo.query("input[type='hidden']");this.serverQuery={};for(i=0;i<this.formFieldData.length;i++){this.serverQuery[this.formFieldData[i].name]=this.formFieldData[i].value;}this.pageSize=this.serverQuery.count=LEE.view.product.Pagination.PER_PAGE.CATEGORY1;this.perRow=LEE.view.product.Pagination.PER_ROW;if(this.node&&dojo.hasClass(this.node,"maywesuggest")){this.pageSize=this.serverQuery.count=LEE.view.product.Pagination.PER_PAGE.SUGGESTION;}this.pageQueryStringName=LEE.view.product.Pagination.PAGE_QUERY_STRING_GET_NAME;this.pageQueryStringRegEx=new RegExp(this.pageQueryStringName+"=[^&+]","gi");this.pageNumbersAfterEllipsis=LEE.view.product.Pagination.PAGE_NUMBERS_AFTER_ELLIPSIS;this.pageNumbersBeforeEllipsis=LEE.view.product.Pagination.PAGE_NUMBERS_BEFORE_ELLIPSIS;this.pageNumbersMax=this.pageNumbersAfterEllipsis+this.pageNumbersBeforeEllipsis;this._convertInputToPageLinks();this._findElements();this._getTemplates();this._loadNumbers();this._findElements();this._resetCheckboxes();this._displayPageNumbers();this._setNextPrevButtons();this._attachListeners();this.viewAngle=LEE.view.product.Pagination.CLASSES.ANGLE1;dojo.subscribe(LEE.event.ModelEventNames.PRODUCT_CATALOG_UPDATE,this,this.onSuccess);dojo.subscribe(LEE.event.ModelEventNames.PRODUCT_CATALOG_ERROR,this,this.onFail);if(window.location.hash.length>1){this.refreshOnHistory();}else{this._invalidateFormQuery();}this.initialQuery=dojo.clone(this.serverQuery);var _32={handle:dojo.hitch(this,this.refreshOnHistory),changeUrl:this._createHashURLFromQuery()};dojo.back.setInitialState(_32);if(dojo.isIE){dojo.back.addToHistory(_32);}},_attachListeners:function(){dojo.forEach(this._connections,function(_33){dojo.disconnect(_33);});this._connections=[];dojo.forEach(this.filters,function(el){if(!LEE.util.Dom.hasTagName(el,"input")){var _34=dojo.query("input",el);if(_34[0]){el=_34[0];}}this._connections.push(dojo.connect(el,"onclick",this,this.refreshOnFilter));},this);dojo.forEach(this.pageNumbers,function(el){this._connections.push(dojo.connect(el,"onclick",this,this.refreshOnPage));},this);dojo.forEach(this.viewOptions,function(el){this._connections.push(dojo.connect(el,"onclick",this,this._changeView));},this);if(this.sortSelect){this._connections.push(dojo.connect(this.sortSelect,"onclick",this,this.refreshOnSort));}if(this.perPage){this._connections.push(dojo.connect(this.perPage,"onclick",this,this.refreshOnCount));}if(this.form){this._connections.push(dojo.connect(this.form,"onsubmit",this,this.refreshOnFilter));}},refresh:function(){dojo.publish(LEE.event.GlobalEventNames.CLICK_BLOCKER_SHOW);this.product.fetchCatalog(this.serverQuery,this.serviceUrl);},_invalidateHashQuery:function(){var _35=unescape(window.location.hash).substring(1).split("&");var _36=_35.length;if(_36>1){for(var i=_36-1;i>=0;i--){var _37=_35[i].split("=");this.serverQuery[_37[0]]=_37[1];}}else{this.serverQuery=dojo.clone(this.initialQuery);}},_invalidateQueryInput:function(){var _38=this.serverQuery.filter1.split("%")[0];var _39=this.serverQuery.filter1.split("%").slice(1);var _3a=this.filters.length;var _3b=[];if(_39.length>0){for(var i=_3a-1;i>=0;i--){var _3c=this.filters[i];var _3d=this._getFilterValue(_3c);if(dojo.indexOf(_39,_3d)>-1){this._selectFilter(_3c);}else{this._deselectFilter(_3c);}}}else{this._resetCheckboxes();}if(this.perPage){this.pageSize=this.perPage.value=this.serverQuery.count;}if(this.sortSelect){this.sortState=this.sortSelect.value=this.serverQuery.sort;}},_getFilterValue:function(_3e){var _3f;var _40=dijit.byNode(_3e);if(_40){var _41=_40.attr("checked");_40.setAttribute("checked",true);_3f=_40.attr("value");_40.setAttribute("checked",_41);}else{if(LEE.util.Dom.hasTagName(_3e,"input")){_3f=_3e.value;}}if(_3f&&_3f.indexOf("__")>-1){_3f=_3f.split("__")[1];}return _3f;},_selectFilter:function(_42){_42.checked="";widget=dijit.byNode(_42);if(widget){widget.setAttribute("disabled",false);widget.setAttribute("checked",true);dojo.publish(LEE.event.GlobalEventNames.CHECKBOX_ENABLED,[_42]);}else{dojo.attr(_42,"checked",true);}dojo.publish(LEE.event.GlobalEventNames.CHECKBOX_ON_PAGINATION,[_42]);},_deselectFilter:function(_43){_43.checked="";widget=dijit.byNode(_43);if(widget){widget.setAttribute("checked",false);dojo.publish(LEE.event.GlobalEventNames.CHECKBOX_ENABLED,[_43]);}else{dojo.removeAttr(_43,"checked");}dojo.publish(LEE.event.GlobalEventNames.CHECKBOX_ON_PAGINATION,[_43]);},_invalidateFormQuery:function(){if(this.perPage){this.serverQuery.count=this.pageSize=this.perPage.value;}if(this.sortSelect){this.serverQuery.sort=this.sortState=this.sortSelect.value;}if(this.viewOptions[0]){this.serverQuery.view=LEE.ui.form.Form.findRadioValue(this.form[this.viewOptions[0].name]);}this.queryFilters=[];var _44=this.filters.length;for(var i=0;i<_44;i++){var _45="";var _46=this.filters[i];var _47=dijit.byNode(_46);if(_47){if(_47.getValue()){this.queryFilters.push(_47.getValue());}}else{if(LEE.util.Dom.hasTagName(_46,"input")){if(_46.checked&&_46.value){if(_46.name===_46.value){this.queryFilters.push(_46.name);}else{this.queryFilters.push(_46.name+"__"+_46.value);}}}}}var _48="";var _49=[];for(var i=0;i<this.queryFilters.length;i++){var _4a=this.queryFilters[i].split("__");if(_48===""&&_4a.length>1){_48=_4a[0];}if(_4a.length>1){_49.push(_4a[1]);}else{if(_4a.length==1){_48=_4a[0];_49.push(_4a[0]);}}}this.serverQuery.filter1=_48+"%"+_49.join("%");this._loadFiltersToServerQuery();},_loadFiltersToServerQuery:function(){for(var key in this.serverQuery){if(key.indexOf("f_")==0){delete this.serverQuery[key];}}var _4b=this.filters.length;for(var i=0;i<_4b;i++){var _4c="";var _4d=this.filters[i];var _4e=dijit.byNode(_4d);if(_4e){if(_4e.getValue()){this.serverQuery[_4e.name]=_4e.getValue();}}else{if(LEE.util.Dom.hasTagName(_4d,"input")){if(_4d.checked&&_4d.value){this.serverQuery[_4d.name]=_4d.value;}}}}},_createHashURLFromQuery:function(){var _4f="";_4f+="count="+this.serverQuery.count;_4f+="&sort="+this.serverQuery.sort;_4f+="&"+LEE.view.product.Pagination.PAGE_QUERY_STRING_NAME+"="+this.serverQuery[LEE.view.product.Pagination.PAGE_QUERY_STRING_NAME];if(this.serverQuery.view){_4f+="&view="+this.serverQuery.view;}_4f+="&filter1="+this.serverQuery.filter1;return _4f;},_addQueryToHistory:function(){var _50={handle:dojo.hitch(this,this.refreshOnHistory),changeUrl:this._createHashURLFromQuery()};dojo.back.addToHistory(_50);},_changeView:function(e){if(e){dojo.stopEvent(e);}this._displayViewOptions();if(e&&e.target&&e.target.value){this.viewAngle=e.target.value;}dojo.forEach(this.items,function(el){var _51=dojo.query("img."+LEE.view.product.Pagination.CLASSES.ANGLE1,el);var _52=dojo.query("img."+LEE.view.product.Pagination.CLASSES.ANGLE2,el);if(_51&&_52){switch(this.viewAngle){case "angle1":dojo.forEach(_51,function(_53){dojo.removeClass(_53,"none");},this);dojo.forEach(_52,function(_54){dojo.addClass(_54,"none");},this);break;default:dojo.forEach(_51,function(_55){dojo.addClass(_55,"none");},this);dojo.forEach(_52,function(_56){dojo.removeClass(_56,"none");},this);break;}}},this);},_convertInputToPageLinks:function(){var _57=0;dojo.forEach(dojo.query("."+LEE.view.product.Pagination.CLASSES.PAGE_NUMBER_CONTAINER),function(el){var _58=LEE.view.product.Pagination.PAGINATION_INPUT_TAG+"."+LEE.view.product.Pagination.CLASSES.PAGE_NUMBER_INPUT;var _59=LEE.util.Lang.getQueryElementByIndex(_58,el,0);var _5a="";var _5b=Math.max(1,parseInt(this.serverQuery[LEE.view.product.Pagination.PAGE_QUERY_STRING_NAME])-1);var _5c=parseInt(this.serverQuery[LEE.view.product.Pagination.PAGE_QUERY_STRING_NAME])+1;if(_59&&LEE.util.Dom.hasTagName(_59,"select")){_5a+="<a href=\""+_59.form.action+_5b+"\" "+"class=\""+LEE.view.product.Pagination.CLASSES.PAGE_NUMBER_LINK;if(this.serverQuery[LEE.view.product.Pagination.PAGE_QUERY_STRING_NAME]<=0){_5a+=" none";}_5a+=" "+LEE.view.product.Pagination.PREV_BUTTON_CLASS+"\">"+"&larr;"+"</a>";dojo.forEach(dojo.query("option",_59),function(opt){_5a+="<a href=\""+_59.form.action+opt.value+"\" "+"class=\""+LEE.view.product.Pagination.CLASSES.PAGE_NUMBER_LINK;if(this.serverQuery[LEE.view.product.Pagination.PAGE_QUERY_STRING_NAME]==opt.value){_5a+=" current";}_5a+="\">"+opt.innerHTML+"</a>";if(parseInt(opt.value)){_57=Math.max(_57,parseInt(opt.value)+1);}},this);_5a+="<a href=\""+_59.form.action+_5c+"\" "+"class=\""+LEE.view.product.Pagination.CLASSES.PAGE_NUMBER_LINK;if(this.totalPages<=this.serverQuery[LEE.view.product.Pagination.PAGE_QUERY_STRING_NAME]){_5a+=" none";}_5a+=" "+LEE.view.product.Pagination.NEXT_BUTTON_CLASS+"\">"+"&rarr;"+"</a>";}if(_5a){var _5d=document.createElement("div");_5d.innerHTML=_5a;dojo.addClass(_59,"none");dojo.place(_5d,el,"last");}},this);this.totalPages=_57;},_displayFilters:function(){for(var i=this.filters.length-1;i>=0;i--){var _5e=dijit.byNode(this.filters[i]);if(_5e&&!_5e.getValue()){_5e.setAttribute("disabled","disabled");}else{dojo.addClass(this.filters[i],"disabled_filter");if(LEE.util.Dom.hasTagName(this.filters[i],"input")&&!this.filters[i].checked){this.filters[i].disabled="disabled";}}dojo.publish(LEE.event.GlobalEventNames.CHECKBOX_DISABLED,[this.filters[i]]);}var _5f=this.data.parametricNavBehavior;if(_5f){for(var i=_5f.length-1;i>=0;i--){var _5e=dijit.byId(_5f[i].elementID);var _60=dojo.byId(_5f[i].elementID);if(_5e){_5e.setAttribute("disabled",false);}else{if(_60){dojo.removeClass(_60,"disabled_filter");if(LEE.util.Dom.hasTagName(_60,"input")){_60.disabled=false;}}}if(_5f[i]){dojo.publish(LEE.event.GlobalEventNames.CHECKBOX_ENABLED,[_5f[i].elementID]);}}}},_displayPageNumbers:function(){var _61=this.pageQueryStringName+"="+(this.serverQuery[LEE.view.product.Pagination.PAGE_QUERY_STRING_NAME]);dojo.forEach(this.pageNumbers,function(i){dojo.removeClass(i,LEE.view.product.Pagination.CLASSES.CURRENT);if(i.href&&i.href.match(_61)){dojo.addClass(i,LEE.view.product.Pagination.CLASSES.CURRENT);}},this);},_displayViewOptions:function(){dojo.forEach(this.viewOptions,function(el){label=LEE.util.Dom.getAncestorByTagName(el,"label");if(el.checked&&el.checked!==""){dojo.addClass(label,LEE.view.product.Pagination.CLASSES.CURRENT);}else{dojo.removeClass(label,LEE.view.product.Pagination.CLASSES.CURRENT);}},this);},_findElements:function(){this.items=dojo.query("."+LEE.view.product.Pagination.CLASSES.ITEMS,this.node);this.pageNumbers=dojo.query("."+LEE.view.product.Pagination.CLASSES.PAGE_NUMBER_LINK);this.viewOptions=dojo.query("."+LEE.view.product.Pagination.VIEW_OPTIONS_CLASS);this.paginationContainers=dojo.query("."+LEE.view.product.Pagination.CLASSES.PAGE_NUMBER_CONTAINER);this.filters=dojo.query("."+LEE.view.product.Pagination.CLASSES.FILTER);if(!this.sortSelect||!this.perPage){this.sortSelect=dojo.byId(LEE.view.product.Pagination.SORT_SELECT_ID);this.perPage=dojo.byId(LEE.view.product.Pagination.PER_PAGE_SELECT_ID);if(this.perPage||this.sortSelect){this.form=LEE.util.Dom.getAncestorByTagName(this.sortSelect,"form")||LEE.util.Dom.getAncestorByTagName(this.perPage,"form");}}if(this.form){this.serviceUrl=this.form.action;}else{if(this.pageNumbers[0]){this.serviceUrl=this.pageNumbers[0].href;}}if(!this.totalElement){this.totalElement=dojo.byId(LEE.view.product.Pagination.TOTAL_ITEMS_ID);}this.prevButtons=dojo.query("."+LEE.view.product.Pagination.PREV_BUTTON_CLASS);this.nextButtons=dojo.query("."+LEE.view.product.Pagination.NEXT_BUTTON_CLASS);if(!document.anchors[LEE.view.product.Pagination.TOP_ANCHOR_NAME]){var _62=document.createElement("a");_62.name=_62.id=LEE.view.product.Pagination.TOP_ANCHOR_NAME;this.node.parentNode.parentNode.insertBefore(_62,this.node.parentNode.parentNode.firstChild);}},_getTemplates:function(){if(this.items[0]){this.templateItem=dojo.clone(this.items[0]);var _63=dojo.query("input[type=checkbox]",this.templateItem);dojo.forEach(_63,function(_64){dojo.removeAttr(_64,"checked");dojo.removeAttr(_64,"name");dojo.removeAttr(_64,"value");},this);}if(this.pageNumbers[1]){this.templateNumber=this.pageNumbers[1].cloneNode(true);}},_getItemValue:function(_65,_66){if(_65&&_65.hasOwnProperty(_66)){return _65[_66];}else{return null;}},_loadItems:function(){var _67=0;var _68=false;this.node.innerHTML="";if(this.items.length===0){this.node.innerHTML=LEE.util.config.get("Errors.PAGINATION_NO_ITEMS");return false;}dojo.forEach(this.items,function(i){var _69=this.templateItem.cloneNode(true);dojo.forEach(dojo.query("img.catalog_item_image",_69),function(el){if(this._getItemValue(i,"URL_image")){el.src=this._getItemValue(i,"URL_image");el.alt=this._getItemValue(i,"name");dojo.removeClass(el,"none");}else{dojo.addClass(el,"none");}},this);dojo.forEach(dojo.query("img.angle2",_69),function(el){if(this._getItemValue(i,"URL_image2")){el.src=this._getItemValue(i,"URL_image2");el.alt=this._getItemValue(i,"name");dojo.removeClass(el,"none");}else{dojo.addClass(el,"none");}},this);dojo.forEach(dojo.query(".catalog_item_name",_69),function(el){var _6a=dojo.query("a.catalog_item_link",el);if(_6a.length>0){_6a[0].innerHTML=this._getItemValue(i,"name");}else{el.innerHTML=this._getItemValue(i,"name");}},this);try{dojo.forEach(dojo.query("."+LEE.view.product.Pagination.CLASSES.SWATCHES,_69),function(el){el.innerHTML="";dojo.forEach(this._getItemValue(i,"swatches"),function(img){el.innerHTML+="<img src=\""+img+"\" "+"width=\""+LEE.view.product.Pagination.SWATCH_SIZE.WIDTH+"\" "+"height=\""+LEE.view.product.Pagination.SWATCH_SIZE.HEIGHT+"\" />";},this);el.innerHTML+="<br class=\"clearabove\" />";},this);}catch(err){console.log(err.message);}dojo.forEach(dojo.query(".original_price",_69),function(el){if(this._getItemValue(i,"price")&&this._getItemValue(i,"price")&&this._getItemValue(i,"current_price")){el.innerHTML="Was "+this._getItemValue(i,"price")+"</span>";}else{if(this._getItemValue(i,"current_price")){el.innerHTML=this._getItemValue(i,"current_price");}else{el.innerHTML=this._getItemValue(i,"price");}}},this);dojo.forEach(dojo.query(".current_price",_69),function(el){if(this._getItemValue(i,"current_price")&&this._getItemValue(i,"price")){dojo.removeClass(el,"none");el.innerHTML="Now <span>"+this._getItemValue(i,"current_price")+"</span>";dojo.removeClass(el,"none");}else{dojo.addClass(el,"none");el.innerHTML="&nbsp;";}},this);dojo.forEach(dojo.query("a.catalog_item_link",_69),function(el){el.href=this._getItemValue(i,"URL_productDetails");},this);dojo.forEach(dojo.query("a.quickview",_69),function(el){el.href=this._getItemValue(i,"URL_quickView");},this);dojo.forEach(dojo.query("img.promotion_tag",_69),function(el){var _6b=this._getItemValue(i,"promo_tag");if(!_6b){_6b={filepath:LEE.util.config.get("Locations.TRANSPARENT_GIF"),alt:""};}el.src=_6b.filepath;el.alt=_6b.alt;},this);dojo.forEach(dojo.query("img.rating",_69),function(el){var _6c=this._getItemValue(i,"rating");if(_6c){el.src=LEE.util.config.get("Locations.RATING_IMAGES."+_6c);el.alt=LEE.view.product.Pagination.RATING_IMAGES_ALT.replace(/%rating%/gi,_6c);}else{el.src=LEE.util.config.get("Locations.TRANSPARENT_GIF");el.alt="Not yet rated";}},this);this.node.appendChild(_69);dojo.forEach(dojo.query("input.checkbox_compare_form",_69),function(el){var _6d="";var pn=dojo.byId(el.parentNode);var _6e=this._getItemValue(i,"compare");_6d="<input type=\"checkbox\" class=\""+el.className+"\" "+"id=\""+LEE.view.product.Pagination.PRODUCT_ID_PREFIX+this._getItemValue(i,"productId")+"\" "+"name=\""+_6e.name+"\" "+"value=\""+_6e.value+"\" ";var _6f=this._getItemValue(i,"IN_COMPARE_QUEUE");if(_6f&&_6f!=="false"){_6d+="checked=\"checked\" ";}else{dojo.removeAttr(el,"checked");}_6d+="/>";pn.removeChild(el);pn.innerHTML=_6d+pn.innerHTML;},this);dojo.forEach(dojo.query("input[type=hidden].compare",_69),function(el){var _70=this._getItemValue(i,"compare");var _71="<input type=\"hidden\" class=\""+el.className+"\" "+"name=\""+_70.value+"\" "+"value=\""+_70.name+"\" />";var pn=el.parentNode;pn.removeChild(el);pn.innerHTML=_71+pn.innerHTML;},this);if((_67+1)%this.perRow===0){dojo.addClass(_69,"last_of_row");this.node.innerHTML+="<br class=\"clearabove\" />";_68=true;}else{_68=false;}_67++;},this);LEE.checkbox.refresh();if(!_68){this.node.innerHTML+="<br class=\"clearabove\" />";}if(dojo.isIE&&dojo.isIE<7){this.node.innerHTML="<div id=\"pagination_htc_container\">"+this.node.innerHTML+"</div>";}dojo.publish(LEE.event.GlobalEventNames.PAGINATION_RELOAD);},_loadNumbers:function(){var _72=(this.serverQuery[LEE.view.product.Pagination.PAGE_QUERY_STRING_NAME])+this.pageNumbersBeforeEllipsis;var _73=Math.max(0,this.totalPages-this.pageNumbersMax);var _74=false;if(this.serverQuery[LEE.view.product.Pagination.PAGE_QUERY_STRING_NAME]>=this.totalPages-this.pageNumbersMax){_74=true;}dojo.forEach(this.paginationContainers,function(el){var _75=dojo.query("*",el);dojo.forEach(_75,function(_76){_76.className="none";},this);var _77=false;var _78=false;var _79=this.templateNumber.cloneNode(true);dojo.addClass(_79,LEE.view.product.Pagination.PREV_BUTTON_CLASS);_79.innerHTML="&larr;";el.appendChild(_79);for(var i=0;i<this.totalPages;i++){if(i>=this.totalPages-this.pageNumbersMax){_78=true;}if((i>=this.serverQuery[LEE.view.product.Pagination.PAGE_QUERY_STRING_NAME]&&i<_72)||(i>=this.totalPages-this.pageNumbersAfterEllipsis)||(_78&&_74)){var _79=this.templateNumber.cloneNode(true);_79.href=_79.href.replace(this.pageQueryStringRegEx,this.pageQueryStringName+"="+i);_79.innerHTML=i+1;if(!_77&&!_74&&i>_72){var _7a=document.createElement("a");_7a.className="ellipsis";_7a.innerHTML="&hellip;";el.appendChild(_7a);_77=true;}el.appendChild(_79);}}var _79=this.templateNumber.cloneNode(true);dojo.addClass(_79,LEE.view.product.Pagination.NEXT_BUTTON_CLASS);_79.innerHTML="&rarr;";el.appendChild(_79);},this);},_readPageNumber:function(e){dojo.stopEvent(e);var _7b=this.serverQuery[LEE.view.product.Pagination.PAGE_QUERY_STRING_NAME];switch(e.target.tagName.toLowerCase()){case "a":_7b=e.target.href.match(this.pageQueryStringRegEx);if(_7b){_7b=_7b.toString().replace(this.pageQueryStringName+"=","");}else{_7b=this.serverQuery[LEE.view.product.Pagination.PAGE_QUERY_STRING_NAME];}break;}_7b=Math.max(_7b,0);this.serverQuery[LEE.view.product.Pagination.PAGE_QUERY_STRING_NAME]=_7b;this.serverQuery.start=this.pageSize*Math.max(_7b-1,0);},_resetCheckboxes:function(){dojo.forEach(this.filters,function(el){el.checked="";var _7c=dijit.byNode(el);if(_7c){_7c.setAttribute("disabled",false);_7c.setAttribute("checked",false);}else{el.disabled=false;el.checked=false;}},this);},_setNextPrevButtons:function(){var _7d=this.pageQueryStringName+"="+(this.serverQuery[LEE.view.product.Pagination.PAGE_QUERY_STRING_NAME]);var _7e=this.pageQueryStringName+"="+Math.min(this.totalPages-1,this.serverQuery[LEE.view.product.Pagination.PAGE_QUERY_STRING_NAME]+1);var _7f=this.pageQueryStringName+"="+Math.max(0,this.serverQuery[LEE.view.product.Pagination.PAGE_QUERY_STRING_NAME]-1);dojo.forEach(this.nextButtons,function(el){switch(el.tagName.toLowerCase()){case "a":el.href=el.href.replace(this.pageQueryStringRegEx,_7e);break;}if(el.href&&el.href.match(_7d)||this.totalPages==0){dojo.addClass(el,"none");}else{dojo.removeClass(el,"none");}dojo.removeClass(el,LEE.view.product.Pagination.CLASSES.CURRENT);},this);dojo.forEach(this.prevButtons,function(el){switch(el.tagName.toLowerCase()){case "a":el.href=el.href.replace(this.pageQueryStringRegEx,_7f);break;}if(this.serverQuery[LEE.view.product.Pagination.PAGE_QUERY_STRING_NAME]>0){dojo.removeClass(el,"none");}else{dojo.addClass(el,"none");}dojo.removeClass(el,LEE.view.product.Pagination.CLASSES.CURRENT);},this);},_setTotals:function(){this.totalPages=this.data.totalPages;if(this.totalElement){this.totalElement.innerHTML=this.data.totalItems;}},refreshOnHistory:function(e){this._invalidateHashQuery();this._invalidateQueryInput();this._loadFiltersToServerQuery();this.refresh();},refreshOnSort:function(e){dojo.stopEvent(e);if(e.target.value!=this.serverQuery.sort){this.serverQuery[LEE.view.product.Pagination.PAGE_QUERY_STRING_NAME]=0;this._invalidateFormQuery();this._addQueryToHistory();this.refresh();}},refreshOnCount:function(e){dojo.stopEvent(e);if(e.target.value!=this.serverQuery.count){this.serverQuery[LEE.view.product.Pagination.PAGE_QUERY_STRING_NAME]=this.serverQuery.start=0;this._invalidateFormQuery();this._addQueryToHistory();this.refresh();}},refreshOnFilter:function(e){dojo.stopEvent(e);this.serverQuery[LEE.view.product.Pagination.PAGE_QUERY_STRING_NAME]=this.serverQuery.start=0;this._invalidateFormQuery();this._addQueryToHistory();this.refresh();},refreshOnPage:function(e){dojo.stopEvent(e);this._readPageNumber(e);this._invalidateFormQuery();this._addQueryToHistory();this.refresh();},onFail:function(_80,_81){dojo.publish(LEE.event.GlobalEventNames.CLICK_BLOCKER_HIDE);if(!_80){_80={message:""};}LEE.alert(LEE.util.config.Errors.PRODUCT_CATALOG_REFRESH);},onFilterClick:function(){},onRequest:function(){dojo.publish(LEE.event.GlobalEventNames.CLICK_BLOCKER_SHOW);this.product.fetchCatalog(this.serverQuery,this.serviceUrl);},onSuccess:function(_82){dojo.publish(LEE.event.GlobalEventNames.CLICK_BLOCKER_HIDE);this.data=_82;this.items=_82.items;this._setTotals();this._loadItems();this._loadNumbers();this._findElements();this._attachListeners();this._changeView();this._displayPageNumbers();this._displayViewOptions();this._setNextPrevButtons();this._displayFilters();try{document.getElementById(LEE.view.product.Pagination.TOP_ANCHOR_NAME).scrollIntoView(true);}catch(err){}dojo.publish(LEE.event.GlobalEventNames.PRODUCT_CATALOG_LOADED);}});LEE.view.product.Pagination.CLASSES={ANGLE1:"angle1",ANGLE2:"angle2",CURRENT:"current",FILTER:"filter",ITEMS:"catalog_item",PAGE_NUMBER_LINK:"paginationPageLink",PAGE_NUMBER_CONTAINER:"pagination",PAGE_NUMBER_INPUT:"page_number_input",SWATCHES:"swatches"};LEE.view.product.Pagination.FILTERS_FORM_ID="filter_options";LEE.view.product.Pagination.NEXT_BUTTON_CLASS="paginationNextButton";LEE.view.product.Pagination.PAGE_NUMBERS_AFTER_ELLIPSIS=1;LEE.view.product.Pagination.PAGE_NUMBERS_BEFORE_ELLIPSIS=3;LEE.view.product.Pagination.PAGE_QUERY_STRING_NAME="pageNumber";LEE.view.product.Pagination.PAGE_QUERY_STRING_GET_NAME="pn";LEE.view.product.Pagination.PAGINATION_CONTAINER_ID="paginationContainer";LEE.view.product.Pagination.PAGINATION_INPUT_TAG="select";LEE.view.product.Pagination.PER_PAGE={CATEGORY1:12,CATEGORY2:16,SUGGESTION:4};LEE.view.product.Pagination.PER_PAGE_SELECT_ID="perPageSelect";LEE.view.product.Pagination.PER_ROW=4;LEE.view.product.Pagination.PREV_BUTTON_CLASS="paginationPrevButton";LEE.view.product.Pagination.RATING_IMAGES_ALT="%rating% of 5 stars";LEE.view.product.Pagination.SORT_SELECT_ID="sortBySelect";LEE.view.product.Pagination.TOTAL_ITEMS_ID="total_matching_products";LEE.view.product.Pagination.VIEW_OPTIONS_CLASS="paginationViewOption";LEE.view.product.Pagination.SWATCH_SIZE={HEIGHT:8,WIDTH:13};LEE.view.product.Pagination.PRODUCT_ID_PREFIX="checkbox_productId_";LEE.view.product.Pagination.TOP_ANCHOR_NAME="paginationtop";}if(!dojo._hasResource["LEE.ui.catalog.CompareForm"]){dojo._hasResource["LEE.ui.catalog.CompareForm"]=true;dojo.provide("LEE.ui.catalog.CompareForm");dojo.declare("LEE.ui.catalog.CompareForm",null,{connections:null,model:null,submission:null,checkboxes:null,form:null,constructor:function(_83){if(_83){this.form=dojo.byId(_83);}dojo.publish(LEE.event.FormEventNames.CREATED,[this.declaredClass,this]);},startup:function(){if(!this.form){this.form=dojo.byId(LEE.ui.catalog.CompareForm.DEFAULT_ID);}try{this._initChildren();}catch(err){console.log(err.message);}return this;},_initChildren:function(){this._initModel();this._initActions();this._initViews();this._updateComparison();},_initModel:function(){this.model=LEE.model.ModelLocator.getModel(LEE.model.ModelNames.COMPARE_MODEL);},_initActions:function(){this.connections=[];this.connections.push(dojo.connect(this.form,"submit",this,this._handleSubmit));this.connections.push(dojo.connect(this.form,"click",this,this._handleClick));this.connections.push(dojo.connect(document.body,"click",this,this._checkClickForSubmission));dojo.subscribe(LEE.event.ModelEventNames.COMPARE_UPDATE,this,this._handleUpdateResponse);dojo.subscribe(LEE.event.ModelEventNames.PRODUCT_CATALOG_UPDATE,this,this._handleCatalogUpdate);dojo.subscribe(LEE.event.GlobalEventNames.PRODUCT_CATALOG_LOADED,this,this._updateComparison);},_initViews:function(){LEE.checkbox.refresh(LEE.ui.catalog.CompareForm.CHECKBOX_CLASS);this._findCheckboxes();},_findCheckboxes:function(){this.checkboxes=dojo.query("input[id^="+LEE.ui.catalog.CompareForm.CHECKBOX_ID_PREFIX+"]");},_insertHiddenFields:function(){dojo.forEach(this.model.products,function(_84){var _85=LEE.util.Lang.getQueryElementByIndex("input[name="+LEE.ui.catalog.CompareForm.CHECKBOX_NAME_PREFIX+_84+"]",this.form,0);if(!_85){var _86=document.createElement("input");_86.type="hidden";_86.name="productId";_86.value=_84;this.form.appendChild(_86);}},this);},_updateComparison:function(e){this.submission=this.model.updateProducts(e,LEE.ui.catalog.CompareForm.CHECKBOX_NAME_PREFIX);},_updateInputs:function(){this._findCheckboxes();try{dojo.forEach(this.checkboxes,function(cb){var _87=(dojo.indexOf(this.model.products,cb.value)>-1);var _88=null;if(_87){dojo.attr(cb,"checked",true);_88=dijit.getEnclosingWidget(cb);if(_88){_88.attr("checked",true);}}else{if(!_87&&cb.checked){dojo.removeAttr(cb,"checked");_88=dijit.getEnclosingWidget(cb);if(_88){_88.attr("checked",false);}}}},this);}catch(err){console.log(err.message);}},_isCheckBox:function(_89){return ((dojo.attr(_89,"type")=="checkbox")&&dojo.attr(_89,"id").indexOf(LEE.ui.catalog.CompareForm.CHECKBOX_ID_PREFIX)==0);},_handleSubmit:function(_8a){dojo.stopEvent(_8a);},_handleCatalogUpdate:function(_8b,_8c){setTimeout(dojo.hitch(this,this._initViews),0);},_handleClick:function(_8d){try{if(this._isCheckBox(_8d.target)){this._updateComparison(_8d);this._updateInputs();}}catch(err){console.log(err.message);}},_checkClickForSubmission:function(e){if(LEE.util.Dom.hasTagName(e.target,"a")&&dojo.attr(e.target,"rel")&&dojo.attr(e.target,"rel")==="compare"){dojo.stopEvent(e);this._insertHiddenFields();this.form.submit();}else{this._handleClick(e);}},_handleUpdateResponse:function(_8e,_8f){try{this._updateInputs();if(_8e&&_8e.limitExceeded){LEE.alert(LEE.util.config.get("Messages.COMPARE_LIMIT_EXCEEDED"));}}catch(err){console.log(err.message);}},_handleUpdateError:function(_90){this._updateInputs();}});LEE.ui.catalog.CompareForm.DEFAULT_ID="compare_form";LEE.ui.catalog.CompareForm.CHECKBOX_CLASS="checkbox_compare_form";LEE.ui.catalog.CompareForm.CHECKBOX_ID_PREFIX="checkbox_productId_";LEE.ui.catalog.CompareForm.CHECKBOX_NAME_PREFIX="compare_checkbox_";LEE.ui.catalog.CompareForm.CHECKBOX_VALUE_PREFIX="hidden_catentryId_";}if(!dojo._hasResource["LEE.ui.catalog.CompareQueue"]){dojo._hasResource["LEE.ui.catalog.CompareQueue"]=true;dojo.provide("LEE.ui.catalog.CompareQueue");dojo.declare("LEE.ui.catalog.CompareQueue",null,{queue:null,constructor:function(_91){if(_91){this.queue=dojo.byId(_91);}},startup:function(){if(!this.queue){this.queue=dojo.byId(LEE.ui.catalog.CompareQueue.DEFAULT_ID);}try{this._initChildren();}catch(err){console.log(err.message);}return this;},_initChildren:function(){this._initModel();this._initActions();this._updateMessage();},_initModel:function(){this.model=LEE.model.ModelLocator.getModel(LEE.model.ModelNames.COMPARE_MODEL);},_initActions:function(){dojo.subscribe(LEE.event.ModelEventNames.COMPARE_UPDATE,this,this._handleUpdateResponse);dojo.subscribe(LEE.event.ModelEventNames.COMPARE_UPDATE_ERROR,this,this._handleUpdateResponseError);dojo.connect(this.queue,"click",this,this._handleClick);},_updateMessage:function(){var _92=LEE.ui.catalog.CompareQueue.REFRESH_TEMPLATE.replace(LEE.ui.catalog.CompareQueue.REFRESH_TOKEN,this.model.products.length);dojo.byId(LEE.ui.catalog.CompareQueue.REFRESH_ELEMENT_ID).innerHTML=_92;},_clearProducts:function(_93){this.model.clearProducts(_93);},_handleClick:function(_94){var _95=_94.target;if(_95.tagName.toLowerCase()!="a"){_95=LEE.util.Dom.getAncestorByTagName(target,"a");}if(dojo.attr(_95,"rel")==LEE.ui.catalog.CompareQueue.CLEAR_REL){dojo.stopEvent(_94);this._clearProducts(dojo.attr(_95,"href"));}},_handleUpdateResponse:function(_96,_97){this._updateMessage();},_handleUpdateError:function(_98){}});LEE.ui.catalog.CompareQueue.DEFAULT_ID="compare_queue";LEE.ui.catalog.CompareQueue.CLEAR_REL="clear";LEE.ui.catalog.CompareQueue.REFRESH_ELEMENT_ID="compare_queue_refresh";LEE.ui.catalog.CompareQueue.REFRESH_TOKEN=/%total%/;LEE.ui.catalog.CompareQueue.REFRESH_TEMPLATE="You have<em> %total% </em>items checked to compare.";}if(!dojo._hasResource["LEE.CategoryPage1"]){dojo._hasResource["LEE.CategoryPage1"]=true;dojo.provide("LEE.CategoryPage1");dojo.subscribe(LEE.event.GlobalEventNames.GLOBAL_LOADED,this,function(){try{LEE.sidebarFilter=new LEE.view.catalog.CatalogFilters();LEE.pagination=new LEE.view.product.Pagination();LEE.compareForm=new LEE.ui.catalog.CompareForm().startup();LEE.compareQueue=new LEE.ui.catalog.CompareQueue().startup();}catch(e){console.log(e.message);}});}
