function detectIE(ClassID){
    result = false;
    document.write('<SCRIPT LANGUAGE=VBScript>\n on error resume next \n result = IsObject(CreateObject("' + ClassID + '"))</SCRIPT>\n');     
    return result;
}

function detectNS(){
    if(navigator.plugins["Shockwave Flash"])
    {
        if((navigator.plugins["Shockwave Flash"].description.indexOf("8.0") > 0) || (navigator.plugins["Shockwave Flash"].description.indexOf("9.0") > 0))
            return true;
    }else{
        return false;
    }
}

function putFlash(flashurl,flashvars,width,height,transparent) {
var flashInstalled;
var IE = document.all?true:false;

if (IE){
	flashInstalled = detectIE("ShockwaveFlash.ShockwaveFlash.9");
	if(!flashInstalled)
		flashInstalled = detectIE("ShockwaveFlash.ShockwaveFlash.8");
}else{
	flashInstalled = detectNS();
}
        
if (!flashInstalled) {
	if (document.getElementById("oldFlash")) {
		document.getElementById("oldFlash").style.display = "block";
	}
}
document.write("<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='" + width + "' height='" + height + "'>");
document.write("<param name='movie' value='" + flashurl + "'/>");
document.write("<param name='quality' value='high'/>");
document.write("<param name='flashvars' value='" + flashvars + "&end' />");
if (transparent) {
	document.write("<param name='wmode' value='transparent'/>"); 
}
document.write("<embed src='" + flashurl + "' quality='high' flashvars='" + flashvars + "&end' pluginspage='http://www.macromedia.com/go/getflashplayer' ");
if (transparent) { 
	document.write("wmode='transparent'");
}
document.write(" type='application/x-shockwave-flash' width='" + width + "' height='" + height + "'></embed>");
document.write("</object>");
}