function getFlashMovie(movieName) {
	var isIE = navigator.appName.indexOf("Microsoft") != -1;
	return (isIE) ? window[movieName] : document[movieName];
};

function playVideo(video) {
	getFlashMovie("video").videoRequestFromJavascript(video);
};

function highlightVideo(video)
{
	$("#nav-video li").removeClass("selected");
	$("#nav-video li").eq(video).addClass("selected");
}

$(function() {
	$("#nav-video a").each(
		function(index) {
			$(this).bind('click', function (event) {
				$('.openTranscript').hide().removeClass('openTranscript');
				$('#transcript_'+(index+1)).show().addClass('openTranscript');
				playVideo(index);
				return false;
			});
		}
	);
	
	$('#toggleTranscript').bind('click', function() {
		if ($(this).html() == "Show Transcript") {
			$('#transcript').show();
			$(this).html('Hide Transcript');
		}
		else {
			$('#transcript').hide();
			$(this).html('Show Transcript');
		}
	});
});
