/*******************************************************
FLASH DETECT 2.01
All code by Ryan Parman, unless otherwise noted.
(c) 1997-2003, Ryan Parman
http://www.skyzyx.com
Distributed according to SkyGPL 2.1, http://www.skyzyx.com/license/
*******************************************************/

var flash=new Object();

// Set some base values
flash.installed=false;
flash.version=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=parseInt(navigator.plugins[x].description.split('Shockwave Flash ')[1]);
            flash.installed=true;
            break;
        }
    }
}
else if (window.ActiveXObject)
{
	// Infotech code modified from original
	// **************************************
	// For compatability with Netscape 4.x
    document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n');
    document.write('Function FlashInstalled(ByVal version) \n');
    document.write('    On Error Resume Next \n');
    document.write('    If IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & CStr(version))) Then \n');
	document.write('        FlashInstalled = True \n');
	document.write('    Else');
	document.write('        FlashInstalled = False \n');
	document.write('    End If \n');
	document.write('End Function \n');
	document.write('</SCR' + 'IPT\> \n');
	
    for (x=2; x<10; x++)
    {
        oFlash=FlashInstalled(x);
        if (oFlash)
        {
            flash.installed=true;
            flash.version=x;
        }
    }
    
    //**************************************
}

flash.ver2=(flash.installed && parseInt(flash.version) >= 2) ? true:false;
flash.ver3=(flash.installed && parseInt(flash.version) >= 3) ? true:false;
flash.ver4=(flash.installed && parseInt(flash.version) >= 4) ? true:false;
flash.ver5=(flash.installed && parseInt(flash.version) >= 5) ? true:false;
flash.ver6=(flash.installed && parseInt(flash.version) >= 6) ? true:false;
flash.ver7=(flash.installed && parseInt(flash.version) >= 7) ? true:false;
flash.ver8=(flash.installed && parseInt(flash.version) >= 8) ? true:false;
flash.ver9=(flash.installed && parseInt(flash.version) >= 9) ? true:false;


/*******************************************************
Code below this point:
(c) 2003, Infotech Canada.
http://www.infotechcanada.com/
*******************************************************/ 

function FeaturePoint(swfFile, flashVars, loop, play, quality, menu, 
	bgColor, alt, title, imageFile, isFlash, webLink, weight, width, height)
{
	this.SwfFile = swfFile;
	this.FlashVars = flashVars;
	this.Loop = loop;
	this.Play = play;
	this.Quality = quality;
	this.Menu = menu;
	this.BgColor = bgColor;
	this.Alt = alt;
	this.Title = title;
	this.ImageFile = imageFile;
	this.IsFlash = isFlash;
	this.WebLink = webLink;
	this.Weight = weight;
	this.Width = width;
	this.Height = height;
}

function WriteFlash(flashVersion, width, height, movie, flashVars, 
	play, loop, quality, menu, bgColor, wMode, alt)
{
	
	if (flash.version >= flashVersion)
	{
		var oeTags = '<object id="admovie" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ' +
		'width="' + width + '" height="' + height + '" ' +
		'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=' + flashVersion.toString() + ',0,0,0">\n' +
		'<param name="movie" value="' + movie + '">\n' +
		'<param name="flashvars" value="' + flashVars + '">\n' +
		'<param name="play" value="' + play + '">\n' +
		'<param name="loop" value="' + loop + '">\n' +
		'<param name="quality" value="' + quality + '">\n' +
		'<param name="menu" value="' + menu + '">\n' +
		'<param name="bgcolor" value="' + bgColor + '">\n' +
		'<param name="wmode" value="' + wMode + '">\n' +
		'<embed name="admovie" id="admovie" src="' + movie + '?' + flashVars + '" \n ' +
		'width="' + width + '" height="' + height + '" \n' +
		'play="' + play + '" \n' +
		'loop="' + loop + '" \n' +
		'quality="' + quality + '" \n' +
		'menu="' + menu + '" \n' +
		'type="application/x-shockwave-flash" \n' +
		'wmode="' + wMode + '" \n' +
		'pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" swLiveConnect=true>' +
		'</embed></object>';

		document.write(oeTags);
	}
	else
	{
		document.write(alt);
	}
}
