function importXML(xmlfile, xmlHandler){
    	var xmlDoc;
	if (document.implementation && document.implementation.createDocument){
		xmlDoc = document.implementation.createDocument("", "", null);
		xmlDoc.onload = function loadHandler() {
			xmlHandler(xmlDoc);
		}
	}else if (window.ActiveXObject)	{
		xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
		xmlDoc.onreadystatechange = function () {
			if (xmlDoc.readyState == 4) xmlHandler(xmlDoc);
		};
	}else{
		alert('Your browser can\'t handle this script');
		return;
	}
	xmlDoc.load(xmlfile);
}

function loadDocument(url, loadHandler){

    var xmlReq;

	if (document.implementation && document.implementation.createDocument){
		xmlReq = new XMLHttpRequest();
	}else if (window.ActiveXObject)	{
		xmlReq = new ActiveXObject("Microsoft.XMLHTTP");
	}else{
		alert('Your browser can\'t handle this script');
		return;
	}

	xmlReq.onreadystatechange = function () {
		if (xmlReq.readyState == 4) {
		  loadHandler(xmlReq.responseText);
		}
	};

	xmlReq.open("GET", url, true);
	xmlReq.send(null);
}


function loadDocumentSync(url, loadHandler){

    var xmlReq;

	if (document.implementation && document.implementation.createDocument){
		xmlReq = new XMLHttpRequest();
	}else if (window.ActiveXObject)	{
		xmlReq = new ActiveXObject("Microsoft.XMLHTTP");
	}else{
		alert('Your browser can\'t handle this script');
		return;
	}

	xmlReq.onreadystatechange = function () {
		if (xmlReq.readyState == 4) {
		  loadHandler(xmlReq.responseText);
		}
	};

	xmlReq.open("GET", url, false);
	xmlReq.send(null);
}