//<script="javascript">

if (self.location != top.location) top.location = self.location;

img1 = new Image();
img1.src = "img/menu.png";


var ie2 = document.all?true:false;
if (!ie2) document.captureEvents(Event.MOUSEMOVE);
document.onmousemove = getMouseXY;
var openwindow="";

function getMouseXY(e) {
if (startH!=initH) {
  if (ie2) {
    var mouX = event.clientX + document.body.scrollLeft;
    var mouY = event.clientY + document.body.scrollTop;} 
  else { var mouX = e.pageX; var mouY = e.pageY;}
  var docwidth=(ie)? iebody.clientWidth : window.innerWidth;
  if (mouX<(menuleft-10) || mouX>(menuleft+winWidth) || mouY>winHeight) stopIt();
  }
return true
}

var ie = document.all && !window.opera;
var IEfadelength=0.3 //fade in duration for IE, in seconds

function displaywin(winid){
if (openwindow) closewin(openwindow);
openwindow=winid;
var dom=document.getElementById
objref=(dom)? document.getElementById(winid) : document.all.winid;
//var iebody = (document.compatMode=="CSS1Compat")? document.documentElement : document.body;
//var scroll_top=(ie)? iebody.scrollTop : window.pageYOffset;
//var docwidth=(ie)? iebody.clientWidth : window.innerWidth
//objref.style.left = leftx + docwidth/2-objref.offsetWidth/2+"px"
//objref.style.top = topy + scroll_top+"px"
if (objref.filters){
objref.filters[0].duration=IEfadelength
objref.filters[0].Apply()
objref.filters[0].Play()
}
objref.style.visibility="visible"
}

function closewin(winid2){
openwindow="";
var dom=document.getElementById
objref=(dom)? document.getElementById(winid2) : document.all.winid2;
objref.style.visibility="hidden";
}


var openpara="";

function disppara(paraid) {
//if (openpara) hidepara(openpara);
openpara=paraid;
var dom=document.getElementById
objref=(dom)? document.getElementById(paraid) : document.all.paraid;
if (objref.filters) {objref.filters[0].Apply(); objref.filters[0].Play();}
if (objref.style.display=="block") objref.style.display="none"; else objref.style.display="block";
}

function hidepara(paraid) {
openpara="";
var dom=document.getElementById
objref=(dom)? document.getElementById(paraid) : document.all.paraid;
objref.style.display="none";
}


// format:
// text<>website<>email<>we like<>logo pic
function disp(datastring) {
var a='<BR><table width="100%" cellspacing=0 cellpadding=1><td valign="center">';
var compB= new Array();
compB=datastring.split("<>");
a=a+"<b>"+compB[0]+"</b> ";
if (compB[1]) a=a+"<a href='http://"+compB[1]+"' target='_Blank'>"+compB[1]+"</a> &nbsp; ";
if (compB[2]) a=a+"Email: <a href='mailto:"+compB[2]+"'>"+compB[2]+"</a>";
if (compB[3]) a=a+"<BR>We like: "+compB[3];
a=a+'</td><td width="20%" align="center" valign="center">';
if (compB[4]) {if (compB[1]) a=a+'<a href="http://'+compB[1]+'" target="_Blank">';
               a=a+"<img src='links/"+compB[4]+"' border=0>";
			   if (compB[1]) a=a+"</a>";}
a=a+'</td></table>';
document.write(a);		 
}




var cteam,cscore;
var entryn=1;
// format:
// team_name , team_score
function team(team_name, team_score) {
cteam=team_name;
cscore=team_score;
}
// 0=police / 1=guest , surname , police#, guest#, sidebyside#, lady#, poolshootlady#, poolshootmen#
function line(pguest, surname, policenum, guestnum, sidebyside, ladynum, poolshootlady, poolshootmen) {
var sp="&nbsp;";
document.write('<tr><td>'+entryn+'</td><td>'+cteam+'</td><td>'+ ((pguest)?'GUEST':'POLICE') + '</td><td>'+ surname+ '</td><td>'+ ((cscore)?cscore:sp)+ '</td><td>'+ ((policenum)?policenum:sp));
document.write('</td><td>'+ ((guestnum)?guestnum:sp)+ '</td><td>'+ ((sidebyside)?sidebyside:sp)+ '</td><td>'+ ((ladynum)?ladynum:sp)+ '</td><td>'+ ((poolshootlady)?poolshootlady:sp)+ '</td><td>'+ ((poolshootmen)?poolshootmen:sp)+ '</td></tr>');
entryn++;
}





iens6=document.all||document.getElementById
ns4=document.layers

var theobj;
var winHeight = 230;
var rootY = 0;
var winWidth = 138;
var initH=16;
var startH=initH;
var stepH=4;
var framet=6;
var openTimer;


