
var obj = null;
var last_obj=2;
var flag=0;
function checkHover() {
	if(flag==0){
		if (obj) {
			obj.find('ul.subMenu').slideUp('fast');	
			last_obj=obj;
		} 
	}
}
function helloForm(){
	$("#contentRight .module_reservation select[name=thematique],#contentRight .module_reservation select[name=nbdays],#contentRight .module_reservation select[name=frommonth]").css('visibility','visible');
	$("#contentRight .module_reservation select[name=FSTBKNGCode]").css('visibility','visible');
	$("#contentRight .module_reservation select[name=fromyear]").css('visibility','visible');
}

function ouvrirpopup(u,n,p) {
	window.open(u,n,p);
}


$(document).ready(function() {


	// Lightbox :
	//$('a[@rel*=lightbox]').lightBox(); // Select all links that contains lightbox in the attribute rel
	
	
	$(".navigation > li").unbind();
	$('.navigation > li').hover(function() {
		
		flag=1;
		if($(this).find('ul.subMenu').css('display')=='none'){
			
			if (obj) {
				obj.find('ul.subMenu').slideUp('fast');
				obj = null;
			}
			
			
			$(this).find('ul.subMenu').slideDown('fast');
			if($.browser.msie)
				helloForm();
			obj=$(this);
		  }
	},function() {
		
		flag=0;
		if($(this).find('ul.subMenu').css('display')=='block'){
			obj=$(this);
			setTimeout("checkHover()",2000); 
		}
	});

	if($.browser.msie){
		elt=$('.navigation >li').get(5);
		
		$(elt).hover(function(){
			$("#contentRight .module_reservation select[name=thematique],#contentRight .module_reservation select[name=nbdays],#contentRight .module_reservation select[name=frommonth]").css('visibility','hidden');
			$("#contentRight .module_reservation select[name=FSTBKNGCode]").css('visibility','hidden');
			$("#contentRight .module_reservation select[name=fromyear]").css('visibility','hidden');
		
		},function(){
			setTimeout("helloForm()",8000); 
		});
		
	}
});


