function GetBrowser(){
			if(document.layers){
				return "ns4";
			}
			if((document.all) && (!document.getElementById)){
				return "ie4";
			}
			if((document.all) && (document.getElementById)){
				return "ie5";
			}
			if((document.getElementById) && (!document.layers) && (!document.all)){
				return "ns6";
			}
		}

		function IsOpera6(){
			if(navigator.userAgent.toLowerCase().indexOf("opera") != -1){
				if(parseFloat(navigator.userAgent.substring(navigator.userAgent.toLowerCase().indexOf("opera") + 5, navigator.userAgent.length)) > 6.0){
					return true;
				} else {
					return false
				}
			} else {
				return false;
			}
		}

		function GetPlatform(){
			if(navigator.userAgent.indexOf("Mac") != -1){
				return "mac";
			} else {
				return "windoze";
			}
		}

		var bool_plugDetected = false;

		function GotPlugin(param_plugType, param_version){

			bool_plugDetected = false;
			
			var str_navPlugins, str_navObject, str_suff;
			if(param_plugType == "flash"){
				str_navPlugins = "Shockwave Flash";
				str_navObject = "ShockwaveFlash.ShockwaveFlash." + param_version
				str_suff = "swf";
			}
			if(param_plugType == "quicktime"){
				str_navPlugins = "QuickTime";
				str_navObject = "QuickTimeCheckObject.QuickTimeCheck." + param_version
				str_suff = "mov";
			}
			if(param_plugType == "wmp"){
				str_navPlugins = "Windows Media Player";
				str_navObject = "MediaPlayer.MediaPlayer." + param_version
				str_suff = "mp";
			}


			if(navigator.plugins && navigator.plugins.length > 0){
				for(var num_k = 0; num_k < navigator.plugins.length; num_k++){
				
					if (navigator.plugins[num_k].name.indexOf(str_navPlugins) != -1){
						var num_pluginVersion = 0;
						var str_pluginDescription = navigator.plugins[num_k].name + " " + navigator.plugins[num_k].description;
						var arr_words = str_pluginDescription.split(" ");
						for (var i = 0; i < arr_words.length; ++i){
							if (isNaN(parseInt(arr_words[i])))
							continue;
							num_pluginVersion = arr_words[i];
						}
						if (parseInt(num_pluginVersion) >= parseInt(param_version)){
							return true;
						} else {
							return false;
						}
					}
				}
			}
			
			if(((GetBrowser() == "ie5") || (GetBrowser() == "ie6")) && (GetPlatform() == "windoze")){
				document.write('<scr' + 'ipt language="VBscript">\n');
				document.write('	On Error Resume Next\n');
				document.write('	If (not IsObject(CreateObject("' + str_navObject + '"))) Then\n');
				document.write('		bool_plugDetected = false\n');
				document.write('	Else\n');
				document.write('		bool_plugDetected = true\n');
				document.write('	End If\n');
				document.write('</scr' + 'ipt>\n');
			}

			return bool_plugDetected;
		}

function flash(swf, filewidth, fileheight, pic, text, lynk){

	if(text){text=text.replace("&","%26")}
	
	if(GotPlugin('flash',6)){
	document.write('<object id="intro" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+filewidth+'" height="'+fileheight+'">');
	document.write('<param name="movie" value="/common_files/merc2005/swf/'+swf+'.swf">');
	document.write('<param name="loop" value="true">');
	document.write('<param name="align" value="center">');
	document.write('<param name="allowScriptAccess" value="sameDomain">');
	document.write('<param name="menu" value="false">');
	document.write('<param name="quality" value="high">');
	document.write('<param name="FlashVars" value="htmlvar1='+text+'&htmlvar2='+lynk+'">');
	document.write('<embed name="intro" src="/common_files/merc2005/swf/'+swf+'.swf" loop="true" FlashVars="htmlvar1='+text+'&htmlvar2='+lynk+'" menu="false" quality="high" bgcolor="#000000" width="'+filewidth+'" height="'+fileheight+'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></embed>');
	document.write('</object>');
	} 
	else {
	/** Default-Pic if no Flash, SubArea **/
	document.write('<a href="http://www.macromedia.com/go/getflashplayer/" target="_blank"><img src="'+pic+'" width="'+filewidth+'" height="'+fileheight+'" border="0"></a>');
	}
}
