
/*utils.js*/
var AjaxUrl="/asp/ajaxrequests/spv/spv.php";var spvtwoUrl="/asp/ajaxrequests/spv/spv2.php";var COOKIE_NAME="CSNUtId";var DELIM=",";var StartTime;var AJAX_DELIM="$~$DELIM$~$";function findPos(a){var b=curtop=0;if(a.offsetParent){do{b+=a.offsetLeft;curtop+=a.offsetTop}while(a=a.offsetParent)}return[b,curtop]}function togChk(e,d,c){var a=e[d];if(a!=null){if(a.length!=undefined){for(var b=0;b<a.length;b++){a[b].checked=c}}else{a.checked=c}}return true}function toggle(b){var a=document.getElementById(b);if(a.style.display!="none"){a.style.display="none"}else{a.style.display="block"}}function HideContent(a){if(a.length<1){return}document.getElementById(a).style.display="none"}function ShowContent(a){if(a.length<1){return}document.getElementById(a).style.display="block"}function changeObjectVisibility(a,c){var b=getStyleObject(a,document);if(b){b.visibility=c;return true}else{return false}}function getStyleObject(a){if(document.getElementById&&document.getElementById(a)){return document.getElementById(a).style}else{if(document.all&&document.all(a)){return document.all(a).style}else{if(document.layers&&document.layers[a]){return document.layers[a]}else{return false}}}}function switchDiv(b){var a=getStyleObject(b);if(a){hideAll();changeObjectVisibility(b,"visible")}else{alert("sorry, this only works in browsers that do Dynamic HTML")}}function spvtwo(b,a){var d="rfCSNID="+getCSNCookie_yui();d=d+"&rfHTTPReferer="+encodeURIComponent(document.referrer);d=d+"&rfURL="+encodeURIComponent(document.location);d=d+"&rfGUID="+encodeURIComponent(getUser(COOKIE_NAME,b));d=d+"&rfSoID="+a;var c=new Image(1,1);c.src=spvtwoUrl+"?"+d;c.onload=function(){chkimgLoad()}}function chkimgLoad(){return}function LoadPage(){StartTime=new Date()}function CallUnloadPage(d,b,e,c,a){UnloadPage(d,b,e,c,false,false,a)}function UnloadPage(e,n,h,o,c,a,b){var f=new Date();var k=f.getTime()-StartTime.getTime();var m=window.location.href;var j=getUser(COOKIE_NAME,b);var l="";if(c){l=GetSkuList()}var d="";if(a){d=GetSriSkuList()}var g=getCSNCookie_yui();UtInfo(j,g,e,m,n,h,l,d,o,k)}function GetSkuList(){var a=document.getElementsByName("sku");var d="";var c;for(var b=0;b<a.length;b++){c=a[b].value;if(c!=null&&c!=""){if(d.length>0){d=d+DELIM+c}else{d=c}}}return d}function GetSriSkuList(){var a=document.getElementsByName("SRISKUTagList");var b="";var c;for(i=0;i<a.length;i++){c=a[i].getAttribute("SRISKUId");if(c!=null&&c!=""){if(b.length>0){b=b+DELIM+c}else{b=c}}}return b}function GUID(){return(S4()+S4()+"-"+S4()+"-"+S4()+"-"+S4()+"-"+S4()+S4()+S4())}function S4(){return(((1+Math.random())*65536)|0).toString(16).substring(1)}function getCookie_yui(a){return YAHOO.util.Cookie.get(a)}function getCSNCookie_yui(){return YAHOO.util.Cookie.getSub("CSN","CSNID")}function setCookie_yui(a,c,b){YAHOO.util.Cookie.set(a,c,{path:"/",domain:b,expires:new Date("January 12, 2034")})}var topLevelDomain;function setSubCookie_yui(a,f,c){var e=0;var d=0;if(topLevelDomain==null||topLevelDomain==""){var b=document.domain;if(b.lastIndexOf(".co.uk")>0){e=b.lastIndexOf(".co.uk");d=b.substring(0,e).lastIndexOf(".");topLevelDomain=b.substring(d)}else{e=b.lastIndexOf(".");d=b.substring(0,e).lastIndexOf(".");topLevelDomain=b.substring(d)}}return YAHOO.util.Cookie.setSub(a,f,c,{path:"/",domain:topLevelDomain})}function getSubCookie_yui(a,b){return YAHOO.util.Cookie.getSub(a,b)}function getUser(b,c){var a=getCookie_yui(b);if(a==null||a==""){a=GUID();if(a!=null&&a!=""){setCookie_yui(b,a,c)}}return a}function UtInfo(f,h,b,l,j,c,e,a,k,d){var g="UtGUID="+f+"&UtURL="+l+"&UtSkuList="+e+"&UtSriSkuList="+a+"&UtCSNID="+h+"&UtCustID="+b+"&UtSoID="+j+"&UtCatID="+c+"&UtRefID="+k+"&UtPgDuration="+d;YAHOO.util.Connect.asyncRequest("POST",AjaxUrl,sb_callback,g)}var sb_callback={success:function(b){try{}catch(a){}},failure:function(a){}};function CreateBookmarkLink(b,a){if(window.sidebar){window.sidebar.addPanel(b,a,"")}else{if(window.external){window.external.AddFavorite(a,b)}else{if(window.opera&&window.print){return"Sorry, bookmarking is not yet supported for Opera."}}}}function openpopup(b,c,a){winpops=window.open(b,"","width="+c+",height="+a+",scrollbars,resizable,toolbar,")}function openimgpopup(b,c,a){var d=document.getElementById("lgimage");if(d!=null){b=b+"&imgs="+encodeURIComponent(d.src)}winpops=window.open(b,"","width="+c+",height="+a+",scrollbars,resizable,toolbar,")}function opennamedpopup(b,d,c,a){winpops=window.open(b,d,"width="+c+",height="+a+",scrollbars,resizable,toolbar,")}function JavaScriptError(d,b,a){var c=document.getElementsByName("AJAX_JAVASCRIPT_OFF");if(c!=null){if(c[0]!=undefined){c[0].value="Error!"}}return true}window.onerror=JavaScriptError;function dealEmailSignUp(){var a=document.getElementById("deal_email_address");if(a!=null){YAHOO.util.Connect.asyncRequest("GET","/asp/public/session/ajax/deal_email.asp?email="+escape(a.value),ajax_callback_deal_email)}else{CatchAjaxError("dealEmailSignUp(): error getting email address.")}}var ajax_callback_deal_email={success:function(g){try{var a=g.responseText;var b=a.split(AJAX_DELIM);var f=b[0];var d=b[1];if(f=="0"){var h=document.getElementById("deal_email_div");if(h!=null){h.innerHTML='<div class="dealemailsubmit">'+d+"</div>"}}else{if(f=="1"){}else{CatchAjaxError(d)}}}catch(c){CatchAjaxError(c.message)}},failure:function(a){}};function footer_get_sponsored_links(b){if(hideSponsoredAds()){return}var a="/asp/public/static/ajax/sponsored_links.asp?"+b;YAHOO.util.Connect.asyncRequest("GET",a,ajax_callback_sponsored_links)}var ajax_callback_sponsored_links={success:function(d){try{var b=document.getElementById("sponsored_links_core");if(b!=null){b.innerHTML=d.responseText}if(document.getElementById("sponsored_links_success")==null){var a=document.getElementById("ft");if(a!=null){a.removeChild(document.getElementById("sponsored_links_div"))}}}catch(c){CatchAjaxError(c.message)}},failure:function(a){}};function limitText(b,a){if(b.value.length>(a-1)){alert("You've reached the character limit for this field.");b.value=b.value.substr(0,a)}}function limitDelimitedText(k,a,g,f){var j=1;var c="";var h=0;var e;var d=false;var b=k.value;for(e=0;e<b.length;e++){if(j>a){if(e==b.length-1){c=c+b.substring(h+1,(e+1))+"\n";d=true}else{if(b.charAt(e)==g||b.charAt(e)==f){if(j-1>a){c=c+b.substring(h,((e)-(h)))+"\n";d=true}}}}if(b.charAt(e)==g||b.charAt(e)==f){j=0;h=e;d=false}j++}if(c!=""){alert("The following values are too long ("+a+" character limit) Please fix these before saving: \n\n"+c);return false}}function isEmpty(fields,aForm){var fieldArray=fields.split(",");var emptyList="";for(var i=0;i<fieldArray.length;i++){if(eval("document."+aForm+"."+fieldArray[i])){if(eval("document."+aForm+"."+fieldArray[i]+".value")==""){alert("Please fill in all required fields.");return false}}}return true}function checkAllBoxes(formName,elementID,valToMatch,valPos,valDelim,action,valType){var checkBoxes=eval("document."+formName+".elements");var boxval;for(var i=0;i<checkBoxes.length;i++){if(eval("checkBoxes[i]."+valType)==valToMatch){checkBoxes[i].checked=action}}}function delAttribute(c,b){var a=c.selectedIndex;if(a<0){return}b.appendChild(c.options.item(a));selectNone(c,b)}function addAttribute(c,b){var a=b.selectedIndex;if(a<0){return}c.appendChild(b.options.item(a));selectNone(c,b)}function selectNone(a,b){a.selectedIndex=-1;b.selectedIndex=-1;addIndex=-1;selIndex=-1}function getSize(c){var a=c.childNodes.length;var b=0;for(i=0;i<a;i++){if(c.childNodes.item(i).nodeType==1){b++}}if(b<2){return 2}else{return b}}function delAll(c,b){var a=c.length-1;for(i=a;i>=0;i--){b.appendChild(c.item(i))}selectNone(c,b);setSize(c,b)}function addAll(c,b){var a=b.length-1;for(i=a;i>=0;i--){c.appendChild(b.item(i))}selectNone(c,b);setSize(c,b)}function selectAllInList(b){for(var a=0;a<b.length;a++){b[a].selected=true}}function LTrim(b){var a=/\s*((\S+\s*)*)/;return b.replace(a,"$1")}function RTrim(b){var a=/((\s*\S+)*)\s*/;return b.replace(a,"$1")}function Trim(a){return LTrim(RTrim(a))}function isDigit(a){return((a>="0")&&(a<="9"))}function isStrEmpty(a){return((a==null)||(a.length==0))}function isInteger(b){var a;b=Trim(b);if(isStrEmpty(b)){return false}for(a=0;a<b.length;a++){var d=b.charAt(a);if(!isDigit(d)){return false}}return true}function IsEmailValid(c){var b=c.length;var a=c.indexOf("@");var d=c.indexOf(" ");if(d>-1){return false}if(a<1){return false}var g=c.substring(a+1,b);var h=g.indexOf(".");if(h<1){return false}var f=g.lastIndexOf(".");if(f==h+1){return false}var e=g.substring(f+1,g.length);dom=e.toLowerCase();if(dom.length>6){return false}if(dom.length<2){return false}return true}function imgPreloader(d,g){var e=0;var c=d.split(g);var f=new Image();var b=new Array();for(var a=0;a<c.length;a++){b[a]=c[a]}for(e=0;e<=c.length;e++){f.src=b[e]}}function swapImage(k,d,a,g,r,e){var q=document.getElementById(k).src;var b=q.lastIndexOf(".");var c=q.substr(b,q.length-b);var o=document.getElementById(k).name;var l=o.split(d);var j=a.split("*")[0];var p=a.split("*")[1];var h=new Array(l.length);var f=new Array(l.length);for(var n=0;n<l.length;n++){if(j==l[n].split("*")[0]){l[n]=a;h[n]=l[n].split("*")[1]}else{h[n]=l[n].split("*")[1]}}h=h.sort(sortArrNumeric);for(n=0;n<h.length;n++){for(var m=0;m<l.length;m++){if(l[m].split("*")[1]==h[n]){f[n]=l[m];break}}}document.getElementById(k).src=g+h.join("")+c;document.getElementById(k).name=f.join("_");document.getElementById(j+"_current").src=r;document.getElementById(j+"_colorName").innerHTML=e}function sortArrNumeric(d,c){return(d-c)}function SetStateName(b,c,a){var e;var f;var d;d=document.getElementById(b);if(d==null){d=document.getElementById(c);f=d.value}else{f=document.myForm[b].options[document.myForm[b].selectedIndex].text}if(f!=null){document.getElementById(a).value=f}}function getHTTPObject(){var a;if(!a&&typeof XMLHttpRequest!="undefined"){try{a=new XMLHttpRequest()}catch(b){a=false}}return a}function GetSelOpts(g){var e="";var c="";var h=g.MiID;if(h!=null){if(h.length!=undefined){for(var f=0;f<h.length;f++){if(h[f].checked==true){e=e+"&PiID="+document.AddItem.MiID[f].value;c=c+document.AddItem.MiID[f].value+","}}}else{if(h.checked==true){e=e+"&PiID="+document.AddItem.MiID[f].value;c=c+document.AddItem.MiID[f].value+","}}}var d=GetOneOpts(g.PiID);e=e+d[0];c=c+d[2];return[e,d[1],c]}function GetOneOpts(e){var f="";var d="";var j="";var h=true;if(e!=null){if(e.length!=undefined&&e.options==undefined){for(var g=0;g<e.length;g++){j="";if(e[g].options!=undefined){if(e[g].options[e[g].selectedIndex].value!="XXXXXXXXXX"){h=false;j=e[g].options[e[g].selectedIndex].value}}else{if(e[g].value!="XXXXXXXXXX"){h=false;j=e[g].value}}if(j!=""){f=f+"&PiID="+j;if(d!=""){d=d+","}d=d+j}}}else{if(e.options!=undefined){if(e.options[e.selectedIndex].value!="XXXXXXXXXX"){h=false;j=e.options[e.selectedIndex].value}}else{if(e.value!="XXXXXXXXXX"){h=false;j=e.value}}if(j!=""){f=f+"&PiID="+j;if(d!=""){d=d+","}d=d+j}}}else{h=false}return[f,h,d]}YAHOO.namespace("YAHOO.Hack").FixIESelectWidth=new function(){var g=this;var j=YAHOO.util.Event;var k=YAHOO.util.Dom;var n={};var a={};var d=0;var l;var e=!!(document.uniqueID&&typeof(XMLHttpRequest)!="undefined");function m(q){q=q||this;if(q.tagName.toLowerCase()!="select"){throw Error("element ["+q.id+"] is not <select>");return}if(!k.hasClass(q.parentNode,"select-box")){throw Error("className select-box is not included for element ["+q.id+"]");return}var p=q.runtimeStyle;var o=q.parentNode.runtimeStyle;o.fonSize=0;var r=q.parentNode.currentStyle.display.toLowerCase();if(r==""||r=="inline"||r=="inline-block"){o.display="inline-block";o.width=q.offsetWidth+"px";o.height=q.offsetHeight+"px";o.position="relative";p.position="absolute";p.top=0;p.left=0}q._timerId=(d+=1);q.selectedIndex=Math.max(0,q.selectedIndex);n["_"+q._timerId]=setTimeout("void(0)",0);a["A"+q._timerId]=setTimeout("void(0)",0);j.on(q,"mouseover",f);j.on(document,"mousedown",h,q,true);j.on(q,"change",b,q,true)}function b(o){status++;this.runtimeStyle.width=""}function f(s){var q=this;if(l&&l!=q){h.call(l,s)}var t="_"+q._timerId;var o="A"+q._timerId;clearTimeout(n[t]);var r=function(){clearTimeout(a[o]);if(Math.abs(p-u)>3){u+=(p-u)/3;q.runtimeStyle.width=u+"px";a[o]=setTimeout(r,0)}else{q.runtimeStyle.width="auto";q.selectedIndex=Math.max(0,q.selectedIndex)}};var u=q.offsetWidth;q.runtimeStyle.width="auto";var p=q.offsetWidth;clearTimeout(a[o]);r();q.focus();l=q}function h(q,p){p=(q.srcElement||q.target);if(p==this&&q.type!="mouseover"){status++;j.stopEvent(q);return false}p=this;clearTimeout(a["A"+p._timerId]);var r="_"+p._timerId;var o=function(){p.runtimeStyle.width=""};if(q.type=="mouseover"){o()}else{n[r]=setTimeout(o,100)}}function c(o){o=[o,""].join("");if(document.uniqueID&&window.createPopup){j.onAvailable(o,m);return true}else{return false}}return c};var magglasspanel;YAHOO.util.Event.addListener(window,"load",initMagGlassPanel);function initMagGlassPanel(){magglasspanel=new YAHOO.widget.Panel("magglasspanel",{width:"41px",height:"37px",visible:false,draggable:false,close:false,underlay:"none"});magglasspanel.render("ProdListContent");if(document.getElementById("magglasspanel")){document.getElementById("magglasspanel").style.display="block"}}function showMagGlassPanel(b,a){var c=b.split("_")[0];magglasspanel.setBody('<img id="'+c+'_glass" src="http://common.csnimages.com/common/misc/mag.png" onmouseover="showBigProdImage(\''+c+"_glass','"+a+"')\"/>");magglasspanel.cfg.setProperty("context",[b,"br","br"]);magglasspanel.show()}function hideMagGlassPanel(){magglasspanel.hide()}var bigprodimagepanel;YAHOO.util.Event.addListener(window,"load",initBigProdImagePanel);function initBigProdImagePanel(){bigprodimagepanel=new YAHOO.widget.Panel("bigprodimagepanel",{width:"354px",height:"354px",visible:false,draggable:false,close:false});bigprodimagepanel.render("ProdListContent");if(document.getElementById("bigprodimagepanel")){document.getElementById("bigprodimagepanel").style.display="block"}}function showBigProdImage(e,d){var f=e.split("_")[0];var b=document.getElementById(f+"_url").href;var a=document.getElementById(f+"_img").src;var c=document.getElementById(f+"_img").title;a=a.replace("/lf/2","/lf/4");bigprodimagepanel.setBody('<a id="MagnifiedImageBoxLink" title="'+c+'" href="'+b+'" onmouseout="hideBigProdImage()"><img id="MagnifiedImageBoxImage" src="'+a+'" alt=""/></a>');bigprodimagepanel.cfg.setProperty("context",[e,d,d]);bigprodimagepanel.show()}function hideBigProdImage(){bigprodimagepanel.hide()}var rolloverpanel;YAHOO.util.Event.addListener(window,"load",initRollOverPanel);function initRollOverPanel(){rolloverpanel=new YAHOO.widget.Panel("rolloverpanel",{visible:false,draggable:false,close:false,autofillheight:"body",underlay:"none"});rolloverpanel.render("ProdListContent");if(document.getElementById("rolloverpanel")){document.getElementById("rolloverpanel").style.display="block"}}function showOptNotify(b,a){rolloverpanel.cfg.setProperty("context",[a,"tl","bl"]);if(b>0){YAHOO.util.Connect.asyncRequest("GET","/asp/public/static/ajax/optnotify.asp?PonID="+b,optnotify_callback)}}function hideOptNotify(){rolloverpanel.hide()}var optnotify_callback={success:function(d){try{xmlDoc=d.responseXML;var c=xmlDoc.documentElement.getElementsByTagName("rollover");if(c[0].hasChildNodes()){var a=c[0].firstChild.nodeValue;if(a.length!=0){document.getElementById("DisplayText").innerHTML=c[0].firstChild.nodeValue;document.getElementById("rolloverpanel").style.display="block";rolloverpanel.show()}}}catch(b){CatchAjaxError(b.message+"***")}},failure:function(a){CatchAjaxError(a.statusText+"***fail***")}};function update_store_banner(){var a="/asp/public/static/ajax/store_banner.asp";YAHOO.util.Connect.asyncRequest("GET",a,update_store_banner_callback)}var update_store_banner_callback={success:function(b){try{update_banner(b.responseText)}catch(a){CatchAjaxError("store banner error:"+a.message)}},failure:function(a){CatchAjaxError("store banner status:"+a.statusText)}};function update_banner(a){var d=a.split("!#ZZ#!");var b=document.getElementById("storebanner");if(b!=null){b.innerHTML=d[0];if(d[0]=""){b.innerHTML='<span class="primary_shipheader">&nbsp</span><span class="secondary_shipheader">&nbsp;</span>'}}if(d.length>1){var c=document.getElementById("emergency_container");if(c!=null&&d[1]!=null){c.innerHTML=d[1]}}if(d.length>3){if((document.getElementById("clnTopBlockAccount")!=null)&&(d[2].indexOf("account")>-1)){document.getElementById("clnTopBlockAccount").innerHTML=d[3]}if((document.getElementById("clnTopBlockSuperbrowse")!=null)&&(d[2].indexOf("superbrowse")>-1)){document.getElementById("clnTopBlockSuperbrowse").innerHTML=d[3]}if((document.getElementById("clnTopBlockHomepage")!=null)&&(d[2].indexOf("homepage")>-1)){document.getElementById("clnTopBlockHomepage").innerHTML=d[3]}if((document.getElementById("clnTopBlockCategory")!=null)&&(d[2].indexOf("categories")>-1)){if(d[2].indexOf(","+document.getElementById("clnCatid").value+",")>-1){document.getElementById("clnTopBlockCategory").innerHTML=d[3]}}}}function loadRealMedia(){var c=realMediaWebsite;if((c.indexOf("https://")>=0)||hideSponsoredAds()){return}if((document.getElementById("realmediaOutsideAdvertise")==null)||(document.getElementById("realmediaOutsideAdvertise")==undefined)){if(realMediaPositions.indexOf("R")>=0){}else{realMediaPositions=realMediaPositions.replace("R","")}}if((document.getElementById("realmediaAdProddeetsBox")==null)||(document.getElementById("realmediaAdProddeetsBox")==undefined)){if(realMediaPositions.indexOf("P")>=0){}else{realMediaPositions=realMediaPositions.replace("P","")}}if((document.getElementById("realmediaAdsponBox")==null)||(document.getElementById("realmediaAdsponBox")==undefined)){if(realMediaPositions.indexOf("B")>=0){}else{realMediaPositions=realMediaPositions.replace("B","")}}if(hideSponsoredAds()){return}if(realMediaPositions!=""){var b="/asp/public/static/ajax/realMedia.asp";b=b+"?RmSoURL="+encodeURIComponent(c);b=b+"&showSpot="+encodeURIComponent(realMediaPositions);var a={success:function(f){try{showRealMediaLoc(f.responseText)}catch(d){CatchAjaxError("RealMedia:"+d.message)}},failure:function(d){CatchAjaxError("RealMedia:"+d.statusText)}};YAHOO.util.Connect.asyncRequest("GET",b,a)}}function showRealMediaLoc(a){var b=a.split("<REALMEDIASPLIT>");if(a.length>0){if(b[0]!=""){if(document.getElementById("realmediaOutsideAdvertise")!=null){document.getElementById("realmediaOutsideAdvertise").innerHTML=b[0];document.getElementById("doc4").style.cssText="padding-right:160px;"}}if(b[1]!=""){if(document.getElementById("adsense_bottom")!=null){document.getElementById("adsense_bottom").style.cssText="float: left; width: 410px;"}if(document.getElementById("csnlocal_ads")!=null){document.getElementById("csnlocal_bottom").style.cssText="float: left;";document.getElementById("csnlocal_ads").style.cssText="width: 410px;"}if(document.getElementById("realmediaAdsponBox")!=null){document.getElementById("realmediaAdsponBox").innerHTML=b[1]}}if(b[2]!=""){if(document.getElementById("realmediaAdProddeetsBox")!=null){document.getElementById("realmediaAdProddeetsBox").innerHTML=b[2]}}}}var localStarted=false;function load_csnLocalContent(b,g,f,e,h,c){if(hideSponsoredAds()){return}localStarted=true;var d="/asp/public/static/ajax/get_local.asp";d=d+"?CurrentURL="+encodeURIComponent(b);d=d+"&sku="+encodeURIComponent(g);d=d+"&CaId="+encodeURIComponent(f);d=d+"&ClId="+encodeURIComponent(e);d=d+"&MaId="+encodeURIComponent(h);d=d+"&SoId="+encodeURIComponent(c);d=d+"&version=1";var a={success:function(k){try{show_csnlocalContent(k.responseText)}catch(j){CatchAjaxError("csnlocal:"+j.message)}},failure:function(j){CatchAjaxError("csnlocal:"+j.statusText)}};YAHOO.util.Connect.asyncRequest("GET",d,a)}function show_csnlocalContent(a){var c=a.split("<ADSPLIT>");if(a.length>0){if(c[0]!=""){if(document.getElementById("csnlocal")!=null&&document.getElementById("csnlocal")!=undefined){foundLocalAds=true;hideEmptyAdBlock("top");document.getElementById("csnlocal").style.display="inline-block";document.getElementById("csnlocal").innerHTML=c[0];YAHOO.util.Dom.removeClass(YAHOO.util.Dom.getElementsByClassName("adblock waiting"),"waiting");var b=YAHOO.util.Dom.getElementsByClassName("localads")[0];if(YAHOO.util.Dom.getChildren(b).length<3){resizeAdBlock("left")}}}if(c[1]!=""&&c[1]!=undefined&&c[1]!=null){foundLocalAds=true;if(document.getElementById("csnlocal_bottom")!=null&&document.getElementById("csnlocal_bottom")!=undefined){document.getElementById("csnlocal_bottom").style.display="inline-block";document.getElementById("csnlocal_bottom").innerHTML=c[1]}}if(document.getElementById("realmediaAdsponBox")!=null){if(document.getElementById("realmediaAdsponBox").innerHTML!=""){document.getElementById("csnlocal").style.cssText="float: left;";document.getElementById("csnlocal_ads").style.cssText="width: 410px;"}}}else{if(typeof(readyForAdsense)!="undefined"&&readyForAdsense){startAdsense()}else{if((typeof(doAFS)=="undefined"||!doAFS)&&(typeof(doAFC)=="undefined"||!doAFC)&&(typeof(hideEmptyAdBlock)=="function")){hideEmptyAdBlock(null)}else{foundLocalAds=false}}}}function LocalFeedbackCommentFocus(a){if(a.innerHTML=="Your comments will be aggregated and reviewed and not replied to directly."){a.innerHTML=""}}function LocalFeedbackCommentBlur(a){if(a.innerHTML==""){a.innerHTML="Your comments will be aggregated and reviewed and not replied to directly."}}function print_local_popup(b){var a="http://www.csnstores.com/asp/public/static/ajax/local_ad_redirect.asp?pplogid="+encodeURIComponent(b);var c={success:function(f){try{}catch(d){CatchAjaxError("csnlocal:"+d.message)}},failure:function(d){CatchAjaxError("csnlocal:"+d.statusText)}};YAHOO.util.Connect.asyncRequest("GET",a,c);window.print()}function isMouseLeaveOrEnter(c,b){if(c.type!="mouseout"&&c.type!="mouseover"){return false}var a=c.relatedTarget?c.relatedTarget:c.type=="mouseout"?c.toElement:c.fromElement;while(a&&a!=b){a=a.parentNode}return(a!=b)}function jumpToAnchor(a){window.location=String(window.location).replace(/\#.*$/,"")+"#"+a}function hideSomeCollectionItems(){var c,a;c=a="";if(document.cookie.length>0){c_start=document.cookie.indexOf("CSN=");if(c_start!=-1){c_start=c_start+4;c_end=document.cookie.indexOf(";",c_start);if(c_end==-1){c_end=document.cookie.length}c=unescape(document.cookie.substring(c_start,c_end))}else{return}}else{return}prvw_start=c.indexOf("PRVW=");if(prvw_start!=-1){prvw_start=prvw_start+5;prvw_end=c.indexOf("&",prvw_start);if(prvw_end==-1){prvw_end=c.length}a=unescape(c.substring(prvw_start,prvw_end))}else{return}var d=a.split("|");if(document.getElementById("numColItems")){var e=parseInt(document.getElementById("numColItems").value,10);for(var b=0;b<d.length;b++){if(document.getElementById("col~"+d[b])!=null){document.getElementById("col~"+d[b]).style.display="none";e--}}if(e!=null&&e<=0){if(document.getElementById("othercollectionitems")!=null){document.getElementById("othercollectionitems").style.display="none"}}}return}function hideSponsoredAds(){var a=(getCookie_yui("CSNHideSponsoredAds")=="1");if(a&&typeof(hideEmptyAdBlock)=="function"){hideEmptyAdBlock(null)}return a}function setSearchCookies(b,a){setSubCookie_yui("Search","Keyword",b.toLowerCase());setSubCookie_yui("Search","DoingPredictiveSearch",a)}function populateSearchBox(){var a=getSubCookie_yui("Search","Keyword");if(document.getElementById("keyword")!=null){if(a!=null&&a!=""&&a!="begriffherstellersku"&&a!="keywordbrandsku"){document.getElementById("keyword").value=a}}}var queryStringObject;function getParamFromQueryString(a){if(queryStringObject==null){queryStringObject=new Object;var b=window.location.search.substring(1).toLowerCase().split("&");for(i=0;i<b.length;i++){pair=b[i].split("=");queryStringObject[pair[0]]=decodeURIComponent(pair[1])}}return queryStringObject[a.toLowerCase()]}function moveParamToFrontOfQueryString(b,f){try{if(b===null||f===null){return b}var a=b.indexOf("?");if(a<0||a+1==b.length){return b}else{var g=b.substring(a+1).toLowerCase().split("&");var d;for(i=0;i<g.length;i++){d=g[i].split("=");if(d[0]==f.toLowerCase()){g.unshift(g.splice(i,1));break}}return b.substring(0,a+1)+g.join("&")}}catch(c){return b}}function loadJSContent(c){var b=document.getElementsByTagName("head")[0];var a=document.createElement("script");a.src=c;a.type="text/javascript";b.appendChild(a)}function loadsescontent(){var P=document.getElementById("sescnt");if(P!=null){var p=P.innerHTML,W="$~$DELIM$~$",Q="",Z="",ab="",n="",I="",Y="",e="",F="",B="",m="",g="",ac="",O=p.split(W),N=document.getElementById("footer_orderrefcode"),U=document.getElementById("basket_link"),u=document.getElementById("basket_link_count"),y=document.getElementById("welcometxt"),S=document.getElementById("myaccount_nav"),l=document.getElementById("collections_top"),J=document.getElementById("myRegistry_nav"),c=document.getElementById("myreg_topnav"),D=document.getElementById("sescnt");if(O.length>=10){Q=O[0];Z=O[1];ab=O[2];n=O[3];I=O[4];Y=O[5];e=O[6];ac=O[7];F=O[8]}if(O.length>=11){Q=O[0];Z=O[1];ab=O[2];n=O[3];I=O[4];Y=O[5];e=O[6];ac=O[7];F=O[8];B=O[9]}if(y!=null){y.innerHTML=Y;D.innerHTML=""}if(N!=null){N.innerHTML=Q;D.innerHTML=""}if(U!=null){U.innerHTML=Z;D.innerHTML=""}if(u!=null){u.innerHTML=ab;D.innerHTML=""}if(S!=null){S.innerHTML=e;D.innerHTML=""}if(J!=null&&F.length>0){J.innerHTML=F;D.innerHTML=""}if(c!=null&&B.length>0){c.innerHTML=B;D.innerHTML=""}if(n!=""){var z=document.getElementById("previouslyviewed_core");if(z!=null){var x=n.split("~#~");if(x.length==2){var v=new YAHOO.util.ImageLoader.group(window,"scroll",2);v.foldConditional=true;v.addTrigger(window,"resize");var X=x[1].split("##");for(i=0;i<X.length;i++){var k=X[i].split("~");v.registerSrcImage(k[0],k[1],"55","55")}z.innerHTML=x[0];D.innerHTML=""}else{z.innerHTML=n;D.innerHTML=""}}}else{var E=document.getElementById("previouslyviewed");if(E!=null){var H=E.parentNode;if(H!=null){H.removeChild(E)}}}if(I!=""){var M=document.getElementById("othertoolsa");var L=document.getElementById("othertoolsb");oiArray=I.split("~!~");if(M!=null){M.innerHTML=oiArray[0];D.innerHTML=""}if(L!=null){L.innerHTML=oiArray[1];D.innerHTML=""}}if(l!=null){var f=document.getElementById("collections_top");if(f!=null){f.innerHTML=m}var C=document.getElementById("collections_core");if(C!=null){C.innerHTML=g}}hideSomeCollectionItems();if(ac!=null&&ac!=""){if(ac.length<=100){parent.location.href=ac}else{var V="#ZZ#";var T=ac.split(V);var K=T[2];var o=T[0];var t="Are you on the right site?";var aa=document.getElementById("atcbody");var R=T[3];setSubCookie_yui("CSNBrief","StayAtCSN"+o+"_"+R,R);if(typeof(aa)=="undefined"||typeof(additempanel)=="undefined"){BuildATCPanel(K,t)}if(additempanel!=null){panelresize(additempanel,700,900);additempanel.show()}atccontent(T[1])}D.innerHTML=""}}}function chksescontent(a){var b=document.getElementById("footer_orderrefcode");if(b==null&&a<10){a=a+1;setTimeout("chksescontent("+a+");",500)}else{loadsescontent()}}function sescontent(a){var b=document.getElementById("sescnt");if(b!=null){b.innerHTML=a}chksescontent(1)}function InsertCarslProducts(a,b){var c=document.getElementById("carslcontent_"+b);if(c!==null){c.innerHTML=a}}function CarouselCallbackWrapper(a){var b={success:function(d){try{InsertCarslProducts(d.responseText,a)}catch(c){CatchAjaxError("carousel error:"+c.message)}},failure:function(c){CatchAjaxError("carousel status:"+c.statusText)}};return b}function GetCarouselProducts(d,g){var f=document.getElementById("carslcontent_"+d.carslId).childNodes;var e=document.getElementById("carslskus_"+d.carslId).value;if(g=="nextpage"){d.index+=d.numPerRow;if(d.index>d.totalProds){d.index-=d.numPerRow}else{for(var c=0;c<f.length;c++){f[c].innerHTML='<img style="margin-left:100px;margin-top:35px;" src="http://common.csnimages.com/common/misc/wait_flower.gif" alt="Loading..." />'}}}else{d.index-=d.numPerRow;if(d.index<1){d.index=1}else{for(var b=(f.length-1);b>=0;b--){f[b].innerHTML='<img style="margin-left:100px;margin-top:35px;" src="http://common.csnimages.com/common/misc/wait_flower.gif" alt="Loading..." />'}}}var a="/asp/public/static/ajax/viewed_by_others.asp?num="+d.numPerRow+"&style="+d.carslStyle+"&sku="+d.sku+"&index="+d.index+"&id="+d.carslId;YAHOO.util.Connect.asyncRequest("GET",a,CarouselCallbackWrapper(d.carslId))}function carslClick(a,b){return function(c){GetCarouselProducts(a,b)}}function carslInit(){YAHOO.util.Event.addListener("nextpage_"+this.carslId,"click",this.click(this,"nextpage"));YAHOO.util.Event.addListener("previouspage_"+this.carslId,"click",this.click(this,"previouspage"))}function Carousel(b,c,e,a,d){this.index=1;this.numPerRow=b;this.totalProds=c;this.sku=e;this.carslStyle=a;this.carslId=d;this.click=carslClick;this.init=carslInit}function startCarousel(a,d,f,b,c){document.getElementById("BestSellerRoundBox-"+a).style.display="block";var e=new Carousel(d,f,b,c,a);e.init()}function loadVideo(e,h,m,b,k,f,g){var g=document.getElementById(g);if(g!=null){g.innerHTML="";var j=document.createElement("a");j.href=e;j.id=k;j.className="video_block";if(h==""){h=e.replace(".flv",".jpg")}j.style.cssText="background-image:url('"+h+"'); background-repeat:no-repeat;height:"+m+"px;width:"+b+"px;";g.appendChild(j);var n=document.createElement("img");n.src="http://common.csnimages.com/common/misc/play_large.png";n.width=83;n.height=83;n.alt=f;n.className="video_play_icon";function l(){n.style.opacity=1}function d(){n.filters.alpha.opacity=100}function a(){n.style.opacity=0.8}function c(){n.filters.alpha.opacity=80}if(n.addEventListener){n.addEventListener("mouseover",l,false);n.addEventListener("mouseout",a,false)}else{if(n.attachEvent){n.attachEvent("onmouseover",d);n.attachEvent("onmouseout",c)}else{n.onmouseover=l;n.onmouseout=a}}j.appendChild(n);flowplayer(k,"http://common.csnimages.com/common/flash/flowplayer-3.2.2.swf",{clip:{autoBuffering:true,scaling:"fit"},play:{width:75,height:75,fadeSpeed:900,rotateSpeed:50}})}};
