// JavaScript Library
// Orange Web Services, S.L.

// Copyright (c) 1999-2003 Orange Web Services, S.L.
// All Rights Reserved.

  window.onerror = null;
  window.defaultStatus = '';

  var bName = navigator.appName;
  var bVer = parseInt(navigator.appVersion);

  var NS4 = (bName == "Netscape" && bVer == 4);
  var NS5 = (bName == "Netscape" && bVer > 4);
  var IE4 = (bName == "Microsoft Internet Explorer" && bVer >= 4);
  var NS3 = (bName == "Netscape" && bVer < 4);
  var IE3 = (bName == "Microsoft Internet Explorer" && bVer < 4);

  if (NS4 || IE4 || NS5) {

    inicio = new Image();
    inicio.src = "pix/_menu_inicio.gif";
    inicio_over = new Image();
    inicio_over.src = "pix/_menu_inicio2.gif";

    internet = new Image();
    internet.src = "pix/_menu_internet.gif";
    internet_over = new Image();
    internet_over.src = "pix/_menu_internet2.gif";

    telefonia = new Image();
    telefonia.src = "pix/_menu_telefonia.gif";
    telefonia_over = new Image();
    telefonia_over.src = "pix/_menu_telefonia2.gif";

    wholesale = new Image();
    wholesale.src = "pix/_menu_wholesale.gif";
    wholesale_over = new Image();
    wholesale_over.src = "pix/_menu_wholesale2.gif";

    soporte = new Image();
    soporte.src = "pix/_menu_soporte.gif";
    soporte_over = new Image();
    soporte_over.src = "pix/_menu_soporte2.gif";

    sobreows = new Image();
    sobreows.src = "pix/_menu_sobreows.gif";
    sobreows_over = new Image();
    sobreows_over.src = "pix/_menu_sobreows2.gif";

    copyright = new Image();
    copyright.src = "pix/_menu2_copyright.gif";
    copyright_over = new Image();
    copyright_over.src = "pix/_menu2_copyright2.gif";

    home = new Image();
    home.src = "pix/_menu_home.gif";
    home_over = new Image();
    home_over.src = "pix/_menu_home2.gif";

    email = new Image();
    email.src = "pix/_menu_email.gif";
    email_over = new Image();
    email_over.src = "pix/_menu_email2.gif";

    en = new Image();
    en.src = "pix/_menu2_en.gif";
    en_over = new Image();
    en_over.src = "pix/_menu2_en2.gif";

    de = new Image();
    de.src = "pix/_menu2_de.gif";
    de_over = new Image();
    de_over.src = "pix/_menu2_de2.gif";

  }


  function img_over(imgName) {
    if (NS4 || IE4 || NS5) {
      imgOver = eval(imgName + "_over.src");
      document [imgName].src = imgOver;
    }
  }

  function img_out(imgName) {
    if (NS4 || IE4 || NS5) {
      imgOut = eval(imgName + ".src");
      document [imgName].src = imgOut;
    }
  }




  if (NS4 || IE4) {
    if (navigator.appName == "Netscape") {
      layerStyleRef="layer.";
      layerRef="document.layers";
      styleSwitch="";
    }
    else {
      layerStyleRef="layer.style.";
      layerRef="document.all";
      styleSwitch=".style";
    }
  }
  else if (NS5) {
    layerStyleRef="layer.style.";
    layerRef="document.all";
    styleSwitch=".style";
  }


  function hideAllLayers () {
    if (NS4 || IE4) {
      hideLayer('prods');
      hideLayer('prodsover');
    }
  }


  function hideAllMenus () {
    if (NS4 || IE4) {

    }
  }

  function hideAll () {
    hideAllLayers ();
  }

  function hideLayer(layerName){
    if (NS4 || IE4 || NS5) {
      if (document.layers) {
        eval("window.document."+layerName+".visibility=\"hidden\"");
      }
      else {
        var tmenu = (document.all)?eval("document.all."+layerName):document.getElementById(layerName);
        tmenu = tmenu.style;
        tmenu.visibility = 'hidden';
      }
    }
  }

  function showLayer(layerName){
    if (NS4 || IE4 || NS5) {
      if (document.layers) {
        eval("window.document."+layerName+".visibility=\"visible\"");
      }
      else {
        var tmenu = (document.all)?eval("document.all."+layerName):document.getElementById(layerName);
        tmenu = tmenu.style;
        tmenu.visibility = 'visible';
      }
    }
  }

  function img_over_div(imgName, divName)
  {
    if (NS4 || IE4 || NS5)
    {
      if (document.layers) {
        eval("window.document." + divName + ".document['" + imgName + "'].src = " + imgName + "_over.src");
      }
      else {
        eval("document['" + imgName + "'].src = " + imgName + "_over.src");
      }

    }
  }

  function img_out_div(imgName, divName)
  {
    if (NS4 || IE4 || NS5)
    {
      if (document.layers) {
        eval("window.document." + divName + ".document['" + imgName + "'].src = " + imgName + ".src");
      }
      else {
        eval("document['" + imgName + "'].src = " + imgName + ".src");
      }
    }
  }

  function img_over_ext(imgName, imgSrc)
  {
    if (NS4 || IE4)
    {
      imgOver = eval(imgSrc + "_over.src");
      document [imgName].src = imgOver;
    }
  }

  function img_out_ext(imgName, imgSrc)
  {
    if (NS4 || IE4)
    {
      imgOut = eval(imgSrc + ".src");
      document [imgName].src = imgOut;
    }
  }


  function hideNetscape() {
    hideAll2();
  }

  function hideIE() {
    if (window.event.toElement && window.event.toElement.className != "menu") {
      hideAll2();
    }
  }

  function hideAll2() {

    img_out('inicio');
    img_out('internet');
    img_out('telefonia');
    img_out('wholesale');
    img_out('soporte');
    img_out('sobreows');
    img_out('home');
    img_out('email');
    img_out('en');
    img_out('de');

  }

  function callurl(entry)
  {
    url_ = new String();
    url_ = entry;
    wintype = url_.substring(0,4);
    if (wintype == "----") { } else {
      window.open('axtremo.cgi?site=db@&db=tellist&il=tellist2&case=no&ex=yes&fn=Land&input='+url_,'esfonepopup','width=350,height=160');
    }
  }

  function openesfonepopup(entry) {
    window.open('','esfonepopup','width=350,height=160');
  }

  function ShowTarif(myIndex) {
    document.tarifas.preciofijo.value = "---";
    document.tarifas.preciomovil.value = "---";

    if (myIndex == 0) return;

    if (TarifTabFix[myIndex-0] > 0)
       document.tarifas.preciofijo.value = TarifTabFix[myIndex-0];
    if (TarifTabMobile[myIndex-0] > 0)
       document.tarifas.preciomovil.value = TarifTabMobile[myIndex-0];
    if (TarifTabMobile[myIndex-0] <= 0)
       document.tarifas.preciomovil.value = document.tarifas.preciofijo.value;
  }

  function ShowTarifExt(myIndex) {
    document.tarifas.preciocc.value = "---";

    if (myIndex == 0) return;

    ShowTarif(myIndex);

    if (TarifTabCC[myIndex-0] > 0)
       document.tarifas.preciocc.value = TarifTabCC[myIndex-0];
  }
