// FUNCIONES DE JQUERY
$(document).ready(function() {
	
	$("#banners .banner div").hover(function() {				
			$(this).stop().animate({ top:0 }, { duration:300, easing: "easeOutCubic" } );
			$(this).next().hide();
		},function(){
			$(this).stop().animate({ top:"245px" }, { duration:300, easing: "easeOutCubic" } );
			$(this).next().show();
		});
	
	 $("#reproducir-video").click(function() {									 
		$('body').append('<div id="overlay"></div>');
		$('body').append('<div id="contenedorVideo"><img id="boton-cerrarvideo" src="/images/home/boton-cerrarvideo.gif" /><br/><iframe src="http://player.vimeo.com/video/9799805?title=0&amp;byline=0&amp;portrait=0&amp;color=f40012" width="400" height="265" frameborder="0"></iframe></div>');
		posicionX = $(window).width() / 2 - ($('#contenedorVideo').width() / 2);
		posicionY = $(window).height() / 2 - ($('#contenedorVideo').height() / 2);
		posicionX = posicionX + 'px';
		posicionY = posicionY + 'px';
		$('#contenedorVideo').css('left',posicionX);
		$('#contenedorVideo').css('top',posicionY);

		
		$("body").css("overflow", "hidden");
		
		
		$("#boton-cerrarvideo").click(function()
			{
				$('#contenedorVideo').remove();
				$('#overlay').fadeOut('slow');
				$('#overlay').remove();
				$("body").css("overflow", "auto");
				
			});
			$("#overlay").click(function()
			{
				$('#contenedorVideo').remove();
				$('#overlay').fadeOut('slow');
				$('#overlay').remove();
				$("body").css("overflow", "auto");
				
			});
		});
			
});
