// JavaScript Document
<!--

function createSplashWindow()
{
    var w, h;
    var x, y;
    var s;

    //  First calculate the size and position for the window
    w = 500;
    h = 450;
    
    //  We need to test if the screen object exists because
    //  older browsers don't support it.
    if ( window.screen )
    {
        x = (screen.width-w)/2;
        y = (screen.height-h)/3;
    }
    else
    {
        x = 100;
        y = 100;
    }
    s = "width=" + w + ",height=" + h + ",left=" + x + ",top=" + y;
    
    //  create the window with just a title bar
    window.open( "splashwindow.htm",
                    "SplashWindow",
                    s + ",resizable=no,scrollbars=no,status=no" );
}

function fetchCookie( sName )
{
    var sValue = "";
    var index = 0;

    //  The "cookie" property on the document is actually a
    //  single string of the form "name=value; name2=value2; ..."
    //  As a result we must search through the cookie string
    //  to find the name=value pair that we are looking for.
    //
    if( document.cookie )
        index = document.cookie.indexOf( sName + "=" );
    else
        index = -1;

    if ( index < 0 )
    {
        sValue = "";
    }
    else
    {
        var nBegin = document.cookie.indexOf( "=", index ) + 1;
        if ( 0 < nBegin )
        {
            var nEnd = document.cookie.indexOf( ";", nBegin );
            if ( nEnd < 0 )
                nEnd = document.cookie.length;
            sValue = document.cookie.substring( nBegin, nEnd );
        }
        else
        {
            sValue = "";
        }
    }
    return sValue;
}

function doSplashWindow()
{   
    //  we use a cookie so the window is only displayed
    //  once per session.  If the visitor closes all of
    //  their open browser windows and then returns to the
    //  site the splash window will show again.
    if ( "" == fetchCookie( "Splash" ) )
        setTimeout( "createSplashWindow()", 0.5*1000 );

    document.cookie = "Splash=yes;";
}

//  Notice that we don't use the 'onload' event to start
//  the splash window.  This is because some documents
//  load lots of images.  We want our splash window to
//  to display 'while' this document is loading.
doSplashWindow();

//-->
