// Globals
// Major version of Flash required
var requiredMajorVersion = 9;
// Minor version of Flash required
var requiredMinorVersion = 0;
// Minor version of Flash required
var requiredRevision = 124;

var playType='';
var playTypeID='';


function Flash_Detection(swfname,swfid,divid,no_flash_file)
{
    var hasProductInstall = DetectFlashVer(6, 0, 65);

    // Version check based upon the values defined in globals
    var hasRequestedVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);

    if ( hasProductInstall && !hasRequestedVersion )
    {
        // DO NOT MODIFY THE FOLLOWING FOUR LINES
        // Location visited after installation is complete if installation is required
        var MMPlayerType = (isIE == true) ? "ActiveX" : "PlugIn";
        var MMredirectURL = window.location;
        document.title = document.title.slice(0, 47) + " - Flash Player Installation";
        var MMdoctitle = document.title;
        generateSWFObject(swfname,swfid,divid);
    }
    else if (hasRequestedVersion)
    {
        // if we've detected an acceptable version
        // embed the Flash Content SWF when all tests are passed
        generateSWFObject(swfname,swfid,divid);
    }
    else
    {
        // flash is too old or we can't detect the plugin
		var divobj = document.getElementById(divid);
		divobj.setAttribute("class", "");
        var alternateContent = '<a href="index.html"><img src=\"/img/logos/' + no_flash_file + '\" alt=\"2xElliot\" title=\"2xElliot\"/></a>';
        document.write(alternateContent);  // insert non-flash content
    }
}

function generateSWFObject(swfname,swfid,divid)
{
    var so = new SWFObject(swfname, swfid, "241","207", "9");
/*								'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',
								'width', '241',
								'height', '207',
								'src', '/swf/pre-loader',
								'quality', 'high',
								'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
								'align', 'middle',
								'play', 'true',
								'loop', 'true',
								'scale', 'showall',
								'wmode', 'transparent',
								'devicefont', 'false',
								'id', 'pre-loader',
								'name', 'pre-loader',
								'menu', 'true',
								'allowFullScreen', 'false',
								'allowScriptAccess','sameDomain',
								'movie', '/swf/pre-loader',
								'salign', ''*/

	so.addParam("name",swfid);
    so.addParam("id",swfid);
    so.addParam("width" , "241");
    so.addParam("height" ,"207");
    so.addParam("quality", "high");
    so.addParam("allowScriptAccess", "sameDomain");
    so.addParam("movie", swfname);
    so.addParam("quality", "high");
    so.addParam("wmode", "transparent");
    so.addParam("scale", "noscale");
    so.addParam("salign", "lt");
    so.write(divid);
}


