// JavaScript Document
function getHTTPObject() {
	var xmlhttp;
	var browser=	 navigator.appName;
	if ( browser == "Microsoft Internet Explorer" ) {
		xmlhttp= new ActiveXObject("Microsoft.XMLHTTP");
	}
	else {
		xmlhttp= new XMLHttpRequest();
		xmlhttp.overrideMimeType('text/xml');
	}
	return xmlhttp;
}

var http = getHTTPObject();  //We create the HTTP Object

function doAJAX(param, url) {
	if(url == null) {
		url = "index.php";
	}
	param = param + '&xml=true';
	http.open("POST", url, true);
	http.onreadystatechange = handleAJAX;
	http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	http.send(param);
}

function handleAJAX() {
	if ( http.readyState == 4 ) {
		//alert(http.responseText);
		var xml = http.responseXML.getElementsByTagName('result')[0];
		var action = http.responseXML.getElementsByTagName('result')[0].getAttribute("action");
		switch(action) {
			case 'getMarkerInfoXML':
				showMarkerInfo(xml);
				break;
		}
	}
}