(function(){
  	var d = document, e = d.documentElement, s = d.createElement('style');
  	if (e.style.MozTransform === '')
	{
    	s.textContent = 'body{visibility:hidden}';
    	e.firstChild.appendChild(s);
    	function f()
		{ 
			s.parentNode && s.parentNode.removeChild(s);
		}
    	addEventListener('load',f,false);
    	setTimeout(f,3000); 
  	}
})();


$(document).ready(function(){
   
   $("input.error").focus(function(){
	   $(this).removeClass("error");
	});
	
	$(".dynLink").click(function(evt){
		evt.preventDefault();
	});
	$("#top_menu_container .top_menu").mouseenter(function(evt){
		if($(".sub_menu_container",$(this)).length > 0)
		{
			open_sub($(this));
		}
	}).mouseleave(function(evt){
		if($(".sub_menu_container",$(this)).length > 0)
		{
			close_sub($(this));
		}
	});
	
	if($("#photo_gallery_pictures").length > 0)
	{
		$("#photo_gallery_pictures").mouseenter(function(evt){
			pause_top_gallery_animation();
		}).mouseleave(function(evt){
			resume_top_gallery_animation();
		});

		$("#photo_gallery_controls_left").click(function(evt){
			prev_picture();
		});
		$("#photo_gallery_controls_right").click(function(evt){
			next_picture();
		});

		$("#photo_gallery_controls_play_pause").click(function(evt){
			photo_gallery_controls_play_pause_click($(this));
		});

		$("#photo_gallery_controls .control").mouseover(function(evt){
			show_thumb($(this).index("#photo_gallery_controls_numbers .control"));
		}).mouseleave(function(evt){
			hide_thumb($(this).index("#photo_gallery_controls_numbers .control"));
		}).click(function(evt){
			change_picture($(this).index("#photo_gallery_controls_numbers .control"));
		});

		setTimeout("setThumbsContainerLeft()",1000);
		start_top_gallery_animation();
	}
	
	var center_td_width = $("table.contenu tr > td.centre").outerWidth(true);
	center_td_max_right = $("table.contenu tr > td.centre").offset().left+center_td_width;
	$("#top_menu_container .sub_menu_container").each(function(){
		$(this).data("left_set",false);
	});
	
	// Date - Year, Month-1, Day, Hours, ...
	end_time = new Date(2012,0,20,19,0,0,0);
	
	opening_countdown();
	
	opening_countdown_interval = setInterval("opening_countdown()",1000);
});
