var UseFlash = 0;
if (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"] ) {
	// Check for Flash version 5 or greater in Netscape
	var plugin = navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin;
	if (plugin && parseInt(plugin.description.substring(plugin.description.indexOf(".")-1))>=3)
		UseFlash = 1;
} else if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && 
	  navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
	// Assume any Windows IE except for Windows 3.1 supports the OBJECT tag
	UseFlash = 1;
}
// Allow the cookie to override
if (document.cookie && (document.cookie.indexOf("FlashRenderOption=P") >= 0)) {
	UseFlash = 1;
} else if (document.cookie && (document.cookie.indexOf("FlashRenderOption=I") >= 0)) {
	UseFlash = 0;
}

function goFlash(file, w, h){

if ( UseFlash ) {
	// Use Flash player
	document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
	document.write(' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=3,0,0,0"');
	document.write(' ID=nav3 WIDTH=' + w + ' HEIGHT=' + h + '>');
	document.write('<PARAM NAME=movie VALUE="' + file + '.swf"> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#FFFFFF> ');
	document.write('<EMBED src="' + file + '.swf" quality=high bgcolor=#FFFFFF ');
	document.write(' swLiveConnect=FALSE WIDTH=' + w + ' HEIGHT=' + h);
	document.write(' TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">');
	document.write('</EMBED>');
	document.write('</OBJECT>');
} else if (!(navigator.appName && navigator.appName.indexOf("Netscape")>=0 && navigator.appVersion.indexOf("2.")>=0)) {
	// Netscape 2 will display the IMG tag below so don't write an extra one
	document.write('<IMG SRC="' + file + '.gif" ' + w + ' HEIGHT=' + h + ' usemap="#' + file +'" BORDER=0>');
}
}

function SetCookieType(ctype)
{
	document.cookie='FlashRenderOption='+ctype+';path=/;'
	if ( navigator.appName.indexOf("Microsoft") != -1 )
		parent.history.go(0);
	else if ( navigator.userAgent.indexOf("Mozilla/2") != -1 )
		parent.location = parent.location;
	else
		parent.location.reload();
}
