/*FONCTION COOKIE pour récupérer les infos stockées dans un cookie*/
function GetCookie(dataName)
{
     var cookieLen = dataName.length;
     var cookieData = document.cookie;
     var allcookieLen = cookieData.length;

     var i = 0;
     var cookieEnd;

     while(i < allcookieLen)
     {
          var j = i + cookieLen;
          if (cookieData.substring(i,j) == dataName)
          {
               cookieEnd = cookieData.indexOf(";", j);
               if (cookieEnd == -1)
               {
                    cookieEnd = cookieData.length;
               }
              return unescape(cookieData.substring(j+1, cookieEnd))
         }
         i++;
     }
return "Echec : cookie non cree ?";
}

/*FONCTION COOKIE pour stocker des infos dans un cookie*/
function SetCookie (name, value)
{
var aujourdhui = new Date() ;
var expdate = new Date() ;
expdate.setTime( aujourdhui.getTime() + ( 365*24*60*60*1000 ) ) ;
document.cookie = name + "=" + value + ";expires=" + expdate.toGMTString() ;
}

/* FONCTION CACHE - cache des cellules du tableau */
function cache(td) {
   if(document.getElementById(td).style.display=="") {
      document.getElementById(td).style.display="none";
	  if (td == 'menug' || td=='menud') SetCookie(td,'0');
   } else {
      document.getElementById(td).style.display="";
	  if (td == 'menug' || td=='menud') SetCookie(td,'1');
	}
}

/*FONCTION CHECK - checkbox de qualitay ;) */
function check() {
  var src=document.images['chk'].src;
  src=src.substring(src.lastIndexOf("/")+1);
	if(src == 'checkboxc_noir.png') { 
	  document.getElementById('chk').src='but/checkboxn_noir.png'; 
	  document.getElementById('chk_hid').value='0'; 
	} else {		 
	  document.getElementById('chk').src='but/checkboxc_noir.png'; 
	  document.getElementById('chk_hid').value='1'; 
	}
}


