/*************** Début switchlanguage****************************/
/*Récupération de la langue courante en utilisant l'attribut html lang*/
function currentLanguage(){
	return $("html").attr("lang");
}

/*Contextualisation sur le body : ajoute la langue comme class sur la balise body*/
function context(){
	var bodyElt = document.getElementsByTagName('body');
	bodyElt[0].className = bodyElt[0].className + " "+ currentLanguage();

}


/*************** FIN switchlanguage****************************/

/*************** Début Label Recherche****************************/
function labelsearch(){

  //Français
	$(".fr #search_input_box").attr('value',' recherche');
	$(".fr #search_input_box").focus(function(){
      if($(this).attr('value')==' recherche'){
      	$(this).attr('value','');
      }
  });
  $(".fr #search_input_box").blur(function(){
      if($(this).attr('value')=='')$(this).attr('value',' recherche');
  });

  //English
	$(".en #search_input_box").attr('value',' search');
	$(".en #search_input_box").focus(function(){
      if($(this).attr('value')==' search')$(this).attr('value','');
  });
  $(".en #search_input_box").blur(function(){
      if($(this).attr('value')=='')$(this).attr('value',' search');
  });
  
  //Spanish
  $(".es #search_input_box").attr('value',' buscar');
	$(".es #search_input_box").focus(function(){
      if($(this).attr('value')==' buscar')$(this).attr('value','');
  });
  $(".es #search_input_box").blur(function(){
      if($(this).attr('value')=='')$(this).attr('value',' buscar');
  });
}

/*************** FIN Label Recherche****************************/

/*Lancement de la contextualisation au début du projet*/
$(document).ready(function(){context();
labelsearch();});
