/* File:	ajax.js
 * Date:	February 16, 2008
 * Author:	Jason Charney (jrcharney@gmail.com)
 * Description:	A JavaScript file that uses AJAX to include source from another file.
 */
var xmlHttp = null;
try{				// Firefox, Opera 8.0+, Safari
 xmlHttp = new XMLHttpRequest();
}
catch(e){			// MSIE 6.0+
 try{
  xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
 }
 catch(e){			// MSIE 5.5+
  xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
 }
}

function getData(divID,dataSrc)
{
 if(xmlHttp)
 {
  xmlHttp.onreadystatechange = function()
  {
   if(xmlHttp.readyState == 4 && xmlHttp.status == 200)
   {
    displayText(divID,xmlHttp.responseText);
   };
  };
  xmlHttp.open("GET",dataSrc);
  xmlHttp.send(null);
 };
};

function displayText(divID,text)
{
 var obj = document.getElementById(divID);
 obj.innerHTML = text;
};

