// http://www.w3schools.com/Xml/xml_to_html.asp
var xmlhttp;
function loadXMLDoc(url) {
	//alert(url);
	xmlhttp=null;
	if (window.XMLHttpRequest)
	{// code for all new browsers
		xmlhttp=new XMLHttpRequest();
	}
	else if (window.ActiveXObject)
	{// code for IE5 and IE6
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}
	if (xmlhttp!=null)
	{
		xmlhttp.onreadystatechange=state_Change;
		xmlhttp.open("GET",url,true);
		xmlhttp.send(null);
	}
	else
	{
		alert("Your browser does not support XMLHTTP.");
	}
}

function state_Change() {
	if (xmlhttp.readyState==4)
	{// 4 = "loaded"
		if (xmlhttp.status==200)
		{// 200 = OK
			processXml(xmlhttp.responseText);
			//alert('loaded');
		}
		else
		{
			alert("Problem retrieving XML data");
		}
	}
}

var xmlDoc=null;
function processXml(data) {
	if (window.ActiveXObject)
	{// code for IE
		xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
		xmlDoc.async="false";
		xmlDoc.loadXML(data);
	}
	else if (document.implementation.createDocument)
	{// code for Mozilla, Firefox, Opera, etc.
		//xmlDoc=document.implementation.createDocument("","",null);
		parser=new DOMParser();
		var xmlDoc=parser.parseFromString(data,"text/xml");
	}
	else
	{
		alert('Your browser cannot handle this script');
	}
	if (xmlDoc!=null)
	{
		xmlDoc.async=false;
		//xmlDoc.load("cd_catalog.xml");

		var divid=null;
		var divcontent=null;

		var x=xmlDoc.getElementsByTagName("DIV");
		for (i=0;i<x.length;i++)
		{
			document.getElementById(x[i].getElementsByTagName("ID")[0].childNodes[0].nodeValue).innerHTML=x[i].getElementsByTagName("CONTENT")[0].childNodes[0].nodeValue;
		}
	}
}