flash_versions = 9;

var flash = new Object();
flash.installed=false;
flash.version='0.0';


if (navigator.plugins && navigator.plugins.length) {
	for (x=0; x < navigator.plugins.length; x++) {
		if (navigator.plugins[x].name.indexOf('Shockwave Flash') != -1) {
			flash.version = navigator.plugins[x].description.split('Shockwave Flash')[1];
			flash.installed = true;
			break;
		}
	}
}


else if (window.ActiveXObject) {
	for (x = 2; x <= flash_versions; x++) {
		try {
			oFlash = eval("new ActiveXObject('ShockwaveFlash.ShockwaveFlash." + x + "');");
			if(oFlash) {
				flash.installed = true;
				flash.version = x + '.0';
			}
		}
		catch(e) {}
	}
}

flash.ver = Array();
for(i = 4; i <= flash_versions; i++) {
	eval("flash.ver[" + i + "] = (flash.installed && parseInt(flash.version) >= " + i + ") ? true : false;");
}


/**
  * Function: embedFlashObject();
  * This function was created to address the problems created by
  * the MS Active X security update released 4/11/06 
  * 
  * Params: 
  *	flash_url = url to SWF
  * gif_url = url to static gif replacement image in the event the user does not have
  * 		  have Flash installed
  * href = URL to be applied to the static GIF
  * alt_text = alt text to be applied to the static GIF 
  * flash_height = height of Flash image
  * flash_width = width of Flash image 
  * gif_height = height of Flash image 
  * gif_width = width of Flash image 
  * bgcolor = bgcolor of Flash image and GIF
  * name = value of name attibute in embed tag and ID of object tag
  * swLiveConnect = (true, false) Specifies whether the browser should start Java when loading the Flash Player for the first time. The default value is false if this attribute is omitted. If you use JavaScript and Flash on the same page, Java must be running for the FSCommand to work.
  * wmode = Sets the Window Mode property of the Flash movie for transparency, layering, and positioning in the browser.
  * align = alignment of Flash animation in the window
  * allowScriptAccess = script Access setting
  * quality = quality of animation playback (low, high, autolow, autohigh, best )
  * loop = whether animation should loop when played
  * navindex = ???
  * declare = ???
  * disabled = ???
  * menu = (true, false)
  * pluginspage = where to download the plugin
  * scale = (showall, noborder, exactfit)
  * salign = (l, t, r, b, tl, tr, bl, br)
  * base = Specifies the base directory or URL used to resolve all relative path statements in the Flash Player movie
  * flashvars = vars to pass into Flash file 
  * flashversion = Number: version of Flash to check for 
  * target = target for HREF attached to static GIF image
  * tabindex = tabindex for HREF attached to static GIF image
  * map = name of IMAGE MAP attached to static GIF image
  * 
  * All params should be set to an empty string if unknown unless otherwise stated
 */

function embedFlashObject(flash_url, gif_url, href, alt_text, flash_height, flash_width, gif_height, gif_width, bgcolor, name, swLiveConnect, wmode, align, allowScriptAccess, quality, loop, navindex, declare, disabled, menu, pluginspage, scale, salign, base, flashvars, flashversion, target, tabindex, map) {

if (bgcolor == "" || bgcolor == null || bgcolor == undefined) {
var bgcolor = "#FFFFFF";
}

if (flashversion == "" || flashversion == null || flashversion == undefined) {
var flashversion = 7;
}


if (gif_url != "") {

	if (parseInt(flash.version) >= flashversion)
	{
			document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="https://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,14,0" width="'+flash_width+'" height="'+flash_height+'" id="'+name+'" align="middle" navindex="'+navindex+'" declare="'+declare+'" disabled="'+disabled+'"><param name="allowScriptAccess" value="'+allowScriptAccess+'" /><param name="movie" value="'+flash_url+'" /><param name="quality" value="'+quality+'" /><param name="bgcolor" value="'+bgcolor+'" /><param name="wmode" value="'+wmode+'" /><param name="menu" value="'+menu+'" /><param name="scale" value="'+scale+'" /><param name="salign" value="'+salign+'" /><param name="base" value="'+base+'" /><param name="flashvars" value="'+flashvars+'" /><embed src="'+flash_url+'" quality="'+quality+'" bgcolor="'+bgcolor+'" width="'+flash_width+'" height="'+flash_height+'" name="'+name+'" align="'+align+'" wmode="'+wmode+'" allowScriptAccess="'+allowScriptAccess+'" type="application/x-shockwave-flash" pluginspage="'+pluginspage+'" menu="'+menu+'" scale="'+scale+'" salign="'+salign+'" base="'+base+'" flashvars="'+flashvars+'"');
		
		if (swLiveConnect != "") {
		document.write(' swliveconnect="'+swLiveConnect+'"');
		}
		
		document.write(' /></object>');
	}

	else
	{
	
		document.write('<table width="'+gif_width+'" border="0" cellpadding="0" cellspacing="0"><tr><td>');
		if (href != "") {
			document.write('<a href="'+href+'"');
			
			if (target != "") {
			document.write(' target="'+target+'"');
			}
			
			if (tabindex != "") {
			document.write(' tabindex="'+tabindex+'"');
			}
			document.write('>');
		}
		document.write('<img src="'+gif_url+'" border="0" width="'+gif_width+'" height="'+gif_height+'" alt="'+alt_text+'" title="'+alt_text+'"');
	
		if (map != "") {
		document.write(' usemap="'+map+'"');
		}
		
		document.write('>');
		
		if (href != "") {
		document.write('</a>');
		}
		document.write('</td></tr></table>');
		}
	
	
	}

else {
document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="https://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,14,0" width="'+flash_width+'" height="'+flash_height+'" id="'+name+'" align="middle" navindex="'+navindex+'" declare="'+declare+'" disabled="'+disabled+'"><param name="allowScriptAccess" value="'+allowScriptAccess+'" /><param name="movie" value="'+flash_url+'" /><param name="quality" value="'+quality+'" /><param name="bgcolor" value="'+bgcolor+'" /><param name="wmode" value="'+wmode+'" /><param name="menu" value="'+menu+'" /><param name="scale" value="'+scale+'" /><param name="salign" value="'+salign+'" /><param name="base" value="'+base+'" /><param name="flashvars" value="'+flashvars+'" ><embed src="'+flash_url+'" quality="'+quality+'" bgcolor="'+bgcolor+'" width="'+flash_width+'" height="'+flash_height+'" name="'+name+'" align="'+align+'" wmode="'+wmode+'" allowScriptAccess="'+allowScriptAccess+'" type="application/x-shockwave-flash" pluginspage="'+pluginspage+'" menu="'+menu+'" scale="'+scale+'" salign="'+salign+'" base="'+base+'" flashvars="'+flashvars+'"');

if (swLiveConnect != "") {
document.write(' swliveconnect="'+swLiveConnect+'"');
}

document.write(' /></object>');
}

}
