var PopUpWin = null;
var varFormName=null;
var varChildWindow=null;
//--------------------------------------------------------------------
//Function Name:	OpenPopup(URL, Params)
//
//Description:		This function accepts a URL and opens the URL in
//					a small popup window that does not have any
//					standard toolbars or menus.
//
//Input:			URL = web address to open
//					Params = parameters for the popup window
//--------------------------------------------------------------------
function OpenPopUp(URL, Name, Params, FormName)
{
    var browserType = navigator.userAgent.toLowerCase();
	//URL = URL.toLowerCase(); 
	//close the zoom window if they currently have it open
	if (PopUpWin && (navigator.appName == "Microsoft Internet Explorer"))
	{
		PopUpWin.close();
	}
	if (URL.indexOf("PopUpBlocked=true") > 0);
	{
	    URL = URL.replace("&PopUpBlocked=true","");
	    URL = URL.replace("?PopUpBlocked=true","");
	}
	//open the window
    if (browserType.indexOf("opera") < 0) //not opera
	{
	    PopUpWin=window.open(URL, Name, Params);
	    if (PopUpWin)
	    {
	        // popup successfully created
	        // set window as the focus
		    PopUpWin.focus();
	    }
	    else 
	    {
	        if (URL.indexOf("zoom") < 0) //not pan&zoom
	        {
                URL += '&PopUpBlocked=true'
                location.href = URL
	        }
	    }
    }
	else //opera kills the code if open window attempted - must redirect automatically
	{
        if (strUrl.indexOf('zoom') < 0) //not pan&zoom
        {
            strUrl = strUrl + '&PopUpBlocked=True'
            location.href = strUrl
        }
	}
	varChildWindow = PopUpWin;
    if (FormName != null || '')
    {
	    varFormName = FormName;
	    return true;
	}
}

function closeChildWindow()
{
    if (varChildWindow != null)
    {
        if (varChildWindow.closed == false)
        {
            varChildWindow.close();
        }
    }
}
