jQuery(document).ready(function () {
  //
    // Ouvrir / fermer  le div pour afficher le contenu de l'enregistrement
    jQuery(".test").live("click", function(){
        var reltest = jQuery(this).attr("rel");
        //alert('test rel = '+ reltest);
        if (reltest==1) {
          //jQuery(".fondcolartg").css({ "background-color" : "#ffffff" });
          jQuery("#celluledroite").css({ "background-image" : "url(../images_res/template/transparent.gif)" });
        }
        if (reltest==2) {
          //jQuery('.fondcolartg').css({"background-color" : "#DDDEEC"});
          jQuery("#celluledroite").css({ "background-image" : "url(../images_res/template/fond_article_1.jpg)" });
        }
        return false; // pour que le navigateur n'applique pas le submit
    });
    //   
  //
  // Survol Connexion
  jQuery('#lienconnexion').hover(function () {
      var reltest = jQuery('#logon').attr("rel");
      if (reltest==0) {
        jQuery("#logon").css({ "display" : "block" });
      }
    }, function () {
      //
      //alert('test = ' + test );
      // si on ne survol pas #logon on ferme
      jQuery.timer(500, function (timer) {
          var testaff = jQuery('#connex').attr("rel");
          if (testaff!=1 ) {
            jQuery("#logon").css({ "display" : "none" });
          }
          timer.stop();
       });      
      //
  });    
  // Survol Box Connexion
  jQuery('#logon').hover(function () {
      jQuery('#logon').attr("rel","1"); // SET
      jQuery('#connex').attr("rel","1"); // SET
      //alert('#connex = ' + jQuery('#connex').attr("rel") );
    }, function () {
        jQuery("#logon").css({ "display" : "none" });
        jQuery('#logon').attr("rel","0"); // RAZ
        jQuery('#connex').attr("rel","0"); // RAZ
      //
  });    
  // Survol des images
  jQuery('img.actif').hover(function () {
    //jQuery(this).css({ cursor: "pointer" });
    //jQuery(this).animate({opacity: "0.7"}, 100);
    }, function () {
    //jQuery(this).css({ cursor: "auto" });
    //jQuery(this).animate({opacity: "1.0"}, 100);
  });
  //
  //
  jQuery('#passoubli').hover(function () {
    jQuery(this).css({ cursor: "pointer" , color : "#ffffff"});
    }, function () {
    jQuery(this).css({ cursor: "auto" , color : "#283976"});
  });
  //  
  //
  jQuery("#identcookies").click(function(){
    //récupération des variables GET
    //var tmpGET = window.location.search.substring();
    // Récupération de l'URL complète
    //alert(document.location);
    jQuery.cookie("urlretourcookies", document.location, { expires: 30 });
    //alert("urlretourcookies = " + jQuery.cookie("urlretourcookies"));
    //
    if (jQuery(this).attr('checked')) { // si true
      //alert("case vient d'être cochée !");
      jQuery.cookie("actioncookies", '1', { expires: 30 });
    }
    else {
      //alert("case vient d'être décochée !");
      jQuery.cookie("actioncookies", '0', { expires: 30 });
    }
    var url="cookiesident.php";
    //alert("actioncookies = " + jQuery.cookie("actioncookies"));
    window.location=url;
  });
  //  
  //
});






