var undefined;

// Check the browser version
function check_browser_version (required)
{
    if (required == 0)
    {
        for (var prop in navigator)
            document.write (prop + "=" + navigator[prop] + "<br>");
    }

    var version = 5;            // default, for FireFox etc
    var appVer = navigator.appVersion;
    var iePos = appVer.indexOf ('MSIE');
    if (iePos != -1)
        version = parseFloat (appVer.substring (iePos + 5, appVer.indexOf (';', iePos)));
    if (required == 0)
    {
        alert ("MSIE version " + version)
        return version;
    }

    if (version < required)
    {
        alert ("Sorry, this site requires Internet Explorer version " + required + " or later");
        window.location = "about:blank";    
    }
    
    return version;
}


// Animate the WFP logo
animate_logo.counter = 0;

function animate_logo ()
{
    if (check_browser_version (1) < 5 || logo == undefined)
        return;

    if (animate_logo.counter > 150)
    {
        clearTimeout (animate_logo.timeout);
        return;
    }
    logo.style.filter = "progid:DXImageTransform.Microsoft.Alpha (Style=2, Opacity=" +
        animate_logo.counter * 2 + ", FinishOpacity=" + 
        ((animate_logo.counter > 50) ? animate_logo.counter - 50 : 0);
    animate_logo.counter += 4;
    animate_logo.timeout = setTimeout (animate_logo, 20);
}


// Display the last update date and time of the page
function LastUpdate ()
{
    document.write ("Last modified: " + document.lastModified);
}


// Code to play an audio sample in FireFox without leaving the current page
var w;

function close_window ()
{
    w.close ();
}

function play_sample (url)
{
    if (navigator.appName == 'Netscape')
    {
        w = window.open (url, 'play audio', 'width=500,height=100');
        setTimeout ('close_window ();', 3000);
    }
    else
        window.location = url;
    
    return false;
}
