function ajaxReq(s_objname_fp) {
    /* USAGE NOTES
    * "n=" is reserved as a query string variable when sending GET requests!
    * no JSON parser since we know our JSON to be coming from safe source
    */
    /**** BEGIN PRIVATE VARIABLES ****/
    //"constants"
    var KEY_ID = 'id';
    var KEY_CONTENT = 'content';
    
    //globals
    var a_loadmsg = null; //has two keys, id & content, to display loading content
    var f_callback; //pointer reference to external method to be called once data loads
    var o_json; //container for raw json data
    var o_xmlhttp; //xmlhttp object
    var s_httpmethod = 'GET'; //communication method to be used when making ajax call
    var s_objname; //name of instantiated object for callback
    /**** END PRIVATE VARIABLES ****/

    /**** BEGIN PUBLIC METHOD POINTERS ****/
    this.doServerRequest = doServerRequest;
    this.setCommMethod = setCommMethod;
    this.setLoadMsg = setLoadMsg;
    /**** END PUBLIC METHOD POINTERS ****/

    /**** BEGIN "CONSTRUCTOR" ACTIONS ****/
    setCallback(s_objname_fp);
    /**** END "CONSTRUCTOR" ACTIONS ****/

    /**** BEGIN PUBLIC METHODS ****/
    function doServerRequest(s_url_fp, s_params_fp, f_callback_fp) {
        var s_err = null;
        var s_url;
        f_callback = f_callback_fp; //set the callback pointer
        o_xmlhttp = null;
        
        try 
        {
        // Firefox, Opera 8.0+, Safari
        	o_xmlhttp=new XMLHttpRequest();
        }
      catch (s_err)
        {
        // Internet Explorer
        try
          {
        	o_xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");
          }
        catch (s_err)
          {
          try
            {
        	  o_xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
            }
          catch (s_err)
            {
            alert(s_err.message);
            return false;
            }
          }
        }
        
        
       /* try {  //create the xml request object
            o_xmlhttp = new XMLHttpRequest(); //mozillas
        }
        catch (s_err) {
            try	{
                o_xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); //one crap browser
            }
            catch (s_err) {
                o_xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); //and the other
            }
        }
        if (s_err) {
            alert(s_err.message); //throw specific object error
        }*/
        if (o_xmlhttp != null) { //if there was no error, make the request
            s_url = s_url_fp + "?" + s_params_fp + "&n=" + Math.random();
            o_xmlhttp.onreadystatechange = doUpdate;
            //alert(s_url);
            o_xmlhttp.open(s_httpmethod, s_url, true);
            o_xmlhttp.send(null);
        }
		
    }

    function setCommMethod(s_method_fp) {
        s_httpmethod = s_method_fp;
    }
    
    function setLoadMsg(s_eleid_fp, s_content_fp) {
        a_loadmsg = new Array();
        a_loadmsg[KEY_ID] = s_eleid_fp;
        a_loadmsg[KEY_CONTENT] = s_content_fp;
    }
    /**** END PUBLIC METHODS ****/
    
    

    /**** BEGIN PRIVATE FUNCTIONS ****/
    function doUpdate() { //call to external object method from pointer in f_callback_fp and send JSON
        if (o_xmlhttp.readyState == 4 && o_xmlhttp.status == 200) {
        	if (f_callback) {
        		f_callback(eval('(' + o_xmlhttp.responseText + ')')); //send the JSON to an external method
        	}
        } else {
           // if ( document.getElementById(a_loadmsg[KEY_ID] ) ) { //if defined, show the loading content
		//	  document.getElementById(a_loadmsg[KEY_ID]).innerHTML = a_loadmsg[KEY_CONTENT];
            //}
        }
    }

    function setCallback(s_objname_fp) {
        s_objname = s_objname_fp;
    }
    /**** END PRIVATE FUNCTIONS ****/
}


function httpRequestObject(){
var s_err = null;
var o_xmlhttp = null;

    
        try 
        {   
        // Firefox, Opera 8.0+, Safari
            return    o_xmlhttp=new XMLHttpRequest();
        }   
      catch (s_err)
        {   
        // Internet Explorer
        try 
          {   
               return  o_xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");
          }   
        catch (s_err)
          {   
          try 
            {   
                  return o_xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
            }   
          catch (s_err)
            {   
            alert(s_err.message);
            return false;
            }   
          }   
        }   
}


function doAjaxPost( params , callBack ){

        var http = new httpRequestObject();
        if( http ){
            http.open( "GET", params , true );  
            http.send( null );
            http.onreadystatechange = callBack; 
        }   
}

