// build the object for async connection based on user agent
function createRequestObject() {

	try { 
		req = new XMLHttpRequest(); /* e.g. Firefox */ 
	} catch(e) { 
		try { 
			req = new ActiveXObject("Msxml2.XMLHTTP"); /* some versions IE */ 
		} catch (e) { 
			try { 
				req = new ActiveXObject("Microsoft.XMLHTTP"); /* some versions IE */ 
			} catch (E) { 
				req = false; 
			} 
		} 
	}

	return req;

}


// send data to the server
function sndReq(method,url,parameters) {

	http.open(method, url,true);

  if (method=="post" || method=="POST"){
    http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
    http.setRequestHeader("Content-length", parameters.length);
    http.setRequestHeader("Connection", "close");
  }else{
		parameters=null;
  }
	http.send(parameters);
	http.onreadystatechange = handleResponse;// handleResponse() should be set locally in script

}


  

