function createRequestObject() {  //Get the right xmlHTTP, including IE, FF and Opera, try and catch for errors error catching
	var xmlhttp;
try
    {
        xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
    catch(e)
    {
        try
        {
             xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
        }
        catch(f)
        {
             xmlhttp=null;
        }
    }
    if(! xmlhttp&&typeof XMLHttpRequest!="undefined")
    {
         xmlhttp=new XMLHttpRequest();
    }
	return  xmlhttp;
}
var http = createRequestObject(); //make the AJAX thingy
var timeoutholder=null; //this variable holds the timeouts which wait between keypresses
var div;


// Search XMLHTTP
function sndReq(url) { //this function asks for the functions
try{
    http.open('get', url);  //sends request
    http.onreadystatechange = handleResponse; //ensures the response is handled by the correct function
    http.send(null);}
	catch(e){}
	finally{}

}
function handleResponse() {
	try{
    if((http.readyState == 4)&& (http.status == 200)){
        var response = http.responseText;
    	// what do we want to do w/ the response?
		document.getElementById(div).innerHTML = response;
	}
}
catch(e){
	alert(e);
}
finally{}
}
function updateCal(divId, disp, month, year, day, m, y) {
	div = divId;
	var url="cal.php?disp="+disp+"&month="+month+"&year="+year+"&day="+day+"&m="+m+"&y="+y;
	if(timeoutholder!=null)window.clearTimeout(timeoutholder);
		timeoutholder=window.setTimeout("sndReq(\'"+url+"\');", 400);
}
function rowOver(object) {
	if (object.className == 'arrow') object.className = 'hover_arrow';
	if (object.className == 'result') object.className = 'result_hover';
}
function rowOut(object) {
	if (object.className == 'hover_arrow') object.className = 'arrow';	
	if (object.className == 'result_hover') object.className = 'result';
}