var xmlHttp;

function showAll( )
{
   xmlHttp = GetXmlHttpObject();
   if ( xmlHttp == null )
   {
      alert("No AJAX support with this browser");
      return;
   }
   var url = "scripts/historyinfo.php";
   url = url+"?all=true";

   xmlHttp.onreadystatechange = getMonthData;
   xmlHttp.open("GET", url, true );
   xmlHttp.send(null);
}

function showMonth( row )
{
   xmlHttp = GetXmlHttpObject();
   if ( xmlHttp == null )
   {
      alert("No AJAX support with this browser");
      return;
   }
   var url = "scripts/historyinfo.php";
   url = url+"?month="+row;

   xmlHttp.onreadystatechange = getMonthData;
   xmlHttp.open("GET", url, true );
   xmlHttp.send(null);

}

function showDay( row )
{
   xmlHttp = GetXmlHttpObject();
   if ( xmlHttp == null )
   {
      alert("No AJAX support with this browser");
      return;
   }

   var url = "scripts/historyinfo.php";
   url = url+"?day="+row;

   xmlHttp.onreadystatechange = getMonthData;
   xmlHttp.open("GET", url, true );
   xmlHttp.send(null);

}


function getMonthData()
{
   if ( xmlHttp.readyState == 1 )
   {
      document.getElementById("loading").style.visibility = "visible";
      document.getElementById("tableHolder").style.filter = "alpha(opacity=30)";
      document.getElementById("tableHolder").style.opacity = 0.3; 
   }
   if ( xmlHttp.readyState == 4 )
   {
      document.getElementById("loading").style.visibility = "hidden";
      document.getElementById("tableHolder").style.filter = "alpha(opacity=100)";
      document.getElementById("tableHolder").style.opacity = 1; 
      document.getElementById("tableHolder").innerHTML = xmlHttp.responseText;
   }
}

function GetXmlHttpObject()
{
   var xmlHttp=null;
   try
   {
     // Firefox, Opera 8.0+, Safari
      xmlHttp=new XMLHttpRequest();
   }
   catch (e)
   {
      // Internet Explorer
      try
      {
         xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
      }
      catch (e)
      {
         xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
      }
   }
   return xmlHttp;
}
