function ueberwachungVoting() {
	if($('voting_item_container')) {
		var elements = null;
		elements = $('voting_item_container').select('[class="voting_item"]');
		for(var i = 0; i < elements.length; i++) {
			elements[i].observe('mouseover', mouseOverVoting);
			elements[i].observe('mouseout', mouseOutVoting);
			elements[i].observe('click', vote);
		}
	}
}

function mouseOutVoting(event) {
	Event.element(event).removeClassName('voting_item_hover');
	Event.element(event).toggleClassName('voting_item');
}

function mouseOverVoting(event) {
	Event.element(event).removeClassName('voting_item');
	Event.element(event).toggleClassName('voting_item_hover');
}

function vote(event) {
	var myRequest = new Ajax.Request('ajaxEngine.php', {
  			method: 'post',
			postBody: 'vote_id='+$('vote_id').innerHTML+'&value='+Event.element(event).innerHTML,
  			onSuccess: function(r){
				updateCommercials();
			}
		}
	);
}
