/* Macromedia Flash Dispatcher - a scriptable detector for Flash Player copyright (c) 2000 Macromedia, Inc. */ 
var MM_FlashPluginsPage = "http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"

var m_isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false
var m_isWin = (navigator.appVersion.indexOf("Windows") != -1) ? true : false
var m_isMac = (navigator.appVersion.indexOf("Macintosh") != -1) ? true : false

var MM_FlashControlInstalled	// Flash ActiveX control installed?
var MM_FlashControlVersion	// ActiveX control version if installed

var MM_FlashVersion
var MM_FlashVersion_Requered = 8
var MM_FlashVersion_Required_8 = 8

function canPlayFlash(){
	return canPlayFlash8()
}


function canPlayFlash8(){
	var bCanPlay = false
	MM_FlashInfo()
	


	if(m_isIE && m_isWin){
		if (MM_FlashControlInstalled){
			 return (MM_FlashVersion_Required_8 <= parseInt(MM_FlashControlVersion))
		}
	} else{		
		return (MM_FlashVersion_Required_8 <= parseInt(MM_FlashVersion) )
	}
}

function MM_FlashInfo(){
		
	if (navigator.plugins && navigator.plugins.length > 0){
		this.implementation = "Plug-in"
		this.autoInstallable = false	// until Netscape SmartUpdate supported

		// Check whether the plug-in is installed:
		if (navigator.plugins["Shockwave Flash"]){
			this.installed = true

			// Get the plug-in version and revision:
			var words = navigator.plugins["Shockwave Flash"].description.split(" ")
	
			for (var i = 0; i < words.length; ++i){
				if (isNaN(parseInt(words[i])))
					continue
				MM_FlashVersion = words[i]
				MM_FlashRememberIfDetectedSelf()
			}
		}else{
			this.installed = false
		}
	} else if (MM_FlashControlInstalled != null) {
		this.implementation = "ActiveX control"
		this.installed = MM_FlashControlInstalled
		this.version = MM_FlashControlVersion
		this.autoInstallable = true

		MM_FlashRememberIfDetectedSelf()
	} else if (MM_FlashDetectedSelf())
		return true
}

function MM_FlashRememberIfDetectedSelf(){
	document.cookie = 'MM_FlashDetectedSelf=true '
}

function MM_FlashDetectedSelf(){
	return (document.cookie.indexOf("MM_FlashDetectedSelf") != -1)
}



function createflash8(width, height, swfname, flashvars, sbghex, wmode, connection,id){

		if (typeof(id)=="undefined") id="start";
		if (typeof(sbghex)=="undefined") sbghex="ffffff";
		if (typeof(wmode)=="undefined") wmode="";
		if (connection!="https") connection="http";

		document.write("<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"" + connection + "://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8 \" width=\"" + width + "\" height=\"" + height + "\" id=\""+id+"\" align=\"middle\" VIEWASTEXT>");
		document.write("<param name=\"allowScriptAccess\" value=\"sameDomain\" />");
		document.write("<param name=\"movie\" value=\"" + swfname + "\" />");
		document.write("<param name=\"FlashVars\" value=\"" + flashvars + "\" />");
		document.write("<param name=\"quality\" value=\"best\" />");
		document.write("<param name=\"bgcolor\" value=\"#" + sbghex + "\" />");
		document.write("<param name=\"menu\" value =\"false\" />");
		document.write("<param name=\"wmode\" value =\"" + wmode + "\" />");
		document.write("<embed name=\""+id+"\" SWLIVECONNECT=\"true\" src=\"" + swfname + "\" FlashVars=\"" + flashvars + "\" quality=\"best\" bgcolor=\"#" + sbghex + "\" width=\"" + width +"\" height=\"" + height + "\" align=\"middle\" allowScriptAccess=\"sameDomain\" type=\"application/x-shockwave-flash\" pluginspage=\"" + connection + "://www.macromedia.com/go/getflashplayer\" wmode=\"" + wmode + "\" />");
		document.write("</object>");
}
