/*
example usage:
onclick="ajaxCall('page.php', myCallback)"
function myCallback(response) {alert(response);}
*/

function ajaxCall(url, callback) {
var req;
try{req=new ActiveXObject('Msxml2.XMLHTTP')}
catch(x){try{req=new ActiveXObject('Microsoft.XMLHTTP')}
catch(x){try{req=new XMLHttpRequest()}
catch(x){alert('no ajax')}}}
	if(req){
		req.onreadystatechange=checkstate;
		req.open('GET',url,true);
		req.send(null);
	}
	function checkstate(){
		if(req.readyState==4){
			if(!callback){
				eval(req.responseText);
			}else{
				callback(req.responseText);
			}
		}
	}
}
