function getObj(name)
{
  if (document.getElementById)
  {
  	this.obj = document.getElementById(name);
	this.style = document.getElementById(name).style;
  }
  else if (document.all)
  {
	this.obj = document.all[name];
	this.style = document.all[name].style;
  }
  else if (document.layers)
  {
   	this.obj = document.layers[name];
   	this.style = document.layers[name];
  }
}

function largeur_fenetre()
{
    if (window.innerWidth) return window.innerWidth;
    else if (document.body && document.body.clientWidth) return document.body.clientWidth;
    else return 0;
}

function hauteur_fenetre()
{
    if (window.innerHeight) return window.innerHeight;
    else if (document.body && document.body.clientHeight) return document.body.clientHeight;
    else return 0;
}

function set_div_logo()
{
    var x = new getObj('logo');
    var l = (largeur_fenetre()-800)/2;
    if (l < 0)
        l = 10;
    l = l + "px";
    x.style.position = "absolute";
    x.style.left = l;
    x.style.top = "25px";
}

/* Ouvre la description des produits */
function open_produits(produit)
{
    var x;
    var y;
    
    x = (screen.availWidth-400);
    if (x < 0)
        x = 0;
    else
        x = x/2;
    
    y = (screen.availHeight-600-50);
    if (y < 0)
        y = 0;
    else
        y = y/2;
    
    fenetre = window.open('prod_detail.php?codetel='+produit, "Produits", "height=600,width=400,left="+x+",top="+y+",menubar=no,location=no,resizable=no,scrollbars=no,status=no");
    fenetre.focus();
}

