// JavaScript Document

function createIndex()
{
	var caseStudy = xmlDoc.getElementsByTagName("JOB");
	var caseStudyLength = caseStudy.length;

	document.write("<ul id='jobs'>");
	for (var i=0; i<caseStudyLength; i++) {
		document.write("<li>");
		document.write("<p class='title'>");
		document.write(xmlDoc.getElementsByTagName('TITLE')[i].firstChild.data);
		document.write("</p><p class='location'>");
		document.write(xmlDoc.getElementsByTagName("LOCATION")[i].firstChild.data);
		document.write("</p><p class='description'>");
		if (xmlDoc.getElementsByTagName("DESCRIPTION")[i].hasChildNodes()==1) {
			document.write(xmlDoc.getElementsByTagName("DESCRIPTION")[i].firstChild.data);
		}
		document.write("</p>");
		document.write("</li>");
	}
	document.write("</ul>");
}

function careerslist(whichXML) {
	//var whichXML = "careers_internship.xml";
	importXML(whichXML);
	createIndex();
}