// JavaScript Document
function getFlashMovieObject(movieName) {
	if (window.document[movieName]) {
		return window.document[movieName];
	}
	if (navigator.appName.indexOf("Microsoft Internet")==-1) {
		if (document.embeds && document.embeds[movieName])
			return document.embeds[movieName];
	}
	else {
		return document.getElementById(movieName);
	}
}

function SendDataToFlashMovie(param) {

// Adobe's JavaScript function - edited some by Ektron.   
AC_FL_RunContent('codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0', 'width', '512', 'height', '371', 'title', 'BMI Video Player', 'src', 'brc/zoom_bmi_custom', 'quality', 'high', 'pluginspage', 'http://get.adobe.com/flashplayer/', 'movie', 'brc/zoom_bmi_custom', 'FlashVars', 'videos=' + param, 'allowfullscreen', 'true', 'swliveconnect', 'true', 'name', 'bmiFlashMovie', 'type', 'application/x-shockwave-flash',
		"wmode", "transparent");


// Test video player implementation using the FlashReplace JavaScript function
//FlashReplace.replace("video", "brc/zoom_bmi_custom.swf", "bmiFlashMovie", 512, 371, 0, { FlashVars:"videos=" + param });


// Test video player implementation not using 3rd party JavaScript.
//var str = "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0\" width=\"512\" height=\"371\" title=\"BMI Video Player\">";
//str += "<param name=\"movie\" value=\"brc/zoom_bmi_custom.swf\">";
//str += "<param name=\"quality\" value=\"high\">";
//str += "<param name=\"allowfullscreen\" value=\"true\"/>";
//str += "<param name=\"FlashVars\" value=\"videos=" + param + "\">";
//str += "<embed src=\"brc/zoom_bmi_custom.swf\" quality=\"high\" pluginspage=\"http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash\" type=\"application/x-shockwave-flash\" width=\"512\" height=\"371\" swliveconnect=\"true\" name=\"bmiFlashMovie\" flashvars=\"videos=" + param + "\"></embed>";
//str += "</object>";
//document.getElementById("video").innerHTML = str;


// Some Ektron code that they commented out before handing over to BMI.
//	var flashMovie=getFlashMovieObject("bmiFlashMovie");
//	flashMovie.SetVariable("videopath.text", param);
}

function ReceiveDataFromFlashMovie() {
	var flashMovie=getFlashMovieObject("bmiFlashMovie");
	var message=flashMovie.GetVariable("mediaVar");
	document.controller.Data.value=message;
}