//JS SCRIPT
try{
    xmlhttp = new XMLHttpRequest();
}catch(ee){
    try{
        xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
    }catch(e){
        try{
            xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
        }catch(E){
            xmlhttp = false;
        }
    }
}

ajaxocupado = function() {
    estadoAtual = this.xmlhttp.readyState;
    return (estadoAtual && (estadoAtual < 4));
}


function mecanicoVote(mecanico, voto){
	
		divAlvo = document.getElementById('divMecanicoVoto');
		
		if(!ajaxocupado()){
		//Abre a url
		xmlhttp.open("GET", "mecanico_ajax_votar.php?mecanico="+mecanico+"&voto="+voto,true);
		divAlvo.innerHTML='<br><br><img src="imagens/load.gif" width="16" height="16" /><br>aguarde<br><br><br>';
		xmlhttp.onreadystatechange=function() {
			if (xmlhttp.readyState==4){
				divAlvo.innerHTML=xmlhttp.responseText;
			}
		}
		xmlhttp.send(null)
		}
	
}