﻿	var obj = null;

	function checkHover() {
		if (obj) {
			obj.find('ul').fadeOut('fast');	
		}
	}

	function clignote(){
		if($("#reserve #lien").children().is(":hidden")){
			$("#reserve #lien").children().show();
		} else {
			$("#reserve #lien").children().hide();
		}
		setTimeout("clignote()",500);
	}

	 $(document).ready(function(){


		$('a.nyroModal, a.actu').nyroModal();
		//$("#vignettes li a").nyroModal();
		$('a#lien').nyroModal({width: 640, height: 400});
		$('a.tarifs').nyroModal({width: 1000, height: 600});
		
		if ($.getURLParam("actu")!=null) {
		  $("a.actu").trigger('click');
		}
		

		
		/*$('a.actu').click(function(){
			window.open(this.href,'','width=750,height=500,scrollbars=yes,resizable=yes');
			return false;
		});*/

		 charge = function(source){
			$('#chargement').show();
			var image = $('#imagecentrale');
			var preloader = new Image();
			preloader.onload = function() {
				image.attr('src', source);
				$('#chargement').hide();
				preloader.onload = null;
				preloader = null;
			};
			preloader.src = source;
		};

		$('#Nav > li').hover(function() {
			if (obj) {
				obj.find('ul').fadeOut('fast');
				obj = null;
			} //if
			
			$(this).find('ul').fadeIn('fast');
		}, function() {
			obj = $(this);
			setTimeout(
				"checkHover()",
				400);
		});
		

	/*	$("#reserve #lien").click(function(e){
			e.preventDefault();
			var langue = $(this).attr("rel");
			$.nyroModalManual({url: (langue == "en" ? 'booking.html' : 'http://www.secure-hotel-booking.com/CHALET-HOTEL-LES-CAMPANULES/2GXY/dateselection'), width: 400, type: 'iframe'});
			return false;

			//window.location.href = "mailto:info@hotel-campanules.com";
		});*/

		clignote();

	});
	
	function actu() {
		window.open
	}
