function GetXmlHttpObject(){ 
	var objXMLHttp=null;
	if (window.XMLHttpRequest)
	{
		objXMLHttp=new XMLHttpRequest();
	}
	else if (window.ActiveXObject)
	{
		objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP");
	}
	return objXMLHttp;
} 

function createRequestObject() {
	var xmlhttp;
	try { xmlhttp=new ActiveXObject("Msxml2.XMLHTTP"); }
  catch(e) {
    try { xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");}
    catch(E) { xmlhttp=null; }
  }
  if(!xmlhttp && typeof XMLHttpRequest != "undefined") {
  	xmlhttp=new XMLHttpRequest();
  	
  }
	return  xmlhttp;
}

function doRequest(url,method,data,handle){
 
 http=createRequestObject();

	if (http==null)
		alert ("Browser does not support HTTP Request.");
	
	http.onreadystatechange = handle;
	
	http.open(method,  url, true);
	http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');	
		
	
	if(method=="POST"){
		if(data == null){			
			alert("No data provided to post");
		}else{
			http.send(data);			
		}
	}else{
		
		http.send(null);	
	}	
	
}

String.prototype.trim = function() {
	return this.replace(/^\s+|\s+$/g,"");
}
String.prototype.ltrim = function() {
	return this.replace(/^\s+/,"");
}
String.prototype.rtrim = function() {
	return this.replace(/\s+$/,"");
}
