
if(!dojo._hasResource["LEE.view.product.ShareForm"]){dojo._hasResource["LEE.view.product.ShareForm"]=true;dojo.provide("LEE.view.product.ShareForm");dojo.declare("LEE.view.product.ShareForm",LEE.ui.form.Form,{resetButton:null,shareSendOverlay:null,messageDefault:null,constructor:function(_1){if(!_1){this.form=dojo.byId(LEE.view.product.ShareForm.IDS.SHARE_FORM);this._startup();}},_attachListeners:function(){this.inherited(arguments);if(this.resetButton){dojo.connect(this.resetButton,"click",this,this.resetForm);}},_findElements:function(){this.inherited(arguments);this.resetButton=dojo.byId(LEE.view.product.ShareForm.IDS.SHARE_RESET_BTN);this.messageElement=dojo.byId(LEE.view.product.ShareForm.IDS.SHARE_HEADER);this.messageDefault=this.messageElement.innerHTML;this.shareSendOverlay=dojo.byId(LEE.view.product.ShareForm.IDS.SHARE_SEND_OVERLAY);},_submitForm:function(){dojo.forEach(dojo.query("input",this.form).concat(dojo.query("textarea",this.form)),function(el){if(el.value===el.title){el.value="";}},this);dojo.style(this.shareSendOverlay,"display","block");this.inherited(arguments);},resetForm:function(e){if(e){dojo.stopEvent(e);}dojo.forEach(this.requiredFields,function(el){dojo.removeClass(el,LEE.ui.form.Form.CLASSES.INVALID);},this);if(this.messageElement){this.messageElement.innerHTML=this.messageDefault;}if(this.form){this.form.reset();}},closeConfirmation:function(e){if(e){dojo.stopEvent(e);}dojo.style(this.shareSendOverlay,"backgroundImage","url(images/en_US/global/loader.gif)");dojo.style(this.shareSendOverlay,"display","none");if(this.shareSendOverlay){dojo.byId(LEE.view.product.ShareForm.IDS.SHARE_SEND_OVERLAY).innerHTML="";}},onSubmit:function(e){if(e){dojo.stopEvent(e);}if(this.inherited(arguments)&&this.messageElement){this.messageElement.innerHTML=LEE.util.config.get("Messages.SEND_TO_A_FRIEND.SUCCESS_HEADER_HTML");}else{if(this.messageElement){this.messageElement.innerHTML=LEE.util.config.get("Messages.SEND_TO_A_FRIEND.ERROR_HEADER_HTML");}}},onSubmitError:function(_7,_8){this.inherited(arguments);dojo.style(this.shareSendOverlay,"backgroundImage","none");if(this.shareSendOverlay){this.shareSendOverlay.innerHTML+=_7;this.shareSendOverlay.innerHTML+="<p><a id='"+LEE.view.product.ShareForm.IDS.CLOSE_BUTTON+"' href='#'>ok</a></p>";}dojo.connect(dojo.byId(LEE.view.product.ShareForm.IDS.CLOSE_BUTTON),"click",this,this.closeConfirmation);},onSubmitSuccess:function(_9,_a){this.inherited(arguments);dojo.style(this.shareSendOverlay,"display","none");if(this.messageElement&&this.response){this.messageElement.innerHTML=_9;}}});LEE.view.product.ShareForm.IDS={CLOSE_BUTTON:"close_confirmation_dialog",SHARE_FORM:"form_sendtoafriend",SHARE_HEADER:"sendtoafriend_header",SHARE_RESET_BTN:"reset_sendtoafriend",SHARE_SEND_OVERLAY:"send_overlay"};}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 _b={handle:dojo.hitch(this,this.refreshOnHistory),changeUrl:this._createHashURLFromQuery()};dojo.back.setInitialState(_b);if(dojo.isIE){dojo.back.addToHistory(_b);}},_attachListeners:function(){dojo.forEach(this._connections,function(_c){dojo.disconnect(_c);});this._connections=[];dojo.forEach(this.filters,function(el){if(!LEE.util.Dom.hasTagName(el,"input")){var _e=dojo.query("input",el);if(_e[0]){el=_e[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 _11=unescape(window.location.hash).substring(1).split("&");var _12=_11.length;if(_12>1){for(var i=_12-1;i>=0;i--){var _14=_11[i].split("=");this.serverQuery[_14[0]]=_14[1];}}else{this.serverQuery=dojo.clone(this.initialQuery);}},_invalidateQueryInput:function(){var _15=this.serverQuery.filter1.split("%")[0];var _16=this.serverQuery.filter1.split("%").slice(1);var _17=this.filters.length;var _18=[];if(_16.length>0){for(var i=_17-1;i>=0;i--){var _1a=this.filters[i];var _1b=this._getFilterValue(_1a);if(dojo.indexOf(_16,_1b)>-1){this._selectFilter(_1a);}else{this._deselectFilter(_1a);}}}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(_1c){var _1d;var _1e=dijit.byNode(_1c);if(_1e){var _1f=_1e.attr("checked");_1e.setAttribute("checked",true);_1d=_1e.attr("value");_1e.setAttribute("checked",_1f);}else{if(LEE.util.Dom.hasTagName(_1c,"input")){_1d=_1c.value;}}if(_1d&&_1d.indexOf("__")>-1){_1d=_1d.split("__")[1];}return _1d;},_selectFilter:function(_20){_20.checked="";widget=dijit.byNode(_20);if(widget){widget.setAttribute("disabled",false);widget.setAttribute("checked",true);dojo.publish(LEE.event.GlobalEventNames.CHECKBOX_ENABLED,[_20]);}else{dojo.attr(_20,"checked",true);}dojo.publish(LEE.event.GlobalEventNames.CHECKBOX_ON_PAGINATION,[_20]);},_deselectFilter:function(_21){_21.checked="";widget=dijit.byNode(_21);if(widget){widget.setAttribute("checked",false);dojo.publish(LEE.event.GlobalEventNames.CHECKBOX_ENABLED,[_21]);}else{dojo.removeAttr(_21,"checked");}dojo.publish(LEE.event.GlobalEventNames.CHECKBOX_ON_PAGINATION,[_21]);},_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 _22=this.filters.length;for(var i=0;i<_22;i++){var _24="";var _25=this.filters[i];var _26=dijit.byNode(_25);if(_26){if(_26.getValue()){this.queryFilters.push(_26.getValue());}}else{if(LEE.util.Dom.hasTagName(_25,"input")){if(_25.checked&&_25.value){if(_25.name===_25.value){this.queryFilters.push(_25.name);}else{this.queryFilters.push(_25.name+"__"+_25.value);}}}}}var _27="";var _28=[];for(var i=0;i<this.queryFilters.length;i++){var _29=this.queryFilters[i].split("__");if(_27===""&&_29.length>1){_27=_29[0];}if(_29.length>1){_28.push(_29[1]);}else{if(_29.length==1){_27=_29[0];_28.push(_29[0]);}}}this.serverQuery.filter1=_27+"%"+_28.join("%");this._loadFiltersToServerQuery();},_loadFiltersToServerQuery:function(){for(var key in this.serverQuery){if(key.indexOf("f_")==0){delete this.serverQuery[key];}}var _2b=this.filters.length;for(var i=0;i<_2b;i++){var _2d="";var _2e=this.filters[i];var _2f=dijit.byNode(_2e);if(_2f){if(_2f.getValue()){this.serverQuery[_2f.name]=_2f.getValue();}}else{if(LEE.util.Dom.hasTagName(_2e,"input")){if(_2e.checked&&_2e.value){this.serverQuery[_2e.name]=_2e.value;}}}}},_createHashURLFromQuery:function(){var _30="";_30+="count="+this.serverQuery.count;_30+="&sort="+this.serverQuery.sort;_30+="&"+LEE.view.product.Pagination.PAGE_QUERY_STRING_NAME+"="+this.serverQuery[LEE.view.product.Pagination.PAGE_QUERY_STRING_NAME];if(this.serverQuery.view){_30+="&view="+this.serverQuery.view;}_30+="&filter1="+this.serverQuery.filter1;return _30;},_addQueryToHistory:function(){var _31={handle:dojo.hitch(this,this.refreshOnHistory),changeUrl:this._createHashURLFromQuery()};dojo.back.addToHistory(_31);},_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 _34=dojo.query("img."+LEE.view.product.Pagination.CLASSES.ANGLE1,el);var _35=dojo.query("img."+LEE.view.product.Pagination.CLASSES.ANGLE2,el);if(_34&&_35){switch(this.viewAngle){case "angle1":dojo.forEach(_34,function(_36){dojo.removeClass(_36,"none");},this);dojo.forEach(_35,function(_37){dojo.addClass(_37,"none");},this);break;default:dojo.forEach(_34,function(_38){dojo.addClass(_38,"none");},this);dojo.forEach(_35,function(_39){dojo.removeClass(_39,"none");},this);break;}}},this);},_convertInputToPageLinks:function(){var _3a=0;dojo.forEach(dojo.query("."+LEE.view.product.Pagination.CLASSES.PAGE_NUMBER_CONTAINER),function(el){var _3c=LEE.view.product.Pagination.PAGINATION_INPUT_TAG+"."+LEE.view.product.Pagination.CLASSES.PAGE_NUMBER_INPUT;var _3d=LEE.util.Lang.getQueryElementByIndex(_3c,el,0);var _3e="";var _3f=Math.max(1,parseInt(this.serverQuery[LEE.view.product.Pagination.PAGE_QUERY_STRING_NAME])-1);var _40=parseInt(this.serverQuery[LEE.view.product.Pagination.PAGE_QUERY_STRING_NAME])+1;if(_3d&&LEE.util.Dom.hasTagName(_3d,"select")){_3e+="<a href=\""+_3d.form.action+_3f+"\" "+"class=\""+LEE.view.product.Pagination.CLASSES.PAGE_NUMBER_LINK;if(this.serverQuery[LEE.view.product.Pagination.PAGE_QUERY_STRING_NAME]<=0){_3e+=" none";}_3e+=" "+LEE.view.product.Pagination.PREV_BUTTON_CLASS+"\">"+"&larr;"+"</a>";dojo.forEach(dojo.query("option",_3d),function(opt){_3e+="<a href=\""+_3d.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){_3e+=" current";}_3e+="\">"+opt.innerHTML+"</a>";if(parseInt(opt.value)){_3a=Math.max(_3a,parseInt(opt.value)+1);}},this);_3e+="<a href=\""+_3d.form.action+_40+"\" "+"class=\""+LEE.view.product.Pagination.CLASSES.PAGE_NUMBER_LINK;if(this.totalPages<=this.serverQuery[LEE.view.product.Pagination.PAGE_QUERY_STRING_NAME]){_3e+=" none";}_3e+=" "+LEE.view.product.Pagination.NEXT_BUTTON_CLASS+"\">"+"&rarr;"+"</a>";}if(_3e){var _42=document.createElement("div");_42.innerHTML=_3e;dojo.addClass(_3d,"none");dojo.place(_42,el,"last");}},this);this.totalPages=_3a;},_displayFilters:function(){for(var i=this.filters.length-1;i>=0;i--){var _44=dijit.byNode(this.filters[i]);if(_44&&!_44.getValue()){_44.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 _45=this.data.parametricNavBehavior;if(_45){for(var i=_45.length-1;i>=0;i--){var _44=dijit.byId(_45[i].elementID);var _46=dojo.byId(_45[i].elementID);if(_44){_44.setAttribute("disabled",false);}else{if(_46){dojo.removeClass(_46,"disabled_filter");if(LEE.util.Dom.hasTagName(_46,"input")){_46.disabled=false;}}}if(_45[i]){dojo.publish(LEE.event.GlobalEventNames.CHECKBOX_ENABLED,[_45[i].elementID]);}}}},_displayPageNumbers:function(){var _47=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(_47)){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 _4a=document.createElement("a");_4a.name=_4a.id=LEE.view.product.Pagination.TOP_ANCHOR_NAME;this.node.parentNode.parentNode.insertBefore(_4a,this.node.parentNode.parentNode.firstChild);}},_getTemplates:function(){if(this.items[0]){this.templateItem=dojo.clone(this.items[0]);var _4b=dojo.query("input[type=checkbox]",this.templateItem);dojo.forEach(_4b,function(_4c){dojo.removeAttr(_4c,"checked");dojo.removeAttr(_4c,"name");dojo.removeAttr(_4c,"value");},this);}if(this.pageNumbers[1]){this.templateNumber=this.pageNumbers[1].cloneNode(true);}},_getItemValue:function(_4d,_4e){if(_4d&&_4d.hasOwnProperty(_4e)){return _4d[_4e];}else{return null;}},_loadItems:function(){var _4f=0;var _50=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 _52=this.templateItem.cloneNode(true);dojo.forEach(dojo.query("img.catalog_item_image",_52),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",_52),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",_52),function(el){var _56=dojo.query("a.catalog_item_link",el);if(_56.length>0){_56[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,_52),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",_52),function(el){if(this._getItemValue(i,"price")&&this._getItemValue(i,"price")&&this._getItemValue(i,"current_price")){el.innerHTML="MSRP <span class=\"strike\">"+this._getItemValue(i,"price")+"</span>";}else{el.innerHTML=this._getItemValue(i,"price");}},this);dojo.forEach(dojo.query(".current_price",_52),function(el){if(this._getItemValue(i,"current_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",_52),function(el){el.href=this._getItemValue(i,"URL_productDetails");},this);dojo.forEach(dojo.query("a.quickview",_52),function(el){el.href=this._getItemValue(i,"URL_quickView");},this);dojo.forEach(dojo.query("img.promotion_tag",_52),function(el){var _5e=this._getItemValue(i,"promo_tag");if(!_5e){_5e={filepath:LEE.util.config.get("Locations.TRANSPARENT_GIF"),alt:""};}el.src=_5e.filepath;el.alt=_5e.alt;},this);dojo.forEach(dojo.query("img.rating",_52),function(el){var _60=this._getItemValue(i,"rating");if(_60){el.src=LEE.util.config.get("Locations.RATING_IMAGES."+_60);el.alt=LEE.view.product.Pagination.RATING_IMAGES_ALT.replace(/%rating%/gi,_60);}else{el.src=LEE.util.config.get("Locations.TRANSPARENT_GIF");el.alt="Not yet rated";}},this);this.node.appendChild(_52);dojo.forEach(dojo.query("input.checkbox_compare_form",_52),function(el){var _62="";var pn=dojo.byId(el.parentNode);var _64=this._getItemValue(i,"compare");_62="<input type=\"checkbox\" class=\""+el.className+"\" "+"id=\""+LEE.view.product.Pagination.PRODUCT_ID_PREFIX+this._getItemValue(i,"productId")+"\" "+"name=\""+_64.name+"\" "+"value=\""+_64.value+"\" ";var _65=this._getItemValue(i,"IN_COMPARE_QUEUE");if(_65&&_65!=="false"){_62+="checked=\"checked\" ";}else{dojo.removeAttr(el,"checked");}_62+="/>";pn.removeChild(el);pn.innerHTML=_62+pn.innerHTML;},this);dojo.forEach(dojo.query("input[type=hidden].compare",_52),function(el){var _67=this._getItemValue(i,"compare");var _68="<input type=\"hidden\" class=\""+el.className+"\" "+"name=\""+_67.value+"\" "+"value=\""+_67.name+"\" />";var pn=el.parentNode;pn.removeChild(el);pn.innerHTML=_68+pn.innerHTML;},this);if((_4f+1)%this.perRow===0){dojo.addClass(_52,"last_of_row");this.node.innerHTML+="<br class=\"clearabove\" />";_50=true;}else{_50=false;}_4f++;},this);LEE.checkbox.refresh();if(!_50){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 _6a=(this.serverQuery[LEE.view.product.Pagination.PAGE_QUERY_STRING_NAME])+this.pageNumbersBeforeEllipsis;var _6b=Math.max(0,this.totalPages-this.pageNumbersMax);var _6c=false;if(this.serverQuery[LEE.view.product.Pagination.PAGE_QUERY_STRING_NAME]>=this.totalPages-this.pageNumbersMax){_6c=true;}dojo.forEach(this.paginationContainers,function(el){var _6e=dojo.query("*",el);dojo.forEach(_6e,function(_6f){_6f.className="none";},this);var _70=false;var _71=false;var _72=this.templateNumber.cloneNode(true);dojo.addClass(_72,LEE.view.product.Pagination.PREV_BUTTON_CLASS);_72.innerHTML="&larr;";el.appendChild(_72);for(var i=0;i<this.totalPages;i++){if(i>=this.totalPages-this.pageNumbersMax){_71=true;}if((i>=this.serverQuery[LEE.view.product.Pagination.PAGE_QUERY_STRING_NAME]&&i<_6a)||(i>=this.totalPages-this.pageNumbersAfterEllipsis)||(_71&&_6c)){var _72=this.templateNumber.cloneNode(true);_72.href=_72.href.replace(this.pageQueryStringRegEx,this.pageQueryStringName+"="+i);_72.innerHTML=i+1;if(!_70&&!_6c&&i>_6a){var _74=document.createElement("a");_74.className="ellipsis";_74.innerHTML="&hellip;";el.appendChild(_74);_70=true;}el.appendChild(_72);}}var _72=this.templateNumber.cloneNode(true);dojo.addClass(_72,LEE.view.product.Pagination.NEXT_BUTTON_CLASS);_72.innerHTML="&rarr;";el.appendChild(_72);},this);},_readPageNumber:function(e){dojo.stopEvent(e);var _76=this.serverQuery[LEE.view.product.Pagination.PAGE_QUERY_STRING_NAME];switch(e.target.tagName.toLowerCase()){case "a":_76=e.target.href.match(this.pageQueryStringRegEx);if(_76){_76=_76.toString().replace(this.pageQueryStringName+"=","");}else{_76=this.serverQuery[LEE.view.product.Pagination.PAGE_QUERY_STRING_NAME];}break;}_76=Math.max(_76,0);this.serverQuery[LEE.view.product.Pagination.PAGE_QUERY_STRING_NAME]=_76;this.serverQuery.start=this.pageSize*Math.max(_76-1,0);},_resetCheckboxes:function(){dojo.forEach(this.filters,function(el){el.checked="";var _78=dijit.byNode(el);if(_78){_78.setAttribute("disabled",false);_78.setAttribute("checked",false);}else{el.disabled=false;el.checked=false;}},this);},_setNextPrevButtons:function(){var _79=this.pageQueryStringName+"="+(this.serverQuery[LEE.view.product.Pagination.PAGE_QUERY_STRING_NAME]);var _7a=this.pageQueryStringName+"="+Math.min(this.totalPages-1,this.serverQuery[LEE.view.product.Pagination.PAGE_QUERY_STRING_NAME]+1);var _7b=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,_7a);break;}if(el.href&&el.href.match(_79)||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,_7b);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(_83,_84){dojo.publish(LEE.event.GlobalEventNames.CLICK_BLOCKER_HIDE);if(!_83){_83={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(_85){dojo.publish(LEE.event.GlobalEventNames.CLICK_BLOCKER_HIDE);this.data=_85;this.items=_85.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(_86){if(_86){this.form=dojo.byId(_86);}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(_87){var _88=LEE.util.Lang.getQueryElementByIndex("input[name="+LEE.ui.catalog.CompareForm.CHECKBOX_NAME_PREFIX+_87+"]",this.form,0);if(!_88){var _89=document.createElement("input");_89.type="hidden";_89.name="productId";_89.value=_87;this.form.appendChild(_89);}},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 _8c=(dojo.indexOf(this.model.products,cb.value)>-1);var _8d=null;if(_8c){dojo.attr(cb,"checked",true);_8d=dijit.getEnclosingWidget(cb);if(_8d){_8d.attr("checked",true);}}else{if(!_8c&&cb.checked){dojo.removeAttr(cb,"checked");_8d=dijit.getEnclosingWidget(cb);if(_8d){_8d.attr("checked",false);}}}},this);}catch(err){console.log(err.message);}},_isCheckBox:function(_8e){return ((dojo.attr(_8e,"type")=="checkbox")&&dojo.attr(_8e,"id").indexOf(LEE.ui.catalog.CompareForm.CHECKBOX_ID_PREFIX)==0);},_handleSubmit:function(_8f){dojo.stopEvent(_8f);},_handleCatalogUpdate:function(_90,_91){setTimeout(dojo.hitch(this,this._initViews),0);},_handleClick:function(_92){try{if(this._isCheckBox(_92.target)){this._updateComparison(_92);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(_94,_95){try{this._updateInputs();if(_94&&_94.limitExceeded){LEE.alert(LEE.util.config.get("Messages.COMPARE_LIMIT_EXCEEDED"));}}catch(err){console.log(err.message);}},_handleUpdateError:function(_96){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.view.product.ThumbnailImage"]){dojo._hasResource["LEE.view.product.ThumbnailImage"]=true;dojo.provide("LEE.view.product.ThumbnailImage");dojo.declare("LEE.view.product.ThumbnailImage",null,{constructor:function(_97,_98,_99,_9a){this.enabled=_97;this.link=_98;this.selected=_99;this.source=_9a;this.thumb=new Image();this.startup();},startup:function(){},getThumbnailFromSrc:function(){return this.source;},getThumbnailImage:function(){return this.thumb;}});}if(!dojo._hasResource["LEE.view.product.ProductImageViewer"]){dojo._hasResource["LEE.view.product.ProductImageViewer"]=true;dojo.provide("LEE.view.product.ProductImageViewer");dojo.declare("LEE.view.product.ProductImageViewer",null,{overlayIdentifier:"",viewLargerBasePath:null,_detailedViewContainer:null,_detailedViewImage:null,_previewActivityIndicator:null,_previewImage:null,_thumbnailList:null,_thumbnailListOverlay:null,_viewLargerLink:null,_viewportBackgroundContainer:null,constructor:function(_9b){this.hScroll=_9b.hScroll;this.image=_9b.image;this.itemList=_9b.items;this.magnifyControl=_9b.magnifyControl;this.magnifyImage=_9b.magnifyImage;this.overlayIdentifier=_9b.overlayIdentifier;this.selectedIndex=_9b.selectedIndex;this.selectedItem=_9b.selectedItem;this.thumbnails=_9b.thumbnails;this.viewLargeButton=_9b.viewLargeButton;this.vScroll=_9b.vScroll;this.selectedColorSet=_9b.selectedColorSet;this._findElements();this._attachListeners();this.viewLargerBasePath=LEE.util.config.get("Locations.VIEW_LARGER");if(!this.viewLargerBasePath&&this._viewLargerLink){this.viewLargerBasePath=this._viewLargerLink.href.split("?")[0];}},_attachListeners:function(){},_findElements:function(){this._detailedViewContainer=dojo.byId(LEE.view.product.ProductImageViewer.IDS.DETAILED_VIEW_CONTAINER);this._detailedViewImage=dojo.byId(LEE.view.product.ProductImageViewer.IDS.DETAILED_VIEW_IMAGE);this._previewActivityIndicator=dojo.byId(LEE.view.product.ProductImageViewer.IDS.PREVIEW_ACTIVITY_INDICATOR);this._previewImage=dojo.byId(LEE.view.product.ProductImageViewer.IDS.PREVIEW_IMAGE);this._productViewContainer=dojo.byId(LEE.view.product.ProductImageViewer.IDS.PRODUCT_VIEW_CONTAINER);this._thumbnailList=dojo.byId(LEE.view.product.ProductImageViewer.IDS.THUMBNAIL_LIST);this._viewLargerLink=dojo.byId(LEE.view.product.ProductImageViewer.IDS.VIEW_LARGER_LINK);this._viewLargerContainer=dojo.byId(LEE.view.product.ProductImageViewer.IDS.VIEW_LARGER_CONTAINER);this._viewport=dojo.byId(LEE.view.product.ProductImageViewer.IDS.VIEWPORT);this._viewportBackground=dojo.byId(LEE.view.product.ProductImageViewer.IDS.VIEWPORT_BACKGROUND);this._viewportBackgroundContainer=dojo.byId(LEE.view.product.ProductImageViewer.IDS.VIEWPORT_BACKGROUND_CONTAINER);},setCurrentItemList:function(_9c){this.itemList=_9c;},startMagnify:function(evt){if(evt.target===this._previewImage){dojo.style(this._detailedViewContainer,{visibility:"visible",opacity:"0"});dojo.style(this._viewportBackgroundContainer,{visibility:"visible",opacity:"0"});dojo.style(this._thumbnailList,{visibility:"hidden"});dojo.fadeIn({node:this._detailedViewContainer}).play();dojo.fadeIn({node:this._viewportBackgroundContainer}).play();}dojo.style(LEE.view.product.ProductImageViewer.IDS.PREVIEW_ACTIVITY_INDICATOR,{backgroundPosition:"0 0"});},stopMagnify:function(evt){dojo.style(this._detailedViewContainer,{visibility:"hidden"});dojo.style(this._viewportBackgroundContainer,{visibility:"hidden"});dojo.style(this._thumbnailList,{visibility:"visible"});dojo.style(LEE.view.product.ProductImageViewer.IDS.PREVIEW_ACTIVITY_INDICATOR,{backgroundPosition:"-26px 0"});},getFilenamesFromArrayIndex:function(_9f){var _a0=[];if(this.itemList){_9f++;if(!this.itemList[_9f]){_9f=1;this.setSelectedIndex(_9f);}if(this.itemList[_9f]){_a0.push(this.itemList[_9f].preview);_a0.push(this.itemList[_9f].fullsize);_a0.push(_9f);}}return _a0;},setDetailedViewImage:function(_a1,_a2){var _a3;if(_a2===this.overlayIdentifier){_a3=dojo.byId(LEE.view.product.ProductImageViewer.IDS.DETAILED_VIEW_OVERLAY);}else{_a3=this._detailedViewImage;this.magnifyImage=_a1;}_a3.src=_a1;},setPreviewImage:function(_a4){this.image=_a4;this._previewImage.src=_a4;},setSelectedColorSet:function(_a5){this.selectedColorSet=_a5;},getSelectedColorSet:function(){return this.selectedColorSet;},setSelectedIndex:function(_a6){this.selectedIndex=_a6;},getSelectedIndex:function(){return this.selectedIndex;},setSelectedItem:function(_a7,_a8){var _a9;if(_a8===this.overlayIdentifier){_a9=dojo.byId(LEE.view.product.ProductImageViewer.IDS.THUMBNAIL_LIST_OVERLAY);}else{_a9=this._thumbnailList;}if(!this.itemList[_a7]){_a7=0;}var _aa=dojo.query("li",_a9);for(var i=_aa.length-1;i>=0;i--){dojo.removeClass(_aa[i],LEE.view.product.ProductImageViewer.CLASSES.SELECTED);if(i==_a7){dojo.addClass(_aa[i],LEE.view.product.ProductImageViewer.CLASSES.SELECTED);}}},setViewLargerImage:function(_ac){this._viewLargerLink.href=this.viewLargerBasePath+_ac;}});LEE.view.product.ProductImageViewer.IDS={DETAILED_VIEW_CONTAINER:"detailed-view-container",DETAILED_VIEW_IMAGE:"detailed-view-image",DETAILED_VIEW_OVERLAY:"detailed-view-overlay",PREVIEW_ACTIVITY_INDICATOR:"preview_activity_indicator",PREVIEW_IMAGE:"preview-image",PRODUCT_VIEW_CONTAINER:"product_view",SITE_CONTAINER:"container",THUMBNAIL_LIST:"thumbnails",THUMBNAIL_LIST_OVERLAY:"overlay-thumbnails",VIEW_LARGER_CONTAINER:"view-larger-link",VIEW_LARGER_LINK:"view-larger-a",VIEWPORT:"viewport",VIEWPORT_BACKGROUND:"viewport-background",VIEWPORT_BACKGROUND_CONTAINER:"viewport-background-container"};LEE.view.product.ProductImageViewer.CLASSES={SELECTED:"selected"};}if(!dojo._hasResource["LEE.view.product.ProductImageViewerController"]){dojo._hasResource["LEE.view.product.ProductImageViewerController"]=true;dojo.provide("LEE.view.product.ProductImageViewerController");dojo.declare("LEE.view.product.ProductImageViewerController",null,{data:{},moveIt:{},thumbnailCollection:{},productImageViewer:{},timeout:null,_connections:[],_subscriptions:[],_detailedViewContainer:null,_detailedViewImage:null,_previewImage:null,_productViewContainer:null,_siteContainer:null,_thumbnailList:null,_thumbnails:[],_viewLargerLink:null,_viewLargerContainer:null,_viewport:null,_viewportBackground:null,_viewportBackgroundContainer:null,_thumbnailTemplate:null,constructor:function(){this.productImageViewer=new LEE.view.product.ProductImageViewer({hScroll:0,image:"",items:[""],magnifyControl:false,magnifyImage:"",overlayIdentifier:LEE.view.product.ProductImageViewerController.OVERLAY_IDENTIFIER,selectedIndex:0,selectedItem:"",thumbnails:this.thumbnailCollection,viewLargeButton:"",vScroll:0,selectedColorSet:"default"});this._findElements();this._getTemplates();this.startup();this._attachListeners();},_attachListeners:function(){dojo.forEach(this._connections,function(_ad){dojo.disconnect(_ad);},this);dojo.forEach(this._subscriptions,function(_ae){dojo.unsubscribe(_ae);},this);dojo.forEach(this._thumbnails,function(el){this._connections.push(dojo.connect(el,"onclick",this,this._handleSelection));},this);this._connections.push(dojo.connect(this._viewportBackgroundContainer,"onmouseenter",this,this.configureProductPreview));this._connections.push(dojo.connect(this._viewportBackgroundContainer,"onmousemove",this,this.mouseMovementResponder));this._connections.push(dojo.connect(this._viewportBackgroundContainer,"onmouseleave",this,this.destroyMover));this._connections.push(dojo.connect(this._detailedViewContainer,"onmouseenter",this._handleMouseOut));this._connections.push(dojo.connect(this._previewImage,"onmouseenter",this,this._handleMouseOver));this._connections.push(dojo.connect(this._viewLargerContainer,"onmouseenter",this,this._handleMouseOut));this._connections.push(dojo.connect(this._viewportBackgroundContainer,"onmouseleave",this,this._handleMouseOut));this._connections.push(dojo.connect(this._viewLargerLink,"onclick",this,LEE.ui.global.ViewLarger));this._subscriptions.push(dojo.subscribe(LEE.event.ModelEventNames.PRODUCT_OPTIONS_UPDATE,this,this._setImageMappingsFromXhrResponse));this._subscriptions.push(dojo.subscribe(LEE.event.ModelEventNames.PRODUCT_OPTIONS_ERROR,this,this._handleImageMappingError));this._subscriptions.push(dojo.subscribe(LEE.event.ModelEventNames.PRODUCT_IMAGE_COLOR_UPDATE,this,this._handleColorChangeEvent));this._subscriptions.push(dojo.subscribe(LEE.event.ModelEventNames.PRODUCT_IMAGE_UPDATE,this,this._handleImageChangeEvent));this._subscriptions.push(dojo.subscribe(LEE.event.ModelEventNames.PRODUCT_OVERLAY_IMAGE_UPDATE,this,this._handleViewLargerImageChangeEvent));this._subscriptions.push(dojo.subscribe(LEE.event.GlobalEventNames.OVERLAY_LOADED,this,this.setUpOverlay));},_findElements:function(){this._detailedViewContainer=dojo.byId(LEE.view.product.ProductImageViewerController.IDS.DETAILED_VIEW_CONTAINER);this._detailedViewImage=dojo.byId(LEE.view.product.ProductImageViewerController.IDS.DETAILED_VIEW_IMAGE);this._previewImage=dojo.byId(LEE.view.product.ProductImageViewerController.IDS.PREVIEW_IMAGE);this._productViewContainer=dojo.byId(LEE.view.product.ProductImageViewerController.IDS.PRODUCT_VIEW_CONTAINER);this._siteContainer=dojo.byId(LEE.view.product.ProductImageViewerController.IDS.SITE_CONTAINER);this._thumbnailList=dojo.byId(LEE.view.product.ProductImageViewerController.IDS.THUMBNAIL_LIST);this._viewLargerLink=dojo.byId(LEE.view.product.ProductImageViewerController.IDS.VIEW_LARGER_LINK);this._viewLargerContainer=dojo.byId(LEE.view.product.ProductImageViewerController.IDS.VIEW_LARGER_CONTAINER);this._viewport=dojo.byId(LEE.view.product.ProductImageViewerController.IDS.VIEWPORT);this._viewportBackground=dojo.byId(LEE.view.product.ProductImageViewerController.IDS.VIEWPORT_BACKGROUND);this._viewportBackgroundContainer=dojo.byId(LEE.view.product.ProductImageViewerController.IDS.VIEWPORT_BACKGROUND_CONTAINER);this._thumbnails=dojo.query("a."+LEE.view.product.ProductImageViewerController.CLASSES.THUMBNAIL,this._thumbnailList);},_getTemplates:function(){if(this._thumbnails.length){var _b0=LEE.util.Lang.getQueryElementByIndex("li",this._thumbnailList,0);if(_b0){this._thumbnailTemplate=_b0.cloneNode(true);dojo.removeClass(this._thumbnailTemplate,LEE.view.product.ProductImageViewerController.CLASSES.SELECTED);var _b1=LEE.util.Lang.getQueryElementByIndex("img",this._thumbnailTemplate,0);if(_b1){_b1.src=LEE.util.config.get("Locations.TRANSPARENT_GIF");}}}},_setImageMappingsFromXhrResponse:function(_b2){this.thumbnailCollection={};if(_b2&&_b2.productImages){for(var i in _b2.productImages){if(_b2.productImages.hasOwnProperty(i)){var _b4=[];var _b5={};for(var j in _b2.productImages[i]){if(_b2.productImages[i].hasOwnProperty(j)){_b4.push(j);}}_b4.sort();for(var j=0,_b7=_b4.length;j<_b7;j++){_b5[_b4[j]]=_b2.productImages[i][_b4[j]];}_b2.productImages[i]=_b5;}}}this.data=_b2;if(this.data.productId){var _b8=this.data.productId;}if(this.data.productImages){this.productImageViewer.setCurrentItemList(this.data.productImages["default"]);for(var i in this.data.productImages["default"]){if(this.data.productImages["default"].hasOwnProperty(i)){this.thumbnailCollection[i]=new LEE.view.product.ThumbnailImage(true,"productDetail?id="+_b8+"&selected=t"+(i-1),true,this.data.productImages["default"][i].preview);}}}else{alert("Sorry, there appears to be an error; please refresh your browser and try again");}},configureProductPreview:function(e){var _ba=dojo.byId(LEE.view.product.ProductImageViewerController.IDS.SITE_CONTAINER);if(window.innerWidth){w=window.innerWidth;}else{w=window.document.body.clientWidth;}var _bb=(w-_ba.clientWidth)/2+25;var h;if(window.pageYOffset){h=window.pageYOffset;}else{h=document.documentElement.scrollTop;}var _bd=185-h;dojo.style(this._viewport,{top:((e.clientY-_bd)-this._viewport.clientHeight/2)+"px",left:((e.clientX-_bb)-this._viewport.clientWidth/2)+"px"});this.moveIt._mover=new this.moveIt.mover(this.moveIt.node,e,this.moveIt);},destroyMover:function(e){dojo.stopEvent(e);if(this.moveIt._mover){this.moveIt._mover.destroy();delete this.moveIt._mover;}},mouseMovementResponder:function(e){clearTimeout(this.timeout);if(this.moveIt._mover&&this.moveIt._mover.node){this.updateDetailView(this.moveIt._mover.node.offsetLeft,this.moveIt._mover.node.offsetTop);}},prepOverlayAndThumbs:function(){var _c0=this.productImageViewer.getSelectedColorSet();if(_c0==="default"){}else{var _c1=dojo.byId(LEE.view.product.ProductImageViewerController.IDS.THUMBNAIL_LIST_OVERLAY);_c1.innerHTML="";if(this.data.productImages){for(var i in this.data.productImages[_c0]){if(this.data.productImages[_c0].hasOwnProperty(i)){var _c3=this._thumbnailTemplate.cloneNode(true);var _c4=LEE.util.Lang.getQueryElementByIndex("img",_c3,0);var _c5=LEE.util.Lang.getQueryElementByIndex("a",_c3,0);_c4.src=this.data.productImages[_c0][i].thumbnail;_c5.id=LEE.view.product.ProductImageViewerController.THUMBNAIL_LINK_PREFIX+(i-1);_c1.appendChild(_c3);}}}}var _c6=this.productImageViewer.getSelectedIndex();var _c7=this.productImageViewer.getFilenamesFromArrayIndex(_c6);this.productImageViewer.setSelectedItem(_c6,LEE.view.product.ProductImageViewerController.OVERLAY_IDENTIFIER);this.productImageViewer.setDetailedViewImage(_c7[1],LEE.view.product.ProductImageViewerController.OVERLAY_IDENTIFIER);},setUpOverlay:function(e){if(dojo.byId(LEE.view.product.ProductImageViewerController.IDS.THUMBNAIL_LIST_OVERLAY)){this.prepOverlayAndThumbs();var _c9=dojo.query("a."+LEE.view.product.ProductImageViewerController.CLASSES.THUMBNAIL,LEE.view.product.ProductImageViewerController.IDS.THUMBNAIL_LIST_OVERLAY);if(_c9.length){dojo.forEach(_c9,function(el){dojo.connect(el,"onclick",this,this._handleOverlayThumbSelecton);},this);}}},startup:function(_cb){if(!_cb){_cb=leeProductId;}this.productId=_cb;if(this._viewport){this.moveIt=new dojo.dnd.move.parentConstrainedMoveable(this._viewport,{within:true});}},updateDetailView:function(x,y){if(x<0){x=0;}if(y<0){y=0;}var _ce=dojo.byId("viewport");dojo.style(this._viewportBackground,{left:(x-this._viewport.clientWidth)+"px",top:(y-this._viewport.clientHeight)+"px"});dojo.style(this._detailedViewImage,{left:"-"+(x*2)+"px",top:"-"+(y*2)+"px"});},updateTargetDivs:function(_cf,_d0){var _d1=this.productImageViewer.getFilenamesFromArrayIndex(_cf);if(_d0===LEE.view.product.ProductImageViewerController.OVERLAY_IDENTIFIER){this.productImageViewer.setSelectedItem(_cf,LEE.view.product.ProductImageViewerController.OVERLAY_IDENTIFIER);this.productImageViewer.setDetailedViewImage(_d1[1],LEE.view.product.ProductImageViewerController.OVERLAY_IDENTIFIER);}else{this.productImageViewer.setPreviewImage(_d1[0]);this.productImageViewer.setDetailedViewImage(_d1[1]);this.productImageViewer.setSelectedItem(_cf);this.productImageViewer.setViewLargerImage(_d1[1]);this.productImageViewer.setSelectedIndex(_cf);}},_handleColorChangeEvent:function(_d2){var _d3=this.productImageViewer.getSelectedColorSet();if(_d3!==_d2){if(this.data.productImages&&this._thumbnailList&&this._thumbnailTemplate){this._thumbnailList.innerHTML="";this._thumbnails=[];for(var i in this.data.productImages[_d2]){if(this.data.productImages[_d2].hasOwnProperty(i)){var _d5=this._thumbnailTemplate.cloneNode(true);var _d6=LEE.util.Lang.getQueryElementByIndex("img",_d5,0);var _d7=LEE.util.Lang.getQueryElementByIndex("a",_d5,0);_d6.src=this.data.productImages[_d2][i].thumbnail;_d7.id=LEE.view.product.ProductImageViewerController.THUMBNAIL_LINK_PREFIX+(i-1);this._thumbnailList.appendChild(_d5);this._thumbnails.push(_d5);}}}this.productImageViewer.setCurrentItemList(this.data.productImages[_d2]);var _d8=this.productImageViewer.getSelectedIndex();this.productImageViewer.setSelectedColorSet(_d2);this.updateTargetDivs(_d8);this._attachListeners();}},_handleImageChangeEvent:function(id){this.updateTargetDivs(id);},_handleMouseOver:function(e){clearTimeout(this.timeout);if(this.productImageViewer){this.timeout=setTimeout(dojo.hitch(this,function(e){this.productImageViewer.startMagnify(e);this.timeout=setTimeout(dojo.hitch(this,this.productImageViewer.stopMagnify,e),LEE.view.product.ProductImageViewerController.INACTIVITY_DURATION);},e),500);}},_handleMouseOut:function(e){clearTimeout(this.timeout);if(this.productImageViewer){this.timeout=setTimeout(dojo.hitch(this,this.productImageViewer.stopMagnify,e),250);}},_handleOverlayThumbSelecton:function(evt){dojo.stopEvent(evt);dojo.publish(LEE.event.ModelEventNames.PRODUCT_OVERLAY_IMAGE_UPDATE,[evt.target.id.substring(1)]);},_handleSelection:function(evt){dojo.stopEvent(evt);dojo.publish(LEE.event.ModelEventNames.PRODUCT_IMAGE_UPDATE,[evt.target.id.substring(1)]);},_handleViewLargerImageChangeEvent:function(e){this.updateTargetDivs(e,LEE.view.product.ProductImageViewerController.OVERLAY_IDENTIFIER);}});LEE.view.product.ProductImageViewerController.THUMBNAIL_ID_PREFIX="t_img";LEE.view.product.ProductImageViewerController.ENLARGE_VIEW_THUMBNAIL_ID_PREFIX="t_ovr_img";LEE.view.product.ProductImageViewerController.THUMBNAIL_LINK_PREFIX="t";LEE.view.product.ProductImageViewerController.OVERLAY_IDENTIFIER="_isOverlay";LEE.view.product.ProductImageViewerController.IDS={DETAILED_VIEW_CONTAINER:"detailed-view-container",DETAILED_VIEW_IMAGE:"detailed-view-image",PREVIEW_IMAGE:"preview-image",PRODUCT_VIEW_CONTAINER:"product_view",SITE_CONTAINER:"container",THUMBNAIL_LIST:"thumbnails",THUMBNAIL_LIST_OVERLAY:"overlay-thumbnails",VIEW_LARGER_CONTAINER:"view-larger-link",VIEW_LARGER_LINK:"view-larger-a",VIEWPORT:"viewport",VIEWPORT_BACKGROUND:"viewport-background",VIEWPORT_BACKGROUND_CONTAINER:"viewport-background-container"};LEE.view.product.ProductImageViewerController.CLASSES={SELECTED:"selected",THUMBNAIL:"thumbnail"};LEE.view.product.ProductImageViewerController.INACTIVITY_DURATION=2000;}if(!dojo._hasResource["LEE.DetailPage"]){dojo._hasResource["LEE.DetailPage"]=true;dojo.provide("LEE.DetailPage");dojo.subscribe(LEE.event.GlobalEventNames.GLOBAL_LOADED,this,function(){if(dojo.byId(LEE.view.product.Pagination.PAGINATION_CONTAINER_ID)){LEE.pagination=new LEE.view.product.Pagination();}LEE.productImageViewer=new LEE.view.product.ProductImageViewerController();LEE.productForm=new LEE.view.product.ProductForm();LEE.shareForm=new LEE.view.product.ShareForm();LEE.compareForm=new LEE.ui.catalog.CompareForm();LEE.productForm.startup();LEE.compareForm.startup();});}