//var l=LireCookie("container");var c=LireCookie("dcommand");var b=LireCookie("content");
compteur=LireCookie("democompteur");
if (compteur==null) { compteur=1;} else {compteur++;}
date=new Date;date.setMonth(date.getMonth()+6);
EcrireCookie("democompteur", compteur, date);


function $(id) {return document.getElementById(id);}
function listchange(formn,selectn) { $(selectn).options.selectedIndex=23;document.forms[formn].submit();}
function display(oEl) {return oEl.className = (oEl.className == 'hidden') ? '' : 'hidden';}
function getstyle(id,att) {var style = document.defaultView.getComputedStyle($(id), '').getPropertyValue("+att+");return style;}

function side(object,here) {
current = ($(object).style.display == 'none') ? 'block' : 'none';$(object).style.display = current;
//w = ($(object).style.height == '') ? '50%' : '10%';$(object).style.height = w;
EcrireCookie(object, current, date);
hcurrent = (here.className == 'plier' ) ? 'deplier' : 'plier';here.className = hcurrent;
}

function EcrireCookie(nom, valeur)
{
var argv=EcrireCookie.arguments;
var argc=EcrireCookie.arguments.length;
var expires=(argc > 2) ? argv[2] : null;
var path=(argc > 3) ? argv[3] : null;
var domain=(argc > 4) ? argv[4] : null;
var secure=(argc > 5) ? argv[5] : false;
document.cookie=nom+"="+escape(valeur)+
((expires==null) ? "" : ("; expires="+expires.toGMTString()))+
((path==null) ? "" : ("; path="+path))+
((domain==null) ? "" : ("; domain="+domain))+
((secure==true) ? "; secure" : "");
}

function getCookieVal(offset)
{
var endstr=document.cookie.indexOf (";", offset);
if (endstr==-1) endstr=document.cookie.length;
return unescape(document.cookie.substring(offset, endstr));
}

function LireCookie(nom)
{
var arg=nom+"=";
var alen=arg.length;
var clen=document.cookie.length;
var i=0;
while (i<clen)
 {
  var j=i+alen;
  if (document.cookie.substring(i, j)==arg) return getCookieVal(j);
  i=document.cookie.indexOf(" ",i)+1;
  if (i==0) break;
 }
return null;
}

function checkSelect(elmId){
	  //maxOptionsSelect = 7;
	  //form = document.all("detailform");

	  inputs = $(elmId);
	  count = 0;
	  for(i=0 ; i<inputs.length ; i++){
	    if(inputs[i].type=="checkbox" && inputs[i].checked==true){
		  count++;
		}
	  }
return false;
}

function makeacl(f,u,targ){
var thename=f+'_'+u+'[]';
//var thename=f+'_'+u;
var theword='';
set = document.getElementsByName(thename);
//set =$(thename);
for (i=0; i<set.length; i++){if (set[i].checked==true) {theword=theword+set[i].value;}}
$(targ).value=theword;
}

function selmess(f,u,targ){
var thename=f+'_'+u+'[]';
//var thename=f+'_'+u;
var theword='';
set = document.getElementsByName(thename);
//set =$(thename);
for (i=0; i<set.length; i++){if (set[i].checked==true) {theword=theword+set[i].value;}}
$(targ).value=theword;
}
 

