/** * @author cristiano */function Poll(){	this.script_page = "/ajax/voto.php";		this.sendVote = function(id)	{			id = parseInt(id);		this.setLoadingSrc("/immagini/vote_loader.gif");		this.setTarget(document.getElementById("php_response"));		this.setLoadingTarget(document.getElementById("php_response"));				var scelte = document.getElementsByName("choices_" + id);		var chosen = false;				this.params["id_sondaggio"] = document.getElementById('id_sondaggio').value;		this.params["voto"] = document.getElementById('user_choice').value;				/*		this.params["num_voti"] = document.getElementById('num_voti').value;		for (var i = 0; i < num_voti; i++)			if (scelte[i].checked)			{				chosen = true;				this.params["voto"] = parseInt(scelte[i].value);			}		*/				if (!this.params["voto"])			alert("E' necessario scegeliere almeno un'opzione.");		else			this.makeRequest(this.script_page);		alert("Il tuo voto e' stato registrato. Grazie");	}}
Poll.prototype = new AjaxModule();Poll.prototype.constructor = Poll;
