/*
 * Dipendenze: $.geolocation  - http://code.google.com/p/geo-location-javascript/
 * */

$.widget("ui.showcase", {
	options : {
		'interval':5000
	},
	_create : function() {
		this.currentStep = 0;
		var _self = this;
		this.titles = this.element.find('.player li');
		this.images = this.element.find('.images li');
		this._next();
		setInterval(function(){
			_self._next();
		},this.options.interval);

	},
	_next:function(){
		$(this.titles[this.currentStep]).fadeOut();
		$(this.images[this.currentStep]).fadeOut();
		this.currentStep++;
		if(this.currentStep > this.titles.length-1) this.currentStep = 0;		
		$(this.titles[this.currentStep]).fadeIn();
		$(this.images[this.currentStep]).fadeIn();
	}
});
