$(function(){

/* ******************************************** */
/* Objet										*/
/* ******************************************** */

SmallInput = function(id_form,id_message){
	myForm = $("#"+id_form);
	myForm.find("input[type=text],textarea").each(function(){
		
		//$(this).attr({ defaut : $(this).val() });
		
		$(this).bind("click",function(){
			if( $(this).attr("defaut") == $(this).val() ){
				$(this).val("");
			}
		});
		
		$(this).bind("blur",function(){
			if( $(this).attr("defaut") == $(this).val() || $(this).val() == ""){
				$(this).val( $(this).attr("defaut") );
			}
		});
		
	});
	
	myForm.submit(function(){
		error = 0;
		$(this).find("input[type=text], textarea").each(function(){
			if( $(this).attr("defaut") == $(this).val() ){
				error ++ ;
			}
		});
		
		if( error > 0 ){
			alert( $("#"+id_message).val() );
			return false;
		}else{
			return true;
		}
		
	});
}

//o = new SmallInput("ContactFormulaire","bad_message");

});
