
var agt=navigator.userAgent.toLowerCase();
var ie = (agt.indexOf("msie") != -1);
var ns = (navigator.appName.indexOf("Netscape") != -1);
var win = ((agt.indexOf("win")!=-1) || (agt.indexOf("32bit")!=-1));
var mac = (agt.indexOf("mac")!=-1);
var pluginlist;

if (ie && win) {
   pluginlist = detectIE("ShockwaveFlash.ShockwaveFlash.1","Shockwave Flash");
}
if (ns || !win) {
  nse = "";
  for (var i=0;i < navigator.mimeTypes.length;i++) nse += navigator.mimeTypes[i].type.toLowerCase();
  pluginlist = detectNS("application/x-shockwave-flash","Shockwave Flash");
}


function detectIE(ClassID,name) {
   result = false;
   document.write('<SCRIPT LANGUAGE=VBScript>\n on error resume next \n result = IsObject(CreateObject("' + ClassID + '"))</SCRIPT>\n');
   if (result) return name+',';
   else return '';
}

function detectNS(ClassID,name) {
   n = "";
   if (nse.indexOf(ClassID) != -1)
     if (navigator.mimeTypes[ClassID].enabledPlugin != null) n = name+",";
   return n;
}


function RunFooClass(src, w, h, vars, bg, mode, cssclass, id)
{
	document.write('<OBJECT id='+ id +' class='+ cssclass +' codeBase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,22,0 \n');
	document.write('height='+ h +' width='+ w +' align=middle \n');
	document.write('classid=clsid:d27cdb6e-ae6d-11cf-96b8-444553540000> \n');
	document.write('<PARAM NAME="_cx" VALUE="18627"> \n');
	document.write('<PARAM NAME="_cy" VALUE="1640"> \n');
	document.write('<PARAM NAME="FlashVars" VALUE="' + vars + '"> \n');

	document.write('<PARAM NAME="Movie" VALUE="' + src +  '"> \n');
	document.write('<PARAM NAME="Src" VALUE="' + src +  '"> \n');

	document.write('<PARAM NAME="WMode" VALUE="'+ mode +'"> \n');
	document.write('<PARAM NAME="Play" VALUE="-1"> \n');
	document.write('<PARAM NAME="Loop" VALUE="-1"> \n');
	document.write('<PARAM NAME="Quality" VALUE="High"> \n');
	document.write('<PARAM NAME="SAlign" VALUE=""> \n');
	document.write('<PARAM NAME="Menu" VALUE="-1"> \n');
	document.write('<PARAM NAME="Base" VALUE=""> \n');
	document.write('<PARAM NAME="AllowScriptAccess" VALUE="sameDomain"> \n');
	document.write('<PARAM NAME="Scale" VALUE="ShowAll"> \n');
	document.write('<PARAM NAME="DeviceFont" VALUE="0"> \n');
	document.write('<PARAM NAME="EmbedMovie" VALUE="0"> \n');
	document.write('<PARAM NAME="BGColor" VALUE="'+ bg +'"> \n');
	document.write('<PARAM NAME="SWRemote" VALUE=""> \n');
	document.write('<PARAM NAME="MovieData" VALUE=""> \n');
	document.write('<PARAM NAME="SeamlessTabbing" VALUE="false"> \n');

	document.write(' <embed \n');
	document.write(' src="' + src  + '"\n');
	document.write(' FlashVars="' + vars + '"  \n');
	document.write(' quality="high" bgcolor="#'+ bg +'" width="'+ w +'" height="'+ h +'" \n');
	document.write(' name="'+ id +'" align="middle" allowScriptAccess="sameDomain" SeamlessTabbing="false" \n');
	document.write(' wmode="'+ mode +'" type="application/x-shockwave-flash" \n');
	document.write(' pluginspage="http://www.macromedia.com/go/getflashplayer" /> \n');
	document.write('</OBJECT> \n');
}

function RunFoo(src, w, h, vars, bg, mode)
{
	RunFooClass(src, w, h, vars, bg, mode, '', 'swf_')
}