function getObject(id)
{
    if( document.layers ) { //Netscape layers
        return document.layers[id]; }
    if( document.getElementById ) { //DOM; IE5, NS6, Mozilla, Opera
        return document.getElementById(id); }
    if( document.all ) { //Proprietary DOM; IE4
        return document.all[id]; }
    if( document[divID] ) { //Netscape alternative
        return document[id]; }
    return false;
  }

function getAbsoluteLeftByObject(o) {
  var oLeft = o.offsetLeft;
  while(o.offsetParent!=null)
  {
    oParent = o.offsetParent;
    oLeft += oParent.offsetLeft;
    o = oParent;
  }
  return oLeft;
}

function getAbsoluteTopByObject(o) {
  var oTop = o.offsetTop;
  while(o.offsetParent!=null)
  {
    oParent = o.offsetParent;
    oTop += oParent.offsetTop;
    o = oParent;
  }
  return oTop;
}

function getAbsoluteLeft(objectId) {
  var o = getObject(objectId);
  return getAbsoluteLeftByObject(o);
}

function getAbsoluteTop(objectId) {
  var o = getObject(objectId);
  return getAbsoluteTopByObject(o);
}

function getBrowser()
{
  var agt = navigator.userAgent.toLowerCase();
  this.isMac = (agt.indexOf('mac') != -1);
  this.isOpera = (agt.indexOf('opera') != -1);
  var IEver = parseInt(agt.substring(agt.indexOf('msie ') + 5));
  this.isIE = ((agt.indexOf('msie')!=-1 && !this.isOpera && (agt.indexOf('webtv')==-1)) && !this.isMac);
  this.isIE5win = (this.isIE && IEver >= 5);
  this.isIE5mac = ((agt.indexOf('msie') != -1) && this.isMac);
  this.isSafari = (agt.indexOf('safari') != -1);
  this.isFirefox = (agt.indexOf('firefox') != -1);
  this.gotSelectBug = (this.isIE && (IEver < 7));
}

function fromPopupGoto(href)
{
  if (window.opener && !window.opener.closed) {
    window.opener.location=href;
    window.opener.focus();
    //window.close();
  } else {
    window.location=href;
  }
  return false;
}

function bouton(o, f)
{
  var object=o;
  if (f==0)
    {
      object.className="boutonOFF";
    }
  else
    {
      object.className="boutonON";
    }
}

