//function nytvindue('http://avenplayudv.advsh.net/spil.asp?H=500&B=800&ID=670&BC=000033&type=viden',navn,toolbar,directories,location,status,menubar,scrollbars,resizable,W,H) {         		
//function nytvindue('http://avenplayudv.advsh.net/spil.asp?H=500&B=800&ID=672&BC=000033&type=scor',navn,toolbar,directories,location,status,menubar,scrollbars,resizable,W,H) {         		

function nytvindue(url,navn,toolbar,directories,location,status,menubar,scrollbars,resizable,W,H) {         		
	//alert(screen.availHeight);
	//alert(screen.availWidth);
	var param="";
	param=param+"toolbar="+toolbar+",";
	param=param+"directories="+directories+",";
	param=param+"location="+location+",";
	param=param+"status="+status+",";
	param=param+"menubar="+menubar+",";
	if (screen.availHeight < H) 
	{
	param=param+"scrollbars=yes,";
	}
	else
	{
	param=param+"scrollbars="+scrollbars+",";
	}

	//param=param+"scrollbars="+scrollbars+",";
	param=param+"resizable="+resizable+",";
	param=param+"width="+W+",";
	param=param+"height="+H+",";


	//if (document.all || document.layers) {
   		var wScreen = screen.availWidth;
   		var hScreen = screen.availHeight;
	//}
	var leftPos = (wScreen-W)/2, topPos = (hScreen-H)/2;
	param=param+"top="+topPos+",";
	param=param+"left="+leftPos+"";
	

//window.open('page,html','popup','width=' + popW + ',height=' + popH + ',top=' + topPos + ',left=' + leftPos);

	window.open(url,navn,param);
}


/*
Syntax 
[windowVar = ][window].open("URL", "windowName", ["windowFeatures"])

windowFeatures:
toolbar[=yes|no]|[=1|0]  
location[=yes|no]|[=1|0]   
directories[=yes|no]|[=1|0]   
status[=yes|no]|[=1|0]   
menubar[=yes|no]|[=1|0]   
scrollbars[=yes|no]|[=1|0]   
resizable[=yes|no]|[=1|0]   
width=pixels   
height=pixels

toolbar creates the standard Navigator toolbar, with buttons such as Back and Forward, if true. 
location creates a Location entry field, if true. 
directories creates the standard Navigator directory buttons, such as What's New and What's Cool, if true. 
status creates the status bar at the bottom of the window, if true. 
menubar creates the menu at the top of the window, if true. 
scrollbars creates horizontal and vertical scrollbars when the document grows larger than the window dimensions, if true. 
resizable allows a user to resize the window, if true. 
width specifies the width of the window in pixels. 
height specifies the height of the window in pixels.  
*/


