function init_rater() {
	
	//check if the current user can vote (logged in)
	
	jQuery('.rating_star_1, .rating_star_2, .rating_star_3, .rating_star_4, .rating_star_5').bind('click', function() {
		current_project = jQuery(this).parent().attr('id').split('_');
		current_project = current_project[2];
		rating = jQuery(this).attr('class').split('_');
		rating = rating[2];


		if (typeof(is_evb) !== "undefined")
		{	

				redirect_to = 'http://t3n.de/startups/rate/' + current_project + '/' + rating + '/redirect_to/' + encodeURIComponent(encodeURIComponent(redirect_url)) + '/';
				if (typeof(is_evb2) === "undefined")
				{
					parent.location.href = redirect_to;
				}
				else
				{
					location.href = redirect_to;
				}
		}
		else
		{		

			if (user_logged_in)
			{
				jQuery.getJSON("http://t3n.de/startups/rate/" + current_project + "/" + rating + "/", function(data) {
				  if (data.send_ok)
				  {
				  	if (typeof(data.is_admin) !== "undefined" && data.is_admin == 1) {
						location.href = redirect_url;
					}
					  if (data.status == 1)
					  {
					  	//rating successful, update scores
					  	project[data.project_id] =
						{
							current_user_rating: data.current_user_rating,
							project_rating_stars: data.project_rating_stars,
							project_rating_score: data.project_rating_score,
							current_over: project[data.project_id].current_over
						};
					  	
					  	if (project[data.project_id].current_over === false)
					  	{
						  	jQuery('#rating_stars_' + data.project_id).removeClass('rating_0 rating_1 rating_2 rating_3 rating_4 rating_5 rating_6 rating_7 rating_8 rating_9 rating_10').addClass('rating_' + data.project_rating_stars);
							jQuery('.rating_text_' + data.project_id).text('Bewertung: ');
							jQuery('.rating_score_' + data.project_id).text(data.project_rating_score);
						}
						else
						{
							jQuery('#rating_stars_' + data.project_id).removeClass('rating_0 rating_1 rating_2 rating_3 rating_4 rating_5 rating_6 rating_7 rating_8 rating_9 rating_10').addClass('rating_' + (data.current_user_rating * 2));
							jQuery('.rating_text_' + data.project_id).text('Bewertung: ');
							jQuery('.rating_score_' + data.project_id).text(data.current_user_rating);
						}

						if (typeof(data.project_rating_ratings) !== "undefined")
						{
							if (data.project_rating_ratings == 1)
							{
								jQuery('#rating_ratings_' + data.project_id).text(data.project_rating_ratings + ' Bewertung');
							}
							else
							{
								jQuery('#rating_ratings_' + data.project_id).text(data.project_rating_ratings + ' Bewertungen');
							}
						 
						 }
							
					  }
					  //show message
					  jQuery('#rating_message_' + data.project_id).remove();
					  jQuery('#rating_stars_border_' + data.project_id).before('<span id="rating_message_' + data.project_id + '" class="' + data.theclass + '">' + data.message + '</span>');
				  		
				  		window.setTimeout("jQuery('#rating_message_" + data.project_id + "').fadeOut('slow', function() { jQuery(this).remove(); });", 3000);
				  }
				});
			}
			else 
			{			
				redirect_to = 'http://t3n.de/startups/rate/' + current_project + '/' + rating + '/redirect_to/' + encodeURIComponent(encodeURIComponent(redirect_url)) + '/';
				full_url = 'http://t3n.de/startups/yeelogin.php?redirect_url_loginbox=' + encodeURIComponent(redirect_to) + '&height=250&width=400&modal=true';
				tb_show(false,full_url,false);
			}
		}
	});
	
	jQuery('.rating_star_1, .rating_star_2, .rating_star_3, .rating_star_4, .rating_star_5').bind('mouseover', function() {
		current_project = jQuery(this).parent().attr('id').split('_');
		current_project = current_project[2];
		
		project[current_project].current_over = true;
		
		if (project[current_project].current_user_rating === 0)
		{
			//user has not voted yet;
			rating = jQuery(this).attr('class').split('_');
			rating = rating[2];
			jQuery('#rating_stars_' + current_project.toString()).removeClass('rating_0 rating_1 rating_2 rating_3 rating_4 rating_5 rating_6 rating_7 rating_8 rating_9 rating_10').addClass('rating_' + (rating * 2));
			jQuery('.rating_text_' + current_project.toString()).text('Bewerten mit');
			jQuery('.rating_score_' + current_project.toString()).text(rating);

		}
		else
		{
			//user has voted already -> show his rating on hover
			jQuery('#rating_stars_' + current_project.toString()).removeClass('rating_0 rating_1 rating_2 rating_3 rating_4 rating_5 rating_6 rating_7 rating_8 rating_9 rating_10').addClass('rating_' + (project[current_project].current_user_rating * 2));
			jQuery('.rating_text_' + current_project.toString()).text('Bewertung:');
			jQuery('.rating_score_' + current_project.toString()).text(project[current_project].current_user_rating);
			
		}
	});
	
	jQuery('.rating_star_1, .rating_star_2, .rating_star_3, .rating_star_4, .rating_star_5').bind('mouseout', function() {
		//show average score on mouseout
		current_project = jQuery(this).parent().attr('id').split('_');
		current_project = current_project[2];
		
		project[current_project].current_over = false;
		
		jQuery('#rating_stars_' + current_project.toString()).removeClass('rating_0 rating_1 rating_2 rating_3 rating_4 rating_5 rating_6 rating_7 rating_8 rating_9 rating_10').addClass('rating_' + project[current_project].project_rating_stars);
		jQuery('.rating_text_' + current_project.toString()).text('Bewertung:');
		jQuery('.rating_score_' + current_project.toString()).text(project[current_project].project_rating_score);
	});
		
}
jQuery(document).ready(init_rater);