var flashinstalled = 0;
var flashversion = 0;

if (navigator.plugins && navigator.plugins.length) {
	x = navigator.plugins["Shockwave Flash"];
	if (x) 	{
		flashinstalled = 2;
		if (x.description)
		{
			y = x.description;
			flashversion = y.charAt(y.indexOf('.')-1);
		}
	} else {
		flashinstalled = 1;
	}

	if (navigator.plugins["Shockwave Flash 2.0"]) {
		flashinstalled = 2;
		flashversion = 2;
	}
} else if (navigator.mimeTypes && navigator.mimeTypes.length) {
	x = navigator.mimeTypes['application/x-shockwave-flash'];

	if (x && x.enabledPlugin)
		flashinstalled = 2;
	else
		flashinstalled = 1;
} else {

	document.writeln("<SCRIPT LANGUAGE='VBScript'>");
	document.writeln("on error resume next");
	document.writeln("For i = 2 to 6");
	document.writeln("	If Not(IsObject(CreateObject(\"ShockwaveFlash.ShockwaveFlash.\" & i))) Then");
	document.writeln("	Else");
	document.writeln("		flashinstalled = 2");
	document.writeln("		flashversion = i");
	document.writeln("	End If");
	document.writeln("Next");

	document.writeln("If flashinstalled = 0 Then");
	document.writeln("	flashinstalled = 1");
	document.writeln("End If");

	document.write("</SCRIPT>");

}


function print_swf_or_gif( swfurl, gifurl, ahref, width, height, id ) {
	if ( flashinstalled == 2) {
		document.write("<OBJECT classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0' WIDTH='"+width+"' HEIGHT='"+height+"' id='"+id+"' ALIGN=''>");
		document.write("<PARAM NAME=movie VALUE='"+swfurl+"'> <PARAM NAME=loop VALUE=false> <PARAM NAME=quality VALUE=best> <PARAM NAME=bgcolor VALUE=#FFFFFF>");
		document.write("<EMBED src='"+swfurl+"' loop=false quality=best bgcolor=#FFFFFF  WIDTH='"+width+"' HEIGHT='"+height+"' NAME='"+id+"' ALIGN='' TYPE='application/x-shockwave-flash' PLUGINSPAGE='http://www.macromedia.com/go/getflashplayer'>");
		document.write("</EMBED></OBJECT>");
	} else {
		document.write("<A HREF='" + ahref + "'><IMG SRC='"+gifurl+"' WIDTH='"+width+"' HEIGHT='"+height+"' NAME='"+id+"' BORDER=0></A>");
	}
}
