//AJAX send function
function sendRequest(type, url, async, callbackfunc, sendparams){
	if(!url || url.length == 0) return null;
	if(!type || type.length == 0) type = 'GET';
	if(async == null || async.length == 0) async = true;
	var xmlhttp;	
	if (window.XMLHttpRequest)
  	{// code for IE7+, Firefox, Chrome, Opera, Safari
  		xmlhttp=new XMLHttpRequest();
  	}
	else
	{// code for IE6, IE5
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}
	if (callbackfunc)
		xmlhttp.onreadystatechange=callbackfunc;
	xmlhttp.open(type,url,async);
	if(sendparams == null)	
		xmlhttp.send();
	else
		xmlhttp.send(sendparams);
	if(async)return null;
	
	if (xmlhttp.readyState==4 && xmlhttp.status==200){    
    	return xmlhttp.responseText;    
    }else{
    	return null;
    }
}
