function objetus() {
	var xmlhttp=false;
	try	{
		xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");
	}
	catch(e)
	{
		try
		{
			xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
		catch(E)
		{
			if (!xmlhttp && typeof XMLHttpRequest!='undefined') xmlhttp=new XMLHttpRequest();
		}
	}
	return xmlhttp; 
}

function CheckUPMor(txt,valor) {

   var objetoAjax=objetus();
	valor += "&text_nombre=" + document.getElementById('text_nombre').value;
	objetoAjax.open("GET","mysql/query.php?insert=" + valor ,true);
	   objetoAjax.onreadystatechange=function() {
		if (objetoAjax.readyState==4) {
		   document.getElementById('IdVotEnc').innerHTML = objetoAjax.responseText;
		}
   }

   objetoAjax.send(null);
}

function CheckUPAdd(idvot) {

   var objetoAjax=objetus();

	objetoAjax.open("GET","mysql/query.php?insert=" + idvot ,true);
	   objetoAjax.onreadystatechange=function() {
		if (objetoAjax.readyState==4) { 
		   document.getElementById('IdVotEnc').innerHTML = objetoAjax.responseText;
		}
   }

   objetoAjax.send(null);

}

function CheckUPEnc() {
	var inputs = 0;
	form = document.getElementById('VotEnc');
	for(var f = 0; f < form.length; f++ ){
		if(form[f].type == 'radio') {
			if(form[f].checked)
				inputs = form[f].value;
		}
	}

	if(inputs) 
		CheckUPAdd(inputs);
	else 
		alert("Debe seleccionar una opcion");
}