// Autor: Francisco Gutierrez Cepeda
// Empresa: Quantum web studio
// Fecha: 23/06/2010

$(document).ready(function() {
	
	$('#images li').hide();
	$('#slide li:first').show().addClass('active');
	
	$caption_h=$('.caption').outerHeight();
	$('.caption').css({'opacity':'0.8','bottom':-$caption_h});
	$('.image').find('div.caption').delay(200).animate({'bottom':'0'},'normal');	

	// SLIDE SHOW; CAMBIO DE IMAGEN
	setInterval(function() { 
		$current=$('#slide .active');
		$next= $current.next().length ? $current.next() : $current.parent().children(':first');
		
		$current.fadeOut('normal').removeClass('active');
		$('.caption').animate({'bottom':-$caption_h},'normal');	
		$next.fadeIn('normal').addClass('active');	
		$next.find('div.caption').delay(200).animate({'bottom':'0'},'normal');
		
	},3000);
	
	/*// BOTONES MANGUERAS //*/
	$('.text').hide();
	
	$('#sec_menu li').hover(function() { 
		$('ul#hoses_img').addClass('hoses_img');
	},function() { 
		$('ul#hoses_img').removeClass('hoses_img');
	});
	
	$('li#flexibles').hover(function() {
		$('li#flexibles_x').fadeIn('normal');
		$('li#flexibles_x').find('.text').delay(300).show('normal');
	},function() { 
		$('li#flexibles_x').fadeOut('normal');
		$('.text').hide('normal');
	});
	
	$('li#trenzadas').hover(function() {
		$('li#trenzadas_x').fadeIn('normal');	
		$('li#trenzadas_x').find('.text').delay(300).show('normal');
	},function() { 
		$('li#trenzadas_x').fadeOut('normal');	
		$('.text').hide('normal');
	});
	
	$('li#moldeadas').hover(function() {
		$('li#moldeadas_x').fadeIn('normal');
		$('li#moldeadas_x').find('.text').delay(300).show('normal');
	},function() { 
		$('li#moldeadas_x').fadeOut('normal');
		$('.text').hide('normal');
	});
	
	$('li#moldeadas_2').hover(function() {
		$('li#moldeadas_2_x').fadeIn('normal');	
		$('li#moldeadas_2_x').find('.text').delay(300).show('normal');
	},function() { 
		$('li#moldeadas_2_x').fadeOut('normal');
		$('.text').hide('normal');
	});
	
	$('li#prods').hover(function() {
		$('li#prods_x').fadeIn('normal');
		$('li#prods_x').find('.text').delay(300).show('normal');
	},function() { 
		$('li#prods_x').fadeOut('normal');
		$('.text').hide('normal');
	});
});
