function dw(s)
{
    document.write(s);
}
// Ultimate client-side JavaScript client sniff.
// (C) Netscape Communications 1999.
// Permission granted to reuse and distribute.
// Modified to be not-so-ultimate 11-30-1999
// by David Gray (davegray@digiweb.com)
// See http://www.it97.de/JavaScript/JS_tutorial/bstat/navobj.html and 
// http://www.it97.de/JavaScript/JS_tutorial/bstat/Browseraol.html 
// for detailed lists of userAgent strings. 
function Is () {
    // convert all characters to lowercase to simplify testing 
    var agt=navigator.userAgent.toLowerCase(); 

    // *** BROWSER VERSION *** 
    // Note: On IE5, these return 4, so use is.ie5up to detect IE5. 
    this.major = parseInt(navigator.appVersion); 
    this.minor = parseFloat(navigator.appVersion); 

    this.nav  = ((agt.indexOf('mozilla')!=-1) &&
                (agt.indexOf('spoofer')==-1)  &&
                (agt.indexOf('compatible') == -1) &&
                (agt.indexOf('opera')==-1) &&
                (agt.indexOf('webtv')==-1));
    this.nav4up = (this.nav && (this.major >= 4)); 

    this.ie   = (agt.indexOf("msie") != -1); 
    this.ie4up  = (this.ie  && (this.major >= 4));
    this.v4up = (this.ie4up || this.nav4up);
} 

function checkFlash(code)
{
    var is = new Is();
    var useFlash=0;
    if(is.ie4up)
    {
        //we must have already calculated
        //whether flash is installed or not
        useFlash = document.forms[0].check.value;
    }
    else if(is.nav4up)
    {
        navigator.plugins.refresh(false);
        numPlugins = navigator.plugins.length;
        var found = 0;
        for (i = 0; i < numPlugins; i++)
        {
            plugin = navigator.plugins[i];
            numTypes = plugin.length;
            for (j = 0; j < numTypes; j++)
            {
                mimetype = plugin[j];
                if (mimetype)
                {
                    if(mimetype.suffixes.indexOf("swf") != -1)
                    {
                        useFlash="True";
                        break;
                    }
                }
            }
        }
    }
    if(useFlash=="True")
    {
        dw(code);
    }
    else
        showError();
}
function showError()
{
    dw('<center><img border="0" align="texttop" src="/games/images/flasherror.gif"><br><nobr><span class="flasherror">&nbsp;Flash plugin missing&nbsp;</span></nobr><br>');
    dw('<table width="100%" border="0" ><tr><td align="center" style="font-family:verdana">It seems your web browser has not installed the <nobr><b>Macromedia Flash Plugin</b>.</nobr><br>');
    dw('You will require this plugin to play this game.<br>');
    dw('<a href="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">Click here to download the plugin.</a></td></tr></table></center>');
}
