function popupcentree(page,largeur,hauteur,options) {
  var top=(screen.height-hauteur)/2;
  var left=(screen.width-largeur)/2;
  window.open(page,"","top="+top+",left="+left+",width="+largeur+",height="+hauteur+","+options);
}
function unctr() {
  alert("Rubrique en construction");
}
function Confirmer(strFrom, strRedir) {
  if (window.confirm("Etes-vous sûr de vouloir supprimer cet élément "+strFrom+" ?")==true) {
    window.location=strRedir;
  }
  return false;
}
function submit_form(frm) {
  document.getElementById(frm).submit();
  return true;
}

function resizeasc(ajust) {
  height_div = 350;
  scr_h = screen.availHeight;
  if (scr_h>600) height_div = (height_div * scr_h / 600) - ajust;
  document.getElementById("contentasc").style.height=height_div+"px";
  document.getElementById("imgsize").style.height=height_div+"px";
  //
  var h = getInnerHeight();
  var elt = document.getElementById("contentasc");
  var t1 = getAbsY(elt);
  var elt = document.getElementById("footer");
  var h2 = elt.offsetHeight;
  var newh = h - t1 - h2 - 2;
  document.getElementById("contentasc").style.height=newh+"px";
  document.getElementById("imgsize").style.height=newh+"px";
}

function getAbsY(obj) {
  var absY  = 0;  
  var node = obj;
  while (node) {
    absY  += node.offsetTop;
    node = node.offsetParent;
  }
  return absY;
}

function getAbsX(obj) {
  var absX  = 0;
  var node = obj;
  while (node) {
    absX += node.offsetLeft;
    node = node.offsetParent;
  }
  return absX;
}

// Calcul de la hauteur interne de la fenêtre (hors menu, barre d'état etc ...)
function getInnerHeight() {
  var height=0;
  if (self.innerHeight) {
    // all except Explorer 
    height = self.innerHeight;
  } else {
    if (document.documentElement && document.documentElement.clientHeight) {
      // Explorer 6 Strict Mode
      height = document.documentElement.clientHeight;
    } else {
      if (document.body) {
        // other Explorers 
        height = document.body.clientHeight;
      }
    }
  }
  return height;
}

// Calcul de la largeur interne de la fenêtre (hors menu, barre d'état etc ...)
function getInnerWidth() {
  var width=0;
  if (self.innerWidth) {
    // all except Explorer
    width = self.innerWidth;
  } else {
    if (document.documentElement && document.documentElement.clientWidth) {
      // Explorer 6 Strict Mode
      width = document.documentElement.clientWidth;
    } else {
      if (document.body) {
        // other Explorers
        width = document.body.clientWidth;
      }
    }
  }
  return width;
}
String.prototype.RLTrim = function () {
 return this.replace(/(^\s*)|(\s*$)/g,"");
}
function mailpage(who) {      
 location.href = "mailto:"+who+"@"+location.hostname;
}
