
function cacher(element){
    document.getElementById(element).style.display = "none";
}


$(function(){
		$('a.textSize').click(function(){
			var ourText = $('#Content p,#Content  li, #Content h4');
			var currFontSize = ourText.css('fontSize');
			var finalNum = parseFloat(currFontSize, 20);
			var stringEnding = currFontSize.slice(-2);
			if(this.id == 'large') {
				finalNum *= 1.5;
			}
			else if (this.id == 'small'){
				finalNum /=1.2;
			}
			if(((finalNum + stringEnding) < '30')){
			ourText.animate({fontSize: finalNum + stringEnding},600);
			}
			
		});
	});


$(function(){
		$("#navigation ul li ul").hide();
		$("#navigation ul li ul").css("height",0);
		$("#navigation ul li").bind("mouseenter", function(e){
															 
			
			if($.browser.msie && $.browser.version == 6){
					$("#monHoraire form select").css("visibility","hidden");
			}
			
			$("ul",this).show().css("opacity",0).stop().animate({ 
		   			opacity: 1,
					height:200
     				 }, 400 );
			})
		  $("#navigation > ul").bind("mouseleave", function(e){
			  if($.browser.msie && $.browser.version == 6){
				  $("#monHoraire form select").css("visibility","visible");
			  }
			  $("ul",this).stop().animate({ 
		   			opacity: 0,
					height:0
     				 }, 400,function(){
						 $(this).hide();
						 } );
		  });
		  
		  $("#navigation > ul li").bind("mouseleave", function(e){
			  if($.browser.msie && $.browser.version == 6){
				  $("#monHoraire form select").css("visibility","visible");
			  }
			  $("ul",this).stop().animate({ 
		   			opacity: 0,
					height:0
     				 }, 400,function(){
						 $(this).hide();
						 } );
		  });
	});


jQuery(document).ready(function() {
/*
    jQuery('ul#mycarousel').jcarousel({
			scroll: 1,
			auto: 5, 
			wrap: 'last',
			animation: 1000,
	    easing: 'easeInOutCubic',
	    itemVisibleInCallback: {
				onAfterAnimation: mycarousel_fadeImgIn,
				onBeforeAnimation: mycarousel_hideImgIn
			},
			itemVisibleOutCallback: {
				onBeforeAnimation: mycarousel_fadeImgOut
			}  
    });
	*/
	
	if ($.browser.msie) {effetFade = "none";} else {effetFade = "fade";} 
	jQuery('ul#mycarousel').cycle({
	fx:     effetFade, 
	timeout: 10000, 
    next:   '#next', 
    prev:   '#prev',
	cleartypeNoBg:   true
	
	});
	
});

function mycarousel_fadeImgIn(carousel, item, idx, state) {
 jQuery('img', item).fadeIn('slow'); 
 jQuery('.contentActu', item).fadeIn('slow');
};
function mycarousel_hideImgIn(carousel, item, idx, state) {
 jQuery('img', item).hide(); 
 jQuery('.contentActu', item).hide();
};
function mycarousel_fadeImgOut(carousel, item, idx, state) {
	jQuery('img', item).hide('fast'); 
	jQuery('.contentActu', item).hide('fast'); 
};
  
  
 // gestion de l'horloge jQuery('#clockJS');
 
 jQuery(document).ready(function () {
	afficheHorloge();
	setInterval("afficheHorloge()", 5000);
 });

function afficheHorloge() {
	var d = new Date();
	var h = d.getHours();
	var m = d.getMinutes();
	var i = 0;
	var r = "";
	if (h < 10) {
		r += '<img src="images/horloge/0.jpg" alt="0" />';
		r += '<img src="images/horloge/' + h +'.jpg" alt="' + h +'" />';
	} else {
		i = parseInt(h/10);
		r += '<img src="images/horloge/' + i +'.jpg" alt="' + i +'" />';
		i = h - (i * 10);
		r += '<img src="images/horloge/' + i +'.jpg" alt="' + i +'" />';
	}
	r += '<img src="images/horloge/sep.jpg" alt=":" />';
	if (m < 10) {
		r += '<img src="images/horloge/0.jpg" alt="0" />';
		r += '<img src="images/horloge/' + m +'.jpg" alt="' + m +'" />';
	}
	else {
		i = parseInt(m/10);
		r += '<img src="images/horloge/' + i +'.jpg" alt="' + i +'" />';
		i = m - (i * 10);
		r += '<img src="images/horloge/' + i +'.jpg" alt="' + i +'" />';
	}
	jQuery('#clockJS').html(r);
}
