(function(a){a.fresca={updateText:"Updating",popups:[],initPopup:function(){a("div#prodRelPreviewCont").append('<div id="smlCont">&nbsp;</div>');a("div#smlCont").css({display:"none",position:"absolute"});a("div#productRelationships li").each(function(){if(a(this).find("a.prodRelViewBtn").length){var b=new Array();b.area=a(this).find("a.prodRelViewBtn");var d=b.area.attr("id").substring(2);var c=b.area.attr("class").split(" ").slice(1,2);b.url="/pws/AJProductDetails.ice?ProductID="+d+"&layout=productquickbuy.layout&colour="+c;b.smlCont=a("div#smlCont");a.fresca.popups.push(b)}});a.fresca.createPopups()},createPopups:function(){a.each(a.fresca.popups,function(c,b){a.fresca.createPopupAction(b)})},createPopupAction:function(b){b.area.click(function(g){var c=285;var d=25;var f=460;var h=300;a.fresca.showPopup(b,g,c,d,f,h);return false})},showPopup:function(b,g,c,d,f,h){b.smlCont.css({display:"block",position:"absolute",visibility:"hidden",top:c,right:d,width:f,height:h});b.smlCont.css("visibility","visible");a.fresca.loadPopupContent(b,b.url)},hidePopup:function(b){b.smlCont.css({display:"none",top:"0",right:"0"})},loadPopupContent:function(b,c){a.fresca.getLoaderContent(b);a("head").append('<script type="text/javascript" src="/pws/javascript/jquery-form.2.0.1.js"><\/script>');a.ajax({url:c,success:function(f){var d=f.indexOf('<div id="qbProductDetailsCont">');if(d>=0){if(a.browser.msie&&a.browser.version=="6.0"){f=f.slice(f.indexOf('<div id="qbProductDetailsCont">'),f.indexOf("<!-- END QUICKBUY -->"))}f=f.slice(0,f.indexOf("<!-- END QUICKBUY -->"));b.smlCont.empty().removeClass("stdHeight");b.smlCont.append(f);a.fresca.createSwatchActions(b);a.fresca.createSizeActions(b);a.fresca.createFormAction(b);e()}else{b.smlCont.empty().append("<p id='homePopUpError'>Sorry, this product is currently out of stock.</p>")}a(".close").click(function(){a.fresca.hidePopup(b);if(a.browser.msie&&a.browser.version=="6.0"){a(".productInfoCont select").show()}});a(".change_colour").change(function(){var i=a(this).attr("data-id");var h=a(this).val();var g="/pws/AJProductDetails.ice?ProductID="+i+"&layout=productquickbuy.layout&colour="+h;a.fresca.loadPopupContent(b,g)});a(".change_size").change(function(){e()});function e(){var i=false;var j=a(".change_size option:selected").text();var l=a(".change_size option:selected").attr("value");a("#basketResponse.add_to_basket").hide();a(".addToBagBtnQB").hide();if(j.indexOf("Not Available")>0&&a("a.sizeSelectorOutOfStockQB").length>0){var h=a("a.sizeSelectorOutOfStockQB").attr("href");var g=h.split("&ProductID=",2);var k=g[1].split("&",2);var m=g[0]+"&ProductID="+l+"&"+k[1];a("a.sizeSelectorOutOfStockQB").attr("href",m);a("div.qbPopup#stockIndicatorLink").show();i=false}else{a("div.qbPopup#stockIndicatorLink").hide();i=true}if(l==""){a("#selectSizeAlertQB").show().html("Please select a size");i=false}else{if(j.indexOf("Not Available")>0){a("#selectSizeAlertQB").show().html("Please select an available size");i=false}else{a("#selectSizeAlertQB").hide()}}if(i){a(".addToBagBtnQB").show()}}},error:function(d,f,e){b.smlCont.empty().append('<div class="prpClose"><img src="/pws/images/btn_close.gif" class="close" alt="Close" /></div><br /><br /><p>Error. Sorry, this product is currently out of stock.</p>');a(".close").click(function(){a.fresca.hidePopup(b)})}})},createSwatchActions:function(b){if(a("div#prodRelAvailColours img").length>1){b.smlCont.find("div#prodRelAvailColours img").each(function(f){var c=a(this).attr("id");var d=a(this).attr("name");var g="/pws/AJProductDetails.ice?layout=productquickbuy.layout&ProductID="+c+"&colour="+d;a(this).click(function(h){b.smlCont.addClass("stdHeight");a.fresca.loadPopupContent(b,g);return false})})}},createSizeActions:function(b){a("div.prodRelSizeSelector").click(function(){if(a(this).parent().hasClass("prodRelEnabled")){a("div.prodRelSizeSelector").removeClass("selected");a(this).addClass("selected");var f=a(this).attr("id");var d=f.substring(4,f.length);var c=f.substring(8,f.length);var g=document.getElementById(d);g.checked=!g.checked;var e=a(this).attr("class").split(" ").slice(0,1);a("#rpFormAddToBag #btnSelectSize").attr("value",c)}})},createFormAction:function(b){a(b.smlCont).find("#rpFormAddToBag").ajaxForm({beforeSubmit:function(){var c=false;if(a("table#prodRelSelectSizeTable tbody tr td div.selected").length>0){var d=0;if(a("table#prodRelSelectSizeTable tbody tr td div").hasClass("onesize")){if(a("#rpFormAddToBag #btnSelectSize")){d=a("#rpFormAddToBag #btnSelectSize1").attr("value");a("#rpFormAddToBag #btnSelectSize").attr("value",d);c=true}}else{if(a("#rpFormAddToBag #btnSelectSize")){d=a("#rpFormAddToBag #btnSelectSize").attr("value");c=true}}}if(c){b.submitting=true;a("#prodRelPrevDetails").html("<img id='ajaxLoader' src='/pws/images/ajax-loader.gif' alt='loading...'/><p  id='waitingMessage'>Please wait, adding to bag.</p>");a("#prodRelPrevImage").hide();a(b.smlCont).find(".prodRelSelectedText").slideUp().empty()}else{a(b.smlCont).find(".prodRelSelectSizeAlert").empty().append("Please select a size").slideDown();return false}},success:function(d,f){var c=d.slice(d.indexOf('<p id="basketResponse">')+23);c=c.slice(0,c.indexOf("</p>"));a(b.smlCont).find("#prodRelPrevDetails").empty().append("<p id='productAddedMessage'>"+c+"</p>").slideDown();loadMiniBasket(true);b.submitting=false;t=setTimeout("closeQuickBasket()",3000)},error:function(d,e,c){a(b.smlCont).find(".prpBtnAddToBag").attr("src","/pws/images/btn_add_to_bag.gif").fadeTo(300,1).attr("disabled",false)}})},getLoaderContent:function(b){b.smlCont.empty();b.smlCont.append('<div class="prpClose"><img src="/pws/images/btn_close.gif" class="close" alt="Close" /></div><img src="/pws/images/ajax-loader.gif" id="ajaxLoader"  alt="Loading" />');a(".close").click(function(){a(".productInfoCont select").show();a.fresca.hidePopup(b)})}}})(jQuery);(function(a){a.fn.frescaZoom=function(r){var c=a.extend({},a.fn.frescaZoom.defaults,r);var n=this;var m;var l;var h;var o;var g;function k(){m=a(n).find("img");var u=m.attr("src").split(c.productFolder);var s=u[0]+c.zoomFolder+u[1];l=a("<img>").attr("src",s).attr("width",c.zoomWidth).attr("height",c.zoomHeight).css("position","absolute");h=a('<div id="zoomCont"></div>');o=a('<div id="mouseWindow"></div>');h.append(l);a(n).append(h);a(n).append(o);d();g=c.zoomHeight/m.height();mouseWindowWidth=(m.width()/g);mouseWindowHeight=(m.height()/g);o.css({height:mouseWindowHeight+"px",width:mouseWindowWidth+"px"});q();if(c.alternativeViews){e(u[0])}}function q(){switch(c.activateOn){case"click":p();break;default:j();break}}function p(){n.click(function(s){b();i(s)});n.hover(function(){},function(){f()})}function j(){n.hover(function(){b()},function(){f()})}function d(){g=c.zoomHeight/m.height();mouseWindowWidth=(h.width()/g);mouseWindowHeight=(h.height()/g)}function i(x){var A=m.offset({relativeTo:"html"}).top;var s=m.offset({relativeTo:"html"}).left;var w=m.height();var y=m.width();if(g>5&&m.height()>0){d()}var u=x.pageY-m.offset({relativeTo:"html"}).top;var v=x.pageX-m.offset({relativeTo:"html"}).left;var B=(v-mouseWindowWidth/2);var z=(u-mouseWindowHeight/2);if(B<0){B=0}else{if(B>(y-mouseWindowWidth)){B=y-mouseWindowWidth}}if(z<0){z=0}else{if(z>(w-mouseWindowHeight)){z=w-mouseWindowHeight}}if(!c.overlayZoom){o.css({top:z,left:B})}l.css({top:"-"+(z*g)+"px",left:"-"+(B*g)+"px"})}function b(){o.css("display","block");h.css("display","block");n.bind("mousemove",function(s){a("ul#alternativeViews").show();a("p#rolloverTag").hide();i(s)})}function f(){n.unbind("mousemove");o.css("display","none");h.css("display","none");a("ul#alternativeViews").show();a("p#rolloverTag").show()}function e(s){a(c.alternativeViewsElement+" li").each(function(){var x=a(this).find("img").attr("src").split(c.thumbnailFolder);var u=x[x.length-1];var w=s+c.productFolder+u;var v=s+c.zoomFolder+u;a("<img>").attr("src",w);a("<img>").attr("stc",v);a(this).click(function(){m.attr("src",w);l.attr("src",v)}).css("cursor","pointer")})}k();return a(this)};a.fn.frescaZoom.defaults={thumbnailFolder:"thumb",productFolder:"large",zoomFolder:"zoom",alternativeViews:false,alternativeViewsElement:"ul#alternativeViews",pngImageFix:false,activateOn:"mousemove",zoomHeight:1626,zoomWidth:1300}})(jQuery);function closeQuickBasket(){clearTimeout(t);$("div#smlCont").fadeOut(3000,function(){})}function showReviews(){$("div#information div.standard_tab").hide();$("div.reviews").show();$("div#infoCont a").removeClass("selected");$("div#infoCont a#reviews").addClass("selected");$("div#information").attr("id","information_review")}function initStockChange(){var c=$("#sku_size_choice option:selected").text();var e=$("#sku_size_choice option:selected").attr("value");$("#basketResponse.add_to_basket").hide();if(c.indexOf("Not Available")>0&&$("a.sizeSelectorOutOfStock").length>0){var b=$("a.sizeSelectorOutOfStock").attr("href");var a=b.split("&ProductID=",2);var d=a[1].split("&",2);var f=a[0]+"&ProductID="+e+"&"+d[1];$("a.sizeSelectorOutOfStock").attr("href",f);$("div#stockIndicatorLink").show();$(".addToBagBtn").hide()}else{$("div#stockIndicatorLink").hide();$(".addToBagBtn").show()}if(e!==""){$("#selectSizeAlert").hide()}}$(document).ready(function(){if($.browser.msie&&$.browser.version=="6.0"){$("a.prodRelViewBtn").click(function(){$(".productInfoCont select").hide()})}var e=navigator.appName;var b=parseInt(navigator.appVersion);var a={productFolder:"large",thumbnailFolder:"thumb",alternativeViews:true,activateOn:"click"};initStockChange();$.fresca.initPopup();$("#sku_colour_choice").change(function(){$("#choose_colour").submit()});var d=new String(window.location);if(d.indexOf("UpdateBasket.ice")==-1){$.cookie("bvproductpage",d,{path:"/"})}$("#sku_size_choice").change(function(){initStockChange()});$(".preventDoubleSubmit").click(function(){var f=$("#sku_size_choice option:selected").text();var g=$("#sku_size_choice option:selected").attr("value");if(g==""){$("p#selectSizeAlert").show().html("Please select a size");return false}else{if(f.indexOf("Not Available")>0){$("p#selectSizeAlert").show().html("Please select an available size");return false}else{$("p#selectSizeAlert").hide();return true}}});if($("form#addToBag").length>0){$("a#addToWishlist").click(function(){var f=$("#sku_size_choice option:selected").attr("value");if(f==""){$("p#selectSizeAlert").show().html("Please select a size");return false}else{$("p#selectSizeAlert").hide();$("form#addToBag").attr("action","/pws/secure/AddToWishList.ice?accountparameter=true&section=account");$("form#addToBag").submit();return false}})}$("div#mainImageCont").frescaZoom(a);if($("form#addToBag").length>0){$("#basketBtn").click(function(){$("form#addToBag").attr("action","/pws/ShippingOptions.ice");$("form#addToBag").submit();return false})}if($("a.tabs").length>0){$("div#information div.standard_tab:even").addClass("even");$("div#information div.standard_tab:odd").addClass("odd");$("a.tabs:first").addClass("selected");var c=$("a.tabs:first").attr("class").split(" ").slice(1,2);$("div#information div.standard_tab").hide();$("div#information div.reviews").hide();$("div#information div."+c).show();$("a.tabs").click(function(){$("div#information div.standard_tab").hide();$("div.reviews").hide();if($(this).attr("id")=="reviews"){$("div#information").attr("id","information_review")}else{$("div#information_review").attr("id","information")}$("div."+$(this).attr("id")).show();$("div#infoCont a").removeClass("selected");$(this).addClass("selected");return false})}$("img.recentlyViewedRight").attr("src","/pws/images/arrow_large_next.gif");$("img.recentlyViewedLeft").attr("src","/pws/images/arrow_large_previous.gif");$("h4 img#recentlyViewedHeading").attr("src","/pws/images/hd_recentlyviewed.gif");if($("div#teamsWithProducts:visible")){$("p#teamsWithLink").hide()}if($("div#alternativeProducts:visible")){$("p#alternativeProductsLink").hide()}if(($("#teamwithCont").length<1)&&($("#alternativeCont").length<1)||($("#alternativeProducts li").length<1)&&($("#teamwithProducts li").length<1)){$("p#recentlyViewedLink").hide();$("div#recentlyViewedCont").show()}if(($("#teamwithCont").length>0)&&($("#alternativeCont").length<1)&&($("#teamwithProducts li").length>0)){$("p#teamsWithLink").hide();$("div#teamwithCont").show()}if(($("#teamwithCont").length<1)&&($("#alternativeCont").length>0)&&($("#alternativeProducts li").length>0)){$("p#alternativeProductLink").hide();$("div#alternativeCont").show()}$("p#recentlyViewedLink a").click(function(){$("div.relatedContainers").hide();$("div#recentlyViewedCont").show();$("p#recentlyViewedLink").hide();if(($("#teamwithProducts li").length<1)){$("p#teamsWithLink").hide()}else{$("p#teamsWithLink").show()}if(($("#alternativeProducts li").length<1)){$("p#alternativeProductLink").hide()}else{$("p#alternativeProductLink").show()}});$("p#alternativeProductLink a").click(function(){$("div.relatedContainers").hide();$("div#alternativeCont").show();$("p#alternativeProductLink").hide();if(($("#teamwithProducts li").length<1)){$("p#teamsWithLink").hide()}else{$("p#teamsWithLink").show()}$("p#recentlyViewedLink").show()});$("p#teamsWithLink a").click(function(){$("div.relatedContainers").hide();$("div#teamwithCont").show();$("p#teamsWithLink").hide();if(($("#alternativeProducts li").length<1)){$("p#alternativeProductLink").hide()}else{$("p#alternativeProductLink").show()}$("p#recentlyViewedLink").show()});if(($("#alternativeProducts li").length<1)){$("p#alternativeProductLink").hide();$("#alternativeCont h4").hide()}if(($("#teamwithProducts li").length<1)){$("p#teamsWithLink").hide();$("#teamwithCont h4").hide()}if($("#recentlyViewedProducts li").length<1){$("p#recentlyViewedLink").hide();$("#recentlyViewedCont h4").hide();$("div#recentlyViewedCont").hide()}$("img.teamsWithLeft").hide();$("img.teamsWithRight").hide();$("a.teamsWithPrevious").addClass("disabled");if($("ul#teamwithProducts li").length>3){$("img.teamsWithRight").show();$("a.teamsWithNext").addClass("cursor");products=Math.ceil($("ul#teamwithProducts li").length);currentProduct=3;currentPosition=0;$("a.teamsWithNext").click(function(){if(!$(this).is(".disabled")){currentProduct++;currentPosition-=221;$("a.teamsWithPrevious").find("img").attr("src",$("a.teamsWithPrevious").find("img").attr("src").replace("_inactive.gif",".gif"));$("a.teamsWithPrevious").removeClass("disabled");$("a.teamsWithPrevious").addClass("cursor");$("img.teamsWithLeft").show();$("ul#teamwithProducts").animate({marginTop:currentPosition},645);if(products==currentProduct){$("img.teamsWithRight").hide();$("a.teamsWithNext").addClass("disabled");$("a.teamsWithNext").removeClass("cursor")}}});$("a.teamsWithPrevious").click(function(){if(!$(this).is(".disabled")){currentProduct--;currentPosition+=221;$("a.teamsWithNext").find("img").attr("src",$("a.teamsWithNext").find("img").attr("src").replace("_inactive.gif",".gif"));$("a.teamsWithNext").removeClass("disabled");$("img.teamsWithRight").show();$("a.teamsWithNext").addClass("cursor");$("ul#teamwithProducts").animate({marginTop:currentPosition},645);if(currentProduct==3){$("img.teamsWithLeft").hide();$("a.teamsWithPrevious").addClass("disabled");$("a.teamsWithPrevious").removeClass("cursor")}}})}$("img.alternativeLeft").hide();$("img.alternativeRight").hide();$("a.alternativePrevious").addClass("disabled");if($("ul#alternativeProducts li").length>3){$("img.alternativeRight").show();$("a.alternativeNext").addClass("cursor");products1=Math.ceil($("ul#alternativeProducts li").length);currentProduct=3;currentPosition=0;$("a.alternativeNext").click(function(){if(!$(this).is(".disabled")){currentProduct++;currentPosition-=221;$("a.alternativePrevious").find("img").attr("src",$("a.alternativePrevious").find("img").attr("src").replace("_inactive.gif",".gif"));$("a.alternativePrevious").removeClass("disabled");$("a.alternativePrevious").addClass("cursor");$("img.alternativeLeft").show();$("ul#alternativeProducts").animate({marginTop:currentPosition},645);if(products1==currentProduct){$("img.alternativeRight").hide();$("a.alternativeNext").addClass("disabled");$("a.alternativeNext").removeClass("cursor")}}});$("a.alternativePrevious").click(function(){if(!$(this).is(".disabled")){currentProduct--;currentPosition+=221;$("a.alternativeNext").find("img").attr("src",$("a.alternativeNext").find("img").attr("src").replace("_inactive.gif",".gif"));$("a.alternativeNext").removeClass("disabled");$("img.alternativeRight").show();$("a.alternativeNext").addClass("cursor");$("ul#alternativeProducts").animate({marginTop:currentPosition},645);if(currentProduct==3){$("img.alternativeLeft").hide();$("a.alternativePrevious").addClass("disabled");$("a.alternativePrevious").removeClass("cursor")}}})}$("img.recentlyViewedLeft").hide();$("img.recentlyViewedRight").hide();$("a.recentlyViewedPrevious").addClass("disabled");if($("ul#recentlyViewedProducts li").length>3){$("img.recentlyViewedRight").show();$("a.recentlyViewedNext").addClass("cursor");products2=Math.ceil($("ul#recentlyViewedProducts li").length);currentProduct=3;currentPosition=0;$("a.recentlyViewedNext").click(function(){if(!$(this).is(".disabled")){currentProduct++;currentPosition-=221;$("a.recentlyViewedPrevious").find("img").attr("src",$("a.recentlyViewedPrevious").find("img").attr("src").replace("_inactive.gif",".gif"));$("a.recentlyViewedPrevious").removeClass("disabled");$("a.recentlyViewedPrevious").addClass("cursor");$("img.recentlyViewedLeft").show();$("ul#recentlyViewedProducts").animate({marginTop:currentPosition},645);if(products2==currentProduct){$("img.recentlyViewedRight").hide();$("a.recentlyViewedNext").addClass("disabled");$("a.recentlyViewedNext").removeClass("cursor")}}});$("a.recentlyViewedPrevious").click(function(){if(!$(this).is(".disabled")){currentProduct--;currentPosition+=221;$("a.recentlyViewedNext").find("img").attr("src",$("a.recentlyViewedNext").find("img").attr("src").replace("_inactive.gif",".gif"));$("a.recentlyViewedNext").removeClass("disabled");$("img.recentlyViewedRight").show();$("a.recentlyViewedNext").addClass("cursor");$("ul#recentlyViewedProducts").animate({marginTop:currentPosition},645);if(currentProduct==3){$("img.recentlyViewedLeft").hide();$("a.recentlyViewedPrevious").addClass("disabled");$("a.recentlyViewedPrevious").removeClass("cursor")}}})}});
