/*
01/22/2007
Desciption : This Function adds javacript to the Take 5 page to play the given flash movie.
Parameters : 
	movieFileName : Flash movie (.swf) file name. 
	Note : The function automatically assumes the default url (/Vids/) of the flash movie files.
*/
function AddFlashObject(movieFileName) 
{
	
	if (movieFileName==null)
	{
		alert("Please provide a valid flash movie file name.");
		return;
	}
	
	//Flash movie url
	var movieSrc="\"" + movieFileName +  "\"";
	
	///Find the span where the javascript need to be rendered.
	objSpan=document.getElementById('spanFlashMovie');
	
	
	if (objSpan==null)
	{
		 alert("Unable to find the control with id spanFlashMovie  on the page.'");
		 return;
	}
	
	var objectTag="";
	
	///Create javascript to render the flash object.
	objectTag="<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\" width=\"320\" height=\"278\" id=\"darius_gabriel\" align=\"left\"> ";
	objectTag=objectTag + "<param name=\"allowScriptAccess\" value=\"sameDomain\" /> ";
	objectTag=objectTag + "<param name=\"movie\" value=\"" + movieFileName + "\"/>"; 
	objectTag=objectTag + "<param name=\"quality\" value=\"high\" /> "	;
	objectTag=objectTag + "<param name=\"bgcolor\" value=\"#cbcb96\" /> ";
	objectTag=objectTag + " <embed src=\"" + movieFileName +  "\" quality=\"high\" bgcolor=\"#cbcb96\" width=\"320\" height=\"278\" name=\"darius_gabriel\" align=\"middle\" allowScriptAccess=\"sameDomain\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" />";
	objectTag=objectTag + "</object>";
	
	//alert(objectTag);
	
	//Assign javascript.
	objSpan.innerHTML=objectTag;
	
}
