/*
The Following Variables must be defined in the file which links to this Javascript Library.

	var movie_width = The width of the image/movie expressed in pixels.
	var movie_height = The height of the image/movie expressed in pixels.
	var movie_altText = The alternate text for the image/movie
	var movie_image = URI to the static image File of the Movie
	var movie_flash = URI to the Flash File of the Movie - Set as '' if not a Flash banner.
	var movie_link = URI for the hyperlink associated with the image/movie
	var servletImage = URI to Reporting Servlet - Image version
	var servletFlash = URI to Reporting Servlet - Movie version
	var MM_FlashCanPlay = Boolean indicating whether Flash version can play - default = 'true'
	var MM_contentVersion = Indicator of Flash Version to use
	var on_click = URI for hyperlink (added for new window)
*/              
	var FlashCanPlay;
	var contentVersion = 6;
	var detectFlash = function(){
		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 PluginVersion = words[i]; 
			    }
			 FlashCanPlay = PluginVersion >= 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('FlashCanPlay = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & MM_contentVersion)))\n');
			document.write('</SCR' + 'IPT\> \n');
		}
	}
	detectFlash();
if ( FlashCanPlay && movie_flash ) {
	document.write('<object title="'+movie_altText+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'); 
	document.write('  codebase="' +window.location.protocol.toString()+ '//download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" ');
	document.write(' id="flash-exmaple" width="' +movie_width+ '" height="' +movie_height+ '">'); 
	document.write(' <param name="movie" value="' +movie_flash+ '"> <param name="quality" value="high"> <param name="wmode" value="transparent"> <param name="bgcolor" value="#FFFFFF">  ');
	document.write(' <embed src="' +movie_flash+ '" quality="high" wmode="transparent" bgcolor="#FFFFFF"  '); 
	document.write(' swLiveConnect=FALSE width="' +movie_width+ '" height="' +movie_height+ '" name="flashgordon" ALIGN=""');
	document.write(' type="application/x-shockwave-flash" pluginspage="' +window.location.protocol.toString()+ '//www.macromedia.com/go/getflashplayer" /></object>');
	document.write('<img src="'+servletFlash+'" width="0" height="0" border="0" vspace="0" hspace="0">');
} else {
	document.write('<a href="' +movie_link+ '" onclick="'+on_click+ '"><img src="' +movie_image+ '" alt="' +movie_altText+ '" width="' + movie_width+ '" height="' +movie_height+ '" border="0"></a>');
	document.write('<img src="'+servletImage+'" width="0" height="0" border="0" vspace="0" hspace="0">');
} 
