function confirmation(URL,MSG)
{
	if(confirm(MSG))
	{
		document.location.href=URL;
	}
}

function redirect(URL)
{
	document.location.href=URL;
}

function verif(email) {
   var reg = /^[a-z0-9._-]+@[a-z0-9.-]{2,}[.][a-z]{2,3}$/
   return (reg.exec(email)!=null)
}

function WarningField(id,max,output)
{
	$(document).ready(function () {
		var affichage_reste = $("#"+id).val().length+' caractères sur '+max+' conseillés';
		$("#"+output).html(affichage_reste);
    });
}

function ShowHide(LayerID,CLhide)
{
	$(document).ready(function () {
		if($("#"+LayerID).is(':visible')) $("#"+LayerID).slideUp('fast');
		if($("#"+LayerID).is(':hidden')) 
		{
			$("."+CLhide).slideUp('fast');
			$("#"+LayerID).slideDown('fast');
		}
	});
}
