var tempCSS = '';



function menuOver(obj, css){

  if (isIE || isNS6 || isOpera){

  tempCSS = obj.className;

  obj.className = css;

  if (isIE || isOpera) obj.style.cursor = 'hand';

  else obj.style.cursor = 'pointer';

}

}

function menuOut(obj){

  if (isIE || isNS6 || isOpera){

  obj.className = tempCSS;

  obj.style.cursor = 'default';

}

}

function menuClick(href, target){

  if (target == 1) location = href;

  else {

   top.location = href;

  }

}

function openWin(url){

var myWin68828 = window.open(url,'DocumentmyWin68828', 'scrollbars=1, location=1, resizable=1, status=1, toolbar=1, menubar=1 width=840, height=640');

}


//IE4=(document.all)


//NS4=(document.layers)


//NS6=document.getElementById


//Mac=(navigator.appVersion.indexOf("Mac")!=-1)











var isNS4 = false;


var isNS6 = false;


var isIE = false;


var isOpera = false;





browserCheck();


//I tilfælde af at enkelte browsere ikke understøttes kan der her linkes videre til "beklager"-side	


//if (isIE) location = 'beklager.html';


if (isNS4) location = '../javascript/beklager.html';


//if (isNS6) location = 'beklager.html';


//if (isOpera) location = 'beklager.html';








function browserCheck(){


	if (parseInt(navigator.appVersion) >= 4) {


		if (navigator.appName == 'Netscape') {


			if (navigator.userAgent.indexOf('Opera') > -1){


				isOpera = true;


			}


			if (parseInt(navigator.appVersion) >= 5)


				isNS6 = true;


			else


				isNS4 = true;


		}


		else if (navigator.appName == 'Opera'){


			isOpera = true;


		}


		else{


			if (navigator.userAgent.indexOf('Opera') > -1){


				isOpera = true;


			}


			else


				isIE = true;


		}


	}


}








function checkLayer(layerStr, name){


	var obj = eval(layerStr + '.' + name);


	if (obj){


		return obj;


	}


	else {


		var myLayer = eval(layerStr + '.layers');


		var len = 0;


		if (myLayer) len = myLayer.length;





		if (len > 0)


		{


			for (var i = 0; i < len; i++){


				var newLayerStr = layerStr + '.layers[' + i + '].document';


				myLayer = eval(newLayerStr);	


				if (myLayer)


				{


					var foundObj = checkLayer(newLayerStr, name);


					if (foundObj){


						return foundObj;


					}


				}


			}


		}


		else{


			var myForm = eval(layerStr + '.forms');


			var len = 0;


			if (myForm) len = myForm.length;





			if (len > 0){


				for (var i = 0; i < len; i++){


					var newFormStr = layerStr + '.forms[' + i + '].' + name;


					myFormElement = eval(newFormStr);	


					if (myFormElement)


						return myFormElement;


					


				}


			}


		}


	}


}








function getObj(idStr){


	if (isNS4){


		return checkLayer('document', idStr);


	}	


	else if (isNS6){


		var obj = document.getElementById(idStr);


		


		if (obj) return obj


		else return checkLayer('document', idStr);


	}


	else{


		return eval('document.all.' + idStr);


	}


}








function showObj(idStr){


	var obj = getObj(idStr);





	if (isOpera){


		obj.style.visibility = "visible";


	}


	else if (isIE){


		obj.style.visibility = "visible";


	}


	else if (isNS6){


		obj.style.visibility = "visible";


	}


	else if (isNS4){


		obj.visibility = "visible";


	}


	return obj;


}





function hideObj(idStr){


	var obj = getObj(idStr);





	if (isOpera){


		obj.style.visibility = "hidden";


	}


	else if (isIE){


		obj.style.visibility = "hidden";


	}


	else if (isNS6){


		obj.style.visibility = "hidden";


	}


	else if (isNS4){


		obj.visibility = "hidden";


	}


	return obj;


}








function setObjClip(idStr, clipLeft, clipTop, clipBottom, clipRight){


var obj = getObj(idStr);


var clipst = 'rect(' + clipTop + ', ' + clipRight + ', ' + clipBottom + ', ' + clipLeft + ')';





if (isNS6){


	oldRect = 'rect(' + obj.offsetTop + ', ' + obj.offsetWidth + ', ' + obj.offsetHeight + ', ' + obj.offsetLeft + ')';


	obj.style.clip = clipst;


}


else if (isNS4)


	with (obj.clip){


		top = clipTop;


		right = clipRight;


		bottom = clipBottom;


		left = clipLeft ;


}


else if (isIE){


	oldRect = 'rect(' + obj.offsetTop + ', ' + obj.offsetWidth + ', ' + obj.offsetHeight + ', ' + obj.offsetLeft + ')';


	obj.style.clip=clipst ;


}


else return null;


}











function getObjPosX(idStr, stopAtID){


	var obj = getObj(idStr);





	if (isOpera){


		temp = obj;


		tempX = 0;


		if (stopAtID != null){


			while (temp.id != stopAtID){


                   tempX += temp.offsetLeft;


                   temp = temp.parentElement;


			}


		


		}


		else{


			while (temp.tagName != 'HTML'){


                   tempX += temp.offsetLeft;


                   temp = temp.parentElement;


			}


		}


		return tempX;


		


	}


	else if (isIE){


		return obj.offsetLeft;


	}


	else if (isNS6){


		return obj.offsetLeft;


	}


	else if (isNS4){


		return obj.left;


	}


	else return null;


}








