/*Function used to create the AJAX instant*/

function getAjaxObj()
{
  var xmlhttp;
  if(window.XMLHttpRequest)
  {
    xmlhttp = new XMLHttpRequest();
  }
  else if (window.ActiveXObject)
  {
    xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	if (!xmlhttp)
	{
	  xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");
	}
  }
  return xmlhttp;
}

/*Function used to load the gallery content using AJAX*/

function loadGallery(catId)
{
  var http = getAjaxObj();
  var url = "content.php?id="+catId;
  http.onreadystatechange = function()
   {
     if(http.readyState == 4)
     {
       var divObj = document.getElementById('ajaxGallery');
       divObj.innerHTML = http.responseText;
     }
   }
   http.open("GET",url,true);
   http.send(null);
}