var ExitPoll = Class.create(); ExitPoll.prototype = { initialize: function( form_id, display_id, amount_in_group ) { this.form = $(form_id); if( !this.form ) return false; this.display = display_id; this.form.onsubmit = function(){ return false; } this.radios = this.form.getInputs('radio'); this.amount_in_group = (amount_in_group) ? parseInt(amount_in_group) : 5; this.checked_amount = 0; this.msg_select_options = 'Please, check at least one option in every options group.' Event.observe( this.form, 'submit', this.send.bind(this) ); return false; }, send: function() { for( var i=0; i 0) { disable('vote_button'); } else if( _vote_selected_option < 1) { div_obj.innerHTML = _msg_loading ; } var url = "voting"; var pars = "selected_option=" + _vote_selected_option ; var req = new Ajax.Request(url, { method: "post", parameters: pars, onComplete: function(req){ Element.update( div_obj, req.responseText ); } } ); }