$(document).ready(function(){



	//BOUTON RECHERCHE
	$('#searchform #xk').focus(function() {
		  var cherche = $('#btcherche').attr("title");
		  if ($('#xk').attr("value")==cherche){
		  $('#xk').attr("value","");
		  return false;
 		 }
				 return false;
	});
	$('#searchform #xk').mouseover(function() {
 		 var cherche = $('#btcherche').attr("title");
 		 if ($('#xk').attr("value")==cherche){
 		 $('#xk').attr("value","");
		 return false;
  		};
				 return false;

	});
	$('#search').mouseout(function() {
		  var cherche = $('#btcherche').attr("title");
		  if ($('#xk').attr("value")==""){
		  $('#xk').attr("value",cherche);
		  return false;
 		 }
				 return false;
	});
	
	$("#searchform").submit(function() {
		  var cherche = $('#btcherche').attr("title");
		  if ($('#xk').attr("value") == cherche || $('#xk').attr("value") == ""){
			  $("#searchalert").fadeIn(500).delay(1500).fadeOut(500);
			return false;
		  };
	});

	//MENU
        $("ul.sf_menu_gen").supersubs({
            minWidth:    14,   // minimum width of sub-menus in em units
            maxWidth:    16,   // maximum width of sub-menus in em units
            extraWidth:  1     // extra width can ensure lines don't sometimes turn over
                               // due to slight rounding differences and font-family
        }).superfish();  // call supersubs first, then superfish, so that subs are
                         // not display:none when measuring. Call before initialising
                         // containing tabs for same reason.
	//MENU2
        $("ul.sf_menu_page").supersubs({
            minWidth:    14,
            maxWidth:    15,
            extraWidth:  1
        }).superfish();


	//TAILLE POLICE
			$(".increaseFont").click(function(){
				var currentFontSize = $('body').css('font-size');
				var currentFontSizeNum = parseFloat(currentFontSize, 10);
				var newFontSize = currentFontSizeNum+2;
				if(newFontSize<19){
				$('body').css({'font-size' : newFontSize});
				}
				if(newFontSize>=19){
				$('#increaseFont').addClass('cachefont');
				}
				if(newFontSize>11){
				$('#decreaseFont').removeClass('cachefont');
				}
				return false;
			});
			$(".decreaseFont").click(function(){
				var currentFontSize = $('body').css('font-size');
				var currentFontSizeNum = parseFloat(currentFontSize, 10);
				var newFontSize = currentFontSizeNum-1;

				if(newFontSize<11){
				$('#decreaseFont').addClass('cachefont');
				}
				if(newFontSize<19){
				$('#increaseFont').removeClass('cachefont');
				}

				if(newFontSize>=11){
				$('body').css({'font-size' : newFontSize});
				}
				return false;
			});
			$(".normalFont").click(function(){
				var newFontSize = $('html').css('font-size');
				$('#decreaseFont').removeClass('cachefont');
				$('#increaseFont').removeClass('cachefont');
				$('body').css({'font-size' : newFontSize});
				return false;
			});
			
});
    
