var estados = ['out', 'over', 'down'];

var MENU_ELEM = [
	['Inicio', '../index.php', [null, null, 65, null],
		[envolverRelleno(3, 'ff0000'), null, [12, null, 40, 3]]
	],
	[['<span style="color: #336600">|</span>', '<span style="color: #336600">|</span>', '<span style="color: #336600">|</span>'], null, [65, null, 10, null]],
	[envolverMenuSelec('El Municipio'), 'index.htm', [10, null, 111, null],
		['', null, [null, null, 182, 10]],
		[envolverSubmenu('Historia y Archivo', 166), 'historia.htm', [null, 10, 182, null],
			['', null, [null, null, 200, 10]],
			[envolverFlecha('Historia Geol&oacute;gica'), 'hist_geologica.htm', [null, 10, 200, null]],
			[envolverSubmenu('Ra&iacute;ces Hist&oacute;ricas', 184), 'raices.htm', null,
				['', null, [206, null, 194, 10]],
				[envolverFlecha('La Romanizaci&oacute;n'), 'romanizacion.htm', [null, 10, 194, null]],
				[envolverFlecha('Los &Aacute;rabes'), 'arabes.htm', [null, null, 194, null]],
				[envolverFlecha('Nacimiento de Castilla'), 'castilla.htm', [null, null, 194, null]],
				[envolverFlecha('El Real de Manzanares'), 'manzanares.htm', [null, null, 194, null]],
				[envolverFlecha('Producci&oacute;n Agropecuaria'), 'produc_agropec.htm', [null, null, 194, null]],
				[envolverFlecha('La Edad Moderna'), 'edad_moderna.htm', [null, null, 194, null]],
				['', null, [null, null, 194, 5]],
				[envolverRelleno(3, 'ff0000'), null, [null, 5, 194, 3]]
			],
			[envolverSubmenu('De Nuestros Bisabuelos', 184), 'bisabuelos.htm', null,
				['', null, [206, null, 161, 10]],
				[envolverFlecha('La Agricultura'), 'agricultura.htm', [null, 10, 161, null]],
				[envolverFlecha('La Vida Cotidiana'), 'vida_cotidiana.htm', [null, null, 161, null]],
				[envolverFlecha('Los Veraneantes'), 'veraneantes.htm', [null, null, 161, null]],
				[envolverFlecha('Las Comunicaciones'), 'comunicaciones.htm', [null, null, 161, null]],
				[envolverFlecha('La Canter&iacute;a'), 'canteria.htm', [null, null, 161, null]],
				['', null, [null, null, 161, 5]],
				[envolverRelleno(3, 'ff0000'), null, [null, 5, 161, 3]]
			],
			[envolverFlecha('Yacimiento Romano'), 'yacimiento.htm', null],
			[envolverSubmenu('Archivo Fuenterroca', 184), 'arch_fuenterroca.htm', null,
				['', null, [206, null, 198, 10]],
				[envolverFlecha('Descripci&oacute;n ISAD (G)'), 'descripcion_isad.htm', [null, 10, 198, null]],
				[envolverFlecha('Acceso Investigadores'), 'acceso_investigadores.htm', [null, null, 198, null]],
				[envolverFlecha('Acceso General'), 'acceso_general.htm', [null, null, 198, null]],
				[envolverFlecha('Buscador'), 'buscador_fuenterroca.php', [null, null, 198, null]],
				[envolverFlecha('Datos Generales'), 'datos_generales.htm', [null, null, 198, null]],
				[envolverFlecha('Antonio Mars&aacute; (Biograf&iacute;a)'), 'antonio_marsa.htm', [null, null, 198, null]],
				[envolverFlecha('Galer&iacute;a de Im&aacute;genes'), 'fuenterroca_imagenes.htm', [null, null, 198, null]],
				[envolverFlecha('Nuestro Pueblo'), 'nuestro_pueblo.htm', [null, null, 198, null]],
				['', null, [null, null, 198, 5]],
				[envolverRelleno(3, 'ff0000'), null, [null, 5, 198, 3]]
			],
			['', null, [null, null, 200, 5]],
			[envolverRelleno(3, 'ff0000'), null, [null, 5, 200, 3]]
		],
		[envolverSubmenu('Entorno Natural', 166), 'entorno.htm', [null, null, 182, null],
			['', null, [null, null, 188, 10]],
			[envolverFlecha('Geolog&iacute;a'), 'geologia.htm', [null, 10, 188, null]],
			[envolverSubmenu('Flora y Fauna', 172), 'flora_fauna.htm', [null, null, 188, null],
				['', null, [null, null, 159, 10]],
				[envolverFlecha('Las Dehesas'), 'dehesas.htm', [null, 10, 159, null]],
				[envolverFlecha('El Cerro del Castillo'), 'cerro_castillo.htm', [null, null, 159, null]],
				[envolverFlecha('Animales Silvestres'), 'animales.htm', [null, null, 159, null]],
				['', null, [null, null, 159, 5]],
				[envolverRelleno(3, 'ff0000'), null, [null, 5, 159, 3]]
			],
			[envolverSubmenu('Paseos y Excursiones', 172), 'excursiones.htm', [null, null, 188, null],
				['', null, [null, null, null, 10]],
				[envolverFlechaSangria('1 - Sierra del Castillo', 21, 7), 'excursion01.htm', [null, 10, null, null]],
				[envolverFlechaSangria('2 - Las Dehesas', 21, 7), 'excursion02.htm', null],
				[envolverFlechaSangria('3 - Cerro del Jaral&oacute;n', 21, 7), 'excursion03.htm', null],
				[envolverFlechaSangria('4 - Cerro del Tel&eacute;grafo', 21, 7), 'excursion04.htm', null],
				[envolverFlechaSangria('5 - Cordel de Castilla', 21, 7), 'excursion05.htm', null],
				[envolverFlechaSangria('6 - Casco Urbano', 21, 7), 'excursion06.htm', null],
				[envolverFlechaSangria('7 - De Collado a Alpedrete', 21, 7), 'excursion07.htm', null],
				[envolverFlechaSangria('8 - A Mataespesa de Alpedrete', 21, 7), 'excursion08.htm', null],
				[envolverFlechaSangria('9 - De Collado a Guadarrama', 21, 7), 'excursion09.htm', null],
				[envolverFlecha('10 - De Collado a Los Molinos'), 'excursion10.htm', null],
				[envolverFlecha('11 - De Collado a Navacerrada'), 'excursion11.htm', null],
				[envolverFlecha('12 - De Collado a Becerril'), 'excursion12.htm', null],
				[envolverFlecha('13 - De Collado a Moralzarzal'), 'excursion13.htm', null],
				['', null, [null, null, null, 5]],
				[envolverRelleno(3, 'ff0000'), null, [null, 5, null, 3]]
			],
			['', null, [null, null, 188, 5]],
			[envolverRelleno(3, 'ff0000'), null, [null, 5, 188, 3]]
		],
		[envolverSubmenu('Fiestas', 166), 'fiestas.htm', [null, null, 182, null],
			['', null, [null, null, 158, 10]],
			[envolverFlecha('Cabalgata de Reyes'), "javascript:document.location.href='fiestas.htm'; abrirLibro('cabalgata_reyes.htm', 'cabalgata_reyes');", [null, 10, 158, null]],
			[envolverFlecha('Fiestas de Invierno'), "javascript:document.location.href='fiestas.htm'; abrirLibro('fiestas_invierno.htm', 'fiestas_invierno');", [null, null, 158, null]],
			[envolverFlecha('Carnaval'), "javascript:document.location.href='fiestas.htm'; abrirLibro('carnaval.htm', 'carnaval');", [null, null, 158, null]],
			[envolverFlecha('Cruz de Mayo'), "javascript:document.location.href='fiestas.htm'; abrirLibro('cruz_mayo.htm', 'cruz_mayo');", [null, null, 158, null]],
			[envolverFlecha('Verano Cultural'), "javascript:document.location.href='fiestas.htm'; abrirLibro('verano_cultural.htm', 'verano_cultural');", [null, null, 158, null]],
			[envolverFlecha('Fiestas de Verano'), "javascript:document.location.href='fiestas.htm'; abrirLibro('fiestas_verano.htm', 'fiestas_verano');", [null, null, 158, null]],
			['', null, [null, null, 158, 5]],
			[envolverRelleno(3, 'ff0000'), null, [null, 5, 158, 3]]
		],
		[envolverFlecha('Callejero'), 'callejero.htm', [null, null, 182, null]],
		[envolverFlecha('Tel&eacute;fonos de Inter&eacute;s'), 'telefonos.htm', [null, null, 182, null]],
		[envolverFlecha('Enlaces Recomendados'), 'enlaces.htm', [null, null, 182, null]],
		['', null, [null, null, 182, 5]],
		[envolverRelleno(3, 'ff0000'), null, [null, 5, 182, 3]]
	],
	[['<span style="color: #336600">|</span>', '<span style="color: #336600">|</span>', '<span style="color: #336600">|</span>'], null, [111, null, 10, null]],
	['Ayuntamiento', '../ayuntamiento/index.htm', [10, null, 129, null],
		['', null, [null, null, null, 10]],
		[envolverFlecha('Bienvenida Institucional'), '../ayuntamiento/bienvenida.htm', [null, 10, null, null]],
		[envolverFlecha('El Pleno y los Concejales'), '../ayuntamiento/concejales.htm', null],
		[envolverFlecha('Secretar&iacute;a'), '../ayuntamiento/secretaria.htm', null],
		[envolverSubmenu('Oficina T&eacute;cnica', 196), '../ayuntamiento/oficina_tec.htm', null,
			['', null, [218, null, 176, 10]],
			[envolverFlecha('Clasificaci&oacute;n del Suelo'), '../ayuntamiento/clasificacion_suelo.htm', [null, 10, 176, null]],
			[envolverFlecha('Calificaci&oacute;n del Suelo'), '../ayuntamiento/calificacion_suelo.htm', [null, null, 176, null]],
			['', null, [null, null, 176, 5]],
			[envolverRelleno(3, 'ff0000'), null, [null, 5, 176, 3]]
		],
		[envolverFlecha('Agencia de Desarrollo Local'), '../ayuntamiento/adl.htm', null],
		[envolverFlecha('Servicios Sociales'), '../ayuntamiento/serv_soc.htm', null],
		[envolverFlecha('Consumo'), '../ayuntamiento/consumo.htm', null],
		[envolverFlecha('Intervenci&oacute;n y Tesorer&iacute;a'), '../ayuntamiento/intervencion.htm', null],
		[envolverFlecha('Recaudaci&oacute;n y Tributos'), ['http://www.recaudacioncolladomediano.com', 'recaudacion', null], null],
		[envolverFlecha('Juzgado (Registro Civil)'), '../ayuntamiento/juzgado.htm', null],
		[envolverFlecha('Polic&iacute;a Local'), '../ayuntamiento/policia.htm', null],
		['', null, [null, null, null, 5]],
		[envolverRelleno(3, 'ff0000'), null, [null, 5, null, 3]]
	],
	[['<span style="color: #336600">|</span>', '<span style="color: #336600">|</span>', '<span style="color: #336600">|</span>'], null, [129, null, 10, null]],
	['Sociedad', '../sociedad/index.htm', [10, null, 92, null],
		['', null, [null, null, 179, 10]],
		[envolverFlecha('Casa de Cultura'), '../sociedad/cultura.htm', [null, 10, 179, null]],
		[envolverSubmenu('Patronato Deportivo', 163), '../sociedad/patronato_deportivo.htm', [null, null, 179, null],
			['', null, [185, null, 185, 10]],
			[envolverFlecha('Polideportivo Municipal'), '../sociedad/polideportivo.htm', [null, 10, 185, null]],
			[envolverFlecha('Actividades en Monta&ntilde;a'), '../sociedad/montana.htm', [null, null, 185, null]],
			['', null, [null, null, 185, 5]],
			[envolverRelleno(3, 'ff0000'), null, [null, 5, 185, 3]]
		],
		[envolverFlecha('&Aacute;rea de la Mujer'), '../sociedad/mujer.htm', [null, null, 179, null]],
		[envolverFlecha('Casa de la Juventud'), '../sociedad/juventud.htm', [null, null, 179, null]],
		[envolverFlecha('Gu&iacute;a Empresarial'), 'http://www.colladomediano.com/', [null, null, 179, null]],
		['', null, [null, null, 179, 5]],
		[envolverRelleno(3, 'ff0000'), null, [null, 5, 179, 3]]
	],
	[['<span style="color: #336600">|</span>', '<span style="color: #336600">|</span>', '<span style="color: #336600">|</span>'], null, [92, null, 10, null]],
	['Mapa web', "javascript:abrirLibro('../mapaweb.htm', 'mapa_web');", [10, null, 99, null],
		[envolverRelleno(3, 'ff0000'), null, [13, null, 73, 3]]
	],
	[['<span style="color: #336600">|</span>', '<span style="color: #336600">|</span>', '<span style="color: #336600">|</span>'], null, [99, null, 10, null]],
	['Contacto', '../contacto.php', [10, null, 92, null],
		[envolverRelleno(3, 'ff0000'), null, [13, null, 66, 3]]
	]
];

