// funciones para la integracion de las encuestas en ajax
function votar(poll_id){
	var variables = "";
	for (i=0;i<document.getElementById('frm_poll_'+poll_id).option_id.length;i++) {
		if (document.getElementById('frm_poll_'+poll_id).option_id[i].selected == true)	{
			variables = "option_id="+document.getElementById('frm_poll_'+poll_id).option_id[i].value;
		}
	}

	if (variables != ""){
		document.getElementById('cmd_votar_'+poll_id).disabled = true;
		variables += "&action=vote&poll_ident="+poll_id;
		cargar('votar.php','div_contenido',variables);
	} else {
		alert("ˇTenés elegir una opción!");
		document.getElementById('cmd_votar_'+poll_id).disabled = false;
	}
}


function set_item_encuesta(opcion,frm){
	for (i=0;i<document.getElementById(frm).option_id.length;i++) {
		document.getElementById(frm).option_id[i].selected = false; //seteo todos los options del form a false
	}
	opcion.selected = true; // seteo el option seleccionado a true
}
