﻿// Version 2 dated 14.11.03 by PS
var page = document.location.href;
// each element of array made up of:
// [Name,Link,External Link?,Sub menu?]
var Menu 	= new Array();

Menu[0] 	= 
["Página Principal SGM","../_home/index.shtml",0,0];

Menu[1] 	= 
["Cronología de la SGM","../timeline/timeline.shtml",0,0];

Menu[2] 	= 
["Personalidades Principales","",0,1,
	["Adolfo Hitler","../figureheads/adolf_hitler.shtml",0,0],
	["Josef Stalin","../figureheads/josef_stalin.shtml",0,0],
	["Neville Chamberlain","../figureheads/neville_chamberlain.shtml",0,0],
	["Winston Churchill","../figureheads/winston_churchill.shtml",0,0],
	["Franklin Roosevelt","../figureheads/franklin_roosevelt.shtml",0,0],
	["Mussolini","../figureheads/benito_mussolini.shtml",0,0],
	["Charles de Gaulle","../figureheads/charles_de_gaulle.shtml",0,0]
];
Menu[3] 	= 
["Las Tropas","",0,1,
	["Tierra","../the_troops/land.shtml",0,0],
	["Aire","../the_troops/air.shtml",0,0],
	["Mar","../the_troops/sea.shtml",0,0]
];
Menu[4] 	= 
["Vivir en Guerra","",0,1,
	["Ataques Aéreos","../living_with_war/air_raids.shtml",0,0],
	["Las Correrías aliadas del Aire","../living_with_war/allied_air_raids.shtml",0,0],
	["Racionamiento de Comida","../living_with_war/food_rationing.shtml",0,0],
	["Mujeres y Guerra","../living_with_war/women_and_war.shtml",0,0],
	["Viviendo en Territorios Ocupados.","../living_with_war/living_in.shtml",0,0]
];
Menu[5] 	= 
["La Invasión de Polonia","../invasion_of_poland/index.shtml",0,1];
//	["Interactivo La Invasión de Polonia","../invasion_of_poland/poland.shtml",0,0]

//];

Menu[6] 	= 
["La Guerra de Invierno","../the_winter_war/index.shtml",0,1];

Menu[7] 	= 
["La Batalla de Inglaterra","",0,1,
	["Nuestra Mejor Hora","../battle_of_britain/our_finest_hour.shtml",0,0],
	["La RAF contraataca","../battle_of_britain/raf_strike_back.shtml",0,0]
];

Menu[8] 	= 
["Operación Barbarossa","../barbarossa/index.shtml",0,1,
	["Interactivo Operación Barbarrosa","../barbarossa/barbarossa.shtml",0,0]
];

Menu[9] 	= 
["Pearl Harbour","../pearl_harbour/index.shtml",0,1,
	["Interactivo de Pearl Harbour","../pearl_harbour/pearl_harbour.shtml",0,0]
];

Menu[10] 	= 
["El Holocausto","../the_holocaust/index.shtml",0,1];

Menu[11] 	= 
["La Batalla de El Alamein","../el_alamein/index.shtml",0,1,
	["Interactivo La Batalla de El Alamein","../el_alamein/el_alamein.shtml",0,0]
];

Menu[12] 	= 
["Día D","",0,1,
	["Vista General","../d_day/overview.shtml",0,0],
	["Playa Utah","../d_day/utah.shtml",0,0],
	["Playa Omaha","../d_day/omaha.shtml",0,0],
	["Playa Gold","../d_day/gold.shtml",0,0],
	["Playa Juno","../d_day/juno.shtml",0,0],
	["Playa Sword","../d_day/sword.shtml",0,0],
	["Interactivo Día D","../d_day/d_day.shtml",0,0]
];

Menu[13] 	= 
["La Bomba Atómica","../atomic_bomb/index.shtml",0,1];


// -------------------------------------------------------------------------
// do not edit below this line!!
// Last Update 27/11/03

// variables for highlighting section/subsection
var showSection = false;
var showSubSection = false;
var output = output2 = output3 = "";
var breadcrumbs = "";
var sectionLink = "";

