var flashTargetVersion=8;
var flashVersion=0;
var MSDetect="false";

if (navigator.plugins && navigator.plugins.length)
{	var p=navigator.plugins["Shockwave Flash"];
	var d=p.description;
	flashVersion=(d)? parseInt(d.replace(/([a-z]|[A-Z]|\s)+/,'')):-1;
}
else
	flashVersion=flashTargetVersion; /*temporal hook*/
/*
	MSDetect = "true";

vbw=document.write;
vbw('<SCRIPT LANGUAGE="VBScript">');
//vbw('on error resume next');
vbw('If MSDetect = "true" Then');
vbw('	If Not(IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & flashTargetVersion))) Then');
vbw('		flashVersion=-1');
vbw('	Else');
vbw('		flashVersion=flashTargetVersion');
vbw('	End If');
vbw('End If');
vbw('</SCRIPT>');
*/

loadFlash=function(id,src,img,width,height)
{	var p=navigator.platform.toLowerCase();
	var code='';
	if(flashVersion>=flashTargetVersion)
	{	if(img&&((p.indexOf('win')!=-1)||(p.indexOf('mac')!=-1)))
		{	code='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" id="'+id+'" width="'+width+'" height="'+height+'" align="middle">';
			code+='<param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="'+src+'" /><param name="quality" value="high" /><param name="wmode" value="transparent" />';
			code+='<embed src="'+src+'" quality="high" wmode="transparent" width="'+width+'" height="'+height+'" swLiveConnect=true id="'+id+'" name="'+id+'" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
			code+='</object>';
		}
		else code='<img src="'+img+'" alt="" />'
	}
	else
	{	code='<div class="flashTxt">To view correctly this page you need newer flash player!<br />';
		code+='Your flash player is version: '+flashVersion+', required version: '+flashTargetVersion+'<br /><br />';
		code+='<a href="http://www.macromedia.com/go/getflashplayer" target="_blank">Get Flash Player!</a></div>';
	}
	document.write(code);
}
