
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(_2,_3){this.inherited(arguments);dojo.style(this.shareSendOverlay,"backgroundImage","none");if(this.shareSendOverlay){this.shareSendOverlay.innerHTML+=_2;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(_4,_5){this.inherited(arguments);dojo.style(this.shareSendOverlay,"display","none");if(this.messageElement&&this.response){this.messageElement.innerHTML=_4;}}});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 _6={handle:dojo.hitch(this,this.refreshOnHistory),changeUrl:this._createHashURLFromQuery()};dojo.back.setInitialState(_6);if(dojo.isIE){dojo.back.addToHistory(_6);}},_attachListeners:function(){dojo.forEach(this._connections,function(_7){dojo.disconnect(_7);});this._connections=[];dojo.forEach(this.filters,function(el){if(!LEE.util.Dom.hasTagName(el,"input")){var _8=dojo.query("input",el);if(_8[0]){el=_8[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 _9=unescape(window.location.hash).substring(1).split("&");var _a=_9.length;if(_a>1){for(var i=_a-1;i>=0;i--){var _b=_9[i].split("=");this.serverQuery[_b[0]]=_b[1];}}else{this.serverQuery=dojo.clone(this.initialQuery);}},_invalidateQueryInput:function(){var _c=this.serverQuery.filter1.split("%")[0];var _d=this.serverQuery.filter1.split("%").slice(1);var _e=this.filters.length;var _f=[];if(_d.length>0){for(var i=_e-1;i>=0;i--){var _10=this.filters[i];var _11=this._getFilterValue(_10);if(dojo.indexOf(_d,_11)>-1){this._selectFilter(_10);}else{this._deselectFilter(_10);}}}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(_12){var _13;var _14=dijit.byNode(_12);if(_14){var _15=_14.attr("checked");_14.setAttribute("checked",true);_13=_14.attr("value");_14.setAttribute("checked",_15);}else{if(LEE.util.Dom.hasTagName(_12,"input")){_13=_12.value;}}if(_13&&_13.indexOf("__")>-1){_13=_13.split("__")[1];}return _13;},_selectFilter:function(_16){_16.checked="";widget=dijit.byNode(_16);if(widget){widget.setAttribute("disabled",false);widget.setAttribute("checked",true);dojo.publish(LEE.event.GlobalEventNames.CHECKBOX_ENABLED,[_16]);}else{dojo.attr(_16,"checked",true);}dojo.publish(LEE.event.GlobalEventNames.CHECKBOX_ON_PAGINATION,[_16]);},_deselectFilter:function(_17){_17.checked="";widget=dijit.byNode(_17);if(widget){widget.setAttribute("checked",false);dojo.publish(LEE.event.GlobalEventNames.CHECKBOX_ENABLED,[_17]);}else{dojo.removeAttr(_17,"checked");}dojo.publish(LEE.event.GlobalEventNames.CHECKBOX_ON_PAGINATION,[_17]);},_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 _18=this.filters.length;for(var i=0;i<_18;i++){var _19="";var _1a=this.filters[i];var _1b=dijit.byNode(_1a);if(_1b){if(_1b.getValue()){this.queryFilters.push(_1b.getValue());}}else{if(LEE.util.Dom.hasTagName(_1a,"input")){if(_1a.checked&&_1a.value){if(_1a.name===_1a.value){this.queryFilters.push(_1a.name);}else{this.queryFilters.push(_1a.name+"__"+_1a.value);}}}}}var _1c="";var _1d=[];for(var i=0;i<this.queryFilters.length;i++){var _1e=this.queryFilters[i].split("__");if(_1c===""&&_1e.length>1){_1c=_1e[0];}if(_1e.length>1){_1d.push(_1e[1]);}else{if(_1e.length==1){_1c=_1e[0];_1d.push(_1e[0]);}}}this.serverQuery.filter1=_1c+"%"+_1d.join("%");this._loadFiltersToServerQuery();},_loadFiltersToServerQuery:function(){for(var key in this.serverQuery){if(key.indexOf("f_")==0){delete this.serverQuery[key];}}var _1f=this.filters.length;for(var i=0;i<_1f;i++){var _20="";var _21=this.filters[i];var _22=dijit.byNode(_21);if(_22){if(_22.getValue()){this.serverQuery[_22.name]=_22.getValue();}}else{if(LEE.util.Dom.hasTagName(_21,"input")){if(_21.checked&&_21.value){this.serverQuery[_21.name]=_21.value;}}}}},_createHashURLFromQuery:function(){var _23="";_23+="count="+this.serverQuery.count;_23+="&sort="+this.serverQuery.sort;_23+="&"+LEE.view.product.Pagination.PAGE_QUERY_STRING_NAME+"="+this.serverQuery[LEE.view.product.Pagination.PAGE_QUERY_STRING_NAME];if(this.serverQuery.view){_23+="&view="+this.serverQuery.view;}_23+="&filter1="+this.serverQuery.filter1;return _23;},_addQueryToHistory:function(){var _24={handle:dojo.hitch(this,this.refreshOnHistory),changeUrl:this._createHashURLFromQuery()};dojo.back.addToHistory(_24);},_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 _25=dojo.query("img."+LEE.view.product.Pagination.CLASSES.ANGLE1,el);var _26=dojo.query("img."+LEE.view.product.Pagination.CLASSES.ANGLE2,el);if(_25&&_26){switch(this.viewAngle){case "angle1":dojo.forEach(_25,function(_27){dojo.removeClass(_27,"none");},this);dojo.forEach(_26,function(_28){dojo.addClass(_28,"none");},this);break;default:dojo.forEach(_25,function(_29){dojo.addClass(_29,"none");},this);dojo.forEach(_26,function(_2a){dojo.removeClass(_2a,"none");},this);break;}}},this);},_convertInputToPageLinks:function(){var _2b=0;dojo.forEach(dojo.query("."+LEE.view.product.Pagination.CLASSES.PAGE_NUMBER_CONTAINER),function(el){var _2c=LEE.view.product.Pagination.PAGINATION_INPUT_TAG+"."+LEE.view.product.Pagination.CLASSES.PAGE_NUMBER_INPUT;var _2d=LEE.util.Lang.getQueryElementByIndex(_2c,el,0);var _2e="";var _2f=Math.max(1,parseInt(this.serverQuery[LEE.view.product.Pagination.PAGE_QUERY_STRING_NAME])-1);var _30=parseInt(this.serverQuery[LEE.view.product.Pagination.PAGE_QUERY_STRING_NAME])+1;if(_2d&&LEE.util.Dom.hasTagName(_2d,"select")){_2e+="<a href=\""+_2d.form.action+_2f+"\" "+"class=\""+LEE.view.product.Pagination.CLASSES.PAGE_NUMBER_LINK;if(this.serverQuery[LEE.view.product.Pagination.PAGE_QUERY_STRING_NAME]<=0){_2e+=" none";}_2e+=" "+LEE.view.product.Pagination.PREV_BUTTON_CLASS+"\">"+"&larr;"+"</a>";dojo.forEach(dojo.query("option",_2d),function(opt){_2e+="<a href=\""+_2d.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){_2e+=" current";}_2e+="\">"+opt.innerHTML+"</a>";if(parseInt(opt.value)){_2b=Math.max(_2b,parseInt(opt.value)+1);}},this);_2e+="<a href=\""+_2d.form.action+_30+"\" "+"class=\""+LEE.view.product.Pagination.CLASSES.PAGE_NUMBER_LINK;if(this.totalPages<=this.serverQuery[LEE.view.product.Pagination.PAGE_QUERY_STRING_NAME]){_2e+=" none";}_2e+=" "+LEE.view.product.Pagination.NEXT_BUTTON_CLASS+"\">"+"&rarr;"+"</a>";}if(_2e){var _31=document.createElement("div");_31.innerHTML=_2e;dojo.addClass(_2d,"none");dojo.place(_31,el,"last");}},this);this.totalPages=_2b;},_displayFilters:function(){for(var i=this.filters.length-1;i>=0;i--){var _32=dijit.byNode(this.filters[i]);if(_32&&!_32.getValue()){_32.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 _33=this.data.parametricNavBehavior;if(_33){for(var i=_33.length-1;i>=0;i--){var _32=dijit.byId(_33[i].elementID);var _34=dojo.byId(_33[i].elementID);if(_32){_32.setAttribute("disabled",false);}else{if(_34){dojo.removeClass(_34,"disabled_filter");if(LEE.util.Dom.hasTagName(_34,"input")){_34.disabled=false;}}}if(_33[i]){dojo.publish(LEE.event.GlobalEventNames.CHECKBOX_ENABLED,[_33[i].elementID]);}}}},_displayPageNumbers:function(){var _35=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(_35)){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 _36=document.createElement("a");_36.name=_36.id=LEE.view.product.Pagination.TOP_ANCHOR_NAME;this.node.parentNode.parentNode.insertBefore(_36,this.node.parentNode.parentNode.firstChild);}},_getTemplates:function(){if(this.items[0]){this.templateItem=dojo.clone(this.items[0]);var _37=dojo.query("input[type=checkbox]",this.templateItem);dojo.forEach(_37,function(_38){dojo.removeAttr(_38,"checked");dojo.removeAttr(_38,"name");dojo.removeAttr(_38,"value");},this);}if(this.pageNumbers[1]){this.templateNumber=this.pageNumbers[1].cloneNode(true);}},_getItemValue:function(_39,_3a){if(_39&&_39.hasOwnProperty(_3a)){return _39[_3a];}else{return null;}},_loadItems:function(){var _3b=0;var _3c=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 _3d=this.templateItem.cloneNode(true);dojo.forEach(dojo.query("img.catalog_item_image",_3d),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",_3d),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",_3d),function(el){var _3e=dojo.query("a.catalog_item_link",el);if(_3e.length>0){_3e[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,_3d),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",_3d),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",_3d),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",_3d),function(el){el.href=this._getItemValue(i,"URL_productDetails");},this);dojo.forEach(dojo.query("a.quickview",_3d),function(el){el.href=this._getItemValue(i,"URL_quickView");},this);dojo.forEach(dojo.query("img.promotion_tag",_3d),function(el){var _3f=this._getItemValue(i,"promo_tag");if(!_3f){_3f={filepath:LEE.util.config.get("Locations.TRANSPARENT_GIF"),alt:""};}el.src=_3f.filepath;el.alt=_3f.alt;},this);dojo.forEach(dojo.query("img.rating",_3d),function(el){var _40=this._getItemValue(i,"rating");if(_40){el.src=LEE.util.config.get("Locations.RATING_IMAGES."+_40);el.alt=LEE.view.product.Pagination.RATING_IMAGES_ALT.replace(/%rating%/gi,_40);}else{el.src=LEE.util.config.get("Locations.TRANSPARENT_GIF");el.alt="Not yet rated";}},this);this.node.appendChild(_3d);dojo.forEach(dojo.query("input.checkbox_compare_form",_3d),function(el){var _41="";var pn=dojo.byId(el.parentNode);var _42=this._getItemValue(i,"compare");_41="<input type=\"checkbox\" class=\""+el.className+"\" "+"id=\""+LEE.view.product.Pagination.PRODUCT_ID_PREFIX+this._getItemValue(i,"productId")+"\" "+"name=\""+_42.name+"\" "+"value=\""+_42.value+"\" ";var _43=this._getItemValue(i,"IN_COMPARE_QUEUE");if(_43&&_43!=="false"){_41+="checked=\"checked\" ";}else{dojo.removeAttr(el,"checked");}_41+="/>";pn.removeChild(el);pn.innerHTML=_41+pn.innerHTML;},this);dojo.forEach(dojo.query("input[type=hidden].compare",_3d),function(el){var _44=this._getItemValue(i,"compare");var _45="<input type=\"hidden\" class=\""+el.className+"\" "+"name=\""+_44.value+"\" "+"value=\""+_44.name+"\" />";var pn=el.parentNode;pn.removeChild(el);pn.innerHTML=_45+pn.innerHTML;},this);if((_3b+1)%this.perRow===0){dojo.addClass(_3d,"last_of_row");this.node.innerHTML+="<br class=\"clearabove\" />";_3c=true;}else{_3c=false;}_3b++;},this);LEE.checkbox.refresh();if(!_3c){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 _46=(this.serverQuery[LEE.view.product.Pagination.PAGE_QUERY_STRING_NAME])+this.pageNumbersBeforeEllipsis;var _47=Math.max(0,this.totalPages-this.pageNumbersMax);var _48=false;if(this.serverQuery[LEE.view.product.Pagination.PAGE_QUERY_STRING_NAME]>=this.totalPages-this.pageNumbersMax){_48=true;}dojo.forEach(this.paginationContainers,function(el){var _49=dojo.query("*",el);dojo.forEach(_49,function(_4a){_4a.className="none";},this);var _4b=false;var _4c=false;var _4d=this.templateNumber.cloneNode(true);dojo.addClass(_4d,LEE.view.product.Pagination.PREV_BUTTON_CLASS);_4d.innerHTML="&larr;";el.appendChild(_4d);for(var i=0;i<this.totalPages;i++){if(i>=this.totalPages-this.pageNumbersMax){_4c=true;}if((i>=this.serverQuery[LEE.view.product.Pagination.PAGE_QUERY_STRING_NAME]&&i<_46)||(i>=this.totalPages-this.pageNumbersAfterEllipsis)||(_4c&&_48)){var _4d=this.templateNumber.cloneNode(true);_4d.href=_4d.href.replace(this.pageQueryStringRegEx,this.pageQueryStringName+"="+i);_4d.innerHTML=i+1;if(!_4b&&!_48&&i>_46){var _4e=document.createElement("a");_4e.className="ellipsis";_4e.innerHTML="&hellip;";el.appendChild(_4e);_4b=true;}el.appendChild(_4d);}}var _4d=this.templateNumber.cloneNode(true);dojo.addClass(_4d,LEE.view.product.Pagination.NEXT_BUTTON_CLASS);_4d.innerHTML="&rarr;";el.appendChild(_4d);},this);},_readPageNumber:function(e){dojo.stopEvent(e);var _4f=this.serverQuery[LEE.view.product.Pagination.PAGE_QUERY_STRING_NAME];switch(e.target.tagName.toLowerCase()){case "a":_4f=e.target.href.match(this.pageQueryStringRegEx);if(_4f){_4f=_4f.toString().replace(this.pageQueryStringName+"=","");}else{_4f=this.serverQuery[LEE.view.product.Pagination.PAGE_QUERY_STRING_NAME];}break;}_4f=Math.max(_4f,0);this.serverQuery[LEE.view.product.Pagination.PAGE_QUERY_STRING_NAME]=_4f;this.serverQuery.start=this.pageSize*Math.max(_4f-1,0);},_resetCheckboxes:function(){dojo.forEach(this.filters,function(el){el.checked="";var _50=dijit.byNode(el);if(_50){_50.setAttribute("disabled",false);_50.setAttribute("checked",false);}else{el.disabled=false;el.checked=false;}},this);},_setNextPrevButtons:function(){var _51=this.pageQueryStringName+"="+(this.serverQuery[LEE.view.product.Pagination.PAGE_QUERY_STRING_NAME]);var _52=this.pageQueryStringName+"="+Math.min(this.totalPages-1,this.serverQuery[LEE.view.product.Pagination.PAGE_QUERY_STRING_NAME]+1);var _53=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,_52);break;}if(el.href&&el.href.match(_51)||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,_53);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(_54,_55){dojo.publish(LEE.event.GlobalEventNames.CLICK_BLOCKER_HIDE);if(!_54){_54={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(_56){dojo.publish(LEE.event.GlobalEventNames.CLICK_BLOCKER_HIDE);this.data=_56;this.items=_56.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(_57){if(_57){this.form=dojo.byId(_57);}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(_58){var _59=LEE.util.Lang.getQueryElementByIndex("input[name="+LEE.ui.catalog.CompareForm.CHECKBOX_NAME_PREFIX+_58+"]",this.form,0);if(!_59){var _5a=document.createElement("input");_5a.type="hidden";_5a.name="productId";_5a.value=_58;this.form.appendChild(_5a);}},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 _5b=(dojo.indexOf(this.model.products,cb.value)>-1);var _5c=null;if(_5b){dojo.attr(cb,"checked",true);_5c=dijit.getEnclosingWidget(cb);if(_5c){_5c.attr("checked",true);}}else{if(!_5b&&cb.checked){dojo.removeAttr(cb,"checked");_5c=dijit.getEnclosingWidget(cb);if(_5c){_5c.attr("checked",false);}}}},this);}catch(err){console.log(err.message);}},_isCheckBox:function(_5d){return ((dojo.attr(_5d,"type")=="checkbox")&&dojo.attr(_5d,"id").indexOf(LEE.ui.catalog.CompareForm.CHECKBOX_ID_PREFIX)==0);},_handleSubmit:function(_5e){dojo.stopEvent(_5e);},_handleCatalogUpdate:function(_5f,_60){setTimeout(dojo.hitch(this,this._initViews),0);},_handleClick:function(_61){try{if(this._isCheckBox(_61.target)){this._updateComparison(_61);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(_62,_63){try{this._updateInputs();if(_62&&_62.limitExceeded){LEE.alert(LEE.util.config.get("Messages.COMPARE_LIMIT_EXCEEDED"));}}catch(err){console.log(err.message);}},_handleUpdateError:function(_64){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(_65,_66,_67,_68){this.enabled=_65;this.link=_66;this.selected=_67;this.source=_68;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(_69){this.hScroll=_69.hScroll;this.image=_69.image;this.itemList=_69.items;this.magnifyControl=_69.magnifyControl;this.magnifyImage=_69.magnifyImage;this.overlayIdentifier=_69.overlayIdentifier;this.selectedIndex=_69.selectedIndex;this.selectedItem=_69.selectedItem;this.thumbnails=_69.thumbnails;this.viewLargeButton=_69.viewLargeButton;this.vScroll=_69.vScroll;this.selectedColorSet=_69.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(_6a){this.itemList=_6a;},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(_6b){var _6c=[];if(this.itemList){_6b++;if(!this.itemList[_6b]){_6b=1;this.setSelectedIndex(_6b);}if(this.itemList[_6b]){_6c.push(this.itemList[_6b].preview);_6c.push(this.itemList[_6b].fullsize);_6c.push(_6b);}}return _6c;},setDetailedViewImage:function(_6d,_6e){var _6f;if(_6e===this.overlayIdentifier){_6f=dojo.byId(LEE.view.product.ProductImageViewer.IDS.DETAILED_VIEW_OVERLAY);}else{_6f=this._detailedViewImage;this.magnifyImage=_6d;}_6f.src=_6d;},setPreviewImage:function(_70){this.image=_70;this._previewImage.src=_70;},setSelectedColorSet:function(_71){this.selectedColorSet=_71;},getSelectedColorSet:function(){return this.selectedColorSet;},setSelectedIndex:function(_72){this.selectedIndex=_72;},getSelectedIndex:function(){return this.selectedIndex;},setSelectedItem:function(_73,_74){var _75;if(_74===this.overlayIdentifier){_75=dojo.byId(LEE.view.product.ProductImageViewer.IDS.THUMBNAIL_LIST_OVERLAY);}else{_75=this._thumbnailList;}if(!this.itemList[_73]){_73=0;}var _76=dojo.query("li",_75);for(var i=_76.length-1;i>=0;i--){dojo.removeClass(_76[i],LEE.view.product.ProductImageViewer.CLASSES.SELECTED);if(i==_73){dojo.addClass(_76[i],LEE.view.product.ProductImageViewer.CLASSES.SELECTED);}}},setViewLargerImage:function(_77){this._viewLargerLink.href=this.viewLargerBasePath+_77;}});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(_78){dojo.disconnect(_78);},this);dojo.forEach(this._subscriptions,function(_79){dojo.unsubscribe(_79);},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,this._handleViewLargerImageClick));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 _7a=LEE.util.Lang.getQueryElementByIndex("li",this._thumbnailList,0);if(_7a){this._thumbnailTemplate=_7a.cloneNode(true);dojo.removeClass(this._thumbnailTemplate,LEE.view.product.ProductImageViewerController.CLASSES.SELECTED);var _7b=LEE.util.Lang.getQueryElementByIndex("img",this._thumbnailTemplate,0);if(_7b){_7b.src=LEE.util.config.get("Locations.TRANSPARENT_GIF");}}}},_setImageMappingsFromXhrResponse:function(_7c){this.thumbnailCollection={};if(_7c&&_7c.productImages){for(var i in _7c.productImages){if(_7c.productImages.hasOwnProperty(i)){var _7d=[];var _7e={};for(var j in _7c.productImages[i]){if(_7c.productImages[i].hasOwnProperty(j)){_7d.push(j);}}_7d.sort();for(var j=0,_7f=_7d.length;j<_7f;j++){_7e[_7d[j]]=_7c.productImages[i][_7d[j]];}_7c.productImages[i]=_7e;}}}this.data=_7c;if(this.data.productId){var _80=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="+_80+"&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 _81=dojo.byId(LEE.view.product.ProductImageViewerController.IDS.SITE_CONTAINER);if(window.innerWidth){w=window.innerWidth;}else{w=window.document.body.clientWidth;}var _82=(w-_81.clientWidth)/2+25;var h;if(window.pageYOffset){h=window.pageYOffset;}else{h=document.documentElement.scrollTop;}var _83=185-h;dojo.style(this._viewport,{top:((e.clientY-_83)-this._viewport.clientHeight/2)+"px",left:((e.clientX-_82)-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 _84=this.productImageViewer.getSelectedColorSet();if(_84==="default"){}else{var _85=dojo.byId(LEE.view.product.ProductImageViewerController.IDS.THUMBNAIL_LIST_OVERLAY);_85.innerHTML="";if(this.data.productImages&&!dojo.hasClass(dojo.query(LEE.view.product.ProductForm.CLASSES.OUT_OF_STOCK)[0],"show")){for(var i in this.data.productImages[_84]){if(this.data.productImages[_84].hasOwnProperty(i)){var _86=this._thumbnailTemplate.cloneNode(true);var _87=LEE.util.Lang.getQueryElementByIndex("img",_86,0);var _88=LEE.util.Lang.getQueryElementByIndex("a",_86,0);_87.src=this.data.productImages[_84][i].thumbnail;_88.id=LEE.view.product.ProductImageViewerController.THUMBNAIL_LINK_PREFIX+(i-1);_85.appendChild(_86);}}}}var _89=this.productImageViewer.getSelectedIndex();var _8a=this.productImageViewer.getFilenamesFromArrayIndex(_89);this.productImageViewer.setSelectedItem(_89,LEE.view.product.ProductImageViewerController.OVERLAY_IDENTIFIER);this.productImageViewer.setDetailedViewImage(_8a[1],LEE.view.product.ProductImageViewerController.OVERLAY_IDENTIFIER);},setUpOverlay:function(e){if(dojo.byId(LEE.view.product.ProductImageViewerController.IDS.THUMBNAIL_LIST_OVERLAY)){this.prepOverlayAndThumbs();var _8b=dojo.query("a."+LEE.view.product.ProductImageViewerController.CLASSES.THUMBNAIL,LEE.view.product.ProductImageViewerController.IDS.THUMBNAIL_LIST_OVERLAY);if(_8b.length){dojo.forEach(_8b,function(el){dojo.connect(el,"onclick",this,this._handleOverlayThumbSelecton);},this);}}},startup:function(_8c){if(!_8c){_8c=leeProductId;}this.productId=_8c;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 _8d=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(_8e,_8f){var _90=this.productImageViewer.getFilenamesFromArrayIndex(_8e);if(_8f===LEE.view.product.ProductImageViewerController.OVERLAY_IDENTIFIER){this.productImageViewer.setSelectedItem(_8e,LEE.view.product.ProductImageViewerController.OVERLAY_IDENTIFIER);this.productImageViewer.setDetailedViewImage(_90[1],LEE.view.product.ProductImageViewerController.OVERLAY_IDENTIFIER);}else{this.productImageViewer.setPreviewImage(_90[0]);this.productImageViewer.setDetailedViewImage(_90[1]);this.productImageViewer.setSelectedItem(_8e);this.productImageViewer.setViewLargerImage(_90[1]);this.productImageViewer.setSelectedIndex(_8e);}},_handleColorChangeEvent:function(_91){var _92=this.productImageViewer.getSelectedColorSet();if(_92!==_91){if((this.data.productImages&&this._thumbnailList&&this._thumbnailTemplate)){this._thumbnailList.innerHTML="";this._thumbnails=[];for(var i in this.data.productImages[_91]){if(this.data.productImages[_91].hasOwnProperty(i)){var _93=this._thumbnailTemplate.cloneNode(true);var _94=LEE.util.Lang.getQueryElementByIndex("img",_93,0);var _95=LEE.util.Lang.getQueryElementByIndex("a",_93,0);_94.src=this.data.productImages[_91][i].thumbnail;_95.id=LEE.view.product.ProductImageViewerController.THUMBNAIL_LINK_PREFIX+(i-1);this._thumbnailList.appendChild(_93);this._thumbnails.push(_93);}}}this.productImageViewer.setCurrentItemList(this.data.productImages[_91]);var _96=this.productImageViewer.getSelectedIndex();this.productImageViewer.setSelectedColorSet(_91);this.updateTargetDivs(_96);this._attachListeners();}},_handleImageChangeEvent:function(id){if(!dojo.hasClass(dojo.query(LEE.view.product.ProductForm.CLASSES.OUT_OF_STOCK)[0],"show")){this.updateTargetDivs(id);}},_handleMouseOver:function(e){dojo.style(dojo.byId(LEE.view.product.ProductImageViewerController.IDS.VIEWPORT_BACKGROUND),"display","block");clearTimeout(this.timeout);if(dojo.hasClass(dojo.query(LEE.view.product.ProductForm.CLASSES.OUT_OF_STOCK)[0],"show")){return;}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),250);}},_handleMouseOut:function(e){dojo.style(dojo.byId(LEE.view.product.ProductImageViewerController.IDS.VIEWPORT_BACKGROUND),"display","none");clearTimeout(this.timeout);if(this.productImageViewer){this.timeout=setTimeout(dojo.hitch(this,this.productImageViewer.stopMagnify,e),250);}},_handleOverlayThumbSelecton:function(evt){dojo.stopEvent(evt);if(dojo.hasClass(dojo.query(LEE.view.product.ProductForm.CLASSES.OUT_OF_STOCK)[0],"show")){return;}dojo.publish(LEE.event.ModelEventNames.PRODUCT_OVERLAY_IMAGE_UPDATE,[evt.target.id.substring(1)]);},_handleSelection:function(evt){dojo.stopEvent(evt);if(dojo.hasClass(dojo.query(LEE.view.product.ProductForm.CLASSES.OUT_OF_STOCK)[0],"show")){return;}dojo.publish(LEE.event.ModelEventNames.PRODUCT_IMAGE_UPDATE,[evt.target.id.substring(1)]);},_handleViewLargerImageChangeEvent:function(e){if(dojo.hasClass(dojo.query(LEE.view.product.ProductForm.CLASSES.OUT_OF_STOCK)[0],"show")){dojo.stopEvent(e);return;}this.updateTargetDivs(e,LEE.view.product.ProductImageViewerController.OVERLAY_IDENTIFIER);},_handleViewLargerImageClick:function(e){if(!dojo.hasClass(dojo.query(LEE.view.product.ProductForm.CLASSES.OUT_OF_STOCK)[0],"show")){LEE.ui.global.ViewLarger(e);}else{dojo.stopEvent(e);return false;}}});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();});}
