function afficheForme(niv)
{
	creationFondSombre();
	$('body').append('<div id = "boxlo" style = "display:none;"></div>');
	$('#boxlo').css('width','430px');
	$('#boxlo').css('height','380px');
	$('#boxlo').css('backgroundColor','#ffffff');
	$('#boxlo').css('padding','15px');
	$('#boxlo').css("position","absolute");
	$('#boxlo').css("top", ( $(window).height() - $('#boxlo').height() ) / 2+$(window).scrollTop() + "px");
	$('#boxlo').css("left", ( $(window).width() - $('#boxlo').width() ) / 2+$(window).scrollLeft() + "px");
	$('#boxlo').css("zIndex","3000");
	$.ajax({
	  	type : 'POST', // envoi des données en GET ou POST
		url : 'moduleLo/client/moteur.php5' , // url du fichier de traitement
		data : "formulaire="+niv , // données à envoyer en  GET ou POST
		success : function(data){ // traitements JS à faire APRES 
		
		$('#boxlo').html(data);
		$('#boxlo').animate({
    width: ['toggle', 'swing'],
    height: ['toggle', 'swing'],
    opacity: 'toggle'
  }, 900, 'swing');
	}
      });
}
function nouveauLO(a)
{
	$.ajax({
	  	type : 'POST', // envoi des données en GET ou POST
		url : 'moduleLo/client/moteur.php5' , // url du fichier de traitement
		data : "nouveau="+a , // données à envoyer en  GET ou POST
		success : function(data){ // traitements JS à faire APRES
			$('#contenuLo').fadeOut("fast"); 
		$('#contenuLo').html(data);
		$('#contenuLo').animate({
    width: ['toggle', 'swing'],
    height: ['toggle', 'swing'],
    opacity: 'toggle'
  }, 900, 'swing');
	}
      });
}
function merci()
{
	creationFondSombre();
	$('body').append('<div id = "boxlo" style = "display:none;"></div>');
	$('#boxlo').css('width','430px');
	$('#boxlo').css('height','280px');
	$('#boxlo').css('backgroundColor','#ffffff');
	$('#boxlo').css('padding','5px');
	$('#boxlo').css("position","absolute");
	$('#boxlo').css("top", ( $(window).height() - $('#boxlo').height() ) / 2+$(window).scrollTop() + "px");
	$('#boxlo').css("left", ( $(window).width() - $('#boxlo').width() ) / 2+$(window).scrollLeft() + "px");
	$('#boxlo').css("zIndex","3000");
	$('#boxlo').css("textAlign","center");
	$('#boxlo').hide();
	$('#boxlo').html("<br/><br/>Votre t&eacute;moignage est bien enregitr&eacute;,<br/>Il paraitra prochainement dans cette liste.<br /><br />Redirection en cours...");
	$('#boxlo').animate({
    width: ['toggle', 'swing'],
    height: ['toggle', 'swing'],
    opacity: 'toggle'
  }, 500, 'swing');
}
function miseZero()
{
	chemin = document.fLo;
	chemin.nom.value = '';
	chemin.email.value = '';
	chemin.ville.value = '';
	chemin.message.value = '';
	chemin.nom.focus();
}
function annuleLO()
{
	$('#lefondmodal').fadeIn("slow").remove();
	$('#boxlo').slideToggle('fast', function() {
    $('#boxlo').remove();
  });
}
function verifFormeLo()
{
	$('#remarques').fadeOut("slow").html('').hide();
	if(document.fLo.nom.value == '')
	$('#remarques').fadeIn("slow").html('<span style="color:red;">Vous devez renseigner votre nom!</span>');
	else if(document.fLo.message.value == '')
	$('#remarques').fadeIn("slow").html('<span style="color:red;">Vous devez renseigner votre message!</span>');
	else
	document.fLo.submit();
}
function retourneHauteur()
{
	var scrollH = 0;	// scrollY
	var windowH = 0;	// largeur de la fenêtre
	if (document.doctype == null || document.documentElement.clientHeight == 0)
	{
		if (window.innerWidth || (document.body.offsetHeight == document.documentElement.offsetHeight))
		{
			scrollH = document.body.scrollTop;
			windowH = document.body.clientHeight;
		}
		else
		{
			scrollH = document.documentElement.scrollTop;
			windowH = document.documentElement.clientHeight;
		}

	}
	else
	{
		if (document.doctype.publicId.search(/xhtml/i) != -1)
		scrollH = document.documentElement.scrollTop;
		else
		scrollH = document.body.scrollTop;
	}
	if (window.innerHeight)
	windowH = window.innerHeight;
	return windowH+scrollH;
}
function creationFondSombre()
{
	hauteur = retourneHauteur();
	hauteur += 400;
	$('body').append('<div id = "lefondmodal"></div>');
	$('#lefondmodal').css("backgroundColor","#000000");
	$('#lefondmodal').css("position","absolute");
	$('#lefondmodal').css("zIndex","2000");
	$('#lefondmodal').css("top","0px");
	$('#lefondmodal').css("left","0px");
	$('#lefondmodal').css("bottom","0px");
	$('#lefondmodal').css("right","0px");
	$('#lefondmodal').css("width","100%");
	$('#lefondmodal').css("height",hauteur+"px");
	$('#lefondmodal').hide();
	$('#lefondmodal').fadeOut("fast").fadeTo("slow", 0.7);
	$('#lefondmodal').click(function(){supprimeModale();})
}


