/*
1) The HTML needs to load this external JS
2) The flash media player embedded in the HTML page needs to be named "mediaplayer"

TO PLAU/PAUSE THE FLV BEING PLAYED
3) The onClick event triggered in the HTML page needs to call the function "callMediaPlayerPauseVideo"

TO CHANGE THE FLV BEING PLAYED
4) The OnClick event triggered in the HTML page needs to call the function "callMediaPlayerPlayVideo" and pass a new URL

*/
// Use a variable to reference the embedded SWF.
var flashMediaPlayer;

/* When the HTML page loads (via the onLoad event of the <body> tag) we have it call the initialize() function. */
function initialize() {
	/* Check if the browser is IE. If so, flashMediaPlayer is window.videoPlayer. Otherwise, it's window.document.videoPlayer. The videoPlayer is the id assigned to <object> and <embed> tags. */
	var ie = navigator.appName.indexOf("Microsoft") != -1;
	flashMediaPlayer = (ie) ? window['FLVplayer'] : document['FLVplayer'];
}

// This calls the pauseResume() function within the SWF.
function pauseplay() {
	initialize();
	flashMediaPlayer.pauseResume();
}

function playNewVideo(keyWord) {
	initialize();
	flashMediaPlayer.playVideo(keyWord );
}	