	timer1 = 30;
	xmlHttpReq = false;
	
		
	function xmlhttpPostCustom(strURL, refreshID, aguardeID, qstring) {
		xmlHttpReq = false;
		var self = this;
		var abortado = false;
		// Mozilla/Safari
		if (window.XMLHttpRequest) {
		self.xmlHttpReq = new XMLHttpRequest();
		}
		// IE
		else if (window.ActiveXObject) {
		self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
		}
		//alert('entrou 1');
		self.xmlHttpReq.open('POST', strURL, true);
		self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
		self.xmlHttpReq.send(getquerystringCustom( qstring ));
		self.xmlHttpReq.onreadystatechange = function() {

		if (self.xmlHttpReq.readyState == 4) {
			
			//alert ('abortado:'+abortado);
			if (abortado==false){
				updatepageCustom(self.xmlHttpReq.responseText, refreshID, aguardeID);
			}
			
		}
		}
	   //abortado = false; 
		
	  //  document.getElementById("bt_enviar").disabled = true;
	  document.getElementById( aguardeID ).style.display = 'block'
	  
	  timer1 = setTimeout ( function(){
		alert ('Não foi possível enviar sua mensagem\nTente novamente em alguns instantes');
		document.getElementById( aguardeID ).style.display = 'none';
		abortado = true;
		self.xmlHttpReq.abort();	
								
	  },15000);
	}
	
	function getquerystringCustom( qstring ) {
		
		//enquete_id = document.form1.eid.value
		//enquete_resposta_id = document.form1.res.value
		//qstr = ''
		//qstr = qstr +"eid=" + enquete_id
		//qstr = qstr +"&res="  + enquete_resposta_id
		//alert(qstr);
		//alert(qstring);
		qstr = qstring;
		
		return qstr;
	}
	
	function updatepageCustom( str, refreshID, aguardeID ){
	
		//alert(str);
		document.getElementById(refreshID).innerHTML = str;
		clearTimeout( timer1 );
		document.getElementById( aguardeID ).style.display = 'none'
		instrucoesExtra();
	}
	
// Não esquecer de criar a função instrucoesExtra() na pagina que chamar o httpreq