/* -------------------------------------------------------------------------- */
/*
   (c) 2004-2005 U.S. Robotics Corporation.
*/
/* -------------------------------------------------------------------------- */


/* --------------------------------------------------------------------------

	Define the information for a single menu item (both main bar and sub-menu).
	Each menu item has an associated filename, title, and description.
	The title and description are translated, but not the filename.

*/

function MenuItem(strFilename, strTitle, strDescription, menuSub)
{
	this.strFilename = strFilename;
	this.strTitle = strTitle;
	this.strDescription = strDescription;
	this.menuSub = menuSub;
}


/* --------------------------------------------------------------------------

	These represent the various menus. There is a main menu bar and some sub-menus.

	The second and third strings in each item need to be translated.
	The first string is a filename and does not need to be translated.

	This is the only section that contains text to be translated.

	The below tag must not be modified. It is used by
	Translation to extract the text to be translated.

	*** TRANSLATION START -->
*/

/*
	The value of this variable is the title of each page, output by the script below.
	The product name "Wireless <i>MAX<\/i>g Router" is not translated,
	but the text "User Guide" is, and the arrangement of that text
	can be changed to suit the target language's grammar.
*/
var strTitle = "Wireless <i>MAX</i>g Router Bedienungsanleitung";

// N.B.: All filenames must be in lowercase here.

var menuHome = new Array(
									new MenuItem("index.html",					"Einführung",	"Einführung in den Router"),
									new MenuItem("features.html",				"Merkmale",			"Merkmale des Routers"),
									new MenuItem("warranty.html",				"Garantie",			"Begrenzte Garantie"),
									new MenuItem("regulatory.html",			"Vorschriften",		"Informationen zu Vorschriften")
								);

var menuInstall = new Array(
									new MenuItem("install.html",				"Router",			"Installation des Routers"),
									new MenuItem("printer.html",				"Drucker",			"Installation eines Netzwerk-USB-Druckers")
								
								);


var menuRouter = new Array(
									new MenuItem("wui.html",					"Anmelden",				"Informationen zum Konfigurieren des Routers"),
									new MenuItem("status.html",				"Status",			"Informationen zur Seite Status des Routers"),
									new MenuItem("log.html",					"Log",				"Informationen zur Seite Log (Protokoll) des Routers"),
									new MenuItem("internet.html",				"Internet",			"Informationen zur Seite Internet des Routers"),
									new MenuItem("security.html",				"Security (Sicherheit)",			"Informationen zur Seite Security (Sicherheit) des Routers"),
									new MenuItem("firewall.html",				"Firewall",			"Informationen zur Seite Firewall des Routers"),
									new MenuItem("wireless.html",				"Wireless",			"Informationen zur Seite Wireless des Routers"),
									new MenuItem("lan.html",					"LAN",				"Informationen zur Seite LAN des Routers"),
									new MenuItem("device.html",				"Gerät",			"Informationen zur Seite Device (Gerät) des Routers")
								);

var menuHelp = new Array(
									new MenuItem("troubleshooting.html",	"Fehlerbehebung",	"Tipps zur Fehlerbehebung"),
									new MenuItem("faq.html",					"FAQ",					"Häufig gestellte Fragen"),
									new MenuItem("support.html",				"Support",				"Technischer Support")
								);

var menuMain = new Array(
									new MenuItem("index.html",					"Startseite",				"Produktinformationen anzeigen",			menuHome),
									new MenuItem("install.html",				"Installation",	"Installation des Routers",		menuInstall),
									new MenuItem("wui.html",					"Konfiguration",	"Konfiguration des Routers",		menuRouter),
									new MenuItem("tutorials.html",			"Lernprogramme",		"Wie Sie Ihre Ziele erreichen"),
									new MenuItem("troubleshooting.html",	"Hilfe",				"Tipps zur Fehlerbehebung und häufig gestellte Fragen",		menuHelp)
								);

/*
	<-- TRANSLATION END ***

	Nothing after this needs to be translated.
	The above tag must not be modified. It is used by
	Translation to extract the text to be translated.
*/


