function setFormulaire(){
	$("span.obligatoire").click(function() {
				$(this).hide();
	});
	$("form").submit(function() {
	var test=true;
	$(this).find("span.obligatoire").remove();
	$(this).find(".champs_obligatoire").each(function() {					
				 if($(this).val()=="") {
					 $(this).after(" <span class=\"obligatoire\">(obligatoire)</span>");
					 $(this).parent().children("span.obligatoire").click(function() {$(this).remove();});
					 $(this).change( function () {if ($(this).val()!=""){$(this).parent().children("span.obligatoire").remove();}} );
					 test=false;
				 }
			});
	$(this).find(".champs_obligatoire").each(function() {					
				 if($(this).val()=="") {
					 $(this).focus();
					 $(document).scrollTop($(document).scrollTop()-180);
					 return false;
				 }
			});
	return test;
	});
}

$(document).ready(function() {
setFormulaire();
});
