

function windopen(langue,texte,img,forme,hauteur,largeur) {
  window.open("info.php4?langue="+langue+"&texte="+escape(texte)+"&image="+img+"&forme="+forme,"info","toolbar=no,location=no,directories=no,status=no, scrollbar=no,resizable=no,width="+largeur+",height="+hauteur);
}

function windopen2(url) {
  window.open(url,"chemin","toolbar=no,location=no,directories=no,status=no, scrollbar=no,resizable=no,width=440,height=340");
}

function win_open(url,x,y) {
  window.open(url,"chemin","toolbar=no,location=no,directories=no,status=no, scrollbar=no,resizable=no,width="+x+",height="+y+"");
}

function window3(source,nb,val) {
  window.open('rte.php4?source='+source+'&val='+escape(val),nb,'toolbar=no,location=no,directories=no,status=yes, scrollbar=no,resizable=no,width=640,height=330');
}

var newWin = null;
function closeWin(){
  if (newWin != null){
    if(!newWin.closed)
      newWin.close();
  }
}
function popUp(strURL,strType,strWidth,strHeight) {
  closeWin();
  var strOptions="";
  if (strType=="console") strOptions="scrollbars,resizable,height="+strHeight+",width="+strWidth;
  if (strType=="fixed") strOptions="status,height="+strHeight+",width="+strWidth;
  if (strType=="elastic") strOptions="toolbar,menubar,scrollbars,resizable,location,height="+strHeight+",width="+strWidth;
  newWin = window.open(strURL, 'newWin', strOptions);
  newWin.focus();
}

function getElemStyle(n)
{
  if(document.getElementById)
    return document.getElementById(n).style;
  if(document.layers)
    return document.layer[n];
  if(document.all)
    return document.all[n].style;
  return null;
}

function getElem(n)
{
  if(document.getElementById)
    return document.getElementById(n);
  if(document.layers)
    return document.layer[n];
  if(document.all)
    return document.all[n];
  return null;
}

function visi(nr)
{
  if (document.layers)
    document.layers[nr].visibility = 'show';
  else if (document.getElementById)
    document.getElementById(nr).style.visibility = 'show';
}
function unvisi(nr)
{
  if (document.layers)
    document.layers[nr].visibility = 'hidden';
  else if (document.getElementById)
    document.getElementById(nr).style.visibility = 'hidden';
}

function blocking(nr)
{
  if (document.layers)
    document.layers[nr].display = 'block';
  else if (document.getElementById)
    document.getElementById(nr).style.display = 'block';
 }
function unblocking(nr)
{
  if (document.layers)
    document.layers[nr].display = 'none';
   else if (document.getElementById)
    document.getElementById(nr).style.display = 'none';
}

function is_block(nr)
{
  if (document.layers)
  {
    if(document.layers[nr].display=='block')
    {
      return true;
    }
    else
    {
      return false;
    }
  }
  else if (document.getElementById)
  {
    if(document.getElementById(nr).style.display=='block')
    {
      return true;
    }
    else
    {
      return false;
   }
  }
  return false;
}

function swap_block(nr)
{
  if(is_block(nr))
  {
    unblocking(nr);
  }
  else
  {
    blocking(nr);
  }
}

function aff(d)
{
  getElemStyle(d).visibility = "visible";
  getElemStyle(d).display = "inline";
}
function hide(d)
{
  getElemStyle(d).visibility = "hidden";
  getElemStyle(d).display = "none";
}

function ArrondiMonetaire(nbr) {
  strnbr= new String(Math.round (nbr*100)/100);
  point=strnbr.split('.');
  if (!point[1]) 
  {
    strnbr=(strnbr+'.00');
  }
  else
  {
    if (point[1].length==1)
    {
      strnbr=(strnbr+'0');
    }
  }
  return strnbr;
}

function changecolor(n,b)
{
  n.style.background=b;
}


function ActuImg()
{
  document.getElementById('image_2dimg').src='reglage_accroch.php?src='+document.getElementById('image_2d').value+'&accroch='+document.getElementById('accroch_lame').value+'';
}
