function createQCObject() { 
   var req; 
   if(window.XMLHttpRequest){ 
      // Firefox, Safari, Opera... 
      req = new XMLHttpRequest(); 
   } else if(window.ActiveXObject) { 
      // Internet Explorer 5+ 
      req = new ActiveXObject("Microsoft.XMLHTTP"); 
   } else { 
      alert('Problem creating the XMLHttpRequest object'); 
   } 
   return req; 
}

function AJAXRequest(method,uri,callback) {
    var ran_no=(Math.round((Math.random()*9999)));
    var http = createQCObject(); //recycling?
	  http.open(method,uri + "&ran="+ran_no);
   	http.onreadystatechange = function(){callback(http);};
   	http.send(null);
}

//Prototype seems quite excessive, so we'll just use this helper function
function $(id) {
  return document.getElementById(id);
}
