// Modified slighly but taken directly from the following source...
//Copyright Patrick Roebuck roebuck@v-page.com www.v-page.com
var newWindow;
var newWindowSimple;
var newWindowSimpleProc;
var helpWindow;
var helpWindowSimple;
var helpWindowSimpleProc;
var strProjectFramesPagePlus = "Welcome_Page.htm#";//defines the name of the start or frameset page for the WebHelp project
var strProjectPath;
var strHelpPage;
var isNav4 = (navigator.appName == "Netscape" && parseInt(navigator.appVersion) == 4);

function callHelp(strProjectPath, strHelpPage)
{
    var strTriHelpWindowOptions = ",toolbar=yes";    //defines whether to display the toolbar (yes) or hides it (no)
    strTriHelpWindowOptions += ",scrollbars=yes";    //defines the distance from the top of the screen that the browser window is opened
    strTriHelpWindowOptions += ",top=0";            //defines the distance from the top of the screen that the browser window is opened
    strTriHelpWindowOptions += ",left=349";            //defines the distance from the left of the screen that the browser window is opened
    strTriHelpWindowOptions += ",width=600";        //defines the width of the browser window
    strTriHelpWindowOptions += ",height=600";        //defines the height of the browser window
    strTriHelpWindowOptions += ",resizable=1";        //resizeable
    if (isNav4)
    {
        helpWindow = window.open("", newWindow, strTriHelpWindowOptions);
        if (helpWindowSimple && !helpWindowSimple.closed)
        {
            helpWindowSimple.close();
        }
        if (helpWindowSimpleProc && !helpWindowSimpleProc.closed)
        {
            helpWindowSimpleProc.close();
        }
        helpWindow.close();
        helpWindow = window.open("", newWindow, strTriHelpWindowOptions);
        helpWindow.location.href = strProjectPath + strProjectFramesPagePlus + strHelpPage;
        helpWindow.focus();
    }
    else if (helpWindow == null || helpWindow.closed)
    {
        if (helpWindowSimple && !helpWindowSimple.closed)
        {
            helpWindowSimple.close();
        }
        if (helpWindowSimpleProc && !helpWindowSimpleProc.closed)
        {
            helpWindowSimpleProc.close();
        }
        helpWindow = window.open("", newWindow, strTriHelpWindowOptions);
        helpWindow.location.href = strProjectPath + strProjectFramesPagePlus + strHelpPage;
    }
    else if (helpWindow && !helpWindow.closed)
    {
        if (helpWindowSimple && !helpWindowSimple.closed)
        {
            helpWindowSimple.close();
        }
        if (helpWindowSimpleProc && !helpWindowSimpleProc.closed)
        {
            helpWindowSimpleProc.close();
        }
        helpWindow.bssright.location.href = strProjectPath + strHelpPage;
        helpWindow.focus();
    }
}

function callHelpSimple(strProjectPath, strHelpPage)
{
    var strSingleHelpWindowOptions = ",toolbar=no";        //defines whether to display the toolbar (yes) or hides it (no)
    strSingleHelpWindowOptions += ",scrollbars=yes";    //defines whether to display the scrollbar (yes) or hides it (no)
    strSingleHelpWindowOptions += ",top=140";            //defines the distance from the top of the screen that the browser window is opened
    strSingleHelpWindowOptions += ",left=125";            //defines the distance from the left of the screen that the browser window is opened
    strSingleHelpWindowOptions += ",width=300";            //defines the width of the browser window
    strSingleHelpWindowOptions += ",height=250";        //defines the height of the browser window
    strSingleHelpWindowOptions += ",resizable=1";        //resizeable
    if (isNav4)
    {
        helpWindowSimple = window.open("", newWindowSimple, strSingleHelpWindowOptions);
        if (helpWindow && !helpWindow.closed)
        {
            helpWindow.close();
        }
        if (helpWindowSimpleProc && !helpWindowSimpleProc.closed)
        {
            helpWindowSimpleProc.close();
        }
        helpWindowSimple.close();
        helpWindowSimple = window.open("", newWindowSimple, strSingleHelpWindowOptions);
        helpWindowSimple.location.href = strProjectPath + strHelpPage;
        helpWindowSimple.focus();
    }
    else if (helpWindowSimple == null || helpWindowSimple.closed)
    {
        if (helpWindow && !helpWindow.closed)
        {
            helpWindow.close();
        }
        if (helpWindowSimpleProc && !helpWindowSimpleProc.closed)
        {
            helpWindowSimpleProc.close();
        }
        helpWindowSimple = window.open("", newWindowSimple, strSingleHelpWindowOptions);
        helpWindowSimple.location.href = strProjectPath  + strHelpPage;
    }
    else if (helpWindowSimple && !helpWindowSimple.closed)
    {
        if (helpWindow && !helpWindow.closed)
        {
            helpWindow.close();
        }
        if (helpWindowSimpleProc && !helpWindowSimpleProc.closed)
        {
            helpWindowSimpleProc.close();
        }
        helpWindowSimple.parent.location.href = strProjectPath + strHelpPage;
        helpWindowSimple.focus();
    }
}

function callHelpSimpleProc(strProjectPath, strHelpPage)
{
    var strSingleHelpWindowOptions = ",toolbar=yes";    //defines whether to display the toolbar (yes) or hides it (no)
    strSingleHelpWindowOptions += ",scrollbars=yes";    //defines whether to display the scrollbar (yes) or hides it (no)
    strSingleHelpWindowOptions += ",top=20";            //defines the distance from the top of the screen that the browser window is opened
    strSingleHelpWindowOptions += ",left=700";          //defines the distance from the left of the screen that the browser window is opened
    strSingleHelpWindowOptions += ",width=300";         //defines the width of the browser window
    strSingleHelpWindowOptions += ",height=680";        //defines the height of the browser window
    strSingleHelpWindowOptions += ",resizable=1";       //resizeable
    if (isNav4)
    {
        helpWindowSimpleProc = window.open("", newWindowSimpleProc, strSingleHelpWindowOptions);
        if (helpWindow && !helpWindow.closed)
        {
            helpWindow.close();
        }
        if (helpWindowSimple && !helpWindowSimple.closed)
        {
            helpWindowSimple.close();
        }
        helpWindowSimpleProc.close();
        helpWindowSimpleProc = window.open("", newWindowSimpleProc, strSingleHelpWindowOptions);
        helpWindowSimpleProc.location.href = strProjectPath + strHelpPage;
        helpWindowSimpleProc.focus();
    }
    else if (helpWindowSimpleProc == null || helpWindowSimpleProc.closed)
    {
        if (helpWindow && !helpWindow.closed)
        {
            helpWindow.close();
        }
        if (helpWindowSimple && !helpWindowSimple.closed)
        {
            helpWindowSimple.close();
        }
        helpWindowSimpleProc = window.open("", newWindowSimpleProc, strSingleHelpWindowOptions);
        helpWindowSimpleProc.location.href = strProjectPath  + strHelpPage;
    }
    else if (helpWindowSimpleProc && !helpWindowSimpleProc.closed)
    {
        if (helpWindow && !helpWindow.closed)
        {
            helpWindow.close();
        }
        if (helpWindowSimple && !helpWindowSimple.closed)
        {
            helpWindowSimple.close();
        }
        helpWindowSimpleProc.parent.location.href = strProjectPath + strHelpPage;
        helpWindowSimpleProc.focus();
    }
}
