var setJsCapable=function(){$(document.body).addClass("js");if($(document.body).getElement("p#flash")){alert($(document.body).getElement("p#flash").get("html"));$(document.body).getElement("p#flash").destroy();}ExternalLinks=new ExternalLinksObject();$$("a").each(function(A){if($defined(A.get("href"))&&A.get("href").getHostname()&&A.get("href").getHostname()!==document.domain&&!A.getParent("div#c005")){ExternalLinks.bindEvent(A);}}.bind(this));googleAnalytics();$(document.body).getElements("div#c005 a").each(function(A){if(A.hasClass("rss")){return ;}A.addEvent("click",function(B){B.preventDefault();Logger.log(A.get("href"));window.open(A.get("href"),"share","toolbar=0,width=700,height=400");}.bind(A));});};var setJsLoaded=function(){new OverText($("c002Query"));};var setHeights=function(A){if(A[0]){var B=0;A.each(function(D,C){var E=D.getSize().y;if(E>B){B=E;}});A.each(function(D,C){D.setStyle("height",B+"px");});}else{return false;}};var NewsletterForm=new Class({Implements:Log,initialize:function(A){if(ENABLE_LOGGING){this.enableLog();}this.form=new Element("form",{method:"post",id:"subscribe-form",action:A.get("title")});p1=new Element("p");label=new Element("label",{"for":"c003Query"}).adopt(new Element("span",{html:"E-mail"}));this.input=new Element("input",{id:"c003Query","class":"text",type:"text",title:"E-mail",name:"email"});label.adopt(this.input);p1.adopt(label);p2=new Element("p").adopt(new Element("button",{"class":"submit",type:"submit"}).adopt(new Element("span",{html:"Sign up"})));this.form.adopt(p1,p2);this.form.replaces($("subscribe-form"));this.overtext=new OverText(this.input);$("subscribe-form").addEvent("submit",this.submitEvent.bind(this));},submitEvent:function(A){A.preventDefault();options={async:false};this.form.set("send",options);this.request=this.form.get("send");this.request.addEvent("onRequest",this.submitting.bind(this));this.request.addEvent("onSuccess",this.completed.bind(this));this.form.send();},submitting:function(){this.form.setStyle("display","none");this.loading=new Element("img",{src:"/images/loader.gif"});this.loading.inject(this.form,"after");},completed:function(A){this.log("We have a response, innit");A=JSON.decode(A);this.log(A);this.loading.destroy();if(A.error){alert(A.error);this.form.setStyle("display","block");this.overtext.reposition();}else{if(A.message){new Element("p",{html:"Thanks for signing up to our newsletter"}).replaces(this.form);}}}});window.addEvents({domready:setJsCapable,load:setJsLoaded});String.implement({getHostname:function(){var A=new RegExp("^(?:f|ht)tp(?:s)?://([^/]+)","im");return this.match(A)?this.match(A)[1]:false;}});var Logger=new Log;if(ENABLE_LOGGING){Logger.enableLog();}var k=0;var l=0;document.addEvent("keyup",function(A){if((A.key=="up"&&k==0)||(A.key=="up"&&k==1&&l=="up")||(A.key=="down"&&k==2&&l=="up")||(A.key=="down"&&k==3&&l=="down")||(A.key=="left"&&k==4&&l=="down")||(A.key=="right"&&k==5&&l=="left")||(A.key=="left"&&k==6&&l=="right")||(A.key=="right"&&k==7&&l=="left")||(A.key=="b"&&k==8&&l=="right")||(A.key=="a"&&k==9&&l=="b")||(A.key=="enter"&&k==10&&l=="a")){k++;l=A.key;}else{l=0;k=0;}if(k==10){document.getElement("body").setStyles({"background-image":"url(/images/hamster.gif)","background-color":"#FFF","background-repeat":"repeat"});$("container").setStyle("background-image","none");}});var track=function(A){if(!$defined("G_ANALYTICS")){return ;}try{var B=_gat._getTracker(G_ANALYTICS);B._trackPageview(A?A:null);}catch(C){}};var googleAnalytics=function(){if(!$defined("G_ANALYTICS")){return ;}var A=(("https:"==document.location.protocol)?"https://ssl.":"http://www.");body=document.getElement("body");script=new Element("script",{src:A+"google-analytics.com/ga.js",type:"text/javascript"});body.adopt(script);track.delay(500);};