	function nuevoAjax(){
	var xmlhttp=false;
	try{
		xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");
	}catch(e){
		try{
			xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
		}catch(E){
			xmlhttp=false;
		}
	}
	
	if(!xmlhttp && typeof XMLHttpRequest!='undefined'){
		xmlhttp = new XMLHttpRequest();
	}
	
	return xmlhttp;
}

function cargarResultados(vot,ofer){
	divResultado = document.getElementById('votacion');
	voto=vot;
	oferta=ofer;
	ajax=nuevoAjax();
    ajax.open("GET", "votar.asp?voto="+voto+"&oferta="+oferta,true);
	ajax.onreadystatechange=function() {
     if (ajax.readyState==1) {
  	    divResultado.innerHTML ='<img src="loading.gif" border="0">'
	 }else if (ajax.readyState==4){
		if(ajax.status==200){
			divResultado.innerHTML=ajax.responseText;
		}else if(ajax.status==404){
			 divResultado.innerHTML = "La direccion no existe";
		}else{
		 divResultado.innerHTML = "Error: ".ajax.status;
	   }
	}
    } 
	ajax.send(null);
}
