$(function(){
	var $img = $('#fotos img')
	$img.filter(":gt(0)").css({opacity: 0})
	function ff(){
		$img.eq(1).css({opacity: 1})
		$img.eq(0)
		.animate({
			top: -385,
			left: -280,
			opacity: 1
		}, 5280, "linear" )
		.animate({
			top: -165,
			left: -120
		}, 7040, "linear", function(){
			f( 1, 1 )
		})
		.animate({
			top: 0,
			left: 0,
			opacity: 0
		}, 5280, "linear", function(){
			$(this).css({
				top: -550,
				left: -400,
				opacity: 0
			})
		})
	}
	function f(n,ud){
		$img.eq(n)
		.animate({
			top: ( - 475 + 175 * ud ),
			opacity: 1
		}, 6000, "linear" )
		.animate({
			top: ( - 475 - 175 * ud )
		}, 7000, "linear", function(){
			if( n == 5 ) ff()
			else f( ( n + 1 ), -ud )
		})
		.animate({
			top: ( - 475 * ( ud + 1 ) )
		}, 6000, "linear", function(){
			$(this).css({
			opacity: 0,
			top: ( 475 * ( ud - 1 ) )
			})
		})
	}
	ff()
})