var bottomwin = '<div id="menu" style="width:'+winWidth+'px; height:'+winHeight+'px;">';
bottomwin+= '<a href="index.html" onclick="stopIt();">Home Page</a><BR>';
bottomwin+= '<a href="testeyes.html" onclick="stopIt();">Cross eye dominance</a><BR>';
bottomwin+= '<a href="middle.html" onclick="stopIt();">Middle vision</a><BR>';
bottomwin+= '<a href="how.html" onclick="stopIt();">How it works</a><BR>';
bottomwin+= '<a href="why.html" onclick="stopIt();">Why it works</a><BR>';
bottomwin+= '<a href="testimonials.html" onclick="stopIt();">Testimonials</a><BR>';
bottomwin+= '<a href="reviews.html" onclick="stopIt();">Reviews</a><BR>';
bottomwin+= '<a href="selector.html" onclick="stopIt();">How to buy</a><BR>';
bottomwin+= '<a href="product.html" onclick="stopIt();">Product details</a><BR>';
bottomwin+= '<a href="aboutus.html" onclick="stopIt();">Who we are</a><BR>';
bottomwin+= '<a href="faq.html" onclick="stopIt();">Questions & answers</a><BR>';
bottomwin+= '<a href="terms.html" onclick="stopIt();">Terms of sale</a><BR>';
bottomwin+= '<a href="links.html" onclick="stopIt();">Links</a><BR>';
bottomwin+= '<form style="display:inline;" target="paypal" name="viewcart" action="https://www.paypal.com/cgi-bin/webscr" method="post"><input type="hidden" name="cmd" value="_cart"><input type="hidden" name="business" value="info@easyhit.co.uk"><input type="hidden" name="display" value="1">';
bottomwin+= '<a href="javascript:void(null);" onclick="document.viewcart.submit(); return false;">View Basket</a><BR>';
bottomwin+= '</div>';

//onmouseout="clearTimeout(openTimer);stopIt()"
function ietruebody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function setObj() {
	if(iens6){
	    ctop.style.visibility="hidden";
		thename = "viewer";
		theobj=document.getElementById? document.getElementById(thename):document.all.thename;
		theobj.style.width=winWidth+"px";
			if(iens6&&document.all) {
				theobj.style.top=ietruebody().scrollTop+rootY+"px"
				theobj.innerHTML = ""
				theobj.insertAdjacentHTML("BeforeEnd",bottomwin)
			}
			if(iens6&&!document.all) {
				theobj.style.top=window.pageYOffset+rootY+"px"
				theobj.innerHTML = ""
				theobj.innerHTML = bottomwin; 
			}
	}
	if(ns4){
		ctop.visibility="hidden";
		thename = "nsviewer"
		theobj = eval("document."+thename)
		theobj.moveTo(0,eval(window.pageYOffset+rootY))
		theobj.width=winWidth
		theobj.clip.width=winWidth
		theobj.document.write(bottomwin)
		theobj.document.close()
	}
    var iebody = (document.compatMode=="CSS1Compat")? document.documentElement : document.body;	
	var docwidth = (ie)? iebody.clientWidth : window.innerWidth
    theobj.style.left = menuleft + "px";	
	viewIt();
}

function viewIt() {
	if(startH<=winHeight) {
		if(iens6) {
			theobj.style.visibility="visible"
				if(iens6&&document.all) {
					theobj.style.top=(ietruebody().scrollTop+rootY)-winHeight+startH+"px"
				}
				if(iens6&&!document.all) {
					theobj.style.top=(window.pageYOffset+rootY)-winHeight+startH+"px"
				}
			startH+=stepH;
			a=0; if (ie) a=10;
			theobj.style.width=winWidth+a+"px";
            theobj.style.height=winHeight+a+"px";	
			openTimer=setTimeout("viewIt()",framet)
			}
		if(ns4) {
			theobj.visibility = "visible"
			theobj.moveTo(0,(eval(window.pageYOffset+rootY)-winHeight+startH))
			theobj.height=winHeight;
			theobj.clip.height=(winHeight);
			startH+=stepH;
			openTimer=setTimeout("viewIt()",framet)
		}
	}else{
		clearTimeout(openTimer)
	}
}

function stopIt() {
	if(iens6) {
		theobj.innerHTML = ""
		theobj.style.visibility="hidden"
	    ctop.style.visibility="visible";
	}
	if(ns4) {
		theobj.document.write("")
		theobj.document.close()
		theobj.visibility="hidden"
		theobj.width=0
		theobj.height=0
		theobj.clip.width=0
		theobj.clip.height=0
	    ctop.visibility="visible";		
	}
    startH=initH;
}


function checkform(form) {
var v=document.coupon.code.value;
if (v) {var l=v.substr(0,1).toUpperCase(); 
        var n=v.substr(1,3);
		var c=v.substr(4,2);
		l=l.charCodeAt(0);
		if (l<65 || l>90 || v.length!=6) {alert("Invalid coupon code!"); return false;}
		if ((n+c)*1 != (n+c)) {alert("Invalid coupon code!"); return false;}
		var s=n.substr(0,1)*3+n.substr(1,1)*2+n.substr(2,1)*1+7+Math.max(n.substr(0,1),n.substr(1,1),n.substr(2.1));
		s=s ^ (l-65)
		if (s>99) s+=-99;
		if (s!=c) {alert("Invalid coupon code!"); return false;}
		//remove paypal postage
		var a=form.hosted_button_id.value;
		if (a=="1331632") form.hosted_button_id.value="9961121";
		if (a=="1331961") form.hosted_button_id.value="9961109";
		if (a=="1332172") form.hosted_button_id.value="9961091";
		if (a=="1332390") form.hosted_button_id.value="9961058";
		if (a=="1332262") form.hosted_button_id.value="9961080";
		if (a=="1332439") form.hosted_button_id.value="9961010";
		// Add coupon code as Paypal option
		form.on1.value="Affiliate code";
		form.os1.value=v;
		}
return true;
}		
		
