// JavaScript Document


function createIndex()
{
	var presentation = xmlDoc.getElementsByTagName("LECTURE");
	var presentationLength = presentation.length;
	var presentationList = "";
		
	// Main List
	for (var i=0; i<presentationLength; i++) {
		presentationList += "<div class='lecture'>";
		presentationList += "<h2 class='title'>";
		/*
		if (xmlDoc.getElementsByTagName("LOGO")[i].hasChildNodes()==1){
			presentationList += "<img src='"+xmlDoc.getElementsByTagName("LOGO")[i].firstChild.data+"' alt='' class='right' />";
		}
		*/
		presentationList += "<a class='pdf' href='"+(xmlDoc.getElementsByTagName("URL")[i].firstChild.data)+"' target='_blank'>";
		presentationList += xmlDoc.getElementsByTagName('TITLE')[i].firstChild.data;
		presentationList += "</a></h2>";
		presentationList += "<p class='credits'>";
		presentationList += xmlDoc.getElementsByTagName("CONFERENCE")[i].firstChild.data+"<br/>";
		presentationList += xmlDoc.getElementsByTagName("SPEAKER")[i].firstChild.data;
		presentationList += "</p></div>";
	}
	document.write(presentationList);
}

function createIndex_home()
{
	var presentation = xmlDoc.getElementsByTagName("LECTURE");
	
	var presentationList = "<table width=100% border='0' cellspacing='10' cellpadding='0'>";

	// Main List
	for (var i=0; i<3; i++) {
		presentationList += "<tr>";
		presentationList += "<td align='left' width=45%>";
		presentationList += "<a class='pdf' href='"+(xmlDoc.getElementsByTagName("URL")[i].firstChild.data)+"' target='_blank'>";
		presentationList += xmlDoc.getElementsByTagName('TITLE')[i].firstChild.data;
		presentationList += "</a></td>";
		presentationList += "<td width=55%>";
		presentationList += "<p class='credits'>"+xmlDoc.getElementsByTagName('CONFERENCE')[i].firstChild.data+"</p></td>";
		presentationList += "</tr>";
		if (i==0 || i==1) { presentationList += "<tr><td class='divider' colspan='2'><div style='border-bottom:1px solid #999;'></div></td></tr>"; }
	}
	presentationList += "</table>";
	document.write(presentationList);
}


var whichXML = "/resources/presentations/presentations.xml";


function presentations_index() {
	importXML(whichXML);
	createIndex();
}

function presentationsTitle_home() {
	importXML(whichXML);
	createIndex_home();
}
