/*
	Finestre ausiliarie()

	Author: Deiro Claudio
	Author Email: deiro@livio.it
*/

var popWnd = null;

function openAux(href, w, h)
{
	if (popWnd && !popWnd.closed) popWnd.close();
	
	var winWidth = w;
	var winHeight = h;
	var xPos = (screen.availWidth-winWidth)/2;
	var yPos = (screen.availHeight-winHeight)/2;

	popWnd = this.open(href, "_blank", "innerWidth=" + w + ",innerHeight=" + h + ",width=" + w + ",height=" + h + ",titlebar=no,toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no,status=no,top=" + yPos + ",left=" + xPos);
}

function openAuxRes(href, w, h)
{
	if (popWnd && !popWnd.closed) popWnd.close();
	
	var winWidth = w;
	var winHeight = h;
	var xPos = (screen.availWidth-winWidth)/2;
	var yPos = (screen.availHeight-winHeight)/2;

	popWnd = this.open(href, "_blank", "innerWidth=" + w + ",innerHeight=" + h + ",width=" + w + ",height=" + h + ",titlebar=no,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes,status=no,top=" + yPos + ",left=" + xPos);
}

function popClose()
{
	if (popWnd && !popWnd.closed) popWnd.close();
}

function openInOpener(turl) {
	if (typeof(opener) == "object" && opener != null && ! opener.closed) {
		opener.location.href = turl;
	} else {
		opener = open(turl);
	}}

window.onunload = popClose;
