var ster1;
var ster2;
var ster3;
var ster4;
var ster5;

function savestars(st1,st2,st3,st4,st5)
{
	ster1 = st1;
	ster2 = st2;
	ster3 = st3;
	ster4 = st4;
	ster5 = st5;
}

$(document).ready(function() {

	$(".hover1star").hover(function() {
		
		savestars($(".hover1star").attr("src"), $(".hover2star").attr("src"), $(".hover3star").attr("src"),$(".hover4star").attr("src"),$(".hover5star").attr("src"));
		
		$(".hover1star").attr("src", "/images/site/rating_yellow.png");
		$(".hover2star").attr("src", "/images/site/rating_gray.png");
		$(".hover3star").attr("src", "/images/site/rating_gray.png");
		$(".hover4star").attr("src", "/images/site/rating_gray.png");
		$(".hover5star").attr("src", "/images/site/rating_gray.png");
	}, function() {
		$(".hover1star").attr("src", ster1);
		$(".hover2star").attr("src", ster2);
		$(".hover3star").attr("src", ster3);
		$(".hover4star").attr("src", ster4);
		$(".hover5star").attr("src", ster5);
	});
	
	$(".hover2star").hover(function() {
		
		savestars($(".hover1star").attr("src"), $(".hover2star").attr("src"), $(".hover3star").attr("src"),$(".hover4star").attr("src"),$(".hover5star").attr("src"));
		
		$(".hover1star").attr("src", "/images/site/rating_yellow.png");
		$(".hover2star").attr("src", "/images/site/rating_yellow.png");
		$(".hover3star").attr("src", "/images/site/rating_gray.png");
		$(".hover4star").attr("src", "/images/site/rating_gray.png");
		$(".hover5star").attr("src", "/images/site/rating_gray.png");
	}, function() {
		$(".hover1star").attr("src", ster1);
		$(".hover2star").attr("src", ster2);
		$(".hover3star").attr("src", ster3);
		$(".hover4star").attr("src", ster4);
		$(".hover5star").attr("src", ster5);
	});
	
	$(".hover3star").hover(function() {
		
		savestars($(".hover1star").attr("src"), $(".hover2star").attr("src"), $(".hover3star").attr("src"),$(".hover4star").attr("src"),$(".hover5star").attr("src"));
		
		$(".hover1star").attr("src", "/images/site/rating_yellow.png");
		$(".hover2star").attr("src", "/images/site/rating_yellow.png");
		$(".hover3star").attr("src", "/images/site/rating_yellow.png");
		$(".hover4star").attr("src", "/images/site/rating_gray.png");
		$(".hover5star").attr("src", "/images/site/rating_gray.png");
	}, function() {
		$(".hover1star").attr("src", ster1);
		$(".hover2star").attr("src", ster2);
		$(".hover3star").attr("src", ster3);
		$(".hover4star").attr("src", ster4);
		$(".hover5star").attr("src", ster5);
	});
	
	$(".hover4star").hover(function() {
		
		savestars($(".hover1star").attr("src"), $(".hover2star").attr("src"), $(".hover3star").attr("src"),$(".hover4star").attr("src"),$(".hover5star").attr("src"));
		
		$(".hover1star").attr("src", "/images/site/rating_yellow.png");
		$(".hover2star").attr("src", "/images/site/rating_yellow.png");
		$(".hover3star").attr("src", "/images/site/rating_yellow.png");
		$(".hover4star").attr("src", "/images/site/rating_yellow.png");
		$(".hover5star").attr("src", "/images/site/rating_gray.png");
	}, function() {
		$(".hover1star").attr("src", ster1);
		$(".hover2star").attr("src", ster2);
		$(".hover3star").attr("src", ster3);
		$(".hover4star").attr("src", ster4);
		$(".hover5star").attr("src", ster5);
	});
	
	$(".hover5star").hover(function() {
		
		savestars($(".hover1star").attr("src"), $(".hover2star").attr("src"), $(".hover3star").attr("src"),$(".hover4star").attr("src"),$(".hover5star").attr("src"));
		
		$(".hover1star").attr("src", "/images/site/rating_yellow.png");
		$(".hover2star").attr("src", "/images/site/rating_yellow.png");
		$(".hover3star").attr("src", "/images/site/rating_yellow.png");
		$(".hover4star").attr("src", "/images/site/rating_yellow.png");
		$(".hover5star").attr("src", "/images/site/rating_yellow.png");
	}, function() {
		$(".hover1star").attr("src", ster1);
		$(".hover2star").attr("src", ster2);
		$(".hover3star").attr("src", ster3);
		$(".hover4star").attr("src", ster4);
		$(".hover5star").attr("src", ster5);
	});
	
	$(".komnuchattenhover").hover(function() {
		$(this).attr("src", "/images/site/komnuchatten_hover.png");
	}, function() {
		$(this).attr("src", "/images/site/komnuchatten.png");
	});

	$(".meerinfohover").hover(function() {
		$(this).attr("src", "/images/site/meerinfohead_hover.png");
	}, function() {
		$(this).attr("src", "/images/site/meerinfo.png");
	});

	$(".liveonlinehover").hover(function() {
		$(this).attr("src", "/images/site/liveonline_hover.png");
	}, function() {
		$(this).attr("src", "/images/site/liveonline.png");
	});

	$(".nuchattenhover").hover(function() {
		$(this).attr("src", "/images/site/nuchattenhead_hover.png");
	}, function() {
		$(this).attr("src", "/images/site/nuchattenhead.png");
	});

	$(".meerinfoheadhover").hover(function() {
		$(this).attr("src", "/images/site/meerinfohead_hover.png");
	}, function() {
		$(this).attr("src", "/images/site/meerinfohead.png");
	});

	$(".komnuchattensidebarhover").hover(function() {
		$(this).attr("src", "/images/site/komnuchattensidebar_hover.png");
	}, function() {
		$(this).attr("src", "/images/site/komnuchattensidebar.png");
	});

	$(".komnuchattenheadhover").hover(function() {
		$(this).attr("src", "/images/site/komnuchattenhead_hover.png");
	}, function() {
		$(this).attr("src", "/images/site/komnuchattenhead.png");
	});


	$(".hoverpicpage").hover(function()
	{
		//$(this).addClass("hoverthispic");
		$(this).children().children('.status').css('top', -($(this).children().children('.status').height()+1));
		$(this).children().children('.status').show().animate({'top': '1px'}, {duration: 400, queue: true});
		
		$(this).children().children('.privechat').css('bottom', '-'+($(this).children().children('.status').height()+1) +'px');
		$(this).children().children('.privechat').show().animate({'bottom': '1px'}, {duration: 400, queue: true});
	
	}, function()
	{
		//$(this).removeClass("hoverthispic");
		$(this).children().children('.status').animate({'top': '-'+($(this).children().children('.status').height()+1)+'px'}, {duration: 400, queue: true});
		$(this).children().children('.privechat').animate({'bottom': '-'+($(this).children().children('.status').height()+1)+'px'}, {duration: 400, queue: true});
	});
	

	$(".hoverbigbuttonprofile").hover(function() {
		$(this).attr("src", "/images/site/buttonprofile_hover.png");
	}, function() {
		$(this).attr("src", "/images/site/buttonprofile.png");
	});
	
	$(".grotewebcamshover").hover(function() {
		$(this).attr("src", "/images/site/groot_licht.png");
	}, function() {
		if (!$(this).hasClass('activesize'))
			$(this).attr("src", "/images/site/groot_grijs.png");
	});
	
	$(".middelwebcamshover").hover(function() {
		$(this).attr("src", "/images/site/middel_licht.png");
	}, function() {
		if (!$(this).hasClass('activesize'))
			$(this).attr("src", "/images/site/middel_grijs.png");
	});
	
	$(".kleinewebcamshover").hover(function() {
		$(this).attr("src", "/images/site/klein_licht.png");
	}, function() {
		if (!$(this).hasClass('activesize'))
			$(this).attr("src", "/images/site/klein_grijs.png");
	});

	$(".livewebcambeeldinclude").click(function() {
		$(".biglivecamimage").attr("src", $(this).attr("src"));
	});
	
  	$.get('/ajax/getFavorieten/' + Math.random()*15531552, function(data) {
  		$('.favorieten').html(data);
	});

	$(".favorietclicker").live('click', function ()
	{
		var naam = $(this).attr("href");
		$(".favorieten").load('/ajax/deleteFavoriet/'+naam);
		
		$('.left a[href='+naam+']').attr('class', 'addtofavorieten');
		$('.left a[href='+naam+'] img').attr('src', '/images/site/favorite_plus.png');
    });

	$(".addtofavorieten").live('click', function ()
	{
		var naam = $(this).attr("href");
		$(".favorieten").load('/ajax/setFavoriet/'+naam);
		$(this).attr('class', 'favorietclicker');
		$(this).children('img').attr('src', '/images/site/favorite_min.png');
    });
	
});
