/**
 * NOIX Star Show
 * @author Joao Neto
 */
var NoixStarsShow = function()
{
	this.init.apply( this, arguments );
};

NoixStarsShow.prototype = {
	index: 1,

	star: null,

	time: 3000,
	
	init: function( id )
	{
		this.star = $( '#'+ id );
	},

	start: function()
	{
		if( this.index == 1 ){
			this.index = 0;
			this.star.fadeIn( 'slow');
		}
		else{
			this.index = 1;
			this.star.fadeOut( 'slow');
		}
		this.registerTimeOut();
	},

	registerTimeOut: function()
	{
		var that = this;
		this.timeout = window.setTimeout( function(){
			that.start();
		}, this.time );
	}
};

$(document).ready(function(){
	var star = new NoixStarsShow( 'stars' );
	star.start();
});