﻿window.addEvent('domready', function() {

    var votingRequest = new Request.HTML({ url: '/asp-bin/regvote_load.asp',
        onSuccess: function(html) {
            $('voting_container').set('text', '');
            $('voting_container').adopt(html);
        },
        onFailure: function() {
            $('voting_container').set('text', '');
        }
    });
    votingRequest.send();
	
});

function vote(typeID, votingID, answerID)
{
    var votingRequest = new Request.HTML({ url: '/asp-bin/regvote_load.asp?typeID=' + typeID + '&votingID=' + votingID + '&answerID=' + answerID,
        onSuccess: function(html) {
            $('voting_container').set('text', '');
            $('voting_container').adopt(html);
        },
        onFailure: function() {
            $('voting_container').set('text', '');
        }
    });
    votingRequest.send();

    return false;
}

function multiVote()
{
	$('regVoteForm').set('send', {onComplete: function(response) { 
	$('voting_container').set('html', response);
	}});
	$('regVoteForm').send();
	return false;
}