String.implement({getHostname:function(){var A=new RegExp("^(?:f|ht)tp(?:s)?://([^/]+)","im");return this.match(A)?this.match(A)[1]:false;}});var ExternalLinksObject=new Class({initialize:function(){this.overlay=new Element("div",{id:"site-overlay",styles:{height:document.getElement("body").getDimensions().y,opacity:0.6,display:"none",cursor:"pointer",position:"absolute",left:0,top:0,right:0,width:"100%",background:"#000","z-index":500}});this.overlay.addEvent("click",function(A){this.hide();}.bind(this));this.container=new Element("div",{id:"link-message",styles:{"text-align":"center",position:"absolute",top:"40%",opacity:1,background:"#000",padding:"10px",width:"30%",left:"50%","margin-left":"-15%",display:"none","z-index":501}});this.container.adopt(new Element("p",{html:"You are about to leave this site and open"}));this.urlElement=new Element("strong");this.container.adopt(new Element("p").adopt(this.urlElement));this.container.adopt(new Element("p",{html:"Please choose whether you'd like to launch the new website in this window or a new one:"}));this.thisWindow=new Element("a",{text:"Use this window"});this.thisWindow.addEvent("click",function(A){Cookie.write("links","same",{domain:document.domain,path:"/"});this.track();this.hide();}.bind(this));this.newWindow=new Element("a",{text:"Open a new window",target:"_blank"});this.newWindow.addEvent("click",function(A){Cookie.write("links","new",{domain:document.domain,path:"/"});this.track();this.hide();}.bind(this));links=new Element("p");links.adopt(this.thisWindow);links.appendText(" / ");links.adopt(this.newWindow);this.container.adopt(links);document.getElement("body").grab(this.overlay,"top");document.getElement("body").adopt(this.container);},bindEvent:function(A){A.addEvent("click",function(B){if(Cookie.read("links")=="new"){this.track();A.set("target","_blank");}else{if(Cookie.read("links")=="same"){this.track();return true;}else{B.preventDefault();this.url=A.get("href");this.show();}}}.bind(this));},show:function(){this.urlElement.set("text",this.url);this.thisWindow.set("href",this.url);this.newWindow.set("href",this.url);this.overlay.setStyle("display","block");this.container.setStyle("display","block");},hide:function(){this.overlay.setStyle("display","none");this.container.setStyle("display","none");},track:function(){try{var B=_gat._getTracker(GOOGLE_ID);B._trackPageview();cleansed=this.url.replace("http://","");var A="/outgoing/"+cleansed;B._trackPageview(A);}catch(C){}}});