function createRequestObject() {
   var req;
   if(window.XMLHttpRequest){
      // Firefox, Safari, Opera...
      req = new XMLHttpRequest();
   } else if(window.ActiveXObject) {
      // Internet Explorer 5+
      req = new ActiveXObject("Microsoft.XMLHTTP");
   } else {
      // There is an error creating the object,
      // just as an old browser is being used.
      alert('Problem creating the XMLHttpRequest object');
   }
   return req;

}

function handleDivTag(divtag)
{
   var divtag;
   return divtag;
}

// Make the XMLHttpRequest object
var http = createRequestObject();


// Create the Divtag Handler -- Mainly an IE 6 Fix
var divhandler = new handleDivTag(null);


function rateDoodle(act1,act2,act3,act4,act5,divtag) {
   // Open PHP script for requests
  //alert("YOUact is " + act1 + " act is " + act2 + " the divtag is " + divtag);
   http.open('get', 'rate.php?vote='+act1+'&ID='+act2+'&p='+act3+'&c='+act4+'&f='+act5);
   http.onreadystatechange = handleResponse;
   divhandler.divtag = divtag;
   http.send(null);
}








function handleResponse() {
 
   if(http.readyState == 4 && http.status == 200){
   
      // Text returned FROM the PHP script
      var response = http.responseText;

      if(response) {
         // UPDATE ajaxTest content
         document.getElementById(divhandler.divtag).innerHTML = response;
      }

   }

} 



