// 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 ajaxEnquete(COD_PERGUNTA, COD_RESPOSTA, LOCAL){
	var enquete = document.getElementById("enquete_div");
	enquete.innerHTML = "Carregando Enquete...";
	if(xmlhttp){
		xmlhttp.open("POST", "ajax.php", true);
		xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=iso-8859-1");
		var dados = "tipo=getEnquete&COD_PERGUNTA="+COD_PERGUNTA+"&LOCAL="+LOCAL+"&COD_RESPOSTA="+COD_RESPOSTA;
		xmlhttp.send(dados);
		xmlhttp.onreadystatechange=function() {
			if (xmlhttp.readyState==4){
				var texto=xmlhttp.responseText;
				texto=texto.replace(/\+/g," ");
				texto=unescape(texto);
				enquete.innerHTML = texto;
			}
		}
	}
}
