
	// Presenter specific initialization and functions
	
	// Init current module
	iCurrentModule = 1;
	//document.pageform.previousbutton.disabled = true;


	// Jump to a specific module in the array
	function GotoModule(iModuleIndex) {
	
		frames['moduleframe'].location.href = aModules[iModuleIndex];
		iCurrentModule = iModuleIndex;
		
		//if (iCurrentModule >= aModules.length - 1) {
		//	document.pageform.nextbutton.disabled = true;
		//} else {
		//	document.pageform.nextbutton.disabled = false;
		//}
		
		//if (iCurrentModule <= 1) {
		//	document.pageform.previousbutton.disabled = true;
		//} else {
		//	document.pageform.previousbutton.disabled = false;
		//}
		
		document.pageform.currentmodule.selectedIndex = iCurrentModule - 1;
		
	}
	
	
	// Restart the presentation - go to the intro page
	function RestartPresentation() {
		GotoModule(1);
	}
	
	
	// Goto the first module past the presentation intro page in the array
	function FirstModule() {
		if (aModules.length > 1) {
			GotoModule(2);
		}
	}
	
	
	// Goto the last module in the array
	function LastModule() {
		GotoModule(aModules.length);
	}
	
	
	// Skip the next module immediately following the current one
	function SkipNextModule() {
		if (iCurrentModule < aModules.length - 2) {
			GotoModule(iCurrentModule + 2);
		}
	}
	
	
	// Goto the next module in the array
	function NextModule() {
		if (iCurrentModule < aModules.length - 1) {
			GotoModule(iCurrentModule + 1);
		}
	}
	
	
	// Goto the previous module in the array
	function PreviousModule() {
		if (iCurrentModule + 1 > 2) {
			GotoModule(iCurrentModule - 1);
		}
	}
	
	
	// Leaves the current presentation and goes to the specified one
	function GotoPresentation(iID) {
		location.href = sAppDomain + iID;
	}
	
	
	// Leaves the presentation and goes to a specific URL
	function GotoURL(sURL) {
		location.href = sURL;
	}
	
	
	// Goes to a specific URL in a new browser window
	function GotoURLNewWindow(sURL) {
		window.open(sURL, '');
	}
	
	
	// Goes to a URL, but retains the main presentation navigation
	function LoadURL(sURL) {
		frames['moduleframe'].location.href = sURL;
	}
	
	
	// Closes the presentation window
	function ClosePresentation() {
		window.self.close();
	}
	
	
	// aMedia = new Array();
	// aMedia[mediaid] = "320,240"
	
	// Opens a popup window containing the given multimedia item
	function MediaPopup(sTextKey) {
		var iWinXPadding = 30;
		var iWinYPadding = 60;
		var aMediaInfo = aMedia[sTextKey].split(",");
		var iWidth = parseInt(aMediaInfo[0]);
		var iHeight = parseInt(aMediaInfo[1]);
		var iTheme = parseInt(aMediaInfo[2]);
		var sURL = sAppDomain + 'media/?textkey=' + sTextKey + '&theme=' + iTheme;
		if (bLowbandwidth) {
			sURL += '&b=lowband';
		}
		DoPopup(sURL, 'mediawin', iWidth + iWinXPadding, iHeight + iWinYPadding, 0, 5, 0, 0, 'alwaysraised=1,dependent=1,directories=0,menubar=0,resizable=1,scrollbars=0,status=0,titlebar=0');
	}
	
	
	// Opens a popup window of a given size with the specified URL
	function OpenPopup(sURL, iWidth, iHeight) {
		DoPopup(sURL, 'popupwin', iWidth, iHeight, 0, 5, 0, 0, 'alwaysraised=1,dependent=1,directories=0,menubar=0,resizable=1,scrollbars=0,status=0,titlebar=0');
	}
	
	// Creates a video object in the page to get around
	// the bullcrap Eolas patent issue.
	function CreateMovieObject(sParentDiv, sVideoID, sURL, sWidth, sHeight, bFullscreen, bShowControls) {
		
		var sEmbedCode = "";
			
		/*sEmbedCode = '<object id="' + sVideoID + '" width="' + sWidth + '" height="' + sHeight + '" classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" type="video/x-ms-wmv">' +
			'<param name="baseURL" value=".">' +
			'<param name="URL" value="' + sURL + '">' +
			'<param name="SendPlayStateChangeEvents" value="true">' +
			'<param name="AllowChangeDisplaySize" value="true">' +
			'<param name="AutoStart" value="true">' +
			'<param name="uiMode" value="none">' +
			'<param name="showcontrols" value="false">' +
			'<param name="showpositioncontrols" value="false">' +
			'<param name="showstatusbar" value="false">' +
			'<param name="showtracker" value="false">' +
			'<param name="stretchToFit" value="true">' +
			'<param name="PlayCount" value="1">' +
			'<param name="fullScreen" value="' + bFullscreen + '">' +
			'<embed id="' + sVideoID + 'embed" height="' + sHeight + '" AllowChangeDisplaySize="true" scale="aspect" stretchToFit="true" url="' + sURL + '" src="' + sURL + '" type="video/quicktime" width="' + sWidth + '" sendplaystatechangeevents="true" autostart="true" uimode="none" controller="false" showcontrols="false" showpositioncontrols="false" showstatusbar="false" showtracker="false" playcount="1" fullscreen="' + bFullscreen + '"></embed>' +
		'</object>'*/
			
		sEmbedCode = '' + 
				'<object id="' + sVideoID + '"  classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" width="' + sWidth + '" height="' + sHeight + '">' + 
				'	<param name="baseURL" value=".">' + 
				'	<param name="url" value="' + sURL + '" />' + 
				'	<param name="sendplaystatechangeevents" value="true" />' + 
				'	<param name="allowchangedisplaysize" value="true" />' + 
				'	<param name="autostart" value="true" />' + 
				'	<param name="uimode" value="' + (bShowControls ? 'full' : 'none') + '" />' + 
				'	<param name="showcontrols" value="' + bShowControls + '" />' + 
				'	<param name="showpositioncontrols" value="false" />' + 
				'	<param name="showstatusbar" value="false" />' + 
				'	<param name="showtracker" value="false" />' + 
				'	<param name="stretchtofit" value="true" />' + 
				'	<param name="playcount" value="1" />' + 
				'	<param name="fullscreen" value="' + bFullscreen + '" />' + 

				'	<embed id="' + sVideoID + 'embed" ' + 
				'		type="video/quicktime" ' + 
				'		src="' + (sURL.substring(0,7) == "file://" ? sURL.substring(7, sURL.length - 7) : sURL) + '" ' + 
				'		qtsrc="' + sURL + '" ' + 
				'		height="' + sHeight + '" ' + 
				'		width="' + sWidth + '" ' + 
				'		allowchangedisplaysize="true" ' + 
				'		scale="aspect" ' + 
				'		autostart="true" ' + 
				'		showcontrols="' + bShowControls + '" ' + 
				'		sendplaystatechangeevents="true" ' +
				'		controller="' + bShowControls + '"></embed>' + 

				'</object>'
		
		document.getElementById(sParentDiv).innerHTML = sEmbedCode;
		
	}
