// JavaScript Document

function Lvl_openWin(u,n,w,h,l,t,c,f,x) 
{ //v1.0 4LevelWebs
	var ww=((screen.width-w)/2);
	if(c==1)
	{
		l=ww;
		t=(screen.height-h)/2;
	}
	if(c==2)
	{
		l=ww
	}
	//f+=',top='+t+',left='+l;
	LvlWin = window.open(u,n,f);
	//if(x==1)
	//{
		LvlWin.focus()
	//}
	document.MM_returnValue=false;
}


function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
	var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
	if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}


function checkFormFocus(e, f) {
	if(window.event) // IE
		keynum = e.keyCode
	else if(e.which) // Netscape/Firefox/Opera
		keynum = e.which
	
	if(keynum == 13) {
		document.forms[f].submit();
		return true;
	}
	return true;
}

// VIDEOPLAYER FUNCTIONS
function openWinPlayer(u,n,w,h,l,t,c,f,x) {
	var ww=((screen.width-w)/2);
	if(c==1)
	{
		l=ww;
		t=(screen.height-h)/2;
	}
	if(c==2)
	{
		l=ww
	}
	f += ',top ='+t+',left='+l;
	LvlWin = window.open(u,n,f);
	if(x==1)
	{
		LvlWin.focus()
	}
	// hack Syrous 
	LvlWin.resizeTo(w, h);
	if(c==1)
	{
		var bw = (screen.width-w)/2;
		var bh = (screen.height-h)/2;
		LvlWin.moveTo(bw, bh);
	}
	document.MM_returnValue=false;
}
function open_player(event_id) {
	var width=screen.availWidth;
	var height=screen.availHeight;
	// Case kleiner gleich 1024 ffnet PLayer Fullscreen mit der vorhanden Screengre
	if(width<=1024)
	{
		openWinPlayer('videoplayer.cfm?event_id=' + event_id,'v2b_videoplayer',width,height,'0','0','1','width=' + width + ',height=' + height,'1');	
	}
	// Case grer 1024 und kleiner gleich 1280
	else if ((width > 1024) && (width <= 1280))
	{
		width = 1058;
		height = 770;
	}
	// Case grer 1280 und kleiner gleich 1280
	else if (width > 1280)
	{
		width = 1306;
		height = 855;
	}
	openWinPlayer('videoplayer.cfm?event_id=' + event_id,'v2b_videoplayer',width,height,'0','0','1','width=' + width + ',height=' + height, '1');	
}
