var objPWin = null;	

function openWindow(url,height,width) {
	//var leftdist = 0;    // distance to left edge of window
	//var topdist = 0;     // distance to top edge of window

	var properties = "toolbar = 0, location = 0, height = " + height;
	properties = properties + ", width=" + width + ", scrollbars=yes, resizable=no";
	var leftprop, topprop, screenX, screenY, cursorX, cursorY, padAmt;

	if(navigator.appName == "Microsoft Internet Explorer") 
	{
		screenY = document.body.offsetHeight;
		screenX = window.screen.availWidth;
		evnt = true;
	}
	else 
	{
		evnt = false;
		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);
	}

	if(evnt) 
	{
		properties = properties + ", left = " + leftprop;
		properties = properties + ", top = " + topprop;
	}

	
	//*** Check if the window exist, if it is open and have not been closed yet.
	//*** If yes, then close it.
	if (objPWin && objPWin.open && !objPWin.closed) objPWin.close();
	
	//*** Create window instance
	objPWin = window.open("","",properties);
	
	//*** Bring in a web page in to the window
	objPWin.location = url;

}
