
//create the Cross-browser XMLHttpRequest object
function getFile(pURL) {
   if (window.XMLHttpRequest) { // code for Mozilla, Safari, etc 
      xmlhttp=new XMLHttpRequest();
      xmlhttp.onreadystatechange=postFileReady;
      xmlhttp.open("GET", pURL, true);
      xmlhttp.send(null);
   } else if (window.ActiveXObject) { //IE 
      xmlhttp=new ActiveXObject('Microsoft.XMLHTTP'); 
      if (xmlhttp) {
         xmlhttp.onreadystatechange=postFileReady;
         xmlhttp.open('GET', pURL, true);
         xmlhttp.send();
      }
   }
}

// function to handle asynchronous call
function postFileReady() {
   if (xmlhttp.readyState==4) { 
      if (xmlhttp.status==200) { 
         document.getElementById('theExample').innerHTML=xmlhttp.responseText;
		
		fileData(xmlhttp.responseText);
		//document.getElementById("debug").style.visibility="hidden";
      }
   }
}

