function loadTopSections(cat,id) {
  // This change is for IE7 caching issues, adding the random time string stops IE from caching.
  var d = new Date();
  var url = "/garcia/ajax_news.php?cat="+cat+"&id="+id+"&d="+ d.getDate() + d.getHours() + d.getMinutes() + d.getMilliseconds();
  //var url="/garcia/ajax_news.php?cat="+cat+"&id="+id;
	var http_request = false;

  if (window.XMLHttpRequest) { // Mozilla, Safari, ...
    http_request = new XMLHttpRequest();
    if (http_request.overrideMimeType) {
      http_request.overrideMimeType('text/xml');
      // See note below about this line
    }
  } else if (window.ActiveXObject) { // IE
    try {
      http_request = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
      try {
        http_request = new ActiveXObject("Microsoft.XMLHTTP");
      } catch (e) {}
    }
  }

  if (!http_request) {
    displayNoAjax();
		//alert('Giving up :( Cannot create an XMLHTTP instance');
    return false;
  }
  http_request.onreadystatechange = function() { displayNews(http_request); };
  http_request.open('GET', url, true);
  http_request.send(null);
}

function displayNews(http_request) { 
  try {
	  document.getElementById("topSections").innerHTML="<div class='body_featured' style='height:300px;text-align:center;'><p style='margin-top:140px;font-size:16px;'><img src='http://qconline.com/images/ajax_loading.gif' alt='' /></p></div>"
		if (http_request.readyState == 4) {
      if (http_request.status == 200) {
        document.getElementById("topSections").innerHTML=http_request.responseText;
      } else {
        //alert('There was a problem with the request.');
      }
    } else {
		  
		}
	}
  catch( e ) {
    //alert('Caught Exception: ' + e.description);
  }
}

function displayNoAjax() {
  document.getElementById("topNews").innerHTML = ""

}
