function authenAjax()
{
   var ident   =$("#login_utilisateur").val();
   var passwd  =$("#pssword_utilisateur").val();

   var result=checkAuthenClub(ident,passwd);

   //alert(result);
   if(result==1){$("#lepdf").show();$(".accespdf").hide();}
   else alert("Nom d'utilisateur ou mot de passe incorrect");

}

function checkAuthenClub(ident,passwd)
{
   var res;
   $.ajax({ async:false,
            dataType:'text',
            data:{identifiant:ident,motdepasse:passwd},
            type: "POST",
            url: "authen.php",
            success:function(xml)
            {
               res=xml;
            }
          });
   return res;
}

$(document).ready(function()
{



   $("#lepdf").hide();
         $('img[@src$=.png]').ifixpng();
         $('#logo, #logo_rub, #banner, #banner_fiche, #menu, #menu li, #menu_rub, #menu_rub li, #smenu, #log, #contenu, #foot_contenu, #menuclub, #menugeneral').ifixpng();
         $('.ombre_left, .ombre_lr, .ombre_right, .ombre_rr, .presentation, .open, .plusactu, .club, .accesclub, .plusrdv, .canada, .europe, .afrique, .accesfiche, .titre_club span, .toppage, .blue, .violet, .green, .titre_edition span, .top_cadre, .centre_cadre, .bottom_cadre, .desc').ifixpng();

            $('.reloadpagination').change(function(){
                                 if($(this).val()!=''){
                                    document.form1.partie.value=$(this).val();document.form1.submit();
                                 }
                                       })

          $.datepicker.setDefaults({showOn: 'both', buttonImage: 'admin/imgs2ktp/calendar.png', buttonImageOnly: true,dateFormat: 'dd-mm-yy'});
   $('.date').datepicker();

   $(".searchpoint").hide();
   $("a.toggle").click(function(event){
         $(".searchpoint").slideToggle("normal");
         return false;
   });

   $(".accespdf").hide();
   $(".openform").click(function()
   {
         var result=checkAuthenClub("","");

         if(result== 1)
         {
            $("#lepdf").show();
            $(".accespdf").hide();
         }
         else $(".accespdf").show();
   });

   $(".closeaccess").click(function(){
         $(".accespdf").slideUp();
         });


   $(".listedoc").hide();
   $(".doclignerep").click(function(){
        var cible=$("+ .listedoc",this);
            testvis=$("+ .listedoc:visible",this);
            if(testvis.size()==0){
               $(".listedoc:visible").slideUp();
               cible.slideDown();
    }
   });


});