$(document).ready(function(){
	var __THEDIVS = [];

    $('#gallery img').each(function() {
        __THEDIVS.unshift($(this));
    })
	
	function animate() {
        $elem = __THEDIVS.pop();
        $elem.animate({
            "height": 43, "width":122, "opacity": "toggle"
        }, {duration: 700, easing: ''});
        if (__THEDIVS.length) {
            setTimeout(animate, 500);
        }
    }
	

    $('#galleryright img').each(function() {
        __THEDIVS.unshift($(this));
    })
	
	function animatetwo() {
        $elem = __THEDIVS.pop();
        $elem.animate({
            "height": 43, "width":122, "opacity": "toggle"
        }, {duration: 700, easing: ''});
        if (__THEDIVS.length) {
            setTimeout(animatetwo, 500);
        }
    }
	
	
   setTimeout(function(){
  $("#header").fadeIn("slow", function(){
	$("#testohome").fadeIn("slow");
  $("#testo").fadeIn("slow", function () {
        
		if (document.getElementById("gallery")) {
    animate();
}
if (document.getElementById("galleryright")) {
    animatetwo();
}

  });
  }); 
  }, 500);
  });
  
$(document).ready(function () {  
$('#gallery img').mouseover(function() {
  
  $(this).animate({
            "height": 50, "width":130
        }, 200);
});

$('#gallery img').mouseout(function() {
  
  $(this).animate({
            "height": 43, "width":122
        },200);
});

$('#galleryright img').mouseover(function() {
  
  $(this).animate({
            "height": 50, "width":130
        }, 200);
});

$('#galleryright img').mouseout(function() {
  
  $(this).animate({
            "height": 43, "width":122
        },200);
});
});

