var clientAreaSliding=false;var slideBoxTop=0;var slideBoxLeft=0;function initCookies(){var A=new String(document.referrer);A=(A.indexOf(document.location.host)!=-1)?"<direct>":document.referrer;var C=new URI(document.location);var B=C.getData("n");if(!B){B="<direct>"}if(!Cookie.read("ref1")){setCookie("ref1",A);setCookie("ref2","<first access>")}else{if(A!="local"){setCookie("ref2",A)}}if(!Cookie.read("ad_ref1")){setCookie("ad_ref1",B);setCookie("ad_ref2","<first access>")}else{if(B!="local"){setCookie("ad_ref2",B)}}}function setCookie(B,C){var A=new Date();A=new Date(A.getFullYear(),A.getMonth()+3,A.getDate());document.cookie=B+"="+escape(C)+"; expires="+A.toGMTString()}function initRelLinks(){$$("a").each(function(C,B){var A=C.getProperty("rel");if(A){if(A.contains("livechat")){C.removeEvents("click");C.addEvent("click",function(D){D.stop();window.open(this.getProperty("href"),"new_blank","width=450,height=360,resizable=no,scrollbars=no,toolbar=no,location=no,menubar=no")})}else{if(A.contains("external")){C.setProperty("target","new_blank")}else{if(A.contains("popup")){C.addEvent("click",function(D){D.stop();window.open(C.getProperty("href"),"new_blank","resizable=yes,titlebar=no,location=no,status=no,menubar=no,toolbar=no")})}}}}})}function initLoginLinks(){$$(".login-link").each(function(B,A){B.setProperty("href","#login");B.addEvent("click",function(C){C.stop();showLoginPopup()})})}function getPageScroll(){var A;if(self.pageYOffset){A=self.pageYOffset}else{if(document.documentElement&&document.documentElement.scrollTop){A=document.documentElement.scrollTop}else{if(document.body){A=document.body.scrollTop}}}return A}function getPageSize(){var C,A;var B,D;if(window.innerHeight&&window.scrollMaxY){C=document.body.scrollWidth;A=window.innerHeight+window.scrollMaxY}else{if(document.body.scrollHeight>document.body.offsetHeight){C=document.body.scrollWidth;A=document.body.scrollHeight}else{C=document.body.offsetWidth;A=document.body.offsetHeight}}if(self.innerHeight){B=self.innerWidth;D=self.innerHeight}else{if(document.documentElement&&document.documentElement.clientHeight){B=document.documentElement.clientWidth;D=document.documentElement.clientHeight}else{if(document.body){B=document.body.clientWidth;D=document.body.clientHeight}}}if(A<D){pageHeight=D}else{pageHeight=A}if(C<B){pageWidth=B}else{pageWidth=C}arrayPageSize=new Array(pageWidth,pageHeight,B,D,C,A);return arrayPageSize}function showErrorsPopup(){var A=$("errors-popup");if(A){showFade();A.setStyles({display:"block"});errorsPopupReposition()}}function showLoginPopup(){var A=$("login-popup");if(A){showFade();A.setStyles({display:"block"});loginPopupReposition()}}function hideErrorsPopup(){var A=$("errors-popup");if(A){A.setStyles({display:"none"})}hideFade()}function hideLoginPopup(){var A=$("login-popup");if(A){A.setStyles({display:"none"})}hideFade()}function errorsPopupReposition(){var B=$("errors-popup");if(B&&B.getStyle("display")=="block"){var A=B.getCoordinates();B.setStyles({left:(Math.round((getWidth()-A.width)/2))+"px",top:(Math.round((getHeight()-A.height)/2)+getScrollTop())+"px"})}}function loginPopupReposition(){var B=$("login-popup");if(B&&B.getStyle("display")=="block"){var A=B.getCoordinates();B.setStyles({left:(Math.round((getWidth()-A.width)/2))+"px",top:(Math.round((getHeight()-A.height)/2)+getScrollTop())+"px"})}}function showFade(){var A=$("fade");if(A){if(Browser.Engine.trident4){$$("select").setStyle("display","none")}A.setStyles({display:"block",position:"absolute",left:"0",top:"0",background:"#000",opacity:"0.6","z-index":100});resizeFade()}}function resizeFade(){var G=$("fade");if(G){var D=getPageSize();var H=$("wrapper");if(H){var A=H.offsetHeight}else{var A=D[1]}G.setStyles({width:(D[4]+"px"),height:(A+"px")})}var D=getPageSize();if(D[4]){var C=document.getElementsByTagName("html");var F=document.getElementsByTagName("body");var B=$("page-width");if(C[0]&&F[0]&&B){if(D[4]<=1024){var E=62}else{if(D[4]<1086&&D[4]>1024){var E=1086-D[4]}else{var E=0}}B.style.paddingLeft=(97-E)+"px";C[0].style.backgroundPosition=(0-E)+"px 0";F[0].style.backgroundPosition=(764-E)+"px 0"}}}function hideFade(){var A=$("fade");if(A){if(Browser.Engine.trident4){$$("select").setStyle("display","block")}A.setStyles({display:"none"})}}function showErrors(){var C=$("errors-popup-content");if(C){C.empty();if(errorMessages.length){var B=new Element("ul",{"class":"errors"}).inject(C);for(var A=0;A<errorMessages.length;A++){new Element("li",{text:(A+1)+". "+errorMessages[A]}).inject(B)}showErrorsPopup()}}}function initErrorsPopup(){var B=$("errors-popup");var A=$("errors-popup-close");if(A&&B){A.setProperty("href","#close");A.addEvent("click",function(C){hideErrorsPopup();C.stop()});if(B.hasClass("visible-by-default")){showErrorsPopup()}}}function initLoginPopup(){var B=$("login-popup");var A=$("login-popup-close");if(B&&A){A.setProperty("href","#close");A.addEvent("click",function(C){hideLoginPopup();C.stop()});if(B.hasClass("visible-by-default")){showLoginPopup()}}}function preloadPopup(){var A=["/images/bg-popup-t.png","/images/bg-popup-b.png","/images/bg-popup-c.png"];new Asset.images(A)}function checkLogin(F,D,C){var B=$(D);var E=$("user-login-error");if(B&&E){var A=B.getProperty("value");if(Validate.isNotEmpty(A)&&Validate.isEmail(A)){B.removeClass("error");E.set("html","");return true}else{B.addClass("error");E.set("html",C)}}return false}function checkPassword(F,B,C){var A=$(B);var E=$("user-password-error");var D=$("hidden-login-action");if(A&&E&&D){if(Validate.isNotEmpty(A.getProperty("value"))||D.getProperty("value")=="forgot"){A.removeClass("error");E.set("html","");return true}else{A.addClass("error");E.set("html",C)}}return false}function checkChatPassword(E,B,C){var A=$(B);var D=$("hidden-login-action");if(A&&D){if(Validate.isNotEmpty(A.getProperty("value"))||D.getProperty("value")=="forgot"){A.removeClass("error");return true}else{A.addClass("error");errorMessages.push(C)}}return false}function initUploadBox(){$$(".upload-box").setStyle("opacity","0.6")}function getGmtOffset(){var E=new Date();var A=new Date(E.getFullYear(),0,1);var D=new Date(E.getFullYear(),6,1);var C=-A.getTimezoneOffset();var B=-D.getTimezoneOffset();return(C<B)?C:B}function setGmtOffset(A){var B=$(A);if(B){B.setProperty("value",getGmtOffset())}}function initLiveChatPopup(){var A=$("live-chat");if(A){A.addEvent("click",function(C){C.stop();var B=window.open("/live-chat","W3SupportLive","width=500,height=490,toolbar=no,status=no,scrollbars=no,menubar=no,resizable=no,location=no");if(B){try{B.focus()}catch(D){}}})}}function isLogin(){var A=window.location.toString();if(A.indexOf("#login-action")!=-1){hideLoginPopup();showLoginPopup()}}function preloadHover(){var A=["/images/btn-deposit-hover.gif","/images/btn-paynow-hover.gif","/images/btn-submit-order-hover.gif","/images/btn-forgot-pass-hover.gif","/images/btn-login-hover.gif","/images/btn-login-chat-hover.gif","/images/btn-post-message-hover.gif","/images/btn-save-account-hover.gif","/images/btn-save-payment-hover.gif","/images/btn-save-payment-details-hover.gif","/images/btn-send-message-hover.gif","/images/btn-send-message2-hover.gif","/images/btn-submit-comment-hover.gif","/images/btn-submit-ticket-hover.gif"];new Asset.images(A)}function initButtonHover(){preloadHover();$$(".button-hover").addEvents({mouseenter:function(){var A=$(this);var B=A.getProperty("src");if(B.indexOf("-hover.gif")==-1){A.setProperty("src",B.replace(".gif","-hover.gif"))}},mouseleave:function(){var A=$(this);A.setProperty("src",A.getProperty("src").replace("-hover.gif",".gif"))}})}window.addEvent("domready",function(){if($("page-width")){$("page-width").style.paddingLeft="0px";$("page-width").className="page-width"}resizeFade();initButtonHover();initLiveChatPopup();initCookies();initRelLinks();initLoginLinks();initLoginPopup();initErrorsPopup();initUploadBox();isLogin();preloadPopup()});window.addEvent("scroll",function(){resizeFade();errorsPopupReposition();loginPopupReposition()});window.addEvent("resize",function(){resizeFade();errorsPopupReposition();loginPopupReposition()});