// JavaScript Document

var xmlDoc = null;
var xmlHttp = null;

function state_Change()
{
	if (xmlHttp.readyState==4) {	//   4 = "Loaded"
		if (xmlHttp.status==200) {	// 200 = "OK"

			xmlDoc = xmlHttp.responseXML.documentElement;

		} else {
			alert("Problem retrieving XML data: " + xmlHttp.statusText);
		}
	}
}

function importXML(whichXML)
{
	if (window.ActiveXObject){
		// code for IE
		xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
	
	} else if (document.implementation.createDocument){
		// code for Mozilla, Firefox, Opera, etc.
		xmlDoc=document.implementation.createDocument("","",null);
	
	} else {
		alert("Your browser cannot handle this script.");
	}

	if (xmlDoc!=null)
	{ 
		try {
			xmlDoc.async=false;
			xmlDoc.load(whichXML);
			
		} catch(e) {
			if (window.XMLHttpRequest) {
				// Code for Safari, Chrome
				xmlHttp=new XMLHttpRequest();
				xmlHttp.onreadystatechange=state_Change;
				xmlHttp.open("GET", whichXML, false);
				xmlHttp.send(null);
			}
		}
	}
}