// JavaScript Document
$(window).load(function(){
	
});
$(document).ready(function(){
	$('.redes_sociales a').hover(function(){
		$(this).find('img').animate({top:'-6px'},{queue:false,duration:130});
	}, function(){
		$(this).find('img').animate({top:'0px'},{queue:false,duration:130});
	});
	
	$('#slides').slides({
		preload: false,
		play: 8000,
		pause: 100,
		hoverPause: true,
		slideSpeed: 600,
		animationStart: function(current){
			
			$('.caption').hide();
		},
		animationComplete: function(current){
			$('.caption').hide().delay(900).fadeIn(200);
		},
		slidesLoaded: function() {
			//$('.caption').fadeIn(450);
		}
	});
	
	$('.caption a').click(function(){
		$(this).parent().parent().remove();
	});
	
	$("a.popup").fancybox();
	
	$.preloadImages("assets/bg_contact.png");

});

jQuery.preloadImages = function()
{
  for(var i = 0; i<arguments.length; i++)
  {
    jQuery("<img>").attr("src", arguments[i]);
  }
}
