var flashCheckVBS = false;
function flashObject(url, version, altContent, w, h, menu) {
	var MM_contentVersion = version;
	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 (!window.flashCheckVBS) {
			flashCheck = '<SCR' + 'IPT LANGUAGE=VBScript\> \n';
			flashCheck += 'Private i, x\n';
			flashCheck += 'On Error Resume Next\n';
			flashCheck += 'MM_FlashControlInstalled = False\n';
			flashCheck += 'For i = 9 To 1 Step -1\n';
			flashCheck += 'Set x = CreateObject("ShockwaveFlash.ShockwaveFlash." & i)\n';
			flashCheck += 'MM_FlashControlInstalled = IsObject(x)\n';
			flashCheck += 'If MM_FlashControlInstalled Then\n';
			flashCheck += 'MM_FlashControlVersion = CStr(i)\n';
			flashCheck += 'Exit For\n';
			flashCheck += 'End If\n';
			flashCheck += 'Next\n';
			flashCheck += '</SCR' + 'IPT\> \n';
			document.write(flashCheck);
			flashCheckVBS = true;
		}
		MM_FlashCanPlay = (window.MM_FlashControlVersion>=MM_contentVersion);		
	}
	//MM_FlashCanPlay = false;
	if (MM_FlashCanPlay) {
		flashContent = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="'+w+'" height="'+h+'">';
		flashContent += '<param name="allowScriptAccess" value="sameDomain" />';
		flashContent += '<param name="movie" value="'+url+'" />';
		flashContent += '<param name="menu" value="'+menu+'" />';
		flashContent += '<param name="wmode" value="transparent" />';
		flashContent += '<embed src="'+url+'" menu="'+menu+'" width="'+w+'" height="'+h+'"  allowScriptAccess="sameDomain" wmode="transparent" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
		flashContent += '</object>';
		document.write(flashContent);		
	}else{
		document.write(altContent);
	}
}