if (window.XMLHttpRequest) {xmlhttp=new XMLHttpRequest();} // code for IE7+, Firefox, Chrome, Opera, Safari
else{xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");}// code for IE6, IE5
xmlhttp.open("GET","locations.xml",false);
xmlhttp.send();
xmlDoc=xmlhttp.responseXML; 
x=xmlDoc.getElementsByTagName("LOC");
i=1;
function nav(id, i) {
	resetlinks(id);
	if (id=="FTW" || id=="IND" || id=="INS" || id=="KKM") {
		getxml(i);
		$("#info").show();
		$("#info2").hide();
		flash2='<iframe width="416" height="313" frameborder="0" style="border:0" src="https://www.google.com/maps/embed/v1/place?q=' + mapimbed + '"></iframe>';
		document.getElementById("flash2").innerHTML=flash2;
		setbottom();
	}
	else if (id=="news") {
		$("#flash2").load("newsletters.html");
		$("#info").show();
		$("#info2").hide();
		getxml(1); //presently only IND is submitting newsletters
		setbottom();
	}
	else if (id=="curriculum" || id=="aboutus" || id=="ourname" || id=="owner" || id=="2015-05" || id=="2015-04" || id=="2015-03" || id=="2015-02" || id=="2015-01" || id=="2014-12" || id=="2014-11") {
		document.getElementById("info2").innerHTML = '<embed width="500" height="442" src="files/' + id + '.pdf">';
		$("#info").hide();
		$("#info2").show();
	}
}
function setbottom() {
	bottom='<a href="https://www.google.com/maps/place/' + maplink + '" target="_blank"><div align=center class="address" itemprop="address" itemscope itemtype="http://schema.org/PostalAddress"><font class="ws11" color="#C6DEFF"><span itemprop="streetAddress">' + address + '</span><br><span itemprop="addressLocality">' + city + '</span>, <span itemprop="addressRegion">' + st + '</span> <span itemprop="postalCode">' + zip + '</span></font></div></a><div align=center><font class="ws11" color="#FFFFFF">Ph: ' + ph + '&nbsp;&nbsp;Fax: ' + fax + '</font></div><a href="mailto:' + direml + '" target="_blank"><div align=center><font class="ws11" color="#C6DEFF">' + diremltxt + '</font></div></a>';
	document.getElementById("bottom").innerHTML=bottom;
}
function resetlinks(id) {
	var links = document.getElementsByClassName("link");
	for(j=0; j<links.length; j++) {links[j].style.backgroundColor = "";}
	document.getElementById(id).style.backgroundColor = "#8888e0";
}
function getxml(i) {
	mapimbed=(x[i].getElementsByTagName("MAPIMBED")[0].childNodes[0].nodeValue);
	maplink=(x[i].getElementsByTagName("MAPLINK")[0].childNodes[0].nodeValue);
	address=(x[i].getElementsByTagName("ADDRESS")[0].childNodes[0].nodeValue);
	city=(x[i].getElementsByTagName("CITY")[0].childNodes[0].nodeValue);
	st=(x[i].getElementsByTagName("ST")[0].childNodes[0].nodeValue);
	zip=(x[i].getElementsByTagName("ZIP")[0].childNodes[0].nodeValue);
	ph=(x[i].getElementsByTagName("PH")[0].childNodes[0].nodeValue);
	fax=(x[i].getElementsByTagName("FAX")[0].childNodes[0].nodeValue);
	direml=(x[i].getElementsByTagName("DIREML")[0].childNodes[0].nodeValue);
	diremltxt=(x[i].getElementsByTagName("DIREMLTXT")[0].childNodes[0].nodeValue);
}