function component_IndexPhoto(auto_id)
{
	this.DOMConstruct('IndexPhoto', auto_id);
	
	var handler = this;
	
	this.references = [];
	
	this.delegates = {
		
	};
}

component_IndexPhoto.prototype =
	new SK_ComponentHandler({
		
		construct : function( data ){
			//alert(JSON.stringify(data));
			
			this.photosArray = data;
			
			var handler = this;
			
			document.temp = function(){handler.switchPhoto();}
			
			setInterval('document.temp();', 5000);
		},
		
		switchPhoto : function()
		{
			var handler = this;

			if( this.counter == undefined )
				this.counter = 1;
				
			
			data = this.photosArray[this.counter];
			this.$('#best_photo_a').fadeOut(3000, function(){
				handler.$('#best_photo_a').attr('href', data.url);
				handler.$('#best_photo_div').css({backgroundImage:'url('+data.src+')'});
				handler.$('#best_photo_a').fadeIn(3000);											   
			});
			
			this.counter++;

			if( (this.counter + 1) > this.photosArray.length )
				this.counter = 0;
		}
	});
