// JavaScript Document - all globally used functions
var isMac = (navigator.platform.indexOf("Mac") != -1) ? true : false;
var isIE = (navigator.appName.indexOf("Microsoft") == -1) ? false : true;
var isNetscape = (navigator.appName.indexOf("Netscape") == -1) ? false : true;
var mainStyle = "";

function setCSSs(){
	if (isNetscape && isMac){
			mainStyle = "format_mozilla_mac";
		}else	if(isNetscape){
			mainStyle = "format_mozilla";
		}else{
			mainStyle = "format_ie";
		}
		document.write('<link href="'+toRootPath+'css/'+ mainStyle+'.css" rel="stylesheet" type="text/css" />');
		//alert('<link href="'+toRootPath+'css/'+ mainStyle+'.css" rel="stylesheet" type="text/css" />');
}
var MM_contentVersion = 6;
var MM_FlashCanPlay = false;
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]; 
	    }
		MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion;
}
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');
}

function writeFlashMovie(vers, w, h, src, fvars, bg, wm){
	if(MM_FlashCanPlay){
		var textFlash = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"';
		textFlash += ' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=';
		textFlash += vers+',0,0,0" width="'+w+'" height="'+h+'">';
		textFlash += '<param name="movie" value="'+src+'" />';
		textFlash += '<param name="FlashVars" value="'+fvars+'" />';
		textFlash += '<param name="menu" value="false" />';
		textFlash += '<param name="quality" value="high" />';
		textFlash += '<param name="scale" value="noscale" />';
		textFlash += '<param name="wmode" value="'+wm+'" />';
		if(bg!=''){
			textFlash += '<param name="bgcolor" value="'+bg+'" />';
		}
		textFlash += '<embed src="'+src+'" type="application/x-shockwave-flash" ';
		textFlash += 'pluginspage="http://www.macromedia.com/go/getflashplayer" ';
		textFlash += 'flashvars="'+fvars+'" menu="false" quality="high" ';
		textFlash += 'wmode="'+wm+'" scale="noscale"';
		if(bg!=''){
			textFlash += ' bgcolor="'+bg+'"';
		}
		textFlash += ' width="'+w+'" height="'+h+'"></embed>';
		textFlash += '</object>';
		document.write(textFlash);
	}else{
		document.write('You need the Flash Player, please download it <a href="http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash&Lang=English" target="_blank">here >>></a>');
	}
}
