
var sleep = 2500;

function embedflash(filename,width,height,bgcolor) {
    var localwidth= 0, localheight= 0;
    localwidth= width;localheight= height;
    var MM_contentVersion = 8;
    var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;

    if ( plugin ) {
            var words = navigator.plugins["Shockwave Flash"].description.split(" ");
            for (var i = 0; i < words.length; ++i)
            {
            if (isNaN(parseInt(words[i])))
            continue;
            var MM_PluginVersion = words[i]; 
            }
    
        var MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion;

    }
    else {
        if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 
           && (navigator.appVersion.indexOf("Win") != -1)) {
            if(parseFloat(navigator.appVersion.substring(navigator.appVersion.indexOf('MSIE')+5)) != 8)
            {
                MM_FlashCanPlay = CheckFlash(MM_contentVersion);
            }
            else    {
                MM_FlashCanPlay = false;
            }   

        }
    }
    if ( MM_FlashCanPlay ) {
        document.write(' <OBJECT classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"');
        document.write(' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" ');
        document.write(' ID="startpage" WIDTH="'+localwidth+'" HEIGHT="'+localheight+'" ALIGN="middle">');
        document.write(' <PARAM NAME=movie VALUE="'+filename+'"> <PARAM NAME=quality VALUE=best> <PARAM NAME=wmode VALUE=transparent>  ');
        document.write(' <EMBED src="'+filename+'" bgcolor='+bgcolor+' quality="best" wmode="transparent" ');
        document.write(' swLiveConnect=TRUE WIDTH="'+localwidth+'" HEIGHT="'+localheight+'" NAME="startpage" ALIGN="middle"');
        document.write(' TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">');
        document.write(' </EMBED>');
        document.write(' </OBJECT>');
    } else{
        //document.write('<br><br><a href="http://www.macromedia.com/go/getflashplayer">Flash plugin not detected</a>');
        var i1 = filename.indexOf( "=" ) + 1;
        var i2 = filename.indexOf( "&" ) ;
        var imgname = filename.substr( i1, i2 - i1 );
        document.write('<div style="border: 0px;"><img src="'+imgname+'" alt="" /></div>');
   	//sleep = 1000;
    }
}

function toggle( id1 )
{
   var div1 = document.getElementById(id1);
   if (div1.style.display == 'none') 
   {
      setTimeout( "document.getElementById('" + id1 + "').style.display = 'block';", sleep );
   } 
   else 
   {
      div1.style.display = 'none';
   }
}





    
