// JavaScript Document



$(document).ready(function(){
	if($('body').hasClass('home')){
		
		$('#encart_offres li').each(function(){
			$(this).click(function(){
				$('#encart_offres li').removeClass('actif');
				$(this).addClass('actif');
				$('#encart_offres div').hide();
				$('#encart_offres div.'+$(this).attr('id')).show();
			});
		});
		
		var over_reservez = false;
		$('#encart_hebergements').children('h4').hover(function () {
			clearTimeout($.data(this, 'timer'));
			$('#encart_reservez').stop(true, true).slideDown(200);
		}, function () {
			$.data(this, 'timer', setTimeout($.proxy(function() {
				if(!over_reservez){
					$(this).removeClass('actif');
					$('#encart_reservez').stop(true, true).slideUp(200);
				}
			}, this), 200));
		});	
		$('#encart_reservez').hover(function () {
			over_reservez = true;
			clearTimeout($.data(this, 'timer'));
			$('#encart_hebergements').children('h4').addClass('actif');
		}, function () {
			$.data(this, 'timer', setTimeout($.proxy(function() {
				over_reservez = '';
				$('#encart_hebergements').children('h4').removeClass('actif');
				$(this).stop(true, true).slideUp(200);
			}, this), 200));
		});
		$('#offres h3').each(function(){
			$(this).hover(function () {
				$(this).children('a').children('span').addClass('color1');
			}, function () {
				$(this).children('a').children('span').removeClass('color1');
				
			});	
		});
	}
});
