function getXmlHttpObject() { //modified from W3C
	var xmlHttp;
	try {
		xmlHttp=new XMLHttpRequest(); // Firefox, Opera 8.0+, Safari
	}
	catch(e) {
		try {
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); // Internet Explorer
		}
  		catch(e) {
  			try {
  				xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); // Internet Explorer
  			}
    		catch (e) {
    			alert("Your browser does not support AJAX!");
    			return false;
    		}
    	}
    }
    return xmlHttp;
}

function updateData(url) {
	var xmlHttp = getXmlHttpObject();
	xmlHttp.onreadystatechange = function() {
		if(xmlHttp.readyState==4) {
			var response = xmlHttp.responseText;
			//alert(response);
			if(eval) {
				eval(response);
			} else if(window.execScript) {
				window.execScript(response);
			}
		}
	}
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}

function postData(url,data) {
	var xmlHttp = getXmlHttpObject();
	xmlHttp.onreadystatechange = function() {
		if(xmlHttp.readyState==4) {
			var response = xmlHttp.responseText;
			//alert(response);
			if(eval) {
				eval(response);
			} else if(window.execScript) {
				window.execScript(response);
			}
		}
	}
	xmlHttp.open("POST", url, true);
	xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	xmlHttp.setRequestHeader("Content-length", data.length);
	xmlHttp.setRequestHeader("Connection", "close");
	xmlHttp.send(data);
}