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 enviaPage(url, metodo, modo, tagId, parametros)
{
    goAjax( url+"?"+parametros+"&rnd"+ Math.random() , metodo, modo , tagId); 
	 
}
function selimagens(url,metodo,modo,tagId,parametros)
{
	goAjax( url+"?"+parametros+"&rnd"+ Math.random() , metodo, modo , tagId); 
	 document.getElementById(tagId).style.display = "block";
}
function pegaimagens(tagRetorno, parametros,div)
{
	
	document.getElementById(tagRetorno).value= parametros
	document.getElementById(div).innerHTML = ''
	document.getElementById(div).style.display = "none";	
}
function enquete(){
	
	
	
	  
  for(x=0;x<document.formenquete.elements.length;x++){
	 
   if(document.formenquete.elements[x].checked){
	   
 	valor = document.formenquete.elements[x].value;
	//alert (valor);
	//alert ("teste");
 enviaPage('enquete.php', 'GET', 'true','enquete','valor='+valor);
 
 break;
}
 }
	
}
function imagens(url, metodo, modo, tagId, parametros)
{
    valor = document.getElementById('Pasta').value;
    //alert(valor);
 		valores ='pasta='+valor;
	enviaPage(url,'GET','TRUE','imagens',valores);
}
function pasta(tagRetorno, parametros,div){


document.getElementById(tagRetorno).value= parametros;
document.getElementById(div).innerHTML = '';
document.getElementById(div).style.display = "none";

}
function goAjax(url, metodo, modo, tagRetorno, parametros) {
        document.getElementById(tagRetorno).innerHTML='<br />carregando...</div>'

            if(metodo == "GET") {
                xmlhttp.open("GET", url, modo);
            
            
            xmlhttp.onreadystatechange = function() {
                if(xmlhttp.readyState == 4) {
                    retorno=xmlhttp.responseText
                    document.getElementById(tagRetorno).innerHTML=retorno
                   
                }
            }
            
                xmlhttp.send(null);
			}
}
function Visualizarelatorio()
{
	  indicemes = document.form.Mes.selectedIndex;
    valormes = document.form.Mes[indicemes].value;
    indiceano = document.form.Ano.selectedIndex;
    valorano = document.form.Ano[indiceano].value;
 
		valores ='ano='+valorano+'&mes='+valormes;
	enviaPage('relatorio_mensal_manha2.asp','GET','TRUE','conteudo',valores);
}

function Visualizamarcacao(data)
{
	indicenivel = document.form.nivel.selectedIndex;
    valornivel = document.form.nivel[indicenivel].value;
    
 
		valores ='data='+data+'&nivel='+valornivel;
	enviaPage('lab_tarde_horarios2.asp','GET','TRUE','conteudo',valores);
}

function Visualizarelatorio2()
{
	indicemes = document.form.Mes.selectedIndex;
    valormes = document.form.Mes[indicemes].value;
    indiceano = document.form.Ano.selectedIndex;
    valorano = document.form.Ano[indiceano].value;
 
		valores ='ano='+valorano+'&mes='+valormes;
	enviaPage('relatorio_mensal_tarde2.asp','GET','TRUE','conteudo',valores);
}

