        function getRadioButtonSelectedValue(ctrl)
        {
        for(i=0;i<ctrl.length;i++)
                if(ctrl[i].checked)
                                return ctrl[i].value;

                alert("Por favor seleccione a un candidato");
                return '0';
        }

        function Votar(){
        // Comprobamos el mail
        var arr = document.form.mail.value.lastIndexOf('@');
            var pun = document.form.mail.value.lastIndexOf('.');
            var tam = document.form.mail.value.length;
            if( arr != 0 && pun != 0  && pun < (tam-2) && arr < (pun-2)){
                        var op_selected=getRadioButtonSelectedValue(document.form.encuesta);
                        if (op_selected!='0'){
                    document.form.votos.value=op_selected;
                    document.form.submit();
                        }
            }else{
            alert ("Lo sentimos, la dirección de correo electrónico no es válida")
        }
        }

		function getStyle() { 
			if(document.createStyleSheet) { 
				if(!document.styleSheets.length > 0 || document.styleSheets(0).href.indexOf("http://www.caminoalamoncloa.com/css/widget.css?update=200801310946") < 0) 
					sc = document.createStyleSheet("http://www.caminoalamoncloa.com/css/widget.css?update=200801310946", 0); 
				else 
					document.styleSheets(0).href = "http://www.caminoalamoncloa.com/css/widget.css?update=200801310946"; 
			} else { 
				sc = document.getElementById("CALM_getStyle"); 
				if(sc) sc.parentNode.removeChild(sc); 
				var sc=document.createElement("link"); 
				sc.id = "CALM_getStyle"; 
				sc.rel="stylesheet"; 
				sc.type="text/css"; 
				document.getElementsByTagName("head")[0].appendChild(sc); sc.href="http://www.caminoalamoncloa.com/css/widget.css?update=200801310946"; 
			} 
		} 