/* --------------------------------------------------------------------------

	Page header and footer functions

*/

/*
	This function returns the filename of the current page.
	It looks for both slash and backward slash.

	N.B.:	It returns the filename in lowercase because
			comparisons shouldn't be case-sensitive.
*/
function getPageFilename()
{
	var strFilename = document.URL;
	var ixSeparator = strFilename.lastIndexOf("/");
	var ixSeparator2 = strFilename.lastIndexOf("\\");
	if (ixSeparator2 > ixSeparator)
		ixSeparator = ixSeparator2;
	if (ixSeparator != -1)
		strFilename = strFilename.substr(ixSeparator + 1);
	return strFilename.toLowerCase();
}

/*
	This writes out a page's header, including the optional menu bar.
	The title parameter is optional. If passed, it's written out
	as the header text.

	Example:

	<img id="idImgHeader" src="images/banner.gif">
	<div id="idHeader">Wireless <i>MAX</i>g Router User Guide</div>

	<div id="idMenu">
		<span class="clsMenuItemActive">Home</span>
		<a class="clsMenuItemInactive" href="two.html">Installation</a>
		<a class="clsMenuItemInactive" href="eleven.html">Router</a>
		<a class="clsMenuItemInactive" href="nine.html">Warranty</a>
	</div>
	<div id="idMenu2">
		<span class="clsMenuItemActive">Status</span>
		<a class="clsMenuItemInactive" href="lan.html">LAN</a>
		<a class="clsMenuItemInactive" href="device.html">Device</a>
	</div>
*/
function writeHeader()
{
	var strFilename = getPageFilename();		  /* get filename of current page */

	document.write("<img id=\"idImgHeader\" src=\"images/banner.gif\" width=\"180\" height=\"30\">");
	document.write("<img id=\"idImgHeader\" src=\"images/device.gif\" width=\"100\" height=\"80\">");
	document.write("<div id=\"idHeader\">" + strTitle + "<\/div>");

	document.write("<div id=\"idMenu\">");
	var menuSub = null;
	for (var i = 0; i < menuMain.length; ++i)
	{
		/*
			Determine if this is the current page.
			First, compare this filename with the current main menu item.
			If that's not it, check any of the current item's sub-menu items.
		*/
		var bCurrentPage = false;
		if (menuMain[i].strFilename == strFilename)
			bCurrentPage = true;
		else if (menuMain[i].menuSub != null)
		{
			for (var j = 0; j < menuMain[i].menuSub.length; ++j)
			{
				if (menuMain[i].menuSub[j].strFilename == strFilename)
				{
					bCurrentPage = true;
					break;
				}
			}
		}

		// the newline is required for there to be space between the tabs
		if (bCurrentPage)
		{
			document.write("<span class=\"clsMenuItemActive\">" + menuMain[i].strTitle + "<\/span>\n");
			menuSub = menuMain[i].menuSub;
		}
		else
			document.write("<a class=\"clsMenuItemInactive\" href=\"" + menuMain[i].strFilename + "\" title=\"" + menuMain[i].strDescription + "\">" + menuMain[i].strTitle + "<\/a>\n");
	}
	document.write("<\/div>");

	/*
		If the current menu item has a sub-menu, output it too.
	*/
	if (menuSub != null)
	{
		document.write("<div id=\"idMenu2\">");
		for (var i = 0; i < menuSub.length; ++i)
		{
			if (menuSub[i].strFilename == strFilename)
				document.write("<span class=\"clsMenuItemActive\">" + menuSub[i].strTitle + "<\/span>\n");
			else
				document.write("<a class=\"clsMenuItemInactive\" href=\"" + menuSub[i].strFilename + "\" title=\"" + menuSub[i].strDescription + "\">" + menuSub[i].strTitle + "<\/a>\n");
		}
		document.write("<\/div>");
	}

	document.write("<div id=\"idContent\">");
}


function writeFooter()
{
	document.write("<\/div>");

   document.write("<p id=\"idCopyright\">&copy; 2004-" + (new Date).getFullYear() + " U.S. Robotics Corporation<\/p>");
}
