/*
 * flashFunctions.js
 * author: Scott Beacher
 * 
 */

/*
 * Variable Definitions
 */
var currentFocus;
var defaultVolume = 50;

/*
 * Function Definitions
 */
 
// returns the flash movie object 
function getFlashMovie(movieId) {
	var isIE = (navigator.appName.indexOf("Microsoft") != -1);
	return (isIE) ? window[movieId] : document[movieId];
}

// tells the passed flash app to stop any audio/video playing
function killAudio(movieId) {
	if (movieId) {
		var movieObj = getFlashMovie(movieId);
		movieObj.killAudio();
	}
}

// registers a flash app as having the current audio/video "focus" for the page
function getAudioFocus(movieId) {
	if (movieId != currentFocus) {
		killAudio(currentFocus);
		currentFocus = movieId;
	}
}

// called by the flash app to get the default (standardized) volume 
function getDefaultVolume() {
	return (defaultVolume);
}

// function to add random numbers at the end of a url to force the browser to reload the swf (instead of using the cache)
function cacheBust(swfPath) {
	return (swfPath + "?" + (Math.floor(Math.random() * 9999999)));
}