var bigPlayer;
var smallPlayer;
var bigVidDiv;

function getPlayerParts( playerIdOrName ) {

	if (isIE) {
		smallPlayer = document.getElementById(playerIdOrName);
	} else {
		smallPlayer = document.getElementsByName(playerIdOrName)[0];
	}

	if ( !smallPlayer ) {
		alert('This content requires the Adobe Flash Player');
	}	
}

function playVideo( id, description, thumbnail, standardVideoFile, largeVideoFile, downloadFile0, downloadFile1, downloadFile2) {
	//FIND PLAYER
	getPlayerParts();
	//CREATE OBJECT TO SEND
	var objToSend = {};
	//POPULATE OBJECT TO SEND
	objToSend.id = id;
	objToSend.description = description; //[OPTIONAL] THIS IS THE TOP LINE OF THE SMALL PLAYER
	objToSend.thumbnail = thumbnail; //[OPTIONAL] THIS IS THE IMAGE THAT WILL DISPLAY WHILE THE VIDEO IS BLANK
	objToSend.standardVideoFile = standardVideoFile; //THE VIDEO THAT WILL PLAY IN THE SMALL PLAYER
	objToSend.largeVideoFile = largeVideoFile; //THE VIDEO THAT WILL PLAY IN THE LARGE PLAYER
	objToSend.downloadFile0 = downloadFile0; //A DOWNLOADABLE VERSION OF THE VIDEO
	objToSend.downloadFile1 = downloadFile1; //A DOWNLOADABLE VERSION OF THE VIDEO
	objToSend.downloadFile1 = downloadFile2; //A DOWNLOADABLE VERSION OF THE VIDEO
	//TELL THE PLAYER TO PLAY
	if (smallPlayer.playVideo( objToSend )) {}
	else if (smallPlayer.playVideo( objToSend )) {}
	else alert("Unfortunately, the player could not be found.");
}

function playVideoByID( videoID, playerId ) {
	//FIND PLAYER
	getPlayerParts(playerId);
	//CREATE OBJECT TO SEND
	var objToSend = {};
	//POPULATE OBJECT TO SEND
	objToSend.videoID = videoID; //THE DOWNLOADABLE VERSION OF THE VIDEO
	//TELL THE PLAYER TO PLAY

	if (smallPlayer.playVideoByID( objToSend )) {}
	else if (smallPlayer.playVideoByID( objToSend )) {}
	else alert("Unfortunately, the player could not be found.");
}
function playBigVideo( thisFile, thisTime, thisID, thisDesc, thisDL0, thisDL1, thisDL2 ) {
	window.open("/mm/largePlayerPopup.html?passedFile=" + thisFile + "&passedTime=" + thisTime + "&passedID=" + thisID + "&passedDesc=" + thisDesc + "&downloadFile0=" + thisDL0 + "&downloadFile1=" + thisDL1 + "&downloadFile2=" + thisDL2, "bigPlayerWindow", "width=700,height=623,status=0,toolbar=0,location=0,menubar=0,directories=0,resizable=1,scrollbars=0");
}
function closeBigVideo() {
	bigVidDiv.style.visibility = "hidden";
}