


function checkForFlash(testfor){
FlashMode = 0
	 if (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"] && navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin) {
		if (navigator.plugins && navigator.plugins["Shockwave Flash"]  && (versionIndex = navigator.plugins["Shockwave Flash"].description.indexOf("."))     != - 1) {
		var versionString = navigator.plugins["Shockwave Flash"].description.substring(versionIndex-1, versionIndex);
		versionIndex = parseInt( versionString );
				if ( versionIndex >= testfor ) {
				FlashMode = 1;
			}
		}
	}else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 && (navigator.userAgent.indexOf("Windows 95")>=0 || navigator.userAgent.indexOf("Windows 98")>=0 || navigator.userAgent.indexOf("Windows NT")>=0 )) {
		document.write('<SCRIPT LANGUAGE=VBScript\> \n');
		document.write('on error resume next \n');
		document.write('FlashMode = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.' + testfor + '")))\n');
		document.write('</SCRIPT\> \n');
	}
	
	if(FlashMode == 1){
		return true;
	}else{
		return false;
	}
}


function generateFlashVars(arr){
	flashVars = ""
	if(arr.indexOf("<")>=0){
			return ""
	}
	arr = arr.split(",")
	for(i=0; i < arr.length; i++){
		thisName = arr[i].substr(0,arr[i].indexOf("="))
		thisValue = arr[i].substr(arr[i].indexOf("=")+1)
		
		/*if(thisValue.indexOf("http:") == 0 && thisValue.lastIndexOf("http:")==0){
			thisValue = resolve(thisValue)
			
		}*/
		flashVars += thisName + "="+ thisValue + "&"
	}
	
	return flashVars;
}

function showFlash(swf, width, height,bgColor,name,version, flashVars, alternateContent, alternateContentImage, loopMovie){
	//swf = resolve(swf)
	vars = ""
	if(flashVars != null){
		vars = generateFlashVars(flashVars)
	}
	if(isNaN(width)){
		width = 550
	}
	if(isNaN(height)){
		height= 400	
	}
	if(isNaN(version)){
		version = 6
	}
	if(checkForFlash(version)){
	
		document.write('<OBJECT align="center" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" WIDTH="' + width + '" HEIGHT="' + height +'" id="news" >')
		document.write('<PARAM NAME=movie VALUE="' + swf + '">')
		document.write('<PARAM NAME=quality VALUE=high>')
		document.write('<PARAM NAME=bgcolor VALUE="' + bgColor + '"> ')
		if (loopMovie != null)
		{
		document.write('<PARAM NAME=loop VALUE="' + loopMovie + '"> ')
		}
		if(vars != ""){
			document.write('<PARAM NAME="FlashVars" VALUE="' + vars + '">')
		}
		document.write('<EMBED src="' + swf +'" quality="high" bgcolor="' + bgColor + '" WIDTH="' + width + '" HEIGHT="' + height + '" NAME="' + name + '" ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"')
		if(vars != ""){
			document.write(' FlashVars="' + vars + '"')
		}
		if(loopMovie != null){
			document.write(' loop="' + loopMovie + '"')
		}
		document.write('></EMBED>')
		document.write('</OBJECT>')
	}else{
		if(alternateContent != null && alternateContent != ""){
			document.write("<iframe src='" + alternateContent + "' WIDTH='" + width + "' HEIGHT='" + height + "'></iframe>")
		}else if(alternateContentImage != null && alternateContentImage !=""){
			document.write("<img border='0' src='" + alternateContentImage + "' alt='" + name + "' usemap='#" + name + "_Map' name='" + name + "'/>")
		}else{
			document.write('<div style="width:' + width + 'px; height:' + height+ 'px; font-family:sans-serif; font-size:9pt"><h3><font color="#999999" face="Arial, Helvetica, sans-serif">You don\'t have the latest version of Macromedia Flash Player.</font></h3><p>This web site makes use of <a href="http://www.macromedia.com/software/flash/" target="_new">Macromedia<sup><font size="-1">&reg;</font></sup>Flash<sup><font size="-2">TM</font></sup></a> software. You have an old version of Macromedia Flash Player that cannot play the content we\'ve created. You may need to restart your computer after installation of the plug in.</p><p><a href="http://www.macromedia.com/go/getflashplayer"><img src="/images/global/getFlash.gif" border="0" width="88" height="31" /></a></p></div>')
		}
		
	}
}

