function inicio(num) {
	stofind = "tiempo"; // Directorio Raíz, puede ser "dominio.com"
	baseurl = "";
	getBaseUrl();
	maxbt = 7;

	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] = "ini";
	txt[2] = "inf";
	txt[3] = "img";
	txt[4] = "lib";
	txt[5] = "pel";
	txt[6] = "stv";
	txt[7] = "for";

	nom[1] = "Principal";
	nom[2] = "Información";
	nom[3] = "Imágenes";
	nom[4] = "Libros";
	nom[5] = "Películas";
	nom[6] = "Series de TV";
	nom[7] = "Foro";

	lnk[1] = baseurl + "index.htm";
	lnk[2] = baseurl + "info/index.htm";
	lnk[3] = baseurl + "img/index.htm";
	lnk[4] = baseurl + "libros/index.htm";
	lnk[5] = baseurl + "cine/index.htm";
	lnk[6] = baseurl + "tv/index.htm";
	lnk[7] = "http://foro.e-azteca.com/?board=tiempo";

	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) {
// ####### 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=90 height=30 border=0></a>');
		} else {
			document.write('<img src="' + baseurl + 'images/btn_' + txt[j] + '.gif" name=' + txt[j] + ' width=90 height=30 border=0></a>');
		}
	} // #### for j
}


function doMenu(num) {
	document.writeln('<p align=center><font face=tahoma size=1 class="f8"><b>');
	for (i=1; i<=maxbt; i++) {
		if(i==num) {
			document.writeln('«<a href=' + lnk[i] + '><font color=#553300>' + nom[i] + '</font></a>»');
		} else {
			document.writeln('[<a href=' + lnk[i] + '>' + nom[i] + '</a>]');
		}
	}
	document.writeln('</b></font></p>');
}

function doAnt() {
	document.writeln('<table border=0 cellspacing=0 cellpadding=5 width=100%>');
	document.writeln('<tr><td><font face=tahoma size=1 class=f8><b>[<a href="javascript:history.back();">Página anterior</a>]<b></font></td>');
	document.writeln('<td align=right><font face=tahoma size=1 class=f8><b>[<a href="#arriba">Subir</a>]<b></font></td></tr></table>');
}

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.e-azteca.com/tiempo/";
		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);
}


