var isIE = (document.all) ? true : false;
var isNS = (document.layers) ? true : 0;
var isDOM = (document.getElementById) ? true : 0;
var isMac = (navigator.userAgent.indexOf("Mac") != -1) ? true : false;
var isWin = (navigator.userAgent.indexOf("Win") != -1) ? true : false;

var FlashInstalled = false;
var FlashVersion = 0;
var strFlash;
var strBackup;
var strOutput;
var strFlashDir = "";
var strImgDir = "/images/flashbackups/";
var iImageWidth = "696px";
// positioning tweaks
if (isMac && isIE) {
	divTop = 0;
} else if (isNS && isWin) {
	divTop += 2;
}

var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"] ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0);

if (plugin && parseInt(plugin.description.substring(plugin.description.indexOf(".")-1)) >= FlashVersion) 
{
	FlashInstalled = true;
} 
else if (isWin && isIE) 
{
	checkFlashForIE();
}

// flash code
strFlash = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="' + window.location.protocol + '//download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="'+iWidth+'" height="'+iHeight+'" id="'+strFlashId+'" align="middle" VIEWASTEXT>\n';
strFlash += '<param name="allowScriptAccess" value="sameDomain" />\n';
strFlash += '<param name="movie" value="'+strFlashDir+strFlashFile+'" />\n';
strFlash += '<param name="quality" value="high" />\n';
strFlash += '<param name="bgcolor" value="#cc0000" />\n';
strFlash += '<param name="scale" value="noscale" />\n';
strFlash += '<param name="wmode" value="transparent" />\n';
if (typeof strFlashVars != 'undefined') {
	strFlash += '<param name="flashvars" value="' + strFlashVars + '" />\n';
}
strFlash += '<embed src="'+strFlashDir+strFlashFile+'" wmode="transparent" scale="noscale" quality="high" bgcolor="#cc0000" width="'+iWidth+'" height="'+iHeight+'" name="'+strFlashId+'" align="middle" allowscriptaccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"';
if (typeof strFlashVars != 'undefined') {
	strFlash += ' flashvars="' + strFlashVars + '"';
}
strFlash += ' />\n';
strFlash += '</object>\n';

// backup code
strBackup = "<a href=http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash target=_blank><img src=" + strImgDir + strBackupFile + " width="+iImageWidth+" height="+iHeight+" alt='To gain the full exprience of this site, download the Macromedia Flash Player here.' border=0></a>";

//write to screen
if (FlashInstalled) 
{	
	strOutput = strFlash;
}
else
{
	//document.location.href="/GetFlash.htm";
	//strOutput = strBackup;
}

