var reVoto = new RegExp(/^voto(.*)$/);

var votoEvents = function () {
	var inputs = document.getElementsByTagName("INPUT");
	for (var i=0; i<inputs.length; i++) {
		if (reVoto.test(inputs[i].id)) {
			inputs[i].onclick = Vota;
		}
	}
}

var Vota = function () {
	var form = document.getElementById("fVotos");
	if (reVoto.test(this.id)) {
		var id = RegExp.$1;
		form.id.value = id;
		form.submit();
		return false;
	}
}

var voteMore = "Recuerda que puedes enviar más votos\n" +
			"enviando un SMS con el texto\n" +
			"AYPVOTO + numero al 7595."; 

var voteOk = function () {
	alert("Muchas gracias por tu voto.\n\n" + voteMore);
}

var allreadyVt = function () {
	alert("Ya habías emitido un voto anteriomente.\n\n" + voteMore);
}

var NotId = function () {
	alert("Para poder votar, debes identificarte previamente.\n\n" + voteMore);
}