var xmlHttp

function GetDomainStats (domain) {
    if (domain == "start") {

    }

    xmlHttp = GetXmlHttpObject ()

    if (xmlHttp == null) {
        alert ('Browser doesnt support HTTP Request')
        return
    }

    var url="/?stats=1&domain="+domain

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

}

function showevents (year,month,day) {
    var url="/~smartserv/lonestarcountrymusic/layout/events.php?year=" + year + "&month=" + month + "&day=" + day

    xmlHttp = GetXmlHttpObject ()

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

function LoadPage (page) {
}

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;
}

function stateChanged () {
    if (xmlHttp.readyState == 4 || xmlHttp.readyState == "complete") {
        document.getElementById("statdiv").innerHTML=xmlHttp.responseText;
    }
}

function UpdateEvents () {
   if (xmlHttp.readyState == 4 || xmlHttp.readyState == "complete") {
        elem    = document.getElementById("events")
        vis     = elem.style;

        if (vis.display == '')
            vis.display = 'block';

        document.getElementById("events").innerHTML=xmlHttp.responseText;
   }
}

<!-- AJAX Routines -->

function ajax_post (url, params, callback) {
    xmlHttp = GetXmlHttpObject ()

    if (xmlHttp == null) {
        alert ('Browser doesnt support HTTP Request')
        return
    }

    xmlHttp.onreadystatechange = callback
    xmlHttp.open("POST",url,true);

    xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
    xmlHttp.setRequestHeader("Content-length", params.length);
    xmlHttp.setRequestHeader("Connection", "close");

    xmlHttp.send(params);
}

function ajax_get (url, callback) {
    xmlHttp = GetXmlHttpObject ()

    if (xmlHttp == null) {
        alert ('Browser doesnt support HTTP Request')
        return
    }

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