$(function (){

       
		var myPages = new Array();
		var myBubbles = new Array();
        var myBobbles = new Array();
	
        $('.page').each(function(){
			myPages.push($(this));              
		});
	
		$('.bubble').each(function(){
			myBubbles.push($(this));
			$(this).css({opacity: 0});
        });

        $('.bobble').each(function(){
			myBobbles.push($(this));
			$(this).css({opacity: 0});
		});

	$("#bubbleWrap,#bobbleWrap").css({'visibility' : 'visible'});
       
 
        $('.feature').mouseover(function(){
                $(".imagen-estatica").stop().animate({opacity: 0, 'top': '0px'}, 500);
	            $(".texto-estatico").stop().animate({opacity: 0, 'top': '0px'}, 500);        
		});
        
         
     $('.feature').mouseleave(function(){
                    setTimeout(function () { 
                    $(".imagen-estatica").stop().animate({opacity: 1, 'top': '0px'}, 500);
	                $(".texto-estatico").stop().animate({opacity: 1, 'top': '0px'},  500);
		
               }, 80); 
               });
               
                     
	jQuery.each(myPages, function(i, val) {
 
		val.mouseover(function() {
		 
                       	myBubbles[i]
							.stop(true, false)
							.animate({opacity: 1, 'top': '0px'},500);
						myBobbles[i]
							.stop(true, false)
							.animate({opacity: 1, 'top': '0px'}, 500);                        
		});
		
		val.mouseleave(function() {
              		   myBubbles[i]
						.stop(true, false)
						.animate({opacity: 0, 'top': '0px'}, 500)
					   myBobbles[i]
						.stop(true, false)
						.animate({opacity: 0, 'top': '0px'},  500)  
						     
		});
	});
	
			
	
	
	(function ($) {
	// VERTICALLY ALIGN FUNCTION
	$.fn.vAlign = function() {
	return this.each(function(i){
	var ah = $(this).height();
	var ph = $(this).parent().height();
	var mh = (ph - ah) / 2;
	$(this).css('padding-top', mh);
	});
	};
	})(jQuery);  
		
});

 $(document).ready(function(){
 
 	$(".news-scroller").jCarouselLite({
        btnNext: ".next",
        btnPrev: ".prev",
        visible: 1
 	 });
    // Alinear Textos Verticalmente
    $('.texto-estatico').vAlign();
    $('.bubble').vAlign();
    $('.desc-holder').vAlign();
    $('.menu li a').vAlign();
   


   });