function UpdateLaptop(school_id){
  var url = "ajax/laptop_content.php?school_id=" + school_id;
  var id = 'laptop_content';
  new GetXmlHttpObject(url, id);
}

function UpdateHeadlines(variables){
  var url = "ajax/headline_news.php?" + variables;
  var id = 'headline_news';
  new GetXmlHttpObject(url, id);
}

function UpdateDIV(id, url){
  new GetXmlHttpObject(url, id);
}

function GetXmlHttpObject(url, id){
  this.xmlHttp=null;
  try{ this.xmlHttp=new XMLHttpRequest(); } // Firefox, Opera 8.0+, Safari
  catch (e){  
    try{ this.xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); }  // Internet Explorer
    catch (e){
      try{ this.xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); }
      catch(e){ this.xmlHttp=null; }
    }
  }
  
  if(this.xmlHttp!=null){
    var c=this;
    this.el=document.getElementById(id);
    this.xmlHttp.open("GET",url,true);
    this.xmlHttp.onreadystatechange=function(){c.stateChanged();};
    this.xmlHttp.send(null);
  }
  else alert('Your browser does not support AJAX!');
}

function Update_news_media_left(link, url){
  $.ajax({
    url: url,
    success: function(data) {
      destination = link.parent().parent().parent().find('div.article_media_left');
      destination.html(data);
    }
  });
}

GetXmlHttpObject.prototype.stateChanged=function (){
  if (this.xmlHttp.readyState==4){
    var tid=this.xmlHttp.responseText;
    this.el.innerHTML = tid;
  }
}
