// Description: Functions for window-handling.

// Description:	Open a new browser-window.
//
// Input:	name - Ikkunan nimi
//				url - Ikkunan kohdeosoite
//				width - Ikkunan leveys
//				height - Ikkunan korkeus
//
function OpenWindow(name, url, width, height) 
{
	var screenX = (screen.availWidth-width)/2;
	var screenY = (screen.availHeight-height)/2;	
	var features = 'left=' + screenX + ',top=' + screenY + ',screenX=' + screenX + ',screenY=' + screenY + ',dependent=1,directories=0,location=0,menubar=0,resizable=1,scrollbars=1,status=0,toolbar=0,width=' + width + ',height=' + height;

	var newWindow = window.open(url, name, features);

	if (newWindow != null)
		newWindow.focus();
}
