// JavaScript Document

var localRoot = "/"
var xmlDoc;
if (window.XMLHttpRequest)
  {
  xmlDoc=new window.XMLHttpRequest();
  xmlDoc.open("GET",localRoot + "xml/sitemap.xml",false);
  xmlDoc.send("");
  xmlDoc=xmlDoc.responseXML;
  }
// IE 5 and IE 6
else if (ActiveXObject("Microsoft.XMLDOM"))
  {
  xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
  xmlDoc.async=false;
  xmlDoc.load(localRoot + "xml/sitemap.xml");
  }

var sitemap = $("sitemap");
var section = xmlDoc.getElementsByTagName("section");
var htmlString = new Array();

for (i=0; i < section.length; i++)
{
	htmlString.push("<div class=column><b>")
	htmlString.push(section[i].getElementsByTagName("title")[0].childNodes[0].nodeValue)
	htmlString.push("</b>")
	if (section[i].getElementsByTagName("loc").length > 0)
	{
		for (n=0; n < section[i].getElementsByTagName("loc").length; n++)
		{
			htmlString.push("<a href=")
			htmlString.push(section[i].getElementsByTagName("url")[n].childNodes[0].nodeValue)
			htmlString.push(" target=")
			htmlString.push(section[i].getElementsByTagName("target")[n].childNodes[0].nodeValue)
			htmlString.push(">")
			htmlString.push(section[i].getElementsByTagName("name")[n].childNodes[0].nodeValue)
			htmlString.push("</a>")
		}
	}
	htmlString.push("</div>")
}
sitemap.innerHTML = htmlString.join("")

if ($("sitemap_page")) {
	$("sitemap_page").innerHTML = htmlString.join("")
}