
//Static Slide Menu 6.5 © MaXimuS 2000-2001, All Rights Reserved.
//Site: http://www.absolutegb.com/maximus
//E-mail: maximus@nsimail.com
//Script featured on Dynamic Drive (http://www.dynamicdrive.com)
// Las variables GK e IE se definen en General.js

if (Obtener('ActivarMenuSitio') != '0' && !gEnVentana) {

	tempBar='';
	barBuilt=0;
	ssmItems=new Array();
	moving=setTimeout('null',1);

	/*
	Configure menu styles below
	NOTE: To edit the link colors, go to the STYLE tags and edit the ssm2Items colors
	*/
	YOffset=15; // no quotes!!
	XOffset=0;
	staticYOffset=10; // no quotes!!
	slideSpeed=0 // no quotes!!
	waitTime=100; // no quotes!! this sets the time the menu stays out for after the mouse goes off it.
	menuBGColor='black';
	menuIsStatic='yes'; //this sets whether menu should stay static on the screen
	menuWidth=150; // Must be a multiple of 10! no quotes!!
	menuCols=2;

	var pm = location.pathname;
	if (vbInStr(pm.toLowerCase(), '\/limites\/') != -1)	{
		Oscuro='#884A0D';
		Medio='#DFCCC3';
		Claro='#EFE5E0';
		Palido='#FBF8F7';	
	} else {
		Oscuro='#A00000';
		Medio='#FFC995';
		Claro='#FFEEDD';
		Palido='#FFF5EB';
	}

	// cabecera	
	hdrAlign='left';
	hdrBGColor=Oscuro;
	hdrFontColor=Claro;
	hdrFontFamily='verdana, sans-serif';
	hdrFontSize='9pt';
	hdrHeight='8';
	hdrVAlign='middle';

	// enlaces
	linkAlign='left';
	linkBGColor=Palido;
	linkFontColor=Oscuro;
	linkFontFamily='arial, sans-serif';
	linkFontSize='8pt';
	linkOverBGColor=Medio;
	linkTarget='_top';

	// barra lateral
	barBGColor=Oscuro;
	barFontColor=Claro;
	barFontFamily=hdrFontFamily;
	barFontSize=hdrFontSize;
	barText = ' SdCF-Secciones ';
	barVAlign = 'middle';
	barWidth = 12;

	var ssmEstilos = '' +

		'.ssmThe {' +
				'position: absolute;' +
				'top: 0;' +
				'z-index: 20;' +
			'}' +

		'.ssmTabla {' + 
				'background-color: ' + menuBGColor + ';' +
				'border-collapse: collapse;' +
				'border: 1px solid ' + menuBGColor + ';' +
				'width: ' + (menuWidth + barWidth + 1) + ';' +
			'}'	+

		'.ssmTDCabecera {' + 
				'background-color: ' + hdrBGColor + ';' +
				'border: 1px solid ' + menuBGColor + ';' +
				'color: ' +  hdrFontColor +';' +
				'font-family: ' + hdrFontFamily + ';' +
				'font-size: ' + hdrFontSize + ';' +
				'font-weight: bold;' + 
				'height: ' + hdrHeight + ';' +
				'padding: 0px 0px 0px 5px;' +
				'text-align: ' + hdrAlign + ';' +
				'vertical-align: ' + hdrVAlign + ';' +
				'width: ' + (menuWidth + barWidth + 2) + ';' +
			'}' +

		'.ssmTDBarraLateral {' +
				'background-color:' + barBGColor + ';' +
				'color: ' +  barFontColor + ';' +
				'font-family: ' + barFontFamily + ';' +
				'font-size: ' + barFontSize + ';' +
				'font-weight: bold;' +
				'text-align: center;' +
				'vertical-align:' + barVAlign + ';' +
				'width:' + barWidth + 'px;' +
			'}' +

		'.ssmTD {' + 
				'background-color: ' + linkBGColor + ';' +
				'color: ' +  linkFontColor + ';' +
				'border: 1px solid ' + menuBGColor + ';' +
				'cursor: pointer;' +
				'font-family:' + linkFontFamily + ';' +
				'font-size:' + linkFontSize + ';' +
				'padding: 0px 0px 0px 5px;' +
				'text-align: ' + linkAlign + ';' +
			'}' +	

		'';

	var ssmHoja = document.createElement ('style');
	ssmHoja.type = 'text/css';
	if (IE) {
		ssmHoja.styleSheet.cssText = ssmEstilos;
	} else {
		ssmHoja.appendChild(document.createTextNode (ssmEstilos));
	}
	var ssmCabecera = document.getElementsByTagName ('head') [0];
	ssmCabecera.appendChild (ssmHoja);

	// con jquery
//	$(document).ready(function(){
//
//		$(window).addClass("ssmTD");
//			$('.ssmTD').css('background-color', linkBGColor);
//			$('.ssmTD').css('color', linkFontColor);
//			$('.ssmTD').css('border', '1px solid ' + menuBGColor);
//			$('.ssmTD').css('cursor', 'pointer');
//			$('.ssmTD').css('font-family', linkFontFamily);
//			$('.ssmTD').css('font-size', linkFontSize);
//			$('.ssmTD').css('padding', '0px 0px 0px 5px');
//			$('.ssmTD').css('text-align: ' + linkAlign);
//
//	}); 


	///////////////////////////
	//Este es un añadido de mi cosecha para poder usar el
	//mismo menú en varios niveles del arbol de directorios
	// el archivo general.js debe estar declarado antes que éste
	cNivel = DevolverNivel();

	// ssmItems[...]=[name, link, target, colspan, endrow?] - leave 'link' and 'target' blank to make a header
	var Indice = 0;
	ssmItems[Indice++]=['Directorio', '', '', 2, 'fin'] //create header
	ssmItems[Indice++]=['<b>BIENVENIDA</b>', cNivel + 'bienvenida.html', '', 2, 'fin']

	ssmItems[Indice++]=['<b>Novedades</b>', cNivel + 'novedad/index.html', '', 2, 'fin']

	ssmItems[Indice++]=['<b>Opinión</b>', cNivel + 'opinion/index.html', '', 2, 'fin']

	ssmItems[Indice++]=['<b>A.T.Q.</b>', cNivel + 'autores/atq/index.html', '', 1, 'sigue']
	ssmItems[Indice++]=['<b>Autores</b>', cNivel + 'autores/index.html', '', 1, 'fin']

	ssmItems[Indice++]=['<b>Biblioteca</b>', cNivel + 'autores/biblioteca/index.html', '', 1, 'sigue']
	ssmItems[Indice++]=['<b>CF Popular</b>', cNivel + 'varios/cfpopular.htm', '', 1, 'fin']

	ssmItems[Indice++]=['<b>Cómics</b>', cNivel + 'comics/index.html', '', 1, 'sigue']
	ssmItems[Indice++]=['<b>La Cocina</b>', cNivel + 'varios/lacocina/index.html', '', 1, 'fin']
	
	ssmItems[Indice++]=['<b>Cortos</b>', cNivel + 'pelis/cortos/index.html', '', 1, 'sigue']
	ssmItems[Indice++]=['<b>Enlaces</b>', cNivel + 'enlaces/index.html', '', 1, 'fin']

	ssmItems[Indice++]=['<b>Firmas</b>', cNivel + 'varios/firmas/index.html', '', 1, 'sigue']
	ssmItems[Indice++]=['<b>G. H. W.</b>', cNivel + 'autores/ghw/index.html', '', 1, 'fin']

	ssmItems[Indice++]=['<b>Galería</b>', cNivel + 'galeria/index.html', '', 1, 'sigue']
	ssmItems[Indice++]=['<b>Glosario</b>', cNivel + 'glosario/index.html', '', 1, 'fin']

	ssmItems[Indice++]=['<b>La Hoguera</b>', cNivel + 'autores/lahoguera/index.html', '', 1, 'sigue']	
	ssmItems[Indice++]=['<b>Humor</b>', cNivel + 'humor/index.html', '', 1, 'fin']

	ssmItems[Indice++]=['<b>L.G.L.</b>', cNivel + 'autores/lgl/index.html', '', 1, 'sigue']
	ssmItems[Indice++]=['<b>Límites</b>', cNivel + 'limites/index.html', '', 1, 'fin']

	ssmItems[Indice++]=['<b>MalaCiencia</b>', cNivel + 'varios/malaciencia/index.html', '', 1, 'sigue']
	ssmItems[Indice++]=['<b>Películas</b>', cNivel + 'pelis/index.html', '', 1, 'fin']

	ssmItems[Indice++]=['<b>PodCast</b>', cNivel + 'varios/podcast/index.html', '', 1, 'sigue']
	ssmItems[Indice++]=['<b>Premios</b>', cNivel + 'premios/index.html', '', 1, 'fin']

	ssmItems[Indice++]=['<b>QsQ</b>', cNivel + 'varios/qsq/index.html', '', 1, 'sigue']
	ssmItems[Indice++]=['<b>Relatos</b>', cNivel + 'relatos/index.html', '', 1, 'fin']

	ssmItems[Indice++]=['<b>Revistero</b>', cNivel + 'opinion/revistero/index.html', '', 1, 'sigue']
	ssmItems[Indice++]=['<b>El Serial</b>', cNivel + 'varios/serial/index.html', '', 1, 'fin']

	ssmItems[Indice++]=['<b>Series</b>', cNivel + 'series/index.html', '_blank', 2, 'fin']

		ssmItems[Indice++]=['<img src="' + cNivel + 'imag/_mnu_ayu.gif" width="14" height="10" hspace="3" border="0" /><small>Ayuda</small>', cNivel + 'varios/_aviso.htm', '', 1, 'sigue']
		ssmItems[Indice++]=['<img src="' + cNivel + 'imag/_mnu_map.gif" width="14" height="10" hspace="3" border="0" /><small>Mapa</small>', cNivel + 'mapa.htm',  '', 1, 'fin']

	buildMenu();
}

