/* 
 * ns_flash.js - version 0.002
 * Date: 01/07/2004
 * Author Brian Weil <brian@brianweil.com>
 * Newswell Studios Flash detection and embed routine.
 */
var FLASH_VERSION = 0;
var pi = (navigator.mimeTypes 
		  && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
if (pi) 
{
	var pd = navigator.plugins["Shockwave Flash"].description.split(" ");
	for (var i = 0; i < pd.length; ++i)
	{
		if (isNaN(parseInt(pd[i]))) continue;
		FLASH_VERSION = pd[i]; 
	}
}
else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 && (navigator.appVersion.indexOf("Win") >=0)) 
{	
	vbstr = '<scr' + 'ipt language="VBScript"\> \n'; 
	vbstr += 'on error resume next \n';
	vbstr += 'cnt = 3 \n';
	vbstr += 'do \n';
	vbstr += 'if IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & cnt)) <> True then \n';
	vbstr += 'FLASH_VERSION = cnt-1 \n';
	vbstr += 'exit do \n';
	vbstr += 'end if \n';
	vbstr += 'cnt = cnt + 1 \n';
	vbstr += 'loop \n';
	vbstr += '</scr' + 'ipt\> \n';
	document.write(vbstr);
}
function NS_FlashEmbed(URL, bgcolor, width, height, id, liveConnect, scaleMode, redirectUrl, altContent, requiredFlashVersion, FLASH_VERSION)
{
	liveConnect ?  liveConnect = 'true' : liveConnect = 'false';
	if (FLASH_VERSION >=  requiredFlashVersion) 
	{
		str = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"';
		str += ' codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=' + requiredFlashVersion + ',0,0,0"';
		str += ' id="' + id + '" width="' + width + '" height="' + height + '" align="center">';
		str += ' <param name="movie" value="' + URL + '"> <param name="quality" value="high"> '; 
		str += ' <param name="bgcolor" value="' + bgcolor + '"> <param name="scale" value="' + scaleMode + '" >';
		str += ' <embed src="' + URL + '" quality="high" bgcolor="' + bgcolor + '" scale="' + scaleMode + '"';
		str += ' swLiveConnect="' + liveConnect + '" width="' + width + '" height="' + height + '" name="' + id + '" align="center"';
		str += ' type="application/x-shockwave-flash"';
		str += ' pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">';
		str += ' </embed></object>';  		
		if(height = '100%')
		{
			str += '<link href="flash_fullscreen.css" type="text/css" rel="stylesheet" media="all"/>'
		}
		document.write(str);
	}
	else
	{
		redirectUrl ? window.location = redirectUrl : document.write(altContent);
	}
}