﻿var _A=0,_I=0,d=document;if(d.getElementById)_I=1;if(d.all&&!window.opera)_A=1;
function DOM(i,s){if(s)return DOM(i).style;if(_I)return d.getElementById(i);if(_A)return d.all[i];return d.layers[i]}
function AC(a,b){a.appendChild(b)}function RC(a,b){return a.removeChild(b)}function IB(a,b,c){a.insertBefore(b,c)}
function IAH(a,p,b){if(_A)a.insertAdjacentHTML(p,b);else{var r=a.ownerDocument.createRange();r.setStartBefore(a);b=r.createContextualFragment(b);switch(p){case'beforeBegin':IB(a.parentNode,b,a);break;case'afterBegin':IB(a,b,a.firstChild);break;case'afterEnd':if(a.nextSibling)IB(a,b,a.nextSibling);else AC(a.parentNode,b);break;default:return AC(a,b)}}}
function cOpac(ob,a){if(_A){if(a==1)ob.style.filter='none';else ob.style.filter='progid:DXImageTransform.Microsoft.Alpha(opacity='+(a*100)+')'}else ob.style.opacity=''+a}function fPX(s){return s.substr(0,s.length-2)-0}
function GHTTP(){if(window.XMLHttpRequest){var h=new XMLHttpRequest();if(h.overrideMimeType)h.overrideMimeType('text/xml');return h}if(window.ActiveXObject){try{return new ActiveXObject('Msxml2.XMLHTTP')}catch(e){try{return new ActiveXObject('Microsoft.XMLHTTP')}catch(e){}}}work=0;return 0}
function findPos(o){var cl=ct=0;if(o.offsetParent){cl=o.offsetLeft;ct=o.offsetTop;while(o=o.offsetParent){cl+=o.offsetLeft;ct+=o.offsetTop}}return [cl,ct]}
function MMove(e){if(!e)e=event;var x,y,z=findPos(DOM("bobhold"));if(e.x){x=e.x;y=e.y}else{x=e.pageX;y=e.pageY}d.bob.SetVariable('jsActive',true);d.bob.SetVariable('jsX',x-z[0]);d.bob.SetVariable('jsY',y-z[1])}

var curA=1,cw=500,ch=440,cA,cB,sp=0,ii,tml=25;
function swapLeft(){if(sp!=0)return true;sp=tml;cA=DOM('site'+(curA?'A':'B'));cB=DOM('site'+(curA?'B':'A'));curSite--;if(curSite==-1)curSite=sites.length-1;loadToB(curSite);cB.style.left='-'+cw+'px';cOpac(cB,0);cB.style.display='block';if(!curA)cA.style.top='-'+ch+'px';ii=setInterval('sp--;var t=0.5+Math.cos(sp*Math.PI/tml)*0.5;cA.style.left=(t*cw)+"px";cB.style.left=(t*cw-cw)+"px";cOpac(cA,1-t);cOpac(cB,t);if(sp==0){cOpac(cA,1);cOpac(cB,1);cA.style.display="none";cB.style.top="0px";curA=!curA;clearInterval(ii)}',20);return true}
function swapRight(){if(sp!=0)return true;sp=tml;cA=DOM('site'+(curA?'A':'B'));cB=DOM('site'+(curA?'B':'A'));curSite++;if(curSite==sites.length)curSite=0;loadToB(curSite);cB.style.left=cw+'px';cOpac(cB,0);cB.style.display='block';if(!curA)cA.style.top='-'+ch+'px';ii=setInterval('sp--;var t=0.5+Math.cos(sp*Math.PI/tml)*0.5;cA.style.left=(-t*cw)+"px";cB.style.left=(cw-t*cw)+"px";cOpac(cA,1-t);cOpac(cB,t);if(sp==0){cOpac(cA,1);cOpac(cB,1);cA.style.display="none";cB.style.top="0px";curA=!curA;clearInterval(ii)}',20);return true}
function loadToB(n){RC(cB,DOM('site'+(curA?'B':'A')+'2'));IAH(cB,'beforeEnd','<div id="site'+(curA?'B':'A')+'2">'+(sites[n][0]=='#'?'':('<a href="'+sites[n][0]+'" target="_blank">'))+'<img src="img/sites/'+n+'.png" width="500" height="350" alt="Site Thumbnail" title="'+(sites[n][0]=='#'?'This site is not available online" />':'Click to see this site" /></a>')+'<h3>'+sites[n][1]+'</h3><p>'+sites[n][2]+'</p>'+(sites[n][0]=='#'?'<p>This site is not available on the internet for viewing.</p>':('<p>The site can be found <a href="'+sites[n][0]+'" target="_blank">here</a>.</p>'))+'</div>')}

