function open_window( url, title, w, h ) 
{
	var winl = (screen.width - w) / 2;
    var wint = (screen.height - h) / 2;
    winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no';
	win = window.open(url, title, winprops);
	if(win.focus) { win.focus(); }	
}

function getWindowHeight() {
	// try this version first, as it is a better value
	// when both are present in case the body is smaller
	// than the window frame
	if (window.innerHeight && window.innerHeight > 0) {
		// netscape
		return window.innerHeight;
	}
	
	// workaround for IE7 not setting document.body.offsetHeight
	// the offsetHeight is correctly set in the HTML element, not the BODY
	obj = document.getElementsByTagName('html')[0];
	if (obj.offsetHeight && obj.offsetHeight > 0) {
		return obj.offsetHeight;
	}
	
	if (document.body.offsetHeight && document.body.offsetHeight > 0) {
		// DOM
		return document.body.offsetHeight;
	}
	
	//return null;
	return 400;
}

/* gets the window width in cross platform form */
function getWindowWidth() {
	// try this version first, as it is a better value
	// when both are present in case the body is smaller
	// than the window frame
	
	if (window.innerWidth && window.innerWidth > 0) {
		// netscape
		return window.innerWidth;
	}
	
	/*
	if (document.body.offsetWidth && document.body.offsetWidth > 0) {
		// DOM
		return document.body.offsetWidth;
	}
	alert('ciao');
	return null;
	*/
}

function open_help( bm, larghezza, altezza ) {
	mywin = window.open( bm, 'SbrausHelp', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width='+larghezza+',height='+altezza+',left=100,top=100');
	mywin.focus();
}