var next_link = "";
var next_text = "";
for (i=0; i<Menu.length;i++)
{
	showSection = comparePage(Menu[i][1],page) ? true : false;
	output3="";
	if (Menu[i][3]==1 && Menu[i][4]!="undefined") // sub nav
	{
		
		for (j=4; j<Menu[i].length;j++)
		{
			breadcrumbsSec="<span class=\"darkgreen1\"> > </span><a href=\"" + Menu[i][j][1] + "\" class=\"darkgreenlink1\">" + Menu[i][j][0] + "</a> " + breadcrumbs;
		
			showSubSection = comparePage(Menu[i][j][1],page) ? true : false;
			output2="";
			for (k=4; k<Menu[i][j].length;k++)
			{
				if (comparePage(Menu[i][j][k][1],page))
				{
					output2 += showTable(Menu[i][j][k][0],Menu[i][j][k][1],showSection,20,true,"",Menu[i][j][k][2]);
				if (k+1 <Menu[i][j].length)
				next_link = Menu[i][j][k+1][1];
				else if (k!=4)
				next_link = Menu[i][j][4][1];
				next_text = "Sub Article";
					showSubSection=showSection=true;
					breadcrumbs+=breadcrumbsSec;
					breadcrumbs+="<span class=\"darkgreen1\"> > </span><a href=\"" + Menu[i][j][k][1] + "\" class=\"darkgreenlink1\">" + Menu[i][j][k][0] + "</a> ";
				}
			}
			
			if (comparePage(Menu[i][j][1],page))
			{
				showSection=true;
				if (j+1 <Menu[i].length)
				{
					next_link = Menu[i][j+1][1];
					next_text = Menu[i][j+1][0];
				}
				else if (j!=4)
				{
					next_link = Menu[i][4][1];
					next_text = Menu[i][4][0];
				}

				breadcrumbs=breadcrumbsSec + breadcrumbs;
			}
			output3 += showTable(Menu[i][j][0],Menu[i][j][1],showSection,15,comparePage(Menu[i][j][1],page) ? true: false,"",Menu[i][j][2]) + output2;
			output3 = output3.replace("replace"," bgcolor='#ffffff'");
			if (showSection && next_text=="")
			{
				if (i+1 < Menu.length)
				next_link = Menu[i][4][1];
				else
				next_link = Menu[0][1];
				next_text = Menu[i][4][0];
			}
		}
		if (!showSubSection && !showSection)
		output3="";
		else 
		{
			var featureLink=Menu[i][1];
			
			if (Menu[i][1]=="undefined" || Menu[i][1]=="")
			featureLink=Menu[i][4][1];
			breadcrumbs="<a href=\"" + featureLink + "\" class=\"darkgreenlink1\">" + Menu[i][0] + "</a> " + breadcrumbs;
		}
				
	}
	if (Menu[i][1]=="")
	sectionLink = Menu[i][4][1];
	else 
	sectionLink = Menu[i][1];

	output += showTable(Menu[i][0], sectionLink, showSection,10, comparePage(Menu[i][1],page) ? true : false, showSubSection || showSection ? "" : "bgcolor='#ffffff'",Menu[i][2]) + output3;
	showSubSection=false; // added 02.03.04 by PS
}
breadcrumbs = "<a href=\"" + Menu[0][1] + "\" class=\"darkgreen2\">Página Principal SGM</a><span class=\"darkgreenlink1\"> > </span>" + breadcrumbs;
output = "<table><tr><td height=\"30\"><img src=\"../_includes/sitewide_images/blank.gif\" width=\"1\" height=\"1\" alt=\"\" border=\"0\"/></td></tr></table>" + output.replace ("replace"," ");




function comparePage (check,current)
{
	var returnValue = false;
	check = check.replace ("\.\.\/","");
	if (current.match(check)) returnValue=true;
	if (check==current) returnValue=true;
	if (check=="") returnValue=false;
	return returnValue;
}

function showNext()
{
	if (next_link!="")
	return "<a href=\"" + next_link + "\" class=\"greenlink1\"><b>" + next_text + "</b> <img src=\"../_includes/sitewide_images/arrow_next.gif\" width=\"7\" height=\"6\" alt=\"\" border=\"0\"/></a>";
	else
	return "";
}

function showTable(name,link,show,pixels,highlight,bgcolor2,target)
{
	bgcolor = show ? "bgcolor='#ffffff'" : "replace";
	nav 	= highlight ? "greenlink2" : "nav";
	target 	= target==1 ? "target=_new" : "";
	isOn 	= highlight ? "_on" : "";

	return  "<table cellpadding=\"2\" cellspacing=\"0\" border=\"0\" width=\"100%\" " + bgcolor + "><tr>" +
	"<td width=\"10\"><img src=\"../_includes/sitewide_images/blank.gif\" width=\"" + pixels + "\" height=\"1\" alt=\"\" border=\"0\"/></td>" + 
	"<td width=\"166\" height=\"20\" valign=\"middle\"><a href=\"" + link + "\" " + target + " class=\"" + nav + "\"><b>" + name + "</b></a></td>" +
	"<td width=14><a href=\"" + link + "\" " + target + " class=\"" + nav + "\"><img src=\"../_includes/sitewide_images/arrow_nav" + isOn + ".gif\" width=\"7\" height=\"6\" alt=\"\" border=\"0\"/></a>" + 
	"<img src=\"../_includes/sitewide_images/blank.gif\" width=\"5\" height=\"1\" alt=\"\" border=\"0\"/></td>" + 
	"</tr></table>" + 
	"<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"100%\"  " + bgcolor2 + ">" + 
	"<tr><td height=\"1\" " + bgcolor2 + "><img src=\"../_includes/sitewide_images/blank.gif\" width=\"1\" height=\"1\" alt=\"\" border=\"0\"/></td>" + 
	"</tr></table>";
}
next = showNext();