function aide(o,sujet,on){return aideaff(o,sujet,"aide",on);}

function aidecust(o,sujet,on){return aideaff(o,sujet,"aidecust",on);}

function ouvre_aide(u,s) {
	waide = window.open(u,'metaaide','scrollbars,resizable=yes,toolbar=no,status=no,menubar=no,location=no,height=200,width=300');
  if( waide != null ) waide.focus();
  return false;
}

function aideaff(o,sujet,div,on){
	var a,pos,marge,w;
	a = getObj(div + sujet);
	if( a == null ) return false;
	if( a.style.visibility == "visible" ) {
		if( on ) return true;
		a.style.visibility = "hidden";
		return true;
	}
	if( !on ) return true;
	pos = getPosAbsolute(o,0,0);
	marge = 5;
	w = Math.min(250,a.offsetWidth);
	a.style.width = w;
	if( window.innerWidth != null && (w + pos[0] + o.offsetWidth + marge >= window.innerWidth) ){a.style.left = pos[0] - w - marge;}
	else if( document.body.clientWidth != null && (w + pos[0] + o.offsetWidth + marge >= document.body.clientWidth) ){a.style.left = pos[0] - w - marge;}
	else{a.style.left = pos[0] + o.offsetWidth + marge;}
	a.style.top = pos[1] + (o.offsetHeight / 2);
	a.style.visibility = "visible";
	return true;
}

function ouvre_aide_det(u) {
	var waidedet = window.open(u,'metaaidedet','scrollbars,resizable=yes,toolbar=no,status=no,menubar=no,location=no,height=520,width=550');
  if( waidedet != null ) waidedet.focus();
  return false;
}

