var popupHandle;

function closePopup()
{
	if(popupHandle != null && !popupHandle.closed) popupHandle.close();
}

function displayPopup(url,name,height,width)
{
	var properties = "location=0, scrollbars,resizable, menubar=0, status=0, titlebar=0, toolbar=0, height = " + height;
	properties = properties + ", width=" + width;
	var leftprop, topprop, screenX, screenY, cursorX, cursorY, padAmt;
	if(navigator.appName == "Microsoft Internet Explorer")
	{
		screenY = document.body.offsetHeight;
		screenX = window.screen.availWidth;
	}
	else
	{
		screenY = window.outerHeight
		screenX = window.outerWidth
	}
	leftvar = (screenX - width) / 2;
	rightvar = (screenY - height) / 2;
	if(navigator.appName == "Microsoft Internet Explorer")
	{
		leftprop = leftvar;
		topprop = rightvar;
	}
	else
	{
		leftprop = (leftvar - pageXOffset);
		topprop = (rightvar - pageYOffset);
	}
	properties = properties + ", left = " + leftprop;
	properties = properties + ", top = " + topprop;
	closePopup();
	popupHandle = open(url,name,properties);
}

