
function fullScreen()
{
	if(Player.playState == 3) Player.fullScreen = 'true';
}

function playNextVideo()
{
	// Release player resources
	//Player.close();
	
	// Proceed to next item in playlist
	if(nextSegmentID != 0)
		location.href = "player.asp?playlistID=" + playlistID + "&segmentID=" + nextSegmentID;
	else if(nextMediaID != 0)
		location.href = "player.asp?playlistID=" + playlistID + "&mediaID=" + nextMediaID;
}

function playPrevVideo()
{
	// Release player resources
	//Player.close();
	
	// Proceed to prev item in playlist
	if(prevSegmentID != 0)
		location.href = "player.asp?playlistID=" + playlistID + "&segmentID=" + prevSegmentID;
	else if(prevMediaID != 0)
		location.href = "player.asp?playlistID=" + playlistID + "&mediaID=" + prevMediaID;
}

// opens up a Full Screen Quicktime movie with or without captions
function open_fullscreen_qt(movieFile, smilFile)
{	
	// stop playing the embedded movie on the page
	var movie = document.movieBox;
	movie.Stop();
	
	// create a link to the SMIL file for the movie 
	var href= "/smil/dynSmil.smil?size=full&mediaTarget=" + movieFile + "&smilTarget=" + smilFile;
			
	// put a hidden embed tag on the page that will cause Quicktime to open the SMIL file
	// this avoids creating a pop up window, which might be blocked by some browsers
	var embedTag = document.createElement("embed");
	embedTag.setAttribute("hidden", "true");
	embedTag.setAttribute("src", "./smil/fullscreen.qti"); // this preview image is never shown, but seems to be required by Internet Explorer for the movie to play
	embedTag.setAttribute("type", "image/x-quicktime");
	embedTag.setAttribute("autohref", "true");
	embedTag.setAttribute("autostart", "true");
	embedTag.setAttribute("controller", "false");
	embedTag.setAttribute("href", href);
	embedTag.setAttribute("target", "quicktimeplayer");

	var body = document.getElementsByTagName("body");
	body[0].appendChild(embedTag);
	
}
