
// This process handles the include loading of all common page contents for header, sidebar, and footer.
 var ajaxObj = MakeAJAXObj();        // Create AJAX communication object when page is loaded.

 function LoadContent() {
  ajaxObj.open('GET','includes/Header.htm',false); // Open the access to the page, may be .Net or ASP or any page on the web
  ajaxObj.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); // Code type depends on data type page expects.
  ajaxObj.send('');                  // Sending paired values same as in a Form POST.
  document.getElementById('HeaderSpace').innerHTML=ajaxObj.responseText;
  ajaxObj.open('GET','includes/Footer.htm',false); // Open the access to the page, may be .Net or ASP or any page on the web
  ajaxObj.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); // Code type depends on data type page expects.
  ajaxObj.send('');                  // Sending paired values same as in a Form POST.
  document.getElementById('FooterSpace').innerHTML=ajaxObj.responseText;
  ajaxObj.open('GET','includes/SideNav.htm',false); // Open the access to the page, may be .Net or ASP or any page on the web
  ajaxObj.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); // Code type depends on data type page expects.
  ajaxObj.send('');                  // Sending paired values same as in a Form POST.
  document.getElementById('SidebarMenu').innerHTML=ajaxObj.responseText;
  document.getElementById('cYear').innerText=new Date().getFullYear();
 }

 function MakeAJAXObj() { 
  var AJAX=null;
  if (window.XMLHttpRequest) {       // Any browser except Internet Explorer
   AJAX=new XMLHttpRequest();
  }
  else if (window.ActiveXObject) {   // Check version of Windows objects available for Internet Explorer
   AJAX=new ActiveXObject("Microsoft.XMLHTTP");
  }
  return AJAX;
 }

