﻿var helpPopup='';
var helpHeight=600;
var helpWidth=400;

function OpenHelp(pageToPoint)
{
    var str = "height=" + helpHeight + ",innerHeight=" + helpHeight + ",width=" + helpWidth + ",innerWidth=" + helpWidth+",location=no,status=no,toolbar=no,menubar=no,titlebar=no,resizable=yes,scrollbars=yes" ;
	var url=pageToPoint;
	
	if (window.screen) 
	{
        var ah = screen.availHeight - 30;
        var aw = screen.availWidth - 10;
        var xc = (aw - helpWidth) / 2;
        var yc = (ah - helpHeight) / 2;
        str += ",left=" + xc + ",screenX=" + xc;
        str += ",top=" + yc + ",screenY=" + yc;
    }
            
    var WindowAlreadyOpened =false
    try
    {
        WindowAlreadyOpened=helpPopup!='' && !helpPopup.closed && helpPopup.location;
    }
    catch(ex){}
    
    if (WindowAlreadyOpened) 
        helpPopup.location.href = url;
    else
	    helpPopup=window.open(url, "", str);	
	
	try
	{
		    
	if (!helpPopup.opener)
        helpPopup.opener = self;
    
    if (window.focus) 
        helpPopup.focus();
    }
	catch(ex){}
}

function CloseHelp()
{
    try
    {
        if(helpPopup!='' && !helpPopup.closed && helpPopup.location)
            helpPopup.close();
    }
    catch(ex){}
}