function envolverSubmenu(texto, ancho) {
	var res = new Array;
	for (var i=0; i<estados.length; i++)
		res[i] = '<table cellpadding="0" cellspacing="0" border="0" width=' + ancho + '><tr><td width="100%" class="m0l1m' + estados[i] + 'i" nowrap>' + (i!=0 ? '<img src="../imgs/flecha_roja.gif">' : '') + texto + '</td><td class="m0l1m' + estados[i] + 'i" style="text-indent: 0px">&gt;</td></tr></table>';
	return res;
}

function envolverRelleno(alto, color) {
	var res = new Array;
	for (var i=0; i<estados.length; i++)
		res[i] = '<table cellpadding="0" cellspacing="0" border="0" width="100%" bgcolor=#' + color + ' height=' + alto + '><tr><td width="100%" class="m0l1m' + estados[i] + 'i" height="2"><img src="imgs/espacio.gif" width="100%" height=' + alto + '></td></tr></table>';
	return res;
}

function envolverFlecha(texto) {
	var res = new Array;
	res[0] = texto;
	res[1] = '<img src="../imgs/flecha_roja.gif">' + texto;
	res[2] = res[1];
	return res;
}

function envolverFlechaSangria(texto, sang1, sang2) {
	var res = new Array;
	res[0] = '<span style="text-indent: ' + sang1 + 'px">' + texto + '</span>';
	res[1] = '<img src="../imgs/flecha_roja.gif"><span style="margin-left: ' + sang2 + 'px">' + texto + '</span>';
	res[2] = res[1];
	return res;
}

