jQuery(document).ready(function() {
				
				jQuery.easing['BounceEaseOut'] = function(p, t, b, c, d) {
					if ((t/=d) < (1/2.75)) {
						return c*(7.5625*t*t) + b;
					} else if (t < (2/2.75)) {
						return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
					} else if (t < (2.5/2.75)) {
						return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
					} else {
						return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
					}
				};

				jQuery("#aguas").jcarousel({
					scroll: 1,
					animation:'slow',
					start:1,
					initCallback: mycarousel_initCallback,
					buttonNextHTML: null, 
					buttonPrevHTML: null
				});
				
				//BOTONERA CARRUSEL
				$("#bolitas div").hover(
					  function () {
						$(this).addClass("activo").show("slow");
					  }, 
					  function () {
						$(this).removeClass("activo");
					  }
				);
				$("#btnmanifiesto").hover(
					  function () {
						$(this).addClass("activo");
					  }, 
					  function () {
						$(this).removeClass("activo");
					  }
				);
				//////////BOTONES BUCKET 2////////////	
				$("#suenoswrapper div").hover(
					  function () {
						var element = $(this);
						var quees = $("#quees");
						var add = element.attr("add");
						
						var reap = function(clase){
							quees.removeClass();
							quees.addClass("quees");
							quees.addClass(add);
							quees.fadeIn(0);
						}
						
						if(element.is(":visible")){
							quees.fadeOut(1, function(){
								reap();
							});
						}
						else{
							reap();
						}
					  }, 
					  function () {
						$("#quees").fadeOut(0);
					  }
				);
				///////////////////BUCKET3/////////////////////
				$("#unetefbboton").click(function(){
					$('#fade').show();
					$('#ventana-videos').show('slow');
					
					jQuery("#videos").jcarousel({
						scroll: 1,
						animation:'fast',
						start:1,
						size:4,
						easing: 'BounceEaseOut',
						animation: 1000,
						initCallback: carouselvideos_initCallback,
						buttonNextHTML: null, 
						buttonPrevHTML: null
					});
				
				});
				$('#cerrarvideos').click(function(){
					$('#ventana-videos').hide('slow');				
					$('#fade').hide();
				});
	
				jQuery('#bannerflash').flash({
				src: 'ciel01.swf',
				width: 958,
				height: 298,				
				wmode:'opaque'
				});

				$(".grid_3").pngFix();
				$(".grid_6").pngFix();
				$("#ventana-videos").hide();

	});

	function mycarousel_initCallback(carousel) {
//		jQuery.youtubeResize();
		jQuery('.carousel-control a').bind('click', function() {
			carousel.scroll(jQuery.jcarousel.intval(jQuery(this).attr("to")));
			$("#bolitas div").animate( {bottom:"0px"}, 50);
			$(this).parent().animate( {bottom:"5px"}, 100);
			return false;
		});
	}

	function carouselvideos_initCallback(carousel) {
		jQuery('#carouselvideos-control-next').bind('click', function() {
			carousel.next();
			return false;
		});

		jQuery('#carouselvideos-control-prev').bind('click', function() {
			carousel.prev();
			return false;
		});

	}

		