/*
 * ID of the SWF. "-1" means it hasn't been found yet.
 */
var curMovie = "-1";

/**
  * Returns the SWF as a DOM object. IE-safe.
  */
function thisMovie(movieName) {
	if (navigator.appName.indexOf("Microsoft") != -1) {
		return window[movieName];
	} else {
		return document[movieName];
	}
}

/**
  * Send something to the Flash player for use in the audioPlayer or videoPlayer SWFs.
  */
function sendToActionScript(value, num) {
	//var num = $('#totalFlashItems').attr('count');
	//for (i=0; i<num; i++) {
	if (curMovie != "-1") {
		var item = "myDynamicContent_"+curMovie;
		//alert(item + ":" + value + ":"+ curMovie);
		thisMovie(item).sendToActionScript(value);
	}
	curMovie = num;
	//}
}

/**
  * Alias for sendToActionScript()
  */
function sendToJavaScript(value, num) {
	sendToActionScript(value, num);
}
