/*

John,
 
Here is the script I use on the rcworks.com uber site.
 
The first four arguments are mandatory:
container (id if the HTML div), width, height, file name.
 
Seb

*/

function writeFlash (_container, _width, _height, _fileName, _skip, _flashReplacement)
	{
	try
		{
		var o_container = document.getElementById(_container);	
		if (o_container != null)
			{	
			flashOutput = "";
			if (_skip)
				flashOutput  += "<p id=\"skipflash\" class=\"skipbutton\"><a href=\"default.asp?nf=0\">Skip Flash &gt;&gt;&gt;</a></p>";
			// Check if the current browser is IE or not and write the beginning of the Flash Object html code accordingly...
			if (navigator.appName != "Microsoft Internet Explorer")
				flashOutput += "<object type=\"application/x-shockwave-flash\" data=\"" + _fileName + "\" width=\"" + _width + "\" height=\"" + _height + "\" id=\"flMovie\">";
			else
				{	
				flashOutput += "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0\" width=\"" + _width + "\" height=\"" + _height + "\" id=\"flMovie\">";
				flashOutput += "<param name=\"movie\" value=\"" + _fileName + "\" />";		
				}
			flashOutput += "<param name=\"wmode\" value=\"transparent\">";
			flashOutput += "<p>Please download Flash Player from the <a href=\"http://www.adobe.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash&Lang=English\">Macromadia</a> website.</p>";
			// If any replacement has been provided, insert it...
			if (_flashReplacement != undefined)
				flashOutput += _flashReplacement;
			flashOutput += "</object>";
			o_container.innerHTML = flashOutput;
			}		
		}
	catch (_e)
		{
		alert("Exception thrown!\n\n"
			+ "\tfile:\tscript/content.js  \n" 
			+ "\terrno:\t" + (_e.number & 0xFFFF) + "  \n"
			+ "\tname:\t" + _e.name + "  \n"
			+ "\tdesc:\t" + _e.description + "  \n"
			+ "\tmsg:\t" + _e.message + "  ");
		}
	}

var flashArea = null;

function insertFlash (_result)
	{
	flashArea = document.getElementById("flashArea");
	flashArea.innerHTML = _result;
	flashArea.style.display = "inline";
	var playerHeight = flashArea.clientHeight;
	flashArea.style.top = document.body.scrollTop + (document.body.clientHeight / 2) - (550 / 2);
	writeFlash("flashContainer", 550, 415, "rcsnews.swf");
	setTimeout("flashArea.style.top = document.body.scrollTop + (document.body.clientHeight / 2) - (550 / 2);", 1);
	}

function playFlash ()
	{
	makeAjaxRequest("flash.htm", insertFlash);
	}

// DIRECT CODE:

document.write('<div id="flashArea" style="display:none; position:absolute;"></div>');


