(function($){			
	$Album = {
		
		me:this,
		
		fotos:[],
		
		_atual:-1,

		_constructor:function()
		{
			var me = this;
			me.initConfig();
			
			$("#left").click(function() { me.anterior() });
			$("#right").click(function() { me.proxima() });
		},
		
		loadFoto: function() {
			$('#foto img').bind("load", function (e) {
				$(this).fadeTo('fast', 1);
			});
		},
		
		atual: function(value) {
			var me = this;
			me._atual = ((value % me.fotos.length) + me.fotos.length) % me.fotos.length;
			$('#foto img')
				.fadeTo('fast', .01)
				.queue(function () {
					$(this)
					.dequeue()
					.attr('src', me.fotos[me._atual]);
				});
		},
		
		anterior: function() {
			this.atual(this._atual - 1);
		},
		
		proxima: function() {
			this.atual(this._atual + 1);
		},

		initConfig:function()
		{
			this.loadFoto();
			this.proxima();
		}

	}
})(jQuery); 
