/**
 * This is a basic class for AJAX interaction
 * Author: Josh VanderLinden
 * Date: 27 Jun 2007
 */

var Ajax = {
   request : null,
   connect : function() {
      if (Ajax.request == null) {
         try {
            Ajax.request = new XMLHttpRequest();
         } catch (error) {
            try {
               Ajax.request = new ActiveXObject("Msxml2.XMLHTTP");
            } catch (error)
            {
               try {
                  Ajax.request = new ActiveXObject("Microsoft.XMLHTTP");
               } catch (error) {
                  return true;
               }
            }
         }
      }
      Ajax.request.onreadystatechange = handleResponse;
      return Ajax.request;
   },
   get:function(url) {
      Ajax.req('get', url);
   },
   post:function(url) {
      Ajax.req('post', url);
   },
   req:function(method, url) {
      Ajax.connect().open(method, url, true);
      //Ajax.connect().send(null);
      Ajax.connect().send('');
      return false;
   }
};

