function createRequestObject(url) {
    //depending on what the browser supports, use the right way to create the XMLHttpRequest object
    if (window.ActiveXObject) { 
        // IE would use this method ...
        tmpXmlHttpObject = new ActiveXObject("Microsoft.XMLHTTP");
    }
    else if (window.XMLHttpRequest) { 
        // Mozilla, Safari would use this method ...
        tmpXmlHttpObject = new XMLHttpRequest();
		 
    }    
    return tmpXmlHttpObject;
}
//call the above function to create the XMLHttpRequest object
function makeGetRequest(url, div) {
http = createRequestObject(url);
    //make a connection to the server ... specifying that you intend to make a GET request 
    //to the server. Specifiy the page name and the URL parameters to send
    http.open('GET', url, false);
    //assign a handler for the response
   http.onreadystatechange = processResponse;
    
    		
    //actually send the request to the server
    http.send(null);
    document.getElementById(div).innerHTML = http.responseText;
}
function processResponse() {
    //check if the response has been received from the server   
  if(http.readyState == 4){
	if(http.status == 200){	 
        //read and assign the response from the server
        var response = http.responseText;
       //do additional parsing of the response, if needed
		 		 
        //in this case simply assign the response to the contents of the <div> on the page. 
        return response;
     }
  }
}

