//Standard AJAX callback function checker. 
//Check state before calling the callback function 
function getCallbackFunction(req, processData) {

      // Return an anonymous function that listens to the
      // XMLHttpRequest instance
      return function () {

        // If the request's status is "complete"
        if (req.readyState == 4) {
          if (req.status == 200) {

            // Pass the XML payload of the response to the
            // handler function
            var xml = req.responseXML;
            //alert('XML :: ' + xml);
            processData(xml);

          } else {

            // An HTTP problem has occurred
          alert("HTTP error: "+req.status);
          }
        }
      }
    }	