function getObjPosY(idStr, stopAtID){


	var obj = getObj(idStr);





	if (isOpera){


		temp = obj;


		tempY = 0;


		if (stopAtID != null){


			while (temp.id != stopAtID){


                   tempY += temp.offsetTop;


                   temp = temp.parentElement;


			}


		


		}


		else{


			while (temp.tagName != 'HTML'){


                   tempY += temp.offsetTop;


                   temp = temp.parentElement;


			}


		}


		return tempY;


	}


	else if (isIE){


		return obj.offsetTop;


	}


	else if (isNS6){


		return obj.offsetTop;


	}


	else if (isNS4){


		return obj.top;


	}


	else return null;


}








function getObjHeight(idStr){


	var obj = getObj(idStr);





	if (isOpera){


		//return obj.pixelHeight;


		return obj.style.height;


	}


	else if (isIE){


		return obj.offsetHeight;


	}


	else if (isNS6){


		return obj.offsetHeight;


	}


	else if (isNS4){


		return obj.clip.height;


	}


	else return null;


}








function getObjWidth(idStr){


	var obj = getObj(idStr);





	if (isOpera){


		//return obj.pixelWidth;


		return obj.style.width;


	}


	else if (isIE){


		return obj.offsetWidth;


	}


	else if (isNS6){


		return obj.offsetWidth;


	}


	else if (isNS4){


		return obj.clip.width;


	}


	else return null;


}








function moveObjXY(idStr, x, y){


	var obj = getObj(idStr);





	if (isOpera){


		obj.style.pixelLeft = x;


		obj.style.pixelTop = y;


	}


	else if (isIE){


		obj.style.pixelLeft = x;


		obj.style.pixelTop = y;


	}


	else if (isNS6){


		obj.style.left = x;


		obj.style.top = y;


	}


	else if (isNS4){


		obj.left = x;


		obj.top = y;


	}


	return obj;


}








function moveObjX(idStr, x){


	var obj = getObj(idStr);





	if (isOpera){


		obj.style.pixelLeft = x;


	}


	else if (isIE){


		obj.style.pixelLeft = x;


	}


	else if (isNS6){


		obj.style.left = x;


	}


	else if (isNS4){


		obj.left = x;


	}


	return obj;


}








function moveObjY(idStr, y){


	var obj = getObj(idStr);





	if (isOpera){


		obj.style.pixelTop = y;


	}


	else if (isIE){


		obj.style.pixelTop = y;


	}


	else if (isNS6){


		obj.style.top = y;


	}


	else if (isNS4){


		obj.top = y;


	}


	return obj;


}








function getAvailScreenWidth(){


	if (isIE){


		return document.body.clientWidth;


	}


	else if (isNS6){


		return window.innerWidth;


	}


	else if (isNS4){


		return window.innerWidth;


	}


	else return null;


}





function getAvailScreenHeight(){


	if (isIE){


		return document.body.clientHeight;


	}


	else if (isNS6){


		return window.innerHeight;


	}


	else if (isNS4){


		return window.innerHeight;


	}


	else return null;


}








function getObjZIndex(idStr){


	var obj = getObj(idStr);





	if (isOpera){


		return obj.style.zIndex;


	}


	else if (isIE){


		return obj.style.zIndex;


	}


	else if (isNS6){


		return obj.style.zIndex;


	}


	else if (isNS4){


		return obj.zIndex;


	}


	return obj;


}





function setObjZIndex(idStr, zIndex){


	var obj = getObj(idStr);





	if (isOpera){


		obj.style.zIndex = zIndex;


	}


	else if (isIE){


		obj.style.zIndex = zIndex;


	}


	else if (isNS6){


		obj.style.zIndex = zIndex;


	}


	else if (isNS4){


		obj.zIndex = zIndex;


	}


	return obj;


}





function setObjWidth(idStr, width){


	var obj = getObj(idStr);





	if (isOpera){


		obj.style.pixelWidth = width;


		//obj.width = width;


	}


	else if (isIE){


		obj.style.width = width;


	}


	else if (isNS6){


		obj.style.width = width;


	}


	else if (isNS4){


		obj.width = width;


	}


	return obj;


}





function setObjHeight(idStr, height){


	var obj = getObj(idStr);





	if (isIE){


		obj.style.height = height;


	}


	else if (isNS6){


		obj.style.height = height;


	}


	else if (isNS4){


		obj.height = height;


	}


	if (isOpera){


		obj.style.pixelHeight = height;


	}


	return obj;


}








function numbersOnly(event){


	if (isIE)


		Ch = event.keyCode;


	else if (isNS6){


		Ch = event.which;


		}


	else if (isNS4)


		Ch = event.which;


	else return false;


	if (Ch < 32 | Ch > 47 && Ch < 58){


		var a = getObj('ticketamount').value;


		if (Ch > 47 && Ch < 58){


			a += String.fromCharCode(Ch);


			alert(Ch);


		}


		return true;


	}


	return false;


}









