/******************************************************************************
 *  CLASS: cHttpRequest
 *   
 *  DESCRIPTION: This class make it possible to possible to post back to the 
 *                web server using AJAX technology. 
******************************************************************************/
 function cHttpRequest(htmlReceiverObject) {  
  var xmlHttp = false;
  if(window.XMLHttpRequest) {
    try{
      xmlHttp = new XMLHttpRequest();            
    } catch(e) {
      xmlHttp = false;      
    } // catch(e) - xmlHttp = new XMLHttpRequest(); 
  } else if (window.ActiveXObject) {
    try {
      xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");      
    } catch(e) {
      try {
        xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
      } catch(e) {
        xmlHttp = false;
      } //catch(e) - xmlHttp = false;
    } // catch(e) - xmlHttp = ActiveXObject("Msxml2.XMLHTTP");
  } //else if (window.ActiveXObject)
     
  xmlHttp.onreadystatechange = 
      function () {                                                                                               							
  			if (xmlHttp.readyState == 4) {				
  				if (xmlHttp.status == 200) {
  					htmlReceiverObject.innerHTML = xmlHttp.responseText;	                                
  				} else {
  				alert('The system has encountered the following errort:\n' + 
                  xmlHttp.status + '\n' + xmlHttp.statusText);
  		      } // if (http_request.status == 200)
  		   } // if (http_request.readyState == 4)		  
  		} // function alertContents()  
        
  /*
  * this method is call to send a request using the get method
  */  
  this.Get = 
    function(url,async){
      xmlHttp.open('GET',url, async);
      xmlHttp.send(null);
    }
 } // function cHttpRequest(htmlReceiverObject)

function getMainCategories(containerId, url) {
	var containerObj = document.getElementById(containerId);
	var xmlHtttObj = new cHttpRequest(containerObj);
	xmlHtttObj.Get(url, true);
	return;
}
