	// SCRIPT javascript permettant de gérer le menu
	// DEBUT		
	var obj = null;

	function checkHover() {
		if (obj) {
			obj.find('ul').fadeOut('fast');	
		} //if
	} //checkHover
	//FIN
	
	$(document).ready(function(){

	// SCRIPT jQuery permettant de gérer le menu
	// DEBUT
		
	$('#Nav > li').hover(function() {
		if (obj) {
			obj.find('ul').fadeOut('fast');
			obj = null;
		} //if
		
		$(this).find('ul').fadeIn('fast');
	}, function() {
		obj = $(this);
		setTimeout(
			"checkHover()",
			0); // si vous souhaitez retarder la disparition, c'est ici
	});
	

	// FIN
		
	$("#msgErreurJavascript").hide();

      $("#dev").css({ opacity: 0}, 500 );
      $("#dev").hover(
      function() {
		  $(this).animate({ opacity: 1}, 500 );
     },
     function(){
			$(this).animate({ opacity: 0}, 500 );
	 });
	
	
	$('a.lightbox').lightBox({
	overlayBgColor: '#FFF',
	overlayOpacity: 0.2,
	imageLoading: SITE_PATH + 'images/lightbox-btn-loading.gif',
	imageBtnClose: SITE_PATH + 'images/lightbox-btn-close.gif',
	imageBtnPrev: SITE_PATH + 'images/lightbox-btn-prev.gif',
	imageBtnNext: SITE_PATH + 'images/lightbox-btn-next.gif',
	containerResizeSpeed: 200,
	txtImage: 'Image',
	txtOf: 'sur'
   });
	
	
	
    $("input[type=text], input[type=password], textarea").focus(
      function() {
		$(this).css({"border":"2px solid #EAB602"});
     });
	 $("input[type=text], input[type=password], textarea").blur(
     function(){
		$(this).css({"border":"2px solid #7f9db9"});
	 });
	 $("#identifiantFormConnexion").focus(function(){
		if($(this).val() == "identifiant"){
			$(this).val("");
		}
	 });
	$("#motdepasseFormConnexion").focus(function(){
		if($(this).val() == "motdepasse"){
			$(this).val("");
		}
	 });
	
	$("#identifiantFormConnexion").blur(function(){
		if($(this).val() == ""){
			$(this).val("identifiant");
		}
	 });
	$("#motdepasseFormConnexion").blur(function(){
		if($(this).val() == ""){
			$(this).val("motdepasse");
		}
	 });

	
	$("#noteJeu").mouseover(function(){
		$("#notationJeu").stop().fadeIn(500);
	 });
	
	$("#noteJeu").mouseout(function(){
		$("#notationJeu").stop().fadeOut(500);
	 });
	$("#notationJeu").mouseover(function(){
		$("#notationJeu").stop().fadeIn(500);
	});
	$("#notationJeu").mouseout(function(){
		$("#notationJeu").stop().fadeOut(500);
	});
	$('#contenuMessage').autogrow({
		maxHeight: 500,
		minHeight: 100,
		lineHeight: 16
	});
	
function attenteDebut(id)
{
	$("#"+id).prepend("<p class='attente erreur'>Opération en cours, veuillez patienter.</p>");
	
}
function attenteFin(id)
{
	$("#"+id+" .attente").remove();
}
//Gestion des commentaires
$("#formulaireCommentaire .validation").click(function()
{
	if($("#formulaireCommentaire #message").val()=="")
	{
		alert("Vous devez remplir tous les champs");
	}
	else
	{
	//alert("Test en cours");
	attenteDebut("formulaireCommentaire");
	$.post(SITE_PATH + "ajax/ajax.php", 
		{ module:"commentaire",
		id_page : ID_PAGE,
		id_utilisateur : ID_UTILISATEUR,
		id_article : ID_ARTICLE,
		message:$("#formulaireCommentaire #message").val()},function(data){
		//alert(data);
	  $("#ListeCommentaire").prepend("<p>Posté par "+ NOM_UTILISATEUR +" <span>aujourd'hui</span><br />"+ $("#formulaireCommentaire textarea").val() +"</p>");
			$("#formulaireCommentaire textarea").val("");
	  attenteFin("formulaireCommentaire");
	});	
	}
});

});
