var req;
function callPage(pageUrl, divElementId, loadinglMessage, pageErrorMessage) {
     document.getElementById(divElementId).innerHTML = loadinglMessage;
     try {
     req = new XMLHttpRequest(); /* e.g. Firefox */
     } catch(e) {
       try {
       req = new ActiveXObject("Msxml2.XMLHTTP");  /* some versions IE */
       } catch (e) {
         try {
         req = new ActiveXObject("Microsoft.XMLHTTP");  /* some versions IE */
         } catch (E) {
          req = false;
         } 
       } 
     }
     req.onreadystatechange = function() {responsefromServer(divElementId, pageErrorMessage);};
     req.open("GET",pageUrl,true);
     req.send(null);
  }

function responsefromServer(divElementId, pageErrorMessage) {
   var output = '';
   if(req.readyState == 4) {
      if(req.status == 200) {
         output = req.responseText;
         document.getElementById(divElementId).innerHTML = output;
         } else {
         document.getElementById(divElementId).innerHTML = pageErrorMessage+"\n"+output;
         }
      }
  }
  
function activeTab(tab)
	{   
		document.getElementById("tab1").className = "";
		document.getElementById("tab2").className = "";
		document.getElementById("tab3").className = "";
		document.getElementById("tab4").className = "";
		document.getElementById("tab"+tab).className = "active";
		if(tab == 1) // If your tabs are more, then you can use 'switch' condition instead of 'if' condition for better practice
		{callPage('templates/health-pricing-a-e.php', 'content', '<img src=\"images/loading.gif\" /> Content is loading, Please Wait...', 'Error in Loading page <img src=\"images/error_caution.gif\" />');
		}else if(tab == 2){
		callPage('templates/health-pricing-f-m.php', 'content', '<img src=\"images/loading.gif\" /> Content is loading, Please Wait...', 'Error in Loading page <img src=\"images/error_caution.gif\" />');
		}else if(tab == 3){
		callPage('templates/health-pricing-n-z.php', 'content', '<img src=\"images/loading.gif\" /> Content is loading, Please Wait...', 'Error in Loading page <img src=\"images/error_caution.gif\" />');
		}else{
		callPage('templates/health-pricing-PRINT.php', 'content', '<img src=\"images/loading.gif\" /> Content is loading, Please Wait...', 'Error in Loading page <img src=\"images/error_caution.gif\" />');
	}
	}
