function changeColumns(changeValue,arrowLink){if(changeValue>0)changeValue=0;if((/Opera[\/\s](\d+\.\d+)/.test(navigator.userAgent))||(/MSIE (\d+\.\d+);/.test(navigator.userAgent))){addedValue=changeValue*(780-2);}
else{addedValue=changeValue*780;}
newValue=addedValue;eggValue=addedValue+8580;var mess=new Array('Earth (n):<br />Mostly harmless.','Earth (n):<br />Mostly harmless.','Earth (n):<br />Mostly harmless.','Earth (n):<br />Mostly harmless.','End of chapter. Please select new from table of contents.','The end of time has come in rhyme.','&hellip;','Don&rsquo;t read on.','Halt!','You have too much time on your hands.<br />Congratulations!','&pi;: the food of a nation.','&#63743;: a healthy snack.','Do you know where your towel is?','&raquo;----&rsaquo;','<a href="http:\/\/xkcd.com">xkcd<\/a>','&nbsp;&nbsp;.,$8NDO$$ZOOD?...&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;,8N7:ND8OO88NM~ONND:.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />:O8~N8DOZOZOZOONM+8DDM8+,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />=O~ND88OOZOOZZZ8DM+NMMNMM8:.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />=7MD8O8O$O8DDO8Z8NN8NMMMMMN8~..&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />?Z8D+8OZOOO8OOO8DN=DMMMMMMNDDN+,&nb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sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;..O,,?+OZ8DODNNN:.&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;....:$ZZ$,..');var max=mess.length;var num=Math.floor((Math.random()*max));if(/MSIE (\d+\.\d+);/.test(navigator.userAgent)){document.getElementById("columnified").style.marginLeft=newValue+'px';if(arrowLink=='next'){totalChanges=changeValue-1;document.getElementById('anext').onclick=function(){changeColumns(totalChanges,'next');}
secondChanges=totalChanges+2;document.getElementById('aprevious').onclick=function(){changeColumns(secondChanges,'previous');}
if(secondChanges<1){document.getElementById('previous').style.visibility="visible";}
else{document.getElementById('previous').style.visibility="hidden";}}
if(arrowLink=='previous'){totalChanges=changeValue+1;document.getElementById('aprevious').onclick=function(){changeColumns(totalChanges,'previous');}
secondChanges=totalChanges-2;document.getElementById('anext').onclick=function(){changeColumns(secondChanges,'next');}
if(totalChanges<1){document.getElementById('previous').style.visibility="visible";}
else{document.getElementById('previous').style.visibility="hidden";}}}
else{if(newValue+8580>0){fade('columniser',100,50,500);}
setTimeout(function(){animateSlide(newValue,1,20,arrowLink)},250);if((eggValue==0)||(eggValue<0)){document.getElementById("easteregg").style.visibility="visible";document.getElementById("easteregg").style.marginTop="0px";document.getElementById("easter").innerHTML=(mess[num]);}
if(eggValue>0){document.getElementById("easteregg").style.visibility="hidden";document.getElementById("easteregg").style.marginTop="-30px";document.getElementById("easter").innerHTML="";}
if(arrowLink=='next'){totalChanges=changeValue-1;document.getElementById('anext').onclick=function(){changeColumns(totalChanges,'next');}
secondChanges=totalChanges+2;document.getElementById('aprevious').onclick=function(){changeColumns(secondChanges,'previous');}
if(secondChanges<1){document.getElementById('previous').style.visibility="visible";}
else{document.getElementById('previous').style.visibility="hidden";}}
if(arrowLink=='previous'){totalChanges=changeValue+1;document.getElementById('aprevious').onclick=function(){changeColumns(totalChanges,'previous');}
secondChanges=totalChanges-2;document.getElementById('anext').onclick=function(){changeColumns(secondChanges,'next');}
if(totalChanges<1){document.getElementById('previous').style.visibility="visible";}
else{document.getElementById('previous').style.visibility="hidden";}}}}
function animateSlide(newValue,iteration,stepLength,arrowLink)
{if(/Opera[\/\s](\d+\.\d+)/.test(navigator.userAgent)){if(iteration<13)
{if(arrowLink=='next'){slidingMargin=newValue+60*(13-iteration);}
if(arrowLink=='previous'){slidingMargin=newValue-60*(13-iteration);}
document.getElementById("columniser").style.marginLeft=slidingMargin+'px';iteration++;setTimeout(function(){animateSlide(newValue,iteration,stepLength,arrowLink)},3);}
else{document.getElementById("columniser").style.marginLeft=newValue+'px';if(newValue+8580>0){fade('columniser',50,100,500);}}}
else{if(iteration<26)
{if(arrowLink=='next'){slidingMargin=newValue+30*(26-iteration);}
if(arrowLink=='previous'){slidingMargin=newValue-30*(26-iteration);}
document.getElementById("columniser").style.marginLeft=slidingMargin+'px';iteration++;setTimeout(function(){animateSlide(newValue,iteration,stepLength,arrowLink)},3);}
else{document.getElementById("columniser").style.marginLeft=newValue+'px';if(newValue+8580>0){fade('columniser',50,100,500);}}}}
function setOpacity(eID,opacityLevel){var eStyle=document.getElementById(eID).style;eStyle.opacity=opacityLevel/100;eStyle.filter='alpha(opacity='+opacityLevel+')';}
function fade(eID,startOpacity,stopOpacity,duration){var speed=Math.round(duration/100);var timer=0;if(startOpacity<stopOpacity){for(var i=startOpacity;i<=stopOpacity;i++){setTimeout("setOpacity('"+eID+"',"+i+")",timer*speed);timer++;}return;}
for(var i=startOpacity;i>=stopOpacity;i--){setTimeout("setOpacity('"+eID+"',"+i+")",timer*speed);timer++;}}
function getElm(eID){return document.getElementById(eID);}
function show(eID){getElm(eID).style.display='block';}
function hide(eID){getElm(eID).style.display='none';}
function fadeIn(eID){setOpacity(eID,0);show(eID);var timer=0;for(var i=1;i<=100;i++){setTimeout("setOpacity('"+eID+"',"+i+")",timer*5);timer++;}}
function fadeOut(eID){var timer=0;for(var i=100;i>=1;i--){setTimeout("setOpacity('"+eID+"',"+i+")",timer*3);timer++;}
setTimeout("hide('"+eID+"')",310);}
window.onload=function(){autoComments();applyDefaultValue(document.getElementById('s'),'Search');applyDefaultValue(document.getElementById('author'),'Name');applyDefaultValue(document.getElementById('email'),'E-mail (not published)');applyDefaultValue(document.getElementById('url'),'Website (optional)');applyDefaultValue(document.getElementById('comment'),'Comment');applyDefaultValue(document.getElementById('wpcf_your_name'),'Name');applyDefaultValue(document.getElementById('wpcf_email'),'E-mail');applyDefaultValue(document.getElementById('wpcf_website'),'Website (optional)');applyDefaultValue(document.getElementById('wpcf_subject'),'Subject');applyDefaultValue(document.getElementById('wpcf_msg'),'Message');applyDefaultValue(document.getElementById('wpcf_response'),'What is Peter\'s surname (last/family name)?');}
function applyDefaultValue(elem,val){if(elem!=null){elem.style.textAlign='center';elem.value=val;elem.onfocus=function(){if(this.value==val){this.style.textAlign='left';this.value='';}}
elem.onblur=function(){if(this.value==''){this.style.textAlign='center';this.value=val;}}}}
function checkSearch(){if(document.getElementById('s').value=='Search'){alert('Please fill in a search term.');return false;}
return true;}
function checkComment(){if(document.getElementById('author').value=='Name'){alert('Please write your name.');return false;}
else if(document.getElementById('email').value=='E-mail (not published)'){alert('Please write your e-mail address.');return false;}
else if(document.getElementById('comment').value=='Comment'){alert('Please write a comment.');return false;}
else if(document.getElementById('url').value=='Website (optional)'){document.getElementById('url').value='';}
return true;}
function checkEmail(){if(document.getElementById('wpcf_your_name').value=='Name'){alert('Please write your name.');return false;}
else if(document.getElementById('wpcf_email').value=='E-mail'){alert('Please write your e-mail address.');return false;}
else if(document.getElementById('wpcf_subject').value=='Subject'){alert('Please write a subject.');return false;}
else if(document.getElementById('wpcf_msg').value=='Message'){alert('Please write a message.');return false;}
else if(document.getElementById('wpcf_response').value=='What is Peter\'s surname (last/family name)?'){alert('Please answer the anti-spam question.');return false;}
else if(document.getElementById('wpcf_website').value=='Website (optional)'){document.getElementById('wpcf_website').value='';}
return true;}
var PANEL_NORMAL_CLASS="panel";var PANEL_COLLAPSED_CLASS="panelcollapsed";var PANEL_HEADING_TAG="h2";var PANEL_CONTENT_CLASS="panelcontent";var PANEL_ANIMATION_DELAY=10;var PANEL_ANIMATION_STEPS=20;function setUpPanels()
{var headingTags=document.getElementsByTagName(PANEL_HEADING_TAG);for(var i=0;i<headingTags.length;i++)
{var el=headingTags[i];if(el.parentNode.className!=PANEL_NORMAL_CLASS&&el.parentNode.className!=PANEL_COLLAPSED_CLASS)
continue;var name=el.firstChild.nodeValue;el.onclick=function()
{var target=this.parentNode;var name=this.firstChild.nodeValue;var collapsed=target.className==PANEL_COLLAPSED_CLASS;animateTogglePanel(target,collapsed);};}}
function autoComments()
{var loc=window.location.href.toLowerCase();if(loc.indexOf("#comment")!=-1){var target=document.getElementById('paneldiv');var collapsed=target.className==PANEL_COLLAPSED_CLASS;animateTogglePanel(target,collapsed);}}
function animateTogglePanel(panel,expanding)
{var elements=panel.getElementsByTagName("div");var panelContent=null;for(var i=0;i<elements.length;i++)
{if(elements[i].className==PANEL_CONTENT_CLASS)
{panelContent=elements[i];break;}}
panelContent.style.display="block";var contentWidth=panelContent.offsetWidth;if(expanding)
panelContent.style.width="0px";var stepWidth=contentWidth/PANEL_ANIMATION_STEPS;var direction=(!expanding?-1:1);if(/MSIE (\d+\.\d+);/.test(navigator.userAgent)){var ieversion=new Number(RegExp.$1)
if(ieversion>=8){document.getElementById('paneltitle').style.marginTop="0px";}
else if(ieversion>=7){document.getElementById('paneltitle').style.marginTop="-600px";}}
setTimeout(function(){animateStep(panelContent,1,stepWidth,direction)},PANEL_ANIMATION_DELAY);}
function animateStep(panelContent,iteration,stepWidth,direction)
{if(iteration<PANEL_ANIMATION_STEPS)
{var panelLength=Math.round(((direction>0)?iteration:PANEL_ANIMATION_STEPS-iteration)*(340/PANEL_ANIMATION_STEPS));if(panelLength<35){panelWidth=0}
else{panelWidth=panelLength-35}
panelContent.style.width=panelWidth+"px";document.getElementById('paneltitle').style.marginLeft=Math.round(((direction>0)?iteration:PANEL_ANIMATION_STEPS-iteration)*(340/PANEL_ANIMATION_STEPS))+"px";if(/MSIE (\d+\.\d+);/.test(navigator.userAgent)){var ieversion=new Number(RegExp.$1)
if(ieversion>=8){document.getElementById('paneltitle').style.marginTop="0px";}
else if(ieversion>=7){document.getElementById('paneltitle').style.marginTop="-600px";}}
document.body.style.minWidth=914+Math.round(((direction>0)?iteration:PANEL_ANIMATION_STEPS-iteration)*(340/PANEL_ANIMATION_STEPS))+"px";document.getElementById('container').style.left="-"+Math.round(((direction>0)?iteration:PANEL_ANIMATION_STEPS-iteration)*(180/PANEL_ANIMATION_STEPS))+"px";stepVisibility(direction,'commentseparator',0);stepVisibility(direction,'comments',0);stepVisibility(direction,'commentlist',0);stepVisibility(direction,'respond',0);stepVisibility(direction,'commentform',0);iteration++;setTimeout(function(){animateStep(panelContent,iteration,stepWidth,direction)},PANEL_ANIMATION_DELAY);}
else
{panelContent.parentNode.className=(direction<0)?PANEL_COLLAPSED_CLASS:PANEL_NORMAL_CLASS;document.getElementById('panelsubdiv').style.marginLeft="";document.getElementById('container').style.left=(direction<0)?'':'-180px';document.body.style.minWidth=(direction<0)?'':'1254px';stepVisibility(direction,'commentseparator',1);stepVisibility(direction,'comments',1);stepVisibility(direction,'commentlist',1);stepVisibility(direction,'respond',1);stepVisibility(direction,'commentform',1);document.getElementById('paneltitle').style.marginLeft=document.getElementById('paneltitle').style.marginTop="";panelContent.style.display=panelContent.style.width="";if(direction>0){var objDiv=document.getElementById("commentlist");if(objDiv!=null){objDiv.scrollTop=objDiv.scrollHeight;}}}}
function stepVisibility(direction,eID,val){var elem=document.getElementById(eID);if(elem!=null){if(val==1){elem.style.display='';if(direction<0){elem.style.opacity=elem.style.filter='';}else{if(/MSIE (\d+\.\d+);/.test(navigator.userAgent)){}else{fade(eID,0,100,500);}}}
else{elem.style.display='none';}}}
if(window.addEventListener)
{window.addEventListener("load",setUpPanels,false);}
else
if(window.attachEvent)
{window.attachEvent("onload",setUpPanels);}