function inicio(num) {

  maxbt = 6;
  txt = new Array();  // Identificadores para botones
  lnk = new Array();  // Páginas de destino
  tx1 = new Array();  // Links de texto
  tx2 = new Array();  // Tamaño de las imágenes

  stofind = "admon03_06"; // Directorio Raíz, puede ser "dominio.com"
  defaulturl="http://www.leon.gob.mx/admon03_06/";
  baseurl = "http://www.leon.gob.mx/admon03_06/";
  getBaseUrl();

  for (i=1; i<=maxbt; i++) {
    txt[i] = "";
    lnk[i] = "";
    tx1[i] = "";
  }
  txt[1] = "gob";
  txt[2] = "eco";
  txt[3] = "srv";
  txt[4] = "clt";
  txt[5] = "tur";
//  txt[6] = "bus";
  txt[6] = "ini";

  lnk[1] = baseurl + "gobierno/index.htm";
  lnk[2] = "http://www.leon.gob.mx/Leon/fomeco/spanish/index.htm";
  lnk[3] = baseurl + "servicios.html";
  lnk[4] = baseurl + "cultura/index.htm";
  lnk[5] = baseurl + "turismo/index.htm";
 //lnk[6] = "http://leongob.aisms.com/cgi-bin/search/search.cgi";
 // lnk[7] = baseurl + "index.htm";
  lnk[6] = baseurl + "index.htm";

  tx1[1] ="Gobierno";
  tx1[2] ="Economía";
  tx1[3] ="Servicios";
  tx1[4] ="Cultura";
  tx1[5] ="Turismo";
  //tx1[6] ="Buscador";
  tx1[6] ="Principal";

  tx2[1] =" width= 65 height=25";
  tx2[2] =' width= 68 height=25 target="_blank"';
  tx2[3] =" width= 65 height=25";
  tx2[4] =" width= 55 height=25";
  tx2[5] =" width= 59 height=25";
//  tx2[6] =" width= 68 height=25";
  tx2[6] =" width= 63 height=25";


  imgn = new Array();
  imgp = new Array();
  for (i=1; i<=maxbt; i++) {
    imgn[i] = new Image();
    imgn[i].src = baseurl + "images/btn_" + txt[i] + ".gif";
    imgp[i] = new Image();
    imgp[i].src = baseurl + "images/btp_" + txt[i] + ".gif";
  }

  if(num) {
    imgn[num].src = baseurl + "images/bta_" + txt[num] + ".gif";
  }
}

function doNav(num) {
  return (true);
}

function doNav2(num) {
  document.writeln('<a name="arriba"><table border=0 cellspacing=0 cellpadding=0 width=740><tr>');
  document.writeln('<td width=740><img src="' + baseurl + 'images/superior.jpg" width=740 height=75></td></tr>');
  document.write('<tr><td background="' + baseurl + 'images/sup_fon.jpg"><img src="' + baseurl + 'images/bt_izq.gif">');


  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] + tx2[j] + ' border=0></a>');
    } else {
      document.write('<img src="' + baseurl + 'images/btn_' + txt[j] + '.gif" name=' + txt[j] + tx2[j] + ' border=0></a>');
    }
  } // #### for j

  //document.write('<img src="' + baseurl + 'images/bt_der.gif" width=33 height=25><img src="' + baseurl + 'images/nada.gif" width=30 height=1><a href="http://www.aisms.com/cgi-bin/lg_recom.cgi"><img src="' + baseurl + 'images/bt_enviar.gif" width=44 height=25 border=0 alt="Envía esta página a un amigo"></a></td></tr></table>');
  document.write('<img src="' + baseurl + 'images/bt_der.gif" width=33 height=25><img src="' + baseurl + 'images/nada.gif" width=30 height=1></td></tr></table>');
  document.writeln('<table border=0 cellspacing=0 cellpadding=0 width=740 background="' + baseurl + 'images/fld_fon.gif">');
  document.writeln('<tr><td width=20><img src="' + baseurl + 'images/fld_izq.gif" width=20 height=20></td>');
  document.writeln('<td width=700><font face=verdana size=1 class=f8><b>« Casa Municipal »</b> Plaza Principal s/n <b>« Conmutador »</b> (477) 788 00 00</font></td>');
  document.writeln('<td width=20><img src="' + baseurl + 'images/fld_der.gif" width=20 height=20></td></tr></table>');
}


function changeImages() {
  if (document.images) {
    document[changeImages.arguments[0]].src = changeImages.arguments[1];
  }
}

function doTexto(num) {
  return (true);
}

function doTexto2(num) {

  document.writeln('<table border=0 cellspacing=0 cellpadding=2 width=740><tr>');
  document.writeln('<td background="' + baseurl + 'images/v2_med_cen.gif" nowrap><font face=Verdana size=1 class=f8><b>');
  for (i=1; i<=maxbt; i++) {
    if (i==num) {
      document.writeln('«<a href="' +lnk[i]+'">' + tx1[i] + '</a>»');
    } else {
      document.writeln('[<a href="' +lnk[i]+'">' + tx1[i] + '</a>]');
    }
  }
  document.writeln('</b></font></td><td align=right background="' + baseurl + 'images/v2_med_cen.gif" nowrap><font face=Verdana size=1 class=f8><b>');
  document.writeln('[<a href="javascript:history.back()">Página anterior</a>] [<a href="#arriba">Subir</a>]</b></font></td></tr>');
  document.writeln('<tr><td colspan=2 bgcolor=#000088></td></tr>');
  document.writeln('<tr><td colspan=2 align=center><font face=verdana size=1 class=f8>Presidencia Municipal de León Guanajuato, México<br>');
  document.writeln('Plaza Principal S.N. Zona Centro C.P. 37000 - Tel 7880000 - webmaster@leon.gob.mx</font></td></tr>');
  document.writeln('<tr><td colspan=2 bgcolor=#000088></td></tr></table><br>');

}


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 {
      baseurl=defaulturl;
      if (docpath.substring(0,baseurl.length) == baseurl) {
        docpath=docpath.substring(baseurl.length,docpath.length);
      }
      return;
    }
  }
  docpath=docpath.substring(x+stofind.length,document.location.pathname.length);
  docname=docpath;
  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) {
    docname=docname.substring(x+1, docname.length);
    baseurl= baseurl + "../";
    x=docname.indexOf(stofind);
  }
//  alert(baseurl + ' ' + docname + ' ' + docpath);
}
