$(document).ready(function(){

var showtime = 0;
var endstar = $.cookie("stars");

//alert(endstar);

if(endstar == null)
{
	endstar = 0;
}

if (endstar != 0)
{
	for (i=0; i<=endstar; i++)
	{
		$('#star'+i).removeClass('star-js');
	}
}

if(endstar < 1)
{
	//alert('1');
	$('#star0').fadeIn(4000);
	$.cookie("stars", '0', { path: '/', expires: 1 });
	showtime = 0;
}

if (endstar < 2)
{
	showtime += 5000;
	$("#star1").oneTime(showtime, function() {
		//alert('2');
		$('#star1').fadeIn(4000);
		$.cookie("stars", '1', { path: '/', expires: 1 });
	});
}

if (endstar < 3)
{
	showtime += 6000;
	$("#star2").oneTime(showtime, function() {
		//alert('3');
		 $('#star2').fadeIn(4000);
		 $.cookie("stars", '2', { path: '/', expires: 1 });
	});
}

if (endstar < 4)
{
	showtime += 7000;
	$("#star3").oneTime(showtime, function() {
		$('#star3').fadeIn(4000);
		$.cookie("stars", '3', { path: '/', expires: 1 });
	});
}

if (endstar < 5)
{
	showtime += 6000;
$("#star4").oneTime(showtime, function() {
     $('#star4').fadeIn(4000);
	 $.cookie("stars", '4', { path: '/', expires: 1 });
});
}

if (endstar < 6)
{
	showtime += 7000;
	$("#star5").oneTime(showtime, function() {
		$('#star5').fadeIn(4000);
		$.cookie("stars", '5', { path: '/', expires: 1});
	});
}

if (endstar < 7)
{
	showtime += 8000;
	$("#star6").oneTime(showtime, function() {
		$('#star6').fadeIn(4000);
		$.cookie("stars", '6', { path: '/', expires: 1 });
	});
}

});

