function sc_ajax(call_page)
{
    var xhr = false
 
  if (window.XMLHttpRequest)     // if Mozilla, Safari etc
  {
    xhr = new XMLHttpRequest()
  }
  else if (window.ActiveXObject) // if IE
  {
    try
    {
      xhr = new ActiveXObject("Msxml2.XMLHTTP")
    }
    catch (e)
    {
      try
      {
        xhr = new ActiveXObject("Microsoft.XMLHTTP")
      }
      catch (e){}
    }
  }
  else
    return false
	    
    xhr.onreadystatechange=function() 
    { 
    	alert_ajax(xhr); 
    }
    
    document.getElementById("loading").style.visibility='visible';
    //document.getElementById("loading").style.display = "block";
       
    xhr.open("GET", "./index.php?m=" + call_page, true);
    xhr.send(null);
    
}


function alert_ajax(xhr)
{
  if (xhr.readyState == 4 &&
          (xhr.status==200 ||
           window.location.href.indexOf("http")==-1))
  {
	 document.getElementById("loading").style.visibility='visible';    
    
	}
}

function sc_ajax_main()
{
    var xhr = false
 
  if (window.XMLHttpRequest)     // if Mozilla, Safari etc
  {
    xhr = new XMLHttpRequest()
  }
  else if (window.ActiveXObject) // if IE
  {
    try
    {
      xhr = new ActiveXObject("Msxml2.XMLHTTP")
    }
    catch (e)
    {
      try
      {
        xhr = new ActiveXObject("Microsoft.XMLHTTP")
      }
      catch (e){}
    }
  }
  else
    return false

    xhr.onreadystatechange = function() { alert_ajax(xhr); };
    
    
    //document.getElementById("loading").style.visibility='visible';
    document.getElementById("loading").style.display = "block";
    
    xhr.open("GET", "./index.php", true);
    xhr.send(null);
    
}
