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