var isIE6=$.browser.msie&&(jQuery.browser.version.substr(0,1)=="6")&&!window.XMLHttpRequest?true:false;$(document).ready(function(){$("a[href!=''][rel*='external']").attr("target","_blank");$("#alert-highlight").css("color","#FFF").animate({opacity:0},1500,function(){$(this).css({"background-color":"transparent",color:"#F00"}).find("a:first").css("color","#F00").parent().animate({opacity:1},1500)});if($.browser.msie&&(jQuery.browser.version.substr(0,1)=="6")&&!window.XMLHttpRequest){}else{$(".field, .placeOrder:first").addClass("showHint");$("#cardType").change(function(){var A=$("#securityCode").parent();if($(this).find("option:selected").text()=="American Express"){A.find(".hint:first .amex").removeClass("amex");A.find(".hint:first span:first").hide();A.find(".hint:first span:last").show()}else{A.find(".hint:first span:last").hide();A.find(".hint:first span:first").show()}});$(".field input, .field select, .field textarea").focus(function(){$(this).parent().find(".hint:first").fadeIn(200)});$(".field input, .field select, .field textarea").blur(function(){$(this).parent().find(".hint:first").fadeOut(200)});$(".cv2 input").focus(function(){$(this).parent().find(".hint:first").fadeIn(200);$(this).parent().parent().find(".hint:first").fadeIn(200)});$(".cv2 input").blur(function(){$(this).parent().find(".hint:first").fadeOut(200);$(this).parent().parent().find(".hint:first").fadeOut(200)})}$("#checkout-help .panel-body a, #basketItems .delivery-message a, #middle-rail .availability a, #prod-availability a").click(function(){var B=$(this).attr("href");var A=window.open(B,"name","width=400,height=420,scrollbars=yes,resizable=yes");if(window.focus){A.focus()}return false});$(".discussion-detail").hide();$(".toggleDiscussion").text("Expand").click(function(){var A=$(this).attr("rel");if($(this).hasClass("collapse")){$("#discussion-"+A).hide();$(this).removeClass("collapse").text("Expand")}else{$("#discussion-"+A).show();$(this).addClass("collapse").text("Collapse")}});$(".resolve-card-problem #middle-rail fieldset").click(function(){$(this).parent().parent().find("input[type='radio']").attr("checked","checked")});$("body#blu-ray #technicaldetails li:contains('Region ')").each(function(){var A=$.trim($(this).text());if(A.indexOf("Region 1",0)>-1){A=A.replace("Region 1","Region A");$(this).text(A)}if(A.indexOf("Region 2",0)>-1){A=A.replace("Region 2","Region B");$(this).text(A)}if(A.indexOf("Region 3",0)>-1){A=A.replace("Region 3","Region C");$(this).text(A)}});if(typeof pageTracker!="undefined"){$(".bannertrack").parent().click(function(){var A=$(this).children("img").attr("alt");var B=$(this).attr("rel");if(A==""){A="Misc"}pageTracker._trackEvent(B,"Click",B+" "+A)});$(".bannertrack").each(function(){var A=$(this).attr("alt");var B=$(this).parent().attr("rel");if(A==""){A="Misc"}pageTracker._trackEvent(B,"Impression",B+" "+A)});$("#popular-searches ul li a").click(function(){var A=$(this).text();var B=$("body").attr("id");if(A==""){A="Misc"}pageTracker._trackEvent(B,"Popular Search",A)});$("#left-rail .panel a").click(function(){var A=$.trim($(this).text());var B=$("body").attr("id");if(A==""){A="noText"}if(B==""){B="noDept"}pageTracker._trackEvent("Left Nav","Nav Click","leftnav-"+B+"-"+A)});$(".flashBannerTrack").each(function(){var A="";var B=$(this).attr("rel");if(A==""){A="Flash Banner"}pageTracker._trackEvent(B,"Impression",B+" "+A)});$("a[href*='checkoutStart.secure']").click(function(){pageTracker._trackEvent("Link","Go To Checkout")});$("button[class*='gotocheckout']").click(function(){pageTracker._trackEvent("Link","Go To Checkout")})}if($("#middle-rail .panel:first").hasClass("campaign1")){var W=$("#campaign-header span").text();if(W!=""){$(".campaign-buttons a[title='"+W+"']").addClass("campaign-button-active")}}var Z=$(".default .panel-head h1").text();if(Z!=""){$(".pagingnumbers ul li a[title='"+Z+"']").addClass("selected-letter")}$("#discountCode").focus(function(){if($(this).val()=="Discount Code"){$(this).val("")}});$("#discountCode").blur(function(){if($(this).val()==""){$(this).val("Discount Code")}});if(showExtras){var U=-1;var P="NONE";var V="NONE";var T=null;var R=strTrailerWidth;var X=271;$("#"+videodivid).flash({swf:"http://thehut.pantherssl.com/design-assets/flash/trailer-assets/player.swf",height:X,width:R,expressInstaller:"http://thehut.pantherssl.com/design-assets/flash/trailer-assets/expressinstall.swf",params:{allowfullscreen:true,allowscriptaccess:"always",flashvars:{repeat:theVideoRepeat,file:theVideoFile,image:theVideoImage,skin:"http://thehut.pantherssl.com/design-assets/flash/trailer-assets/bright.swf",backcolor:theVideoBackColour,frontcolor:theVideoFrontColour,lightcolor:theVideoLightColour,stretching:"none"}}})}if(showFlashBanner){for(var Y=0;Y<flashBannerSets.length;Y++){$("#"+flashBannerIds[Y]).flash({swf:flashBannerSwfs[Y]+"?clickTAG="+flashBannerLinks[Y]+"&bannerId="+flashBannerIds[Y],height:flashBannerHeights[Y],width:flashBannerWidths[Y],params:{allowscriptaccess:"always",wmode:"transparent"}})}}if($("body").attr("id")=="shops"&&shopSifr!=false){var Q=$("#middle-rail h1").css("color"),O;var S=$("#middle-rail h1").css("text-transform")=="uppercase"?"upper":"";if(Q.match("rgb")){Q=Q.substring(4,Q.length-1);var N=Q.split(",");O=rgbToHex(N[0],N[1],N[2])}else{O=Q}if(typeof sIFR=="function"){sIFR.replaceElement(named({sSelector:"#middle-rail h2 span",sFlashSrc:"/common/flash/"+shopSifr+".swf",sColor:O,sWmode:"transparent",sLinkColor:O,sCase:S}))}}$(".giftfinder-container .selectall a.selectall-link").click(function(){$(this).closest("ul").find("input:checkbox").attr("checked","checked");return false});$(".giftfinder-container .selectall a.selectnone-link").click(function(){$(this).closest("ul").find("input:checkbox").removeAttr("checked");return false})});function incCancelQty(F,D){var E=document.getElementById("cancel-"+F);if(E.value<D){E.value++}return false}function decCancelQty(F,D){var E=document.getElementById("cancel-"+F);if(E.value>D){E.value--}return false}function trackFlash(F){if(typeof pageTracker!="undefined"){var E="";var D=$("#"+F).attr("rel");if(E==""){E="Flash Banner"}pageTracker._trackEvent(D,"Click",D+" "+E)}}function rgbToHex(H,I,G){var K=[H,I,G],J="#";for(var L=0;L<K.length;L++){if(K[L]==null){J+="00"}K[L]=parseInt(K[L]);if(K[L]==0||isNaN(K[L])){J+="00"}K[L]=Math.max(0,K[L]);K[L]=Math.min(K[L],255);K[L]=Math.round(K[L]);J+="0123456789ABCDEF".charAt((K[L]-K[L]%16)/16)+"0123456789ABCDEF".charAt(K[L]%16)}return J}function getSKU(G,H){var L=G.attr("href");var I=L.split("?");if(I.length>1){var J=new Object();if(I.length==2){var K=I[1].split("&");while(K.length){temp=K.shift().split("=");J[temp[0]]=temp[1]}return J[H]}else{}}else{return false}}function setSelect(D,E){if(D.length>0){var F=D[0].variationId;E.find("select[rel='"+F+"'] option[value!='']").attr("disabled","disabled");jQuery.each(D,function(){E.find("select[rel='"+this.variationId+"'] option[value='"+this.optionId+"']").removeAttr("disabled")});E.find("select[rel='"+F+"']").val("")}}function updateValues(F,J,G,I){var H=G.find("#"+F).val();if((H!="")&&(J!="")){AjaxInterface.getDataForSelectedOption(I,siteId,H,J,function(A){setSelect(A,G)})}};