<% clearTranscripts() %>
<% openDiv = null %>
<% if (isarabic && main.course.lang == "tl") { window.document.body.style.direction = "rtl"; var lidir = "rtl"; } else { window.document.body.style.direction = "ltr"; var lidir = ""; } %>


<h1><%= main.course.title %> - <%= main.course.subtitle %></h1>
<% if (main.chapter.type != "CourseTour") { %>
	<h2><%= main.chapter.getLI() %> <%= main.chapter.title %></h2>
<%}%>
<% for (var j=0; j<main.chapter.sections.length; j++) { %>
	<% if (main.chapter.type != "CourseTour") { %>
		<h3><%= main.chapter.sections[j].getLI(lidir) %> <%= main.chapter.sections[j].title %></h3>
	<%}%>
	<% for (var k=0; k<main.chapter.sections[j].topics.length; k++) { %>
		<% if (main.chapter.type != "CourseTour") { %>
			<b><i><%= main.chapter.sections[j].topics[k].getLI(lidir) %> <%= main.chapter.sections[j].topics[k].title %></i></b><br/><br/>
		<%}%>
		<% for (var l=0; l<main.chapter.sections[j].topics[k].pages.length; l++) { %>
			<b><%= main.theme.getThemeItem("indexpage") %> <%= main.chapter.sections[j].topics[k].pages[l].num %>:</b><br/>
			<% if (main.chapter.sections[j].topics[k].pages[l].type != "FullScreen") { %>
				<%= main.chapter.sections[j].topics[k].pages[l].contenttext %>
			<% } %>
			<% var mediaref = main.chapter.sections[j].topics[k].pages[l].media.file %>
			<% var externalref = main.chapter.sections[j].topics[k].pages[l].media.external %>
			<% var mediatyperef = main.chapter.sections[j].topics[k].pages[l].media.majortype %>
			<% var oid = main.chapter.sections[j].topics[k].pages[l].media.oid %>
			<% var mediaplayer = "../../swf/mediaplayer.swf" %>
			<% var mediawidth = 862 %>
			<% var mediaheight = 395 %>
			<% if (mediaref.indexOf('.flv') > -1) { %>
				<% mediaplayer = "../../swf/flvplayer.swf" %>
				<% mediawidth = 500 %>
				<% mediaheight = 300 %>
			<% } %>
			<% if (mediaref.indexOf('.swf') > -1) { %>
				<% texttranscript = mediaref.substring(0, mediaref.indexOf('.swf')) %>
				<% texttranscript = texttranscript+"transcript.xml" %>
			<% } else if (mediaref.substr(mediaref.length-1,mediaref.length) == "/") { %>
				<% texttranscript = mediaref.substring(0, mediaref.length-1) %>
				<% texttranscript = texttranscript+"transcript.xml" %>
			<% } else if (mediaref.indexOf('.flv') > -1) { %>
				<% texttranscript = mediaref.substring(0, mediaref.indexOf('.flv')) %>
				<% texttranscript = texttranscript+"transcript.xml" %>
			<% } %>
			<% if (getMediaPresentation() == "choice") { %>
			<a href="javascript:loadTranscript('<%=texttranscript%>','media<%=oid%>', 'brief');" alt="<%= main.theme.getThemeItem('viewtranscript') %>"><%= main.theme.getThemeItem('viewtranscript') %></a> | <a href="javascript:loadVisualMedia('<%=oid%>','<%=mediawidth%>','<%=mediaheight%>','<%=mediaplayer%>','<%=mediaref%>','<%=externalref%>','<%=mediatyperef%>');" alt="V<%= main.theme.getThemeItem('viewmedia') %>"><%= main.theme.getThemeItem('viewmedia') %></a>
			<% } else if (getMediaPresentation() == "transbrief") { %>
				<% var to = new transcriptObject(texttranscript, "media"+oid, "brief") %>
				<% addTranscript(to) %>
			<% } else if (getMediaPresentation() == "transfull") { %>
				<% addTranscript({url:texttranscript, target:"media"+oid, type:"full"}) %>
			<% } else if (getMediaPresentation() == "visual") { %>
				<a href="javascript:loadVisualMedia('<%=oid%>','<%=mediawidth%>','<%=mediaheight%>','<%=mediaplayer%>','<%=mediaref%>','<%=externalref%>','<%=mediatyperef%>');" alt="V<%= main.theme.getThemeItem('viewmedia') %>"><%= main.theme.getThemeItem('viewmedia') %></a>
			<% } %>
			<br/><br/>
			<div id="media<%=oid%>" name="media<%=oid%>">
			</div>
			<br/>
			<br/>
			<% } %>
	<% } %>
<% } %>
<hr/>

