//------------------------------------------------------------------
// Auteur : Ludovic Martin <ludovic@dreamclic.com> / www.dreamclic.com
// 
// Version             : 2.0
// Date de création    : 26/06/2008
//
// Description         : Fonctions utilitaires
//
//------------------------------------------------------------------

//------------------------------------------------------------------
// au chargement du document
$(document).ready(function(){
	// Pour "Afficher/Masquer" un contenu dans un input
	// d'après http://remysharp.com/2007/03/19/a-few-more-jquery-plugins-crop-labelover-and-pluck/#labelOver
	$('label.texte_fantome').each(function(){
		var label = $(this);
		var f = label.attr('for');
		if(f){
		
			var input = $('#' + f);
			this.hide = function(){
			  label.hide();
			}
			
			this.show = function(){
			  if(input.val() == '') label.show();
			}

			input.focus(this.hide);
			input.blur(this.show);
			label.click(function(){ input.focus() });
			
			if(input.val() != '') this.hide(); 
		}
	});  
});
//------------------------------------------------------------------