﻿var docAjax;
var obj;

   function ajaxRequest(url) { 

       if (window.XMLHttpRequest) { // Mozilla, Safari,... 
           docAjax = new XMLHttpRequest(); 
       } else if (window.ActiveXObject) { // IE 
           docAjax = new ActiveXObject("Microsoft.XMLHTTP"); 
       } 
             
       docAjax.onreadystatechange = ajaxResponse; 
       docAjax.open('GET', url, true); 
       docAjax.send(null); 

   } 

function ajaxResponse() {
   if(docAjax.readyState<4)
        obj.innerHTML="<p align=\"center\" >LOADING....</p>"
   else if (docAjax.readyState == 4) { 
       if (docAjax.status == 200) { 
           obj.innerHTML=docAjax.responseText;
           
       } else { 
           alert('There was a problem with the request.'); 
       } 
   } 

}
