var Nshop={ClientFieldArticleID:"",ClientFieldColorID:"",ID:"",TargetButtonID:"",ClientFieldFromRecentID:"",ArticleID:0,GroupID:0,SmallImg:null,LargeImg:null,Cursor:null,Timer:null,Animation:null,ZoomInitialized:false};Nshop.initialize=function(a){this.SmallImg=$get(a);$clearHandlers(this.SmallImg);$clearHandlers($get("imgZoomCursor"));$addHandler(this.SmallImg,"mouseout",Function.createDelegate(this,this.mouseOut));$addHandler(this.SmallImg,"mousemove",Function.createDelegate(this,this.mouseMove));$addHandler($get("imgZoomCursor"),"mouseout",Function.createDelegate(this,this.mouseOut));$addHandler($get("imgZoomCursor"),"mousemove",Function.createDelegate(this,this.keepGoing))};Nshop.InitAnimition=function(){var a=$get("ImgZoomCanvas");if(a){a.style.display="block"}this.LargeImg=a.getElementsByTagName("IMG")[0];var b=Sys.UI.DomElement.getBounds(this.LargeImg);this.largeWidth=b.width;this.largeHeight=b.height;var b=Sys.UI.DomElement.getBounds(a);canvasWidth=b.width;canvasHeight=b.height;this.xShift=parseInt(canvasWidth/2);this.yShift=parseInt(canvasHeight/2);b=Sys.UI.DomElement.getBounds(this.SmallImg);this.smallWidth=b.width;this.smallHeight=b.height;this.xOrgShift=$(this.SmallImg).position().left;this.yOrgShift=$(this.SmallImg).position().top;this.xRatio=this.largeWidth/this.smallWidth;this.yRatio=this.largeHeight/this.smallHeight;this.cursorWidth=parseInt(canvasWidth/this.xRatio);this.cursorHeight=parseInt(canvasHeight/this.yRatio);this.Cursor=$get("imgZoomCursor");this.Cursor.style.width=this.cursorWidth+"px";this.Cursor.style.height=this.cursorHeight+"px";this.Cursor.style.display="block";this.ZoomInitialized=true};Nshop.mouseMove=function(h,f){oImg=f?h.target.parentElement:h.target;if(this.Timer){clearTimeout(this.Timer);this.Timer=null}if(!this.ZoomInitialized){this.InitAnimition(oImg)}var a=h.offsetX;var i=h.offsetY;if(f){a+=parseInt((this.Cursor.style.left.replace("px","")));i+=parseInt((this.Cursor.style.top.replace("px","")))}var d=0;var g=0;if(!VWABrowserInfo.IsIE){d=this.xOrgShift;g=this.yOrgShift;if(f){a-=d;i-=g}}var c=(a<this.cursorWidth/2)?this.cursorWidth/2:a;c=(a>this.smallWidth-this.cursorWidth/2)?this.smallWidth-this.cursorWidth/2:c;var b=(i<this.cursorHeight/2)?this.cursorHeight/2:i;b=(i>this.smallHeight-this.cursorHeight/2)?this.smallHeight-this.cursorHeight/2:b;this.Cursor.style.left=(parseInt(c-this.cursorWidth/2)+d)+"px";this.Cursor.style.top=(parseInt(b-this.cursorHeight/2)+g)+"px";c=parseInt(c*this.xRatio);b=parseInt(b*this.yRatio);c-=this.xShift;b-=this.yShift;this.LargeImg.style.left=(c*-1)+"px";this.LargeImg.style.top=(b*-1)+"px"};Nshop.keepGoing=function(a){this.mouseMove(a,true)};Nshop.mouseOut=function(a,b){if(this.Timer){clearTimeout(this.Timer);this.Timer=null}this.Timer=window.setTimeout(Function.createDelegate(this,this.Hide),20)};Nshop.Hide=function(){this.ZoomInitialized=false;this.Cursor.style.display="none";this.Hide2()};Nshop.Hide2=function(b){var a=$get("ImgZoomCanvas");if(a){a.style.display="none"}};var NCart={oContainerID:"",bCollapsed:true,timer:null,showTime:2000,show:function(){this.expandCart()},hide:function(){this.hideCart()},expandCart:function(b){if(this.timer){clearTimeout(this.timer);this.timer=null}if((this.bCollapsed||b)&&this.oContainerID.length>0){var a=$("#"+this.oContainerID);a.css("display","block");$("#"+this.oContainerID+"_Tbl");var c=$("#"+this.oContainerID+"_Tbl").height();a.css("height","1px");a.animate({height:(c+10)},{duration:200});a=null;this.bCollapsed=false}if(b){this.hideCart()}},hideCart:function(){if(this.timer){clearTimeout(this.timer);this.timer=null}this.timer=window.setTimeout(Function.createDelegate(this,this.hideCart2),this.showTime)},hideCart2:function(){$("#"+this.oContainerID).animate({height:1},{duration:200,complete:Function.createDelegate(this,this.hideContainer)});this.bCollapsed=true},hideContainer:function(){$get(this.oContainerID).style.display="none"}};function addLastVisit(b,a){if(!a){a==0}var d=getCookie("lstVisit","");aCookie=d.split("+");d=b+"_"+a;for(var c=0;c<aCookie.length;c++){if(aCookie[c].toLowerCase()==d.toLowerCase()){Array.removeAt(aCookie,c)}}for(var c=0;c<10&&c<aCookie.length;c++){d+="+"+aCookie[c]}setCookie("lstVisit",d,100)}function onProductClick(b,a){$get(Nshop.ClientFieldArticleID).value=b+"~"+Nshop.ID;$get(Nshop.ClientFieldColorID).value=a;addLastVisit(b,a)}function showPrint(){var a=sHostName+"ProductPopUp.aspx?cmd=print&ProductID="+Nshop.ArticleID;a+="&View="+Nshop.View;a+="&ColorID="+Nshop.ColorSpecID;a+="&GroupID="+Nshop.GroupID;if(Nshop.sDetailImgId&&Nshop.sDetailImgId.length>0&&$get(Nshop.sDetailImgId)){a+="&FRS="+$get(Nshop.sDetailImgId).src}ModalPopupOpen("Enlarge","80%","80%",a,null,null,true,true)}function showMail(){var a=sHostName+"Content/ProductPopUp.aspx?cmd=mail&ProductID="+Nshop.ArticleID;a+="&ColorSpecID="+Nshop.ColorSpecID;a+="&GroupID="+Nshop.GroupID;a+="&TargetBtnID="+Nshop.TargetButtonID;ModalPopupOpen("Mail","35","46",a,null,null,true,true)}function recentClicked(b,a){var c=getOrCreateHidden(Nshop.ClientFieldColorID,true);c.value=a;c=getOrCreateHidden(Nshop.ClientFieldArticleID,true);c.value=b;addLastVisit(b,a);c=getOrCreateHidden(Nshop.ClientFieldFromRecentID,true);c.value="1"}function popupClosed(a){var b=theForm[oCatProps.sArticleColorClientID+a.ProductID];if(!b){b=document.createElement("INPUT");b.type="hidden";b.name=oCatProps.sArticleColorClientID+a.ProductID;theForm.appendChild(b)}b.value=a.ColorSpecID;$get(oCatProps.ClientFieldArticleID).value=a.ProductID+"~"+oCatProps.ID;addLastVisit(a.ProductID);MenuClick(null,oCatProps.TargetButtonID,"",null)}function showAlertIFrame(b){var a=document.getElementById(oPopup.sPopupID+"Ifrm").contentWindow;if(a&&a.ModalPopupOpen){a.ModalPopupOpen("Alert",305,195,b,null,null,false,true)}}if(typeof(Sys)!=="undefined"){Sys.Application.notifyScriptLoaded()};