// JavaScript Document
try{
    xmlhttp = new XMLHttpRequest();
}catch(ee){
    try{
        xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
    }catch(e){
        try{
            xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
        }catch(E){
            xmlhttp = false;
        }
    }
}
function agenda(data, COD_LOCAL){
	var desc = document.getElementById("resultado");
	desc.innerHTML = "Carregando dados...";
	if(xmlhttp){
		xmlhttp.open("POST", "/2009/ajax.php", true);
		xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=iso-8859-1");
		var dados = "tipo=agenda&COD_LOCAL="+COD_LOCAL+"&data="+data;
		xmlhttp.send(dados);
		xmlhttp.onreadystatechange=function() {
			if (xmlhttp.readyState==4){
				var texto=xmlhttp.responseText;
				texto=texto.replace(/\+/g," ");
				texto=unescape(texto);
				desc.innerHTML = texto;
			}
		}
	}
}
function ajaxCalendario(mes, ano, COD_LOCAL){
	var calendario = document.getElementById("calendario");
	//calendario.innerHTML = "Carregando Calendario...";
	if(xmlhttp){
		xmlhttp.open("POST", "/2009/ajax.php", true);
		xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=iso-8859-1");
		var dados = "tipo=getCalendario&COD_LOCAL="+COD_LOCAL+"&mes="+mes+"&ano="+ano;
		xmlhttp.send(dados);
		xmlhttp.onreadystatechange=function() {
			if (xmlhttp.readyState==4){
				var texto=xmlhttp.responseText;
				texto=texto.replace(/\+/g," ");
				texto=unescape(texto);
				calendario.innerHTML = texto;
			}
		}
	}
}