$(document).ready(function(){

// Efecto mostrar contenido
	$('#info').animate({left:'370px'},600);
	
	$('#nav a').click(function(){
		a=parseInt($('#nav a').index(this))+1;
		if($('#imagenes').children('div').index($('#imagenes').children('div:visible'))!=a){
			$('#imagenes').children('div:visible').animate({left:'790px'},600,function(){
				$(this).hide();
				$('#imagenes').children('div').eq(a).show().animate({left:'370px'},600);
			});
		}
		return false;
	});


// Efecto fade de imagen de fondo
		$('ul#imagenes_fondo').innerfade({
			speed: 1000,
			timeout: 5000,
			type: 'sequence',
			containerheight: '500px'
		});
		
		$('.fade').innerfade({
			speed: 1000,
			timeout: 6000,
			type: 'random_start',
			containerheight: '1.5em'
		});

// Scroll de imagenes 
$("#buttondown").hover(function(){ 
			c=$(".scrolling").parents("div").height();
			m=0-($(".scrolling").height())+c-50;
			a=($(".scrolling").height()/c)*3000;			
			if(c<$(".scrolling").height())$(".scrolling").animate({top: m+'px'},a);
		},function(){$(".scrolling").stop();});

		$("#buttonup").hover(function(){ 
			c=$(".scrolling").parents("div").height();
			a=($(".scrolling").height()/c)*3000;			
			if(c<$(".scrolling").height())$(".scrolling").animate({top: '0px'},a);
		},function(){$(".scrolling").stop();});

		$(".scrollbutton>img").hover(function(){$(this).attr("src", "img/point.gif");},function(){$(this).attr("src", "img/point_grey.gif");});
		

		$("#buttondown").click(function(){ 
			c=$(".scrolling").parents("div").height();
			m=0-($(".scrolling").height())+c-50;
			if(c<$(".scrolling").height())$(".scrolling").stop().animate({top: m+'px'}, 300);
		});		

		$("#buttonup").click(function(){if(c<$(".scrolling").height()){$(".scrolling").stop().animate({top: '0px'}, 300);}});

// Lightbox
	$(function() {
        $('#gallery a').lightBox();
    });

});




