var ShippingProfile=function(){return{cancelEvent:function(A){if(!A){A=window.event}A.cancelBubble=true;if(A.stopPropagation){A.stopPropagation()}},sCurMod:"",initPage:function(){var D=getObj("where_we_ship");var B=getObj("chat_text");var C=getObj("warning_chat_text");var A="";if(D){ShippingProfile.activateModule(D.getAttribute("data-defaultCountry"))}if(B&&C){A=getChatLink("LiveChat","customerservice@workgroup."+B.getAttribute("data-chatHost"),B.getAttribute("data-chatServer"));if(A!=""){B.innerHTML="with our "+A+" service, ";C.innerHTML="with our "+A+" service, "}}},activateModule:function(E){var C=getObj("container_"+E);var B=getObj("currency_container_"+E);var A=getObj("currency_"+E);var D=getObj("link_"+E);if(C&&B&&A&&D){C.className="active_module";B.style.display="block";D.style.display="inline";A.disabled=false;D.setAttribute("data-submitUrl",D.getAttribute("data-baseServer")+D.getAttribute("data-basePage")+"curr="+A.value+"&pre_context="+D.getAttribute("data-preferredContext"));ShippingProfile.sCurMod=E}},deactivateModule:function(E){var C=getObj("container_"+E);var B=getObj("currency_container_"+E);var A=getObj("currency_"+E);var D=getObj("link_"+E);if(C&&B&&A&&D){C.className="inactive_module";B.style.display="none";D.style.display="none";A.disabled=true}},selectCountry:function(C){var A="";var B=getEventSrc(C);if(B){if(B.id!=ShippingProfile.sCurMod){ShippingProfile.deactivateModule((ShippingProfile.sCurMod));ShippingProfile.activateModule(B.id)}}ShippingProfile.cancelEvent(C)},currencyChange:function(B){var A=getEventSrc(B);var C=null;if(A){C=getObj(A.id.replace("currency_","link_"));if(C){C.setAttribute("data-submitUrl",C.getAttribute("data-baseServer")+C.getAttribute("data-basePage")+"curr="+A.value+"&pre_context="+C.getAttribute("data-preferredContext"))}}ShippingProfile.cancelEvent(B)},switchCountries:function(D){var C=getEventSrc(D);var B,A,E;if(C){B=C.getAttribute("data-submitUrl");A=C.getAttribute("data-oldProductSet");E=C.getAttribute("data-newProductSet");if(A!=E){ShippingProfile.openProductSetWarning()}else{ShippingProfile.redirectUser(B)}}ShippingProfile.cancelEvent(D)},openProductSetWarning:function(){var C=$("#product_set_warning");var F=getObj("warning_dynamic_text");var J=getObj("background_fade");var G=getObj("container_"+ShippingProfile.sCurMod);var E=getObj("link_"+ShippingProfile.sCurMod);var L=E.getAttribute("data-oldCountryName");var B=E.getAttribute("data-newCountryName");var D=0;var H=null;if(C&&F&&J&&G&&E){F.innerHTML="You will lose the contents of your shopping basket when changing from our "+L+" site to our "+B+" site.";var A=$(window).height();var I=$(document).width();var K=$(document).height();C.css({display:"block",left:I/2-(C.width()/2),top:A/2-(C.height()/2)});H=getBrowserSize();J.style.height=K+"px";J.style.width=I+"px";J.style.display="block";window.scrollTo(0,0)}},changeProductSet:function(B){var A=getObj("currency_"+ShippingProfile.sCurMod);var C=getObj("link_"+ShippingProfile.sCurMod);if(A&&C){ShippingProfile.redirectUser(C.getAttribute("data-baseServer")+"default.jsp?curr="+A.value+"&pre_context="+C.getAttribute("data-preferredContext"))}ShippingProfile.cancelEvent(B)},closeProductSetWarning:function(A){var B=getObj("product_set_warning");var C=getObj("background_fade");if(B&&C){B.style.display="none";C.style.display="none"}ShippingProfile.cancelEvent(A)},redirectUser:function(A){window.location=A},ShippingProfileRules:{"#where_we_ship input.country_radio":function(A){addEvent(A,"click",ShippingProfile.selectCountry,false);A=null},"#where_we_ship .currency_menu":function(A){addEvent(A,"change",ShippingProfile.currencyChange,false);A=null},"#where_we_ship img.link_button":function(A){addEvent(A,"click",ShippingProfile.switchCountries,false);A=null},"#product_set_warning div.change_product_set":function(A){addEvent(A,"click",ShippingProfile.changeProductSet,false);A=null},"#product_set_warning div.close_warning, div.background_fade":function(A){addEvent(A,"click",ShippingProfile.closeProductSetWarning,false);A=null}},initShippingProfile:function(){if(Behaviour){Behaviour.registerAndApply(ShippingProfile.ShippingProfileRules);ShippingProfile.initPage()}}}}();if(LoadState.addToLoadQueue){LoadState.addToLoadQueue(ShippingProfile.initShippingProfile,null,"ShippingProfile.initShippingProfile()")};