/* Author: Tiago Celestino
 *
*/
function galeriaFotos(url, title) {
	
	var $img = $('#fotoGrande img:first');
	var $tit = $('#fotoGrande span');
	var $loader = $('.loading');
	
	$loader.show();
		
    $img.fadeOut('normal', function(){
        $img.attr('src', url);
		$tit.html(title);
    });
	
	$img.fadeOut('normal', function() {
		$img.fadeIn('normal');
		$tit.fadeIn('normal');
		$loader.hide();
	});
	
	$img.load(function() {
		$img.fadeIn('normal');
		$tit.fadeIn('normal');
		$loader.hide();
	});
	
	if($img[0].complete) {
		$img.fadeIn('normal');
		$tit.fadeIn('normal');
		$loader.hide();
	};
	
	
}
$(document).ready(function(){
	

			//TinyCarousel
			$('#thumbs').tinycarousel();

			$('.overview li a').bind('click', function(e) {
				
			
				galeriaFotos($(this).attr('href'), $(this).attr('title'));
				
				e.preventDefault();

				
			});
			
			$('.overview li a:first').trigger('click');
			
			
			
		});





