function inicio(num) {
  stofind = "anadisec.com"; // Directorio Raíz, puede ser "dominio.com"
  baseurl = "";
  getBaseUrl();
  maxbt = 8;
  menos=3;

  txt = new Array();  // Identificadores para botones
  nom = new Array();  // Nombre de cada sección
  lnk = new Array();  // Páginas de destino
  dim = new Array();  // Dimensiones de los botones

  txt[1] = "dse";
  txt[2] = "coe";
  txt[3] = "sue";
  txt[4] = "pyd";
  txt[5] = "dro";
  txt[6] = "alo";
  txt[7] = "nos";
  txt[8] = "con";

  nom[1] = "Diseño Estructural";
  nom[2] = "Corresponsabilidad Estructural";
  nom[3] = "Supervisión Estructural";
  nom[4] = "Peritajes y Dictámenes";
  nom[5] = "D. R. O.";
  nom[6] = "Algunas Obras";
  nom[7] = "Nosotros";
  nom[8] = "Contáctenos";

  lnk[1] = baseurl + "diseno.html";
  lnk[2] = baseurl + "corresp.html";
  lnk[3] = baseurl + "super.html";
  lnk[4] = baseurl + "peritajes.html";
  lnk[5] = baseurl + "dro.html";
  lnk[6] = baseurl + "obras.html";
  lnk[7] = baseurl + "nosotros.html";
  lnk[8] = baseurl + "contacto.html";

  imgn = new Array();
  imgp = new Array();
  for (i=1; i<=maxbt; i++) {
    imgn[i] = new Image();
    if(i==num) {
      imgn[i].src = baseurl + "images/bta_" + txt[i] + ".gif";
    } else {
      imgn[i].src = baseurl + "images/btn_" + txt[i] + ".gif";
    }
    imgp[i] = new Image();
    imgp[i].src = baseurl + "images/btp_" + txt[i] + ".gif";
  }
}

function doNav(num) {
  document.writeln('<table border=0 cellpadding=0 cellspacing=0 width=200>');
  document.write('<tr><td><img src="' + baseurl + 'images/bt_sup.gif" width=200 height=10><br>');

// ####### Crear barra de navegación

  for (j=1; j<=maxbt; j++) {
    document.write('<a href="' + lnk[j]+ '" onMouseOver="changeImages(' + "'" + txt[j] + "','" + imgp[j].src + "')" + '" onMouseOut="changeImages(' + "'" + txt[j] + "','" + imgn[j].src + "')" +'">');
    if(j==num) {
      document.write('<img src="' + baseurl + 'images/bta_' + txt[j] + '.gif" name=' + txt[j] + ' width=200 height=25 border=0></a><br>');
    } else {
      document.write('<img src="' + baseurl + 'images/btn_' + txt[j] + '.gif" name=' + txt[j] + ' width=200 height=25 border=0></a><br>');
    }
  } // #### for j
  document.write('<img src="' + baseurl + 'images/bt_inf.gif" width=200 height=10><br>');
  document.write('<img src="' + baseurl + 'images/nada.gif" width=200 height=10></td></tr></table>');
}


function doMenu(num) {
  document.writeln('<font face=tahoma size=1 class=f8><img src="' + baseurl + 'images/nada.gif" width=10 height=5><hr size=1 width=100% color=#774400>');
document.writeln('Blvd. A. López Mateos No. 744 Pte. int. 301 y 302 • Col. Obregón • Tel/Fax (477) 716 69 03 • León 37320 Gto.');
  document.writeln('<hr size=1 width=100% color=#774400></font>');
  document.writeln('<font face=tahoma size=1 class="f8" color=#774400><b>');
  for (i=1; i<=maxbt; i++) {
    if(i==num) {
      document.writeln('«<a href=' + lnk[i] + '><font color=#774400>' + nom[i] + '</font></a>»');
    } else {
      document.writeln('[<a href=' + lnk[i] + '>' + nom[i] + '</a>]');
    }
    if (i==menos) { document.writeln('<br>'); }
  }
  document.writeln('<br><img src="' + baseurl + 'images/nada.gif" width=5 height=10><br>[<a href="javascript:history.back();">Página anterior</a>]');
  document.write('[<a href="#arriba">Subir</a>]</b></font><br><img src="' + baseurl + 'images/nada.gif" width=5 height=5>');
}


function changeImages() {
  if (document.images) {
    document[changeImages.arguments[0]].src = changeImages.arguments[1];
  }
}

function getBaseUrl() {
  igual=1;
  docpath=document.location.pathname;
  x=docpath.indexOf(stofind);
  for (i=0; i< stofind.length; i++) {
    if (docpath.substring(x+i,x+i+1) == stofind.substring(i,i+1)) { x=x;
    } else { igual=0; }
  }
  if (igual == 0) {
    baseurl="http://www." + stofind + "/";
    return;
  }
  docname=docpath.substring(x+stofind.length,document.location.pathname.length);
  stofind="/";
  x=docname.indexOf(stofind);
  if (x<0) { 
     stofind="\\";
     x=docname.indexOf(stofind);
  }
  docname=docname.substring(x+1, docname.length);
  baseurl="";
  x=docname.indexOf(stofind);
  while (x >= 0) {
    x=docname.indexOf(stofind);
    if( x>=0) {
      docname=docname.substring(x+1, docname.length);
      baseurl= baseurl + "../";
    }
  }
//  alert(baseurl + ' ' + docname);
}