function moveOut() {
	if ((GK) && parseInt(ssm.left) < 0 || IE && ssm.pixelLeft < 0) {
		clearTimeout(moving);
		moving = setTimeout('moveOut()', slideSpeed);
		slideMenu(10);
	} else {
		clearTimeout(moving);
		moving=setTimeout('null', 1);
	}
}//moveOut

function moveBack() {
	clearTimeout(moving);
	moving = setTimeout('moveBack1()', waitTime);
}//moveBack

function moveBack1() {
	if ((GK) && parseInt(ssm.left) > (-menuWidth) || IE && ssm.pixelLeft > (-menuWidth)) {
		clearTimeout(moving);
		moving = setTimeout('moveBack1()', slideSpeed);
		slideMenu(-10);
	} else {
		clearTimeout(moving);
		moving=setTimeout('null', 1);
	}
}//moveBack1

function slideMenu(num){
	if (IE) ssm.pixelLeft += num;
	if (GK) ssm.left = parseInt(ssm.left) + num;
}//slideMenu

function makeStatic() {
	if (GK) winY = window.pageYOffset;
	if (IE) winY = document.body.scrollTop;
	if (GK || IE) {
		if (winY != lastY && winY > YOffset - staticYOffset) {
			smooth = .2 * (winY - lastY - YOffset + staticYOffset);
		} else if (YOffset - staticYOffset + lastY > YOffset - staticYOffset) {
			smooth = .2 * (winY - lastY - (YOffset - (YOffset-winY)));
		} else {
			smooth = 0
		}
		if(smooth > 0) {
			smooth = Math.ceil(smooth);
		} else {
			smooth = Math.floor(smooth);
		}

		if (IE) ssm.pixelTop += smooth;
		if (GK) ssm.top = parseInt(ssm.top) + smooth;

		lastY = lastY + smooth; 
		setTimeout('makeStatic()', 1);
	}
}//makeStatic

