// A sequence number used to give each flash movie a unique ID.
var flashMovieSequenceNum = 1;

// Insert a flash movie into the document.  This is needed in order to work around Microsoft's "upgrade" which doesn't allow 
// flash movies to accept mouse or keyboard events unless clicked on.
// if windowMode is omitted or emtpy, then the arugment is omitted from the HTML (e.g., the movie will not be transparent)
function insert_flash(url,width,height,version,windowMode)
{
	document.writeln(get_flash_html(url,width,height,version,windowMode));
}

// Get the html for a flash movie:
function get_flash_html(url,width,height,version,windowMode)
{
	var result = "";
	var windowModeStr = "";
	
	result = '<object classid="clsid:D27CDB6E-AE6D-11CF-96B8-444553540000" id="obj'+flashMovieSequenceNum+'" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version='+version+'" border="0" width="'+width+'" height="'+height+'">';
	result += '<param name="movie" value="'+url+'">';
	result += '<param name="quality" value="High">';
	if (windowMode != null)
	{
		if (windowMode.length>0)
		{
			result += '<param name="WMode" value="'+windowMode+'">';
			windowModeStr = 'wmode="'+windowMode+'" ';
		}
	}	
	result += '<embed '+windowModeStr+'src="'+url+'" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" name="obj'+flashMovieSequenceNum+'" width="'+width+'" height="'+height+'" quality="High"></object>';
	flashMovieSequenceNum++;
	return(result);
}
