var newwindow;
var helpWidth=300;
var helpHeight=150;
var halfHelpWidth=helpWidth/2;
var halfHelpHeight=helpHeight/2;
function showHelp(url,x,y)
{
	// check for invalid x position from mouse
	if(isNaN(x))
	{
		// if we couldn't get mouse position, set values to -1
		x = -1;
		y = -1;
	}
	var browserx = window.screenLeft;
	var browsery = window.screenTop;
	if(isNaN(browserx))
	{
		// if we couldn't get browser position, set values to -1 
		browserx = -1;
		browsery = -1;
	}
	var popupx = x + browserx - 30;	// place 'close' link right where mouse is
	var popupy = y + browsery - 55;	// place 'close' link right where mouse is
//	var popupx=((browserx + x) - halfHelpWidth);	// center popup to mouse position
//	var popupy=((browsery + y) - halfHelpHeight);	// center popup to mouse position


	
	// center popup on screen if we couldn't use mouse position
	if(x == -1)
	{
		var wx = window.innerWidth;
		var wy = window.innerHeight;
		
		if(typeof(wx)=="undefined")
		{
			// we couldn't get window size to caluclate center... so, just hardcode some safe values
			popupx = 350;
			popupy = 300;
		}
		else
		{
			popupx=((wx / 2) - halfHelpWidth);	// center popup to mouse position
			popupy=((wy / 2) - halfHelpHeight);	// center popup to mouse position
		}
	}

	

	// IE & Netscape params
	var params = "";
	params += "width=" + helpWidth;
	params += ",height=" + helpHeight;
	params += ",screenX=" + popupx;
	params += ",screenY=" + popupy;
	params += ",top=" + popupy;
	params += ",left=" + popupx;
	params += ",resizable=yes,scrollbars=yes";
	newwindow=window.open(url,'_help',params);
	
	if (window.focus) {newwindow.focus()}
}