function buildBar() {
	if (barText.indexOf('<img') > -1) {
		tempBar = barText;
	} else {
		for (b=0; b<barText.length; b++) {
			tempBar += barText.charAt(b) + '<br />';
		}
	}
	document.write('<td rowspan="100" class="ssmTDBarraLateral">' + tempBar + '</td>');
}//buildBar

function initSlide() {
	if (GK) {
		ssm = document.getElementById('thessm').style;
	} else if (IE) {
		ssm = document.all('thessm').style;
	}
	if (menuIsStatic == 'yes') makeStatic();
}//initSlide

function buildMenu() {

	if (gEnVentana) return;

	document.write('<div id="thessm" class="ssmThe" ' +
						'style="left: ' + (-menuWidth) + '; top: ' + YOffset + '; width: ' + (menuWidth + barWidth + 10) + ';" ' + 
						'onmouseover="moveOut();" onmouseout="moveBack();">' +
					'<table class="ssmTabla">');
	
	for(i=0; i<ssmItems.length; i++) {
		if (!ssmItems[i][3]) ssmItems[i][3] = menuCols;
			var colspan = (ssmItems[i][3] > 1 ? ' colspan="' + ssmItems[i][3] + '" ' : '');
		if (ssmItems[i-1] && ssmItems[i-1][4] != 'sigue') document.write('<tr>');
		if (!ssmItems[i][1]) {
			document.write('<td class="ssmTDCabecera"' + colspan + '>' + ssmItems[i][0] + '</td>');
		} else {
			if (!ssmItems[i][2]) ssmItems[i][2] = linkTarget;
			var Id = 'IdTd' + i;
			document.write('<td id="' + Id + '" class="ssmTD"' + colspan + 
											' onmouseover="stlTDf(\'' + Id + '\')"' +
											' onmouseout="stlTDn(\'' + Id + '\')">' + 
												'<a href="' + ssmItems[i][1] + '" target="' + ssmItems[i][2] + '">' + ssmItems[i][0] + '</a>' + 
											'</td>');
		} // 											' onclick="top.location=\'' + ssmItems[i][1] + '\'"' +

		if(ssmItems[i][4] != 'sigue') {
			if (barBuilt == 0) {
				buildBar();
				barBuilt = 1;			
			}
			document.write('</tr>');
		}

	}

	document.write('</table></div>');
	
	theleft = -menuWidth;
	lastY = 0;
	setTimeout('initSlide();', 1);

}//buildMenu

function stlTDn(Id) {document.getElementById(Id).style.backgroundColor = linkBGColor;}
function stlTDf(Id) {document.getElementById(Id).style.backgroundColor = linkOverBGColor;}

