// JavaScript Document
function objetus() {
   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 Votar(numencuesta)//ingresa usuarios al sistema
   {
           _objetus=objetus()
           _loader=document.getElementById('loader')
			_opcionsel=0
			for (x=0;x< document.formm.rb.length;x++)
			{
				if(document.formm.rb[x].checked==true)
					_opcionsel=document.formm.rb[x].value
			}
			if (_opcionsel==0)
			{
				alert("Seleccione una opcion")
				return
			}
			//return
			_loader.innerHTML= "cargando"
		   _values_send="funcion=ingresar_usu&opcion=Votar&numvotar="+_opcionsel+"&idvotar="+numencuesta+"&usu_random="+Math.random
		   _URL_="encuesta/phpencuesta.php?"
           _loader.style.display=''
           _objetus.open("GET",_URL_+"&"+_values_send,true);
           _objetus.onreadystatechange=function() {
                   if(_objetus.readyState==4)
                   {
                           if(_objetus.status==200)
                           {
                                   _loader.innerHTML = _objetus.responseText;
                           }
                   }
           }
           _objetus.send(null);
   }