function envolverSubmenuLat(texto) {
	var res = new Array;
	res[0] = '<span style="font-size: 11px; color: #ff0000">' + texto + '</span>';
	res[1] = '<img src="../imgs/flecha_roja.gif"><span style="font-size: 11px">' + texto + '</span>';
	res[2] = res[1];
	return res;
}

function envolverRellenoLat(ancho, alto, color) {
	var res = new Array;
	for (var i=0; i<estados.length; i++)
		res[i] = '<table cellpadding="0" cellspacing="0" border="0" width=' + (ancho + 6) + ' bgcolor=#' + color + ' height=' + alto + '><tr><td width="6" bgcolor="#ffffff"><img src="imgs/espacio.gif" width="6" height=' + alto + '></td><td width="' + ancho + '" class="m0l1m' + estados[i] + 'i" height="2"><img src="imgs/espacio.gif" width="100%" height=' + alto + '></td></tr></table>';
	return res;
}

function envolverMenuSelec(texto) {
	var res = new Array;
	res[0] = '<span style="color: #ff0000">' + texto + '</span>';
	res[1] = res[0];
	res[2] = res[0];
	return res;
}

function envolverSubmenuSelec(texto, ancho) {
	return '<table cellpadding="0" cellspacing="0" border="0" width=' + ancho + '><tr><td width="100%" class="m0l1m' + estados[0] + 'i" nowrap><span style="color: #ff0000">' + texto + '</span></td><td class="m0l1m' + estados[0] + 'i" style="text-indent: 0px"><span style="color: #ff0000">&gt;</span></td></tr></table>';
}

function envolverSubmenuIntSelec(texto, ancho) {
	var res = new Array;
	res[0] = '<table cellpadding="0" cellspacing="0" border="0" width=' + ancho + '><tr><td width="100%" class="m0l1m' + estados[0] + 'i" nowrap><span style="color: #ff0000">' + texto + '</span></td><td class="m0l1m' + estados[0] + 'i" style="text-indent: 0px"><span style="color: #ff0000">&gt;</span></td></tr></table>';
	res[1] = res[0];
	res[2] = res[0];
	return res;
}

function envolverSubmenuFinSelec(texto) {
	var res = new Array;
	res[0] = '<span style="color: #ff0000">' + texto + '</span>';
	res[1] = '<span style="color: #ff0000; text-indent: 14px">' + texto + '</span>';
	res[2] = res[1];
	return res;
}

function envolverSubmenuFinSangSelec(texto, sang1) {
	var res = new Array;
	res[0] = '<span style="color: #ff0000; text-indent: ' + sang1 + 'px">' + texto + '</span>';
	res[1] = res[0];
	res[2] = res[0];
	return res;
}
