
function createFlash(object)
//PRE: 	"object" is an empty object element (literally an element of type "object") that exists within the document body.
//			object.movie, object.quality, object.width, object.height must all be set prior to running this function on "object".
//		object.movie is the url of the movie to load into object.
//		object.quality is the quality of the movie to be played in object (low, medium, high, best).
//POST:	returns true if movie was successfully loaded, and false if not.
//REQUIRES:	detectFlash();
{
	if(!detectFlash() || top.uberPieceOfJunk || !object) return false;
	
	//classid adds the necessary PARAMs and probably does some other stuff.
	object.classid = "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000";
	object.codebase = "http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0";
	
	//Update PARAMs instead of adding for IE 5.5 compatiblity.
	var params = object.getElementsByTagName('PARAM');
	for(var i = 0; i < params.length; ++i) {
		if(params[i].name == 'movie') {
			params[i].value = object.movie;
		}
		if(params[i].name == 'quality') {
			params[i].value = object.quality;
		}
	}
	
	/* This code chunk is broken in IE < 5.5
	object.innerHTML = '<param name="movie" value="'+ object.movie +'"><param name="quality" value="'+ object.quality +'">';
	var movie_param = document.createElement('PARAM'); document.body.appendChild(movie_param);
		movie_param.name = "movie";
		movie_param.value = object.movie;
	object.appendChild(movie_param);
	var quality_param = document.createElement('PARAM');
		quality_param.name = "quality";
		quality_param.value = object.quality;
	object.appendChild(quality_param);
	*/
	
	//Non-IE browser technique
	if(navigator.userAgent.indexOf('MSIE') < 0 || navigator.userAgent.indexOf('Opera') > -1) {
		var embed = document.createElement('EMBED');
			embed.src = object.movie;
			embed.quality = object.quality;
			embed.pluginspage = "http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash";
			embed.type = "application/x-shockwave-flash";
			embed.width = object.width;
			embed.height = object.height;
		object.appendChild(embed);
	}
	//IE Mac exiting due to problems
	else if(navigator.platform == 'MacPPC') { return false; }
	else { 
		object.LoadMovie(0, object.movie);
	}
	
	return true;
}

