var MM_contentVersion = 6;
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
if ( plugin ) {
	var words = navigator.plugins["Shockwave Flash"].description.split(" ");
	for (var i = 0; i < words.length; ++i) {
		if (isNaN(parseInt(words[i])))
			continue;
		var MM_PluginVersion = words[i]; 
	}
	var MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion;
	FlashMode = 0;
	if (navigator.plugins && navigator.plugins.length > 0) {
		if (navigator.plugins["Shockwave Flash"]) {
			var plugin_version = 0;
			var words = navigator.plugins["Shockwave Flash"].description.split(" ");
			for (var i = 0; i < words.length; ++i) {
				if (isNaN(parseInt(words[i])))
					continue;
				plugin_version = words[i];
			}
			if (plugin_version >= 6) {
				var plugin = navigator.plugins["Shockwave Flash"];
				var numTypes = plugin.length;
				for (j = 0; j < numTypes; j++) {
					mimetype = plugin[j];
					if (mimetype) {
						if (mimetype.enabledPlugin && (mimetype.suffixes.indexOf("swf") != -1)) // Mac wierdness
							FlashMode = 1;
						if (navigator.mimeTypes["application/x-shockwave-flash"] == null)
							FlashMode = 0;
					}
				}
			}
		}
	}
	if (FlashMode == 1)
		var MM_FlashCanPlay = true;
	else
		var MM_FlashCanPlay = false;
}
else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 && (navigator.appVersion.indexOf("Win") != -1)) {
	document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n'); //FS hide this from IE4.5 Mac by splitting the tag
	document.write('on error resume next \n');
	document.write('MM_FlashCanPlay = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & MM_contentVersion)))\n');
	document.write('</SCR' + 'IPT\> \n');
}

// flash nav
function RunFlashNav(flashParams) {
var flashPath = 'http://images.traderonline.com/img/rs/swf/searchmap_v01.swf' + flashParams;
	document.write('	<object type="application/x-shockwave-flash" data="' + flashPath + '&"   ');
	document.write('	width="400" height="270">\n  ');
	document.write('	<param name="movie" value="' + flashPath + '&" />\n  ');
	document.write('	</object> ');

	/*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" ');
	document.write('	' + flashDimensions + ' id="map" ALIGN="">');
	document.write('	<PARAM NAME=movie VALUE="' + flashPath + '">');
	document.write('	<PARAM NAME=quality VALUE=high>');
	document.write('	<PARAM NAME=bgcolor VALUE=#FFFFFF>');
	document.write('	<EMBED src="' + flashPath + '" quality=high bgcolor=#FFFFFF ' + flashDimensions + ' NAME="map" ALIGN="" ');
	document.write('		TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">');
	document.write('	</EMBED>');
	document.write('</OBJECT>'); */
} 

// flash map
function runFlashMap(flashParams) {
var flashPath = 'http://images.traderonline.com/img/rs/swf/holder.swf' + flashParams;
	document.write('<tr><td colspan="2">');
	document.write('	<object type="application/x-shockwave-flash" data="' + flashPath + '&"   ');
	document.write('	width="400" height="325">\n  ');
	document.write('	<param name="movie" value="' + flashPath + '&" />\n  ');
	document.write('	</object> ');
	document.write('</td></tr>');
	
	document.write('<tr><td colspan="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="470" HEIGHT="325" id="flashcalendar" ALIGN="">');
	document.write('	<PARAM NAME=movie VALUE="' + flashPath + '">');
	document.write('	<PARAM NAME=quality VALUE=high>');
	document.write('	<EMBED src="' + flashPath + '" quality=high bgcolor=#FFFFFF WIDTH="470" HEIGHT="325" NAME="flashcalendar" ALIGN="" ');
	document.write('	TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED>');
	document.write('</OBJECT>');
	document.write('</td></tr>');
} 

function runFlashHeader(flashParams) {
var img_path = 'http://images.traderonline.com/img/rs/';
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="196" height="20" id="dynamic_link_header" align="middle">');
	document.write('<param name="allowScriptAccess" value="sameDomain" />');
	document.write('<param name="movie" value="' + img_path + 'swf/new_swf/dynamic_link_header.swf' + flashParams + '" />');
	document.write('<param name="quality" value="high" />');
	document.write('<param name="bgcolor" value="#ffffff" />');
	document.write('<embed src="' + img_path + 'swf/new_swf/dynamic_link_header.swf' + flashParams + '" quality="high" bgcolor="#FAF7E3" width="196" height="20" name="dynamic_link" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
	document.write('</object>');
}