/*
	PARAMETERS: 
	
	filePath => The relative or absolute path to the video file
	fileName => The file name.
	autoplay => true or false value
	flashPlayerSourceFolder => the relative or absolute path to where player.swf is located.

	NOTES:
	filePath: REQUIRED FIELD, if not specified function will return with an error message
	autoplay: if not specified, the default value is true
	flashPlayerSourceFolder: if not specified, the default value is the "Flash_Player/" folder

*/
function playVideo(filePath, fileName,autoplay,flashPlayerSourceFolder)
{
		//Default is the root folder.
		
		if(flashPlayerSourceFolder == undefined){ flashPlayerSourceFolder = "Flash_Player/"; }
		//The video will play automatically by default.
		if(autoplay == undefined) autoplay = true;
		
		
		var typeOfError = "ERROR in flash player playVideo function";
		if(filePath ==  "undefined")
		{
			alert(typeOfError+": filePath is not specified");
			return;
		}
		
		var PLAYER = "<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" ";

	    PLAYER += "codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\" ";

		PLAYER += "width=\"390\" height=\"273\" id=\"player\" align=\"middle\"><param name=\"allowScriptAccess\" ";

		PLAYER += "value=\"sameDomain\" /><param name=\"movie\" value=\""+flashPlayerSourceFolder+"player.swf?fileName="+filePath+fileName+"&autoplay="+autoplay+"\" />";
		
		PLAYER += "<param name=\"wmode\" value=\"transparent\" />";

		PLAYER += "<param name=\"quality\" value=\"high\" /><param name=\"bgcolor\" value=\"#ffffff\" />";

		PLAYER += "<embed src=\""+flashPlayerSourceFolder+"player.swf?fileName="+filePath+fileName+"&autoplay="+autoplay+"\" quality=\"high\" bgcolor=\"#ffffff\" ";

		PLAYER += "width=\"390\" height=\"273\" wmode=\"transparent\" name=\"player\" align=\"middle\" allowScriptAccess=\"sameDomain\" ";

		PLAYER += "type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" />";

		PLAYER += "</object>";

		document.write(PLAYER);

}