
function init_jquery()
{$('.bewertung_widget').each(function(i){var widget=this;var act_rateing=$(widget).attr('title')
var out_data={id:$(widget).attr('id'),todo:"get_rating"};$.post('/bewerten.php',out_data,function(INFO){$(widget).data('data',INFO);set_votes(widget);},'json');});$('.bewertung_stars').hover(function(){$(this).prevAll().andSelf().addClass('bewertung_over');$(this).nextAll().removeClass('bewertung_vote');},function(){$(this).prevAll().andSelf().removeClass('bewertung_over');set_votes($(this).parent());});$('.bewertung_stars').click(function(){var widget=$(this).parent();var clicked_data={todo:"rate",clicked_on:$(this).attr('class'),id:$(this).parent().attr('id')};$.post('/bewerten.php',clicked_data,function(INFO){widget.data('data',INFO);set_votes(widget);},'json');});}
function set_votes(widget)
{var val=$(widget).data('data').val;var msg=$(widget).data('data').msg;var err=$(widget).data('data').err;if(val!="")
{$(widget).find('.star_'+val).prevAll().andSelf().addClass('bewertung_vote');$(widget).find('.star_'+val).nextAll().removeClass('bewertung_vote');}
if(msg!=""){$('#bewertung_info').text(msg);}
if(err!=""){$('#error_info').html(err);}}
