/**
 * Page updated for positioning the x-axis location of the popup
 * Raheel Khawaja raheel@enetpulse.com
 * LAST UPDATED November 02, 2007
 */
var IE = document.all?true:false
var xLocation = 0;
/**
 * function created to get xlocation of the mouse.
 * @param e 
 */
function getMouseXLocation(e){

	if (IE) { //Get mouse X location for IE
		xLocation = event.clientX + document.body.scrollLeft;
	} else {  //Get mouse X location for firefox and other
		xLocation = e.pageX;
	}
	
	if (xLocation < 0){
		xLocation = 0;
	}
	if(!IE){
		console.log(screen.width);
	}
}

function popup(msg,bak,extra,heighty){
	var content="<TABLE class='tbl' WIDTH=150 BORDER=0 BORDERCOLOR=#999999 CELLPADDING=0 CELLSPACING=0 "+"BGCOLOR="+bak+"><TD ALIGN=center><FONT COLOR=black SIZE=2>"+msg+"</FONT></TD></TABLE>";
	yyy=Yoffseta;
	if(nsa4){
		skna.document.write(content);
		skna.document.close();
		skna.visibility="visible";
		skna.style.left = xLocation+'px';
	}
	if(nsa6){
		document.getElementById("dek").innerHTML=content;
		skna.display='';
		document.getElementById("dek").style.left = xLocation+'px';
	}
	if(iea4){
		document.all("dek").innerHTML=content;
		skna.display='';
		document.all("dek").style.left = xLocation+'px';
	}
	if(iea5){
		document.all("dek").innerHTML=content;
		skna.display='';
		document.all("dek").style.left = xLocation+'px';
	}
/*var hey = heighty * 28;
if(extra==2){
yyy = Yoffseta - hey;
} else {
yyy=Yoffseta;
}
if(nsa4){skna.document.write(content);skna.document.close();skna.visibility="visible";}
if(nsa6){document.getElementById("dek").innerHTML=content;skna.display='';}
if(iea4){document.all("dek").innerHTML=content;skna.display='';}
if(iea5){document.all("dek").innerHTML=content;skna.display='';}*/
}
function kill(){
	yyy=-1000;
	if(nsa4){
		skna.visibility="hidden";
	}else if (nsa6||iea4)
		skna.display="none"
}
	Xoffseta = -156;
	Yoffseta = 20;
	var olda,skna,iexa=(document.all),yyy=-1000;
	var nsa4=document.layers;
	var nsa6=document.getElementById && !document.all
	var iea4=document.all;
	var iea5=document.all;
	if (nsa4)
		skna=document.dek;
	else if (nsa6){
		skna=document.getElementById("dek").style;
	} else if (iea4)
		skna=document.all.dek.style;
	if(nsa4)
		document.captureEvents(Event.MOUSEMOVE);
	else {
		skna.visibility="visible";
		skna.display="none";
	}
document.onmousemove = HideMenus;
function HideMenus(e) {

	getMouseXLocation;
	
	var xa=(nsa4 || nsa6)?e.pageX:event.x + document.body.scrollLeft;
	if(nsa6){
		skna.left = xa+Xoffseta-120 + "px";
	} else {
		skna.left = xa+Xoffseta + "px";
	}
	var ya=(nsa4 || nsa6)?e.pageY:event.y+document.body.scrollTop;
	if(nsa6){
		skna.top = ya+yyy-240 + "px";
	} else {
		skna.top = ya+yyy + "px";	
	}
}
var myimages=new Array()
function preloadimages(){
	for (i=0;i<preloadimages.arguments.length;i++){
		myimages[i]=new Image();
		myimages[i].src=preloadimages.arguments[i];
	}
}
function on(img) {
	img.src="http://sporten.tv2.dk/img/results/compare_on.gif";
}
function off(img) {
	img.src="http://sporten.tv2.dk/img/results/compare.gif";
}
function openpb(newd){
	if(document.getElementById("id"+newd).style.display == ""){
		document.getElementById("id"+newd).style.display = "none";
		document.getElementById("plus"+newd).innerHTML= "+";
	} else {
		document.getElementById("id"+newd).style.display = "";
		document.getElementById("plus"+newd).innerHTML= "-";
	}
}


preloadimages("img/compare.gif","img/compare_on.gif","spacer.gif","img/goal.gif");