viewHandler=Product;function Product(){var q=this;this.animationColor="#FFFFFF";this.enlargementCache=[];this.previewCache=[];this.viewerPreviewsInitialized=false;this.productSingleLinksTooltips=[];this.productMultipleLinksTooltips=[];this.productMultiplePrecache=[];this.productMultipleAjaxQueue={items:[],valid:false};this.notificationTimeout=null;this.init=function(){this.base.init.call(this);this.initSingleItem();this.initMultipleItem();var r='<div class="text">View larger product image'+(1<document.getElementById("productPhoto").className.replace(/\D/g,"")*1?"<br/>and alternative views":"")+"</div>";this.productImageTooltip=new YAHOO.widget.Tooltip("productImageTooltip",{context:document.getElementById("productPhoto").getElementsByTagName("img")[0],text:r,preventoverlap:true,showDelay:750,effect:{effect:YAHOO.widget.ContainerEffect.FADE,duration:0.2}});this.initLinkColourAnimation();this._addAnimationId(document.getElementById("productNotifications"));c();YAHOO.util.Event.addListener(document,"hashchange",c);document.getElementById("productContent").style.background="#FFFFFF";document.getElementById("productBody").className="";if(this.isTrident6==true&&!!document.getElementById("productRecent")==true){this.addTrident6RecentHelpers()}setTimeout("xhtml.precacheProductImages();",1500);this._googleAnalyticsTrackEvent("product","init",document.getElementById("productCode").innerHTML)};this.initSingleItem=function(){var s=document.getElementById("productSingleLinks").getElementsByTagName("a");for(var r=0;r<s.length;r++){var v='<div class="text">'+s[r].getAttribute("title").replace(/\\n/g,"<br/>")+"</div>";s[r].setAttribute("title","");this.productSingleLinksTooltips[r]=new YAHOO.widget.Tooltip("productSingleLinkTooltip"+r,{context:s[r],text:v,preventoverlap:true,showDelay:200,effect:{effect:YAHOO.widget.ContainerEffect.FADE,duration:0.2}})}var u=document.getElementById("formProductSingle").getElementsByTagName("select");for(var r=0;r<u.length;r++){YAHOO.util.Event.addListener(u[r],"change",h);YAHOO.util.Event.addListener(u[r],"change",e);var t=u[r].getElementsByTagName("option");for(var z=t.length-1,w=0;0<=z;z--){if(t[z].text.indexOf("Add $")!=-1){w=(t[z].text.substring(t[z].text.indexOf("Add $"),t[z].text.length)).replace(/[^0-9\.]+/g,"");t[z].setAttribute("offset",w)}else{t[z].setAttribute("offset","0")}}}xhtml._addAnimationId(document.getElementById("priceSingle"));document.getElementById("formProductSingle").action="javascript:;"};this.initMultipleItem=function(){if(!!document.getElementById("productMultipleSizes")==false){document.getElementById("productSingleChangeView").className="invisible";return}var A=document.getElementById("productMultipleLinks").getElementsByTagName("a");for(var z=0;z<A.length;z++){var r='<div class="text">'+A[z].getAttribute("title").replace(/\\n/g,"<br/>")+"</div>";A[z].setAttribute("title","");this.productMultipleLinksTooltips=new YAHOO.widget.Tooltip("productMultipleLinkTooltip"+z,{context:A[z],text:r,preventoverlap:true,showDelay:200,effect:{effect:YAHOO.widget.ContainerEffect.FADE,duration:0.2}})}var u=document.getElementById("productMultipleSizes").getElementsByTagName("input");var t=document.getElementById("productMultipleSizes").getElementsByTagName("label");for(var z=0,s=0;z<u.length;z++){if(t[z].innerHTML.indexOf("Add $")!=-1){s=(t[z].innerHTML.substring(t[z].innerHTML.indexOf("Add $"),t[z].innerHTML.length)).replace(/[^0-9\.]+/g,"");u[z].setAttribute("offset",s);t[z].innerHTML="<b>"+t[z].innerHTML.substring(0,t[z].innerHTML.indexOf(":"))+'</b> <u>@</u> <span class="sizePrice">$0.00</span>'}else{u[z].setAttribute("offset",0);t[z].innerHTML="<b>"+t[z].innerHTML+'</b> <u>@</u> <span class="sizePrice">$0.00</span>'}if(parseInt(u[z].value)!=0){u[z].className="active"}else{u[z].className=""}YAHOO.util.Event.addListener(u[z],"blur",i);YAHOO.util.Event.addListener(u[z],"blur",j);YAHOO.util.Event.addListener(u[z],"keyup",j);YAHOO.util.Event.addListener(u[z],"keyup",m)}document.getElementById("productMultipleSizes").parentNode.appendChild(document.getElementById("productMultipleSizes"));var v=document.getElementById("formProductMultiple").getElementsByTagName("select");for(var z=0;z<v.length;z++){YAHOO.util.Event.addListener(v[z],"change",m);YAHOO.util.Event.addListener(v[z],"change",n);var B=v[z].getElementsByTagName("option");for(var w=B.length-1,s=0;0<=w;w--){if(B[w].text.indexOf("Add $")!=-1){s=(B[w].text.substring(B[w].text.indexOf("Add $"),B[w].text.length)).replace(/[^0-9\.]+/g,"");B[w].setAttribute("offset",s)}else{B[w].setAttribute("offset","0")}}}xhtml._addAnimationId(document.getElementById("priceMultiple"));xhtml._addAnimationId(document.getElementById("itemsMultiple"));m();this._precacheImages([this._imagesBaseUrl+"global-elements-processing.gif",this._imagesBaseUrl+"global-elements-icon-checkmark.png"])};this.initLinkColourAnimation=function(){this.animationColor=this.colours.mediumGrey;switch(document.getElementById("productContent").className){case"workout":this.animationColor=this.colours.pink;break;case"competition":this.animationColor=this.colours.gold;break;case"streetwear":this.animationColor=this.colours.green;break}var s=document.getElementById("productLocation").getElementsByTagName("a");for(var r=0;r<s.length;r++){if(s[r].className.indexOf("active")!=-1){tooltipHtml='<div class="text">View other items in the same collection</div>';var t=new YAHOO.widget.Tooltip("categoryLocationTooltip",{context:s[r],text:tooltipHtml,preventoverlap:true,showDelay:200,effect:{effect:YAHOO.widget.ContainerEffect.FADE,duration:0.25}})}}this._addLinkAnimation(s,this.animationColor,this.colours.darkBlue);this._addLinkAnimation([document.getElementById("productPhotoZoom")],this.animationColor,this.colours.darkBlue);this._addLinkAnimation(document.getElementById("productSingleLinks").getElementsByTagName("a"),this.animationColor,this.colours.darkBlue);if(xhtml.isTrident6==false){this._addLinkAnimation(document.getElementById("productShareDialogSocial").getElementsByTagName("a"),this.animationColor,this.colours.darkBlue)}if(!!document.getElementById("productRecent")==true){this._addLinkAnimation(YAHOO.util.Dom.getElementsByClassName("details","div",document.getElementById("productRecentArtboard")),this.colours.lightBlue,this.colours.darkBlue)}};this.layerSingle=function(){document.getElementById("productSingle").className="";document.getElementById("productMultiple").className="hidden";e();this._googleAnalyticsTrackEvent("product","single",document.getElementById("productCode").innerHTML)};this.layerMultiple=function(){document.getElementById("productSingle").className="hidden";document.getElementById("productMultiple").className="";n();this._googleAnalyticsTrackEvent("product","multiple",document.getElementById("productCode").innerHTML)};this.cartAddSingle=function(){var t=[];var s=document.getElementById("formProductSingle").getElementsByTagName("select");for(var r=0;r<s.length;r++){if(s[r][s[r].selectedIndex].value==""){t.push(s[r].getAttribute("title"))}}if(0<t.length){alert("Please select "+this._errorHandlingBuildMessage(t,true)+" option for this product before adding it to your cart.");return}document.getElementById("productSingleProcessingCart").className="";YAHOO.util.Connect.asyncRequest("GET",this._getAjaxUrl({formId:"formProductSingle",params:"Response=JSON&Ajax=AddProductSingle"}),{success:l,failure:function(){alert("Sorry, the server didn't respond in a timely manner...\nThis can happen occasionally, please try adding to your cart again.");document.getElementById("productSingleProcessingCart").className="invisible"}});this._googleAnalyticsTrackEvent("product","cartSingle",document.getElementById("productCode").innerHTML)};this.cartItemAddedSingle=function(){var u=document.getElementById("formProductSingle").getElementsByTagName("select");var s=[];for(var r=0;r<u.length;r++){s.push(u[r].getAttribute("title")+": "+u[r][u[r].selectedIndex].value)}var t=[];t.push('<h1><img src="'+this._imagesBaseUrl+'global-elements-heading-itemaddedcart.png" width="299" height="17" alt=""/></h1>');t.push('<img class="photo" src="'+document.getElementById("productPhotoImage").src.replace("fullsize","notification")+'" width="50" height="65" alt=""/>');t.push('<div class="details">');t.push("<h3>"+document.getElementById("productTitle").innerHTML+"</h3>");t.push("<p>"+s.join("<br/>")+"</p>");t.push("</div>");t.push('<a class="cart" href="/shoppingcart.html"></a>');this.notificationOpen(t.join("\n"),document.getElementById("headerCart"))};this.cartAddMultiple=function(){if(this.productMultipleAjaxQueue.valid==false){this.productMultipleAjaxQueue.valid=true;var r=document.getElementById("productCartDialog").getElementsByTagName("ul")[0];r.className="processing";r.getElementsByTagName("li")[0].className="processing";YAHOO.util.Connect.asyncRequest("GET",this._getAjaxUrl({params:this.productMultipleAjaxQueue.items[0].uri}),{success:d,failure:function(){alert("Sorry, the server didn't respond in a timely manner...\nThis can happen occasionally, please try adding to your cart again.")}});this.productMultipleAjaxQueue.items[0].processing=true}};this.cartConfirmMultiple=function(){var z=[];var u=document.getElementById("formProductMultiple").getElementsByTagName("select");for(var r=0;r<u.length;r++){if(u[r][u[r].selectedIndex].value==""){z.push(u[r].getAttribute("title"))}}if(0<z.length){alert("Please select "+this._errorHandlingBuildMessage(z,true)+" option for this product before adding it to your cart.");return}var w="Response=JSON&Ajax=AddProductMultiple&";for(var r=0;r<u.length;r++){w+=encodeURIComponent(u[r].name)+"="+encodeURIComponent(u[r][u[r].selectedIndex].value)+"&"}var s=document.getElementById("formProductMultiple").getElementsByTagName("fieldset")[0].getElementsByTagName("input");for(var r=0;r<s.length;r++){w+=encodeURIComponent(s[r].name)+"="+encodeURIComponent(s[r].value)+"&"}this.productMultipleAjaxQueue={items:[],valid:false,completed:0};var s=document.getElementById("productMultipleSizes").getElementsByTagName("input");
var y=document.getElementById("productMultipleSizes").getElementsByTagName("label");for(var r=0,v=0;r<s.length;r++){if(0<(s[r].value.replace(/\D/g,"")*1)){this.productMultipleAjaxQueue.items[v]={uri:w+"Quantity="+(s[r].value.replace(/\D/g,"")*1)+"&"+encodeURIComponent(s[r].name.split("=")[0])+"="+encodeURIComponent(s[r].name.split("=")[1])+"&queueId="+v,title:(s[r].value.replace(/\D/g,"")*1)+" x "+y[r].getElementsByTagName("b")[0].innerHTML,processing:false};v++}}if(this.productMultipleAjaxQueue.items.length<1){alert("Please enter a quantity for at least one size before adding to your cart.");return}var t=[];for(var r=0;r<this.productMultipleAjaxQueue.items.length;r++){t.push("<li>"+this.productMultipleAjaxQueue.items[r].title+"</li>")}document.getElementById("productCartDialog").getElementsByTagName("ul")[0].innerHTML=t.join("\n");if(xhtml.isTrident6==true){var u=document.getElementsByTagName("select");for(var r=0;r<u.length;r++){u[r].style.visibility="hidden"}}this.cartUpdateOverlay();if(xhtml.isFirefox3==true){document.getElementById("productCartDialog").getElementsByTagName("div")[1].style.backgroundPosition="-580px -196px";setTimeout("document.getElementById('productCartDialog').getElementsByTagName('div')[1].style.backgroundPosition = '-580px 100%';",10)}document.getElementById("productCart").className="";document.getElementById("productCartBackground").className="";document.getElementById("productCartDialog").className="";xhtml._centerDiv(document.getElementById("productCartDialog"),(xhtml.isTrident6?false:true));this._googleAnalyticsTrackEvent("product","cartMultiple",document.getElementById("productCode").innerHTML)};this.cartCloseMultiple=function(){if(xhtml.productMultipleAjaxQueue.completed==xhtml.productMultipleAjaxQueue.items.length){window.scrollTo(0,0);var s=document.getElementById("productMultipleSizes").getElementsByTagName("input");for(var r=0;r<s.length;r++){s[r].value=0;s[r].className=""}m()}this.productMultipleAjaxQueue={items:[],valid:false};document.getElementById("productCart").className="invisible";document.getElementById("productCartBackground").className="invisible";document.getElementById("productCartDialog").className="invisible";document.getElementById("productCartDialog").getElementsByTagName("ul")[0].className="";document.getElementById("productCartDialog").getElementsByTagName("ul")[0].innerHTML="<li>&nbsp;</li>";if(xhtml.isTrident6==true){var t=document.getElementsByTagName("select");for(var r=0;r<t.length;r++){t[r].style.visibility="visible"}}};this.cartUpdateOverlay=function(){var t=document.getElementById("productCartBackground");t.style.position="absolute";t.style.left="0px";t.style.top="0px";t.style.background="#000";t.style.opacity=0.6;t.style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity=60)";t.style.width=document.body.offsetWidth+"px";var r=(document.getElementById("page").offsetHeight<document.documentElement.clientHeight?document.documentElement.clientHeight:document.getElementById("page").offsetHeight);var s=280;r=((s+40)<r?r:(s+40));t.style.height=r+"px";t.className=""};this.wishlistAdd=function(){var t=[];var s=document.getElementById("formProductSingle").getElementsByTagName("select");for(var r=0;r<s.length;r++){if(s[r][s[r].selectedIndex].value==""){t.push(s[r].getAttribute("title"))}}if(0<t.length){alert("Please select "+this._errorHandlingBuildMessage(t,true)+" option for this product before adding it to your wishlist.");return}document.getElementById("productSingleProcessingWishlist").className="";if(this._isWishListId(xhtml.cookie.get("wishlistid"))==null){YAHOO.util.Connect.asyncRequest("POST","/ajax/wishlist-create.php",{success:g,failure:function(){alert("There was a problem adding this item to your wishlist,\nplease try again.")}});this._googleAnalyticsTrackEvent("wishlist","create",document.getElementById("productCode").innerHTML);return}else{this.wishlistAddProcess()}};this.wishlistAddProcess=function(){var u=document.getElementById("formProductSingle").getElementsByTagName("select");var v="Response=JSON&Ajax=AddProductSingle";var t=[];for(var r=0;r<u.length;r++){v+="&"+encodeURIComponent(u[r].name)+"="+encodeURIComponent(u[r][u[r].selectedIndex].value);t.push(u[r].getAttribute("title")+": "+u[r][u[r].selectedIndex].value)}var s=document.getElementById("formProductSingle").getElementsByTagName("fieldset")[0].getElementsByTagName("input");for(var r=0;r<s.length;r++){v+="&"+encodeURIComponent(s[r].name)+"="+encodeURIComponent(s[r].value)}var w="productCode="+encodeURIComponent(document.getElementById("productCode").value);w+="&productPrice="+encodeURIComponent(document.getElementById("priceSingle").innerHTML.replace("$","").trim());w+="&productName="+encodeURIComponent((document.getElementById("productTitle").innerHTML).replace(/<([^>]+)>/ig,""));w+="&productView="+encodeURIComponent(window.location.href);w+="&productAdd="+encodeURIComponent(v);w+="&productOptions="+encodeURIComponent(t.join("[br]"));YAHOO.util.Connect.asyncRequest("POST","/ajax/wishlist-add.php",{success:k,failure:function(){alert("There was a problem adding this item to your wishlist,\nplease try again.")}},w);this._googleAnalyticsTrackEvent("wishlist","add",document.getElementById("productCode").innerHTML)};this.wishlistItemAdded=function(){var u=document.getElementById("formProductSingle").getElementsByTagName("select");var s=[];for(var r=0;r<u.length;r++){s.push(u[r].getAttribute("title")+": "+u[r][u[r].selectedIndex].value)}var t=[];t.push('<h1><img src="'+this._imagesBaseUrl+'global-elements-heading-itemaddedwishlist.png" width="317" height="17" alt=""/></h1>');t.push('<img class="photo" src="'+document.getElementById("productPhotoImage").src.replace("fullsize","notification")+'" width="50" height="65" alt=""/>');t.push('<div class="details">');t.push("<h3>"+document.getElementById("productTitle").innerHTML+"</h3>");t.push("<p>"+s.join("<br/>")+"</p>");t.push("</div>");t.push('<a class="wishlist" href="/wishlist.html"></a>');this.notificationOpen(t.join("\n"),document.getElementById("headerWishList"))};this.shareOpen=function(){if(xhtml.isTrident6==true){var s=document.getElementsByTagName("select");for(var r=0;r<s.length;r++){s[r].style.visibility="hidden"}}this.shareUpdateOverlay();document.getElementById("productShare").className="";document.getElementById("productShareBackground").className="";document.getElementById("productShareDialog").className="";this._centerDiv(document.getElementById("productShareDialog"),(xhtml.isTrident6?false:true))};this.shareClose=function(){if(xhtml.isTrident6==true){var s=document.getElementsByTagName("select");for(var r=0;r<s.length;r++){s[r].style.visibility="visible"}}document.getElementById("formProductShareEmail").getElementsByTagName("label")[0].className="hidden";document.getElementById("formProductShareEmail").getElementsByTagName("label")[1].className="hidden";document.getElementById("formProductShareEmail").getElementsByTagName("input")[0].value="";document.getElementById("formProductShareEmail").getElementsByTagName("fieldset")[0].className="hidden";document.getElementById("formProductShareEmail").getElementsByTagName("fieldset")[1].className="";if(xhtml.isFirefox3==true){document.getElementById("productShareDialog").getElementsByTagName("div")[1].style.backgroundPosition="-580px -196px";setTimeout("document.getElementById('productShareDialog').getElementsByTagName('div')[1].style.backgroundPosition = '-580px 100%';",10)}document.getElementById("productShare").className="invisible";document.getElementById("productShareBackground").className="invisible";document.getElementById("productShareDialog").className="invisible"};this.shareSocialFacebook=function(){var r=""+window.location;if(r.indexOf("#")!=-1){r=r.substring(0,r.indexOf("#"))}if(confirm("Would you like to post this item to your Facebook account?")==true){var s="http://www.facebook.com/sharer.php?u=%url%&t=%title%";s=s.replace("%url%",r).replace(/[\u0080-\uFFFF]+/g,"");s=s.replace("%title%",encodeURIComponent((document.getElementById("productTitle").innerHTML.replace(/<([^>]+)>/ig,"")+" from k-Bee Leotards").replace(/[\u0080-\uFFFF]+/g,"")).replace("%20","+","g").replace("%2520","+","g"));window.open(s,"_blank");this._googleAnalyticsTrackEvent("share","facebook",document.getElementById("productCode").innerHTML)}};this.shareSocial=function(t){switch(t){case"bebo":var s="http://www.bebo.com/c/share?Url=%url%&t=%title%";break;case"delicious":var s="http://del.icio.us/post?url=%url%&title=%title%";break;case"digg":var s="http://digg.com/submit?phase=2&url=%url%&title=%title%&bodytext=%desc%";break;case"facebook":var s="http://www.facebook.com/sharer.php?u=%url%&t=%title%";break;case"google":var s="http://www.google.com/bookmarks/mark?op=edit&bkmk=%url%&title=%title%";break;case"myspace":var s="http://www.myspace.com/Modules/PostTo/Pages/?u=%url%&t=%title%";break;case"technorati":var s="http://www.technorati.com/faves?add=%url%";break;case"windowslive":var s="https://favorites.live.com/quickadd.aspx?marklet=1&mkt=en-us&url=%url%&title=%title%&top=1";break;case"yahoomyweb":var s="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=%url%&t=%title%";break;default:this.shareClose();return}var r=""+window.location;if(r.indexOf("#")!=-1){r=r.substring(0,r.indexOf("#"))}s=s.replace("%url%",encodeURIComponent(r));s=s.replace("%title%",encodeURIComponent(document.getElementById("productTitle").innerHTML.replace(/<([^>]+)>/ig,"")+" from k-Bee Leotards"));s=s.replace("%desc%",encodeURIComponent(document.getElementById("productDesc").innerHTML.replace(/<([^>]+)>/ig,"")));window.open(s,"_blank");this.shareClose();this._googleAnalyticsTrackEvent("share",t,document.getElementById("productCode").innerHTML)};this.shareEmail=function(){var u=document.getElementById("formProductShareEmail");var s=u.getElementsByTagName("input");for(var r=0;r<3;r++){if(s[r].value==""){u.getElementsByTagName("fieldset")[0].className="";u.getElementsByTagName("label")[0].className="missing";if(xhtml.isFirefox3==true){document.getElementById("productShareDialog").getElementsByTagName("div")[1].style.backgroundPosition="-580px -196px";
setTimeout("document.getElementById('productShareDialog').getElementsByTagName('div')[1].style.backgroundPosition = '-580px 100%';",10)}return}}var t=/^[a-z0-9_+-.]+@[a-z0-9_-]*\.?[a-z0-9_-]*\.?[a-z0-9_-]*\.[a-z]+$/i;if(t.test(s[0].value)==false||t.test(s[2].value)==false){u.getElementsByTagName("fieldset")[0].className="";u.getElementsByTagName("label")[0].className="missing";if(xhtml.isFirefox3==true){document.getElementById("productShareDialog").getElementsByTagName("div")[1].style.backgroundPosition="-580px -196px";setTimeout("document.getElementById('productShareDialog').getElementsByTagName('div')[1].style.backgroundPosition = '-580px 100%';",10)}return}document.getElementById("formProductShareEmailUrl").value=(window.location.href+"").replace(window.location.hash,"");document.getElementById("formProductShareEmailTitle").value=document.getElementById("productTitle").innerHTML.replace(/<([^>]+)>/ig,"");document.getElementById("formProductShareEmailDesc").value=document.getElementById("productDesc").innerHTML.replace(/<([^>]+)>/ig,"");YAHOO.util.Connect.setForm("formProductShareEmail");YAHOO.util.Connect.asyncRequest("POST","/ajax/emailafriend-product.php",{success:function(){xhtml.shareEmailSent()},failure:function(){alert("There was a problem sending your message, please try again.")}});u.getElementsByTagName("fieldset")[0].className="";u.getElementsByTagName("label")[0].className="hidden";u.getElementsByTagName("label")[1].className="sending";if(xhtml.isFirefox3==true){document.getElementById("productShareDialog").getElementsByTagName("div")[1].style.backgroundPosition="-580px -196px";setTimeout("document.getElementById('productShareDialog').getElementsByTagName('div')[1].style.backgroundPosition = '-580px 100%';",10)}};this.shareEmailSent=function(){document.getElementById("formProductShareEmail").getElementsByTagName("fieldset")[0].className="";document.getElementById("formProductShareEmail").getElementsByTagName("label")[0].className="hidden";document.getElementById("formProductShareEmail").getElementsByTagName("label")[1].className="sending";document.getElementById("formProductShareEmail").getElementsByTagName("label")[1].innerHTML="<b>Message Sent!</b>";document.getElementById("formProductShareEmail").getElementsByTagName("fieldset")[1].className="hidden";if(xhtml.isFirefox3==true){document.getElementById("productShareDialog").getElementsByTagName("div")[1].style.backgroundPosition="-580px -196px";setTimeout("document.getElementById('productShareDialog').getElementsByTagName('div')[1].style.backgroundPosition = '-580px 100%';",10)}setTimeout("xhtml.shareClose();",1750);this._googleAnalyticsTrackEvent("share","email",document.getElementById("productCode").innerHTML)};this.shareUpdateOverlay=function(){var t=document.getElementById("productShareBackground");t.style.position="absolute";t.style.left="0px";t.style.top="0px";t.style.background="#000";t.style.opacity=0.6;t.style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity=60)";t.style.width=document.body.offsetWidth+"px";var r=(document.getElementById("page").offsetHeight<document.documentElement.clientHeight?document.documentElement.clientHeight:document.getElementById("page").offsetHeight);var s=280;r=((s+40)<r?r:(s+40));t.style.height=r+"px";t.className=""};this.viewerOpen=function(){window.scrollTo(0,0);document.body.className+=" fixed";if(xhtml.isTrident6==true){var t=document.getElementsByTagName("select");for(var r=0;r<t.length;r++){t[r].style.visibility="hidden"}}document.getElementById("productViewerPhoto").onclick=this.__eventHandlerCancelBubble;this.viewerUpdateOverlay();document.getElementById("productViewer").className="";document.getElementById("productViewerBackground").className="";document.getElementById("productViewerPhoto").className="";if(document.getElementById("productPhoto").className!="views1"){if(this.viewerPreviewsInitialized==false){switch(document.getElementById("productPhoto").className){case"views3":document.getElementById("productViewerPreviews3").innerHTML='<img src="'+document.getElementById("productPhotoImage").src.replace("fullsize","preview").replace(".jpg","-view3.jpg")+'" width="80" height="105" alt=""/>';this.productImageTooltip=new YAHOO.widget.Tooltip("productImageTooltip",{context:document.getElementById("productViewerPreviews3"),text:'<div class="text">Click to view this image</div>',preventoverlap:true,showDelay:750,effect:{effect:YAHOO.widget.ContainerEffect.FADE,duration:0.2}});case"views2":document.getElementById("productViewerPreviews2").innerHTML='<img src="'+document.getElementById("productPhotoImage").src.replace("fullsize","preview").replace(".jpg","-view2.jpg")+'" width="80" height="105" alt=""/>';document.getElementById("productViewerPreviews1").innerHTML='<img src="'+document.getElementById("productPhotoImage").src.replace("fullsize","preview").replace(".jpg","-view1.jpg")+'" width="80" height="105" alt=""/>';this.productImageTooltip=new YAHOO.widget.Tooltip("productImageTooltip",{context:document.getElementById("productViewerPreviews2"),text:'<div class="text">Click to view this image</div>',preventoverlap:true,showDelay:750,effect:{effect:YAHOO.widget.ContainerEffect.FADE,duration:0.2}});this.productImageTooltip=new YAHOO.widget.Tooltip("productImageTooltip",{context:document.getElementById("productViewerPreviews1"),text:'<div class="text">Click to view this image</div>',preventoverlap:true,showDelay:750,effect:{effect:YAHOO.widget.ContainerEffect.FADE,duration:0.2}})}this.viewerPreviewsInitialized=true}document.getElementById("productViewerPreviews").className=""}document.getElementById("productViewerContainer").innerHTML='<img src="'+document.getElementById("productPhotoImage").src.replace("fullsize","enlargement").replace(".jpg","-view1.jpg")+'" width="550" height="720" alt=""/><span onclick="xhtml.viewerNext();"></span>';document.getElementById("productViewerContainer").getElementsByTagName("img")[0].style.display="block";if(document.getElementById("productPhoto").className!="views1"){var s='<div class="text">Click to view the next product image</div>';this.productImageTooltip=new YAHOO.widget.Tooltip("productImageTooltip",{context:document.getElementById("productViewerContainer").getElementsByTagName("span")[0],text:s,preventoverlap:true,showDelay:750,effect:{effect:YAHOO.widget.ContainerEffect.FADE,duration:0.2}});document.getElementById("productViewerContainer").getElementsByTagName("span")[0].style.cursor="pointer"}this._googleAnalyticsTrackEvent("product","viewEnlargement",document.getElementById("productCode").innerHTML)};this.viewerChange=function(r){document.getElementById("productViewerContainer").innerHTML='<img src="'+document.getElementById("productPhotoImage").src.replace("fullsize","enlargement").replace(".jpg","-view"+r+".jpg")+'" width="550" height="720" alt=""/><span onclick="xhtml.viewerNext();"></span>';document.getElementById("productViewerContainer").getElementsByTagName("img")[0].style.display="block";if(document.getElementById("productPhoto").className!="views1"){var s='<div class="text">Click to view the next product image</div>';this.productImageTooltip=new YAHOO.widget.Tooltip("productImageTooltip",{context:document.getElementById("productViewerContainer").getElementsByTagName("span")[0],text:s,preventoverlap:true,showDelay:750,effect:{effect:YAHOO.widget.ContainerEffect.FADE,duration:0.2}});document.getElementById("productViewerContainer").getElementsByTagName("span")[0].style.cursor="pointer"}};this.viewerNext=function(){var r=(document.getElementById("productPhoto").className.replace(/\D/g,""))*1;if(1<r){var s=document.getElementById("productViewerContainer").getElementsByTagName("img")[0].src;var t=parseInt(s.substring(s.length-5,s.length).replace(/\D/g,""))+1;if(r<t){t=1}this.viewerChange(t)}};this.viewerClose=function(){window.scrollTo(0,0);document.body.className=document.body.className.replace(/\s?fixed/g,"");if(xhtml.isTrident6==true){var s=document.getElementsByTagName("select");for(var r=0;r<s.length;r++){s[r].style.visibility="visible"}}document.getElementById("productViewer").className="invisible";document.getElementById("productViewerBackground").className="invisible";document.getElementById("productViewerPhoto").className="invisible";document.getElementById("productViewerPreviews").className="invisible"};this.viewerUpdateOverlay=function(){var s=document.getElementById("productViewerBackground");s.style.position="absolute";s.style.left="0px";s.style.top="0px";s.style.background="#000";s.style.opacity=0.6;s.style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity=60)";s.style.width=document.body.offsetWidth+"px";var r=(document.getElementById("page").offsetHeight<document.documentElement.clientHeight?document.documentElement.clientHeight:document.getElementById("page").offsetHeight);var t=document.getElementById("productPhoto").className=="views1"?800:925;r=(t<r?r:t+40);s.style.height=r+"px";s.className=""};this.notificationOpen=function(u,r){clearTimeout(xhtml.notificationTimeout);document.getElementById("productNotifications").className="invisible";document.getElementById("productNotifications").getElementsByTagName("div")[0].innerHTML=u;var s=YAHOO.util.Dom.getXY(r);var x=parseInt(s[0]+(r.offsetWidth/2)-(document.getElementById("productNotifications").offsetWidth/2));var w=parseInt(s[1]+r.offsetHeight+5);document.getElementById("productNotifications").style.left=x+"px";document.getElementById("productNotifications").style.top=w+"px";document.getElementById("productNotifications").style.height="1px";document.getElementById("productNotifications").className="";YAHOO.util.Event.removeListener(document.getElementById("productNotifications"),"mouseover",b);YAHOO.util.Event.addListener(document.getElementById("productNotifications"),"mouseover",b);YAHOO.util.Event.removeListener(document.getElementById("productNotifications"),"mouseout",a);YAHOO.util.Event.addListener(document.getElementById("productNotifications"),"mouseout",a);var t=document.getElementById("productNotifications");
try{xhtml.animationReferences[t.getAttribute("animationId")].stop(false)}catch(v){}xhtml.animationReferences[t.getAttribute("animationId")]=new YAHOO.util.Anim(t,{height:{to:196}},0.65,YAHOO.util.Easing.easeOut);xhtml.animationReferences[t.getAttribute("animationId")].animate();this.notificationTimeout=setTimeout("xhtml.notificationClose();",5000)};this.notificationClose=function(){clearTimeout(xhtml.notificationTimeout);YAHOO.util.Event.removeListener(document.getElementById("productNotifications"),"mouseover",b);YAHOO.util.Event.removeListener(document.getElementById("productNotifications"),"mouseout",a);var r=document.getElementById("productNotifications");try{xhtml.animationReferences[r.getAttribute("animationId")].stop(false)}catch(s){}xhtml.animationReferences[r.getAttribute("animationId")]=new YAHOO.util.Anim(r,{height:{to:1}},0.65,YAHOO.util.Easing.easeIn);xhtml.animationReferences[r.getAttribute("animationId")].onComplete.subscribe(function(){document.getElementById("productNotifications").style.height="1px";document.getElementById("productNotifications").className="invisible"});xhtml.animationReferences[r.getAttribute("animationId")].animate()};this.bookmarkPage=function(){var s=(document.getElementById("productTitle").innerHTML).replace(/<([^>]+)>/ig,"")+" - k-Bee Leotards";var r=window.location;if(!!window.external==true){window.external.AddFavorite(r,s);return false}this._googleAnalyticsTrackEvent("product","bookmark",document.getElementById("productCode").innerHTML)};this.precacheProductImages=function(){var s=(document.getElementById("productPhoto").className.replace(/\D/g,""))*1;for(var r=0;r<s;r++){this._precacheImages([document.getElementById("productPhotoImage").src.replace("fullsize","preview").replace(".jpg","-view"+(r+1)+".jpg"),document.getElementById("productPhotoImage").src.replace("fullsize","enlargement").replace(".jpg","-view"+(r+1)+".jpg")])}this._precacheImages([document.getElementById("productPhotoImage").src.replace("fullsize","notification"),this._imagesBaseUrl+"global-elements-heading-itemaddedcart.png",this._imagesBaseUrl+"global-elements-heading-itemaddedwishlist.png",this._imagesBaseUrl+"global-elements-processing-grey.gif"])};this.addTrident6RecentHelpers=function(){var s=YAHOO.util.Dom.getElementsByClassName("productItem","div",document.getElementById("productRecentArtboard"));for(var r=s.length-1;0<=r;r--){YAHOO.util.Event.addListener(s[r],"mouseover",f);YAHOO.util.Event.addListener(s[r],"mouseout",p)}};function c(){if(2<window.location.hash.length){var v=window.location.hash.replace("#","").split("|");switch(v[0]){case"s":document.getElementById("productSingle").className="";document.getElementById("productMultiple").className="hidden";var t=document.getElementById("formProductSingle").getElementsByTagName("select");if((v.length-1)==t.length){for(var r=0,s=0,u=0;r<t.length;r++){var u=t[r].getElementsByTagName("option").length;var s=parseInt(v[r+1].replace(/\D/g,""));if(-1<s&&s<u){t[r].selectedIndex=s}}h()}break;case"m":document.getElementById("productSingle").className="hidden";document.getElementById("productMultiple").className="";var t=document.getElementById("formProductMultiple").getElementsByTagName("select");if((v.length-1)==t.length){for(var r=0,s=0,u=0;r<t.length;r++){var u=t[r].getElementsByTagName("option").length;var s=parseInt(v[r+1].replace(/\D/g,""));if(-1<s&&s<u){t[r].selectedIndex=s}}m()}break}}}function h(){var t=parseFloat(document.getElementById("priceSingle").innerHTML.replace("$",""));var v=parseFloat(document.getElementById("formProductSingleBase").value);var s=document.getElementById("formProductSingle").getElementsByTagName("select");for(var r=0;r<s.length;r++){v+=parseFloat(s[r][s[r].selectedIndex].getAttribute("offset"))}if(t.toFixed(2)!=v.toFixed(2)){try{xhtml.animationReferences[document.getElementById("priceSingle").getAttribute("animationId")].stop(false)}catch(u){}xhtml.animationReferences[document.getElementById("priceSingle").getAttribute("animationId")]=new YAHOO.util.ColorAnim(document.getElementById("priceSingle"),{color:{from:xhtml.animationColor,to:xhtml.colours.graphiteGrey}},1.5,YAHOO.util.Easing.easeIn);xhtml.animationReferences[document.getElementById("priceSingle").getAttribute("animationId")].animate()}document.getElementById("priceSingle").innerHTML="$"+v.toFixed(2)}function e(){var t="#s";var s=document.getElementById("formProductSingle").getElementsByTagName("select");for(var r=0;r<s.length;r++){t+="|"+s[r].selectedIndex}window.location.replace(window.location.href.replace(window.location.hash,"")+t)}function j(){var t=this.value.replace(/\D/g,"")*1;var s=document.getElementById("productMultipleSizes").getElementsByTagName("input");for(var r=0;r<s.length;r++){if(this==s[r]){if(t!=0){s[r].className="active"}else{s[r].className=""}break}}}function i(){this.value=this.value.replace(/\D/g,"")*1;m()}function m(){var B=0;var C=0;var t=parseFloat(document.getElementById("priceMultiple").innerHTML.replace("$",""));var w=parseInt(document.getElementById("itemsMultiple").innerHTML);var y=parseFloat(document.getElementById("formProductMultipleBase").value);var z=document.getElementById("formProductMultiple").getElementsByTagName("select");for(var A=0;A<z.length;A++){y+=parseFloat(z[A][z[A].selectedIndex].getAttribute("offset"))}var u=document.getElementById("productMultipleSizes").getElementsByTagName("input");var v=document.getElementById("productMultipleSizes").getElementsByTagName("span");for(var A=0,D=0,s=0;A<u.length;A++){D=y+parseFloat(u[A].getAttribute("offset"));v[A].innerHTML="$"+D.toFixed(2);s=u[A].value.replace(/\D/g,"")*1;C+=s;B+=D.toFixed(2)*s}if(t.toFixed(2)!=B.toFixed(2)||w.toFixed(2)!=C.toFixed(2)){try{xhtml.animationReferences[document.getElementById("itemsMultiple").getAttribute("animationId")].stop(false)}catch(r){}xhtml.animationReferences[document.getElementById("itemsMultiple").getAttribute("animationId")]=new YAHOO.util.ColorAnim(document.getElementById("itemsPrice"),{color:{from:xhtml.animationColor,to:xhtml.colours.graphiteGrey}},1,YAHOO.util.Easing.easeIn);xhtml.animationReferences[document.getElementById("itemsMultiple").getAttribute("animationId")].animate();xhtml.animationReferences[document.getElementById("itemsMultiple").getAttribute("animationId")]=new YAHOO.util.ColorAnim(document.getElementById("itemsMultiple"),{color:{from:xhtml.animationColor,to:xhtml.colours.graphiteGrey}},1,YAHOO.util.Easing.easeIn);xhtml.animationReferences[document.getElementById("itemsMultiple").getAttribute("animationId")].animate()}document.getElementById("priceMultiple").innerHTML="$"+B.toFixed(2);document.getElementById("itemsMultiple").innerHTML=C+(C==1?" item":" items")}function n(){var t="#m";var s=document.getElementById("formProductMultiple").getElementsByTagName("select");for(var r=0;r<s.length;r++){t+="|"+s[r].selectedIndex}window.location.replace(window.location.href.replace(window.location.hash,"")+t)}function b(){clearTimeout(xhtml.notificationTimeout)}function a(){xhtml.notificationTimeout=setTimeout("xhtml.notificationClose();",500)}function f(){this.getElementsByTagName("div")[1].style.visibility="visible"}function p(){this.getElementsByTagName("div")[1].style.visibility="hidden"}function o(){window.location=this.getElementsByTagName("a")[0].href;return false}function d(t){var y={};try{y=JSON.parse(t.responseText)}catch(u){alert("There was an error adding the items to cart,\nplease try again and double check your cart prior to checkout for duplicate items.");return}if(typeof(y)=="object"&&y.status==true){if(xhtml.productMultipleAjaxQueue.valid==true){if(xhtml.productMultipleAjaxQueue.items[y.queueId]){xhtml.productMultipleAjaxQueue.completed++;var s=document.getElementById("productCartDialog").getElementsByTagName("li");for(var r=0;r<s.length;r++){if(s[r].innerHTML==xhtml.productMultipleAjaxQueue.items[y.queueId].title){s[r].className="completed";if(!!xhtml.isTrident==true){var w=new YAHOO.util.ColorAnim(s[r],{color:{to:"#FFFFFF"}},0.75);w.onComplete.subscribe(function(){var x=this.getEl();x.parentNode.removeChild(x)});w.animate()}else{var w=new YAHOO.util.Anim(s[r],{opacity:{to:0}},0.75);w.onComplete.subscribe(function(){var x=this.getEl();x.parentNode.removeChild(x)});w.animate()}break}}if(xhtml.productMultipleAjaxQueue.completed==xhtml.productMultipleAjaxQueue.items.length){setTimeout("document.getElementById('productCartDialog').className = 'completed';",1000);if(xhtml.isFirefox3==true){setTimeout("document.getElementById('productCartDialog').getElementsByTagName('div')[1].style.backgroundPosition = '-580px -196px';",1250);setTimeout("document.getElementById('productCartDialog').getElementsByTagName('div')[1].style.backgroundPosition = '-580px 100%';",1350)}xhtml._updateHeaderCart();return}var v=false;var z="";for(var r=0;r<xhtml.productMultipleAjaxQueue.items.length;r++){if(xhtml.productMultipleAjaxQueue.items[r].processing==false){YAHOO.util.Connect.asyncRequest("GET",xhtml._getAjaxUrl({params:[xhtml.productMultipleAjaxQueue.items[r].uri]}),{success:d,failure:function(){alert("There was an error adding the items to cart,\nplease try again and double check your cart prior to checkout for duplicate items.")}});xhtml.productMultipleAjaxQueue.items[r].processing=true;z=xhtml.productMultipleAjaxQueue.items[r].title;v=true;break}}if(v==false){return}for(var r=0;r<s.length;r++){if(s[r].innerHTML==z){s[r].className="processing"}}}}}else{alert("There was an error adding the items to cart,\nplease try again and double check your cart prior to checkout for duplicate items.");return}}function l(r){document.getElementById("productSingleProcessingCart").className="invisible";var t={};try{t=JSON.parse(r.responseText)}catch(s){alert("There was a problem adding this item to your cart,\nplease try again.");return}if(typeof(t)=="object"&&t.status==true){xhtml._updateHeaderCart();xhtml.cartItemAddedSingle()}else{alert("There was a problem adding this item to your cart,\nplease try again.");return}}function g(r){var t={};try{t=JSON.parse(r.responseText)
}catch(s){alert("There was a problem adding this item to your wishlist,\nplease try again.");document.getElementById("productSingleProcessingWishlist").className="invisible";return}if(typeof(t)=="object"&&t.status==true){xhtml.wishlistAdd()}else{alert("There was a problem adding this item to your wishlist,\nplease try again.");document.getElementById("productSingleProcessingWishlist").className="invisible";return}}function k(r){document.getElementById("productSingleProcessingWishlist").className="invisible";var t={};try{t=JSON.parse(r.responseText)}catch(s){alert("There was a problem adding this item to your wishlist,\nplease try again.");return}if(typeof(t)=="object"&&t.status==true){xhtml._updateHeaderWishlist();xhtml.wishlistItemAdded()}else{alert("There was a problem adding this item to your wishlist,\nplease try again.");return}}};