/**
* 
* Hitachi GST Internet Navigation Script
* 
* author: Ryan Huff, IBM Global Services, rlhuff@us.ibm.com
* 
* The purpose of this script is to make an easily maintainable
* navigation structure.
* 
* Tier 2 (Products, About) may not be *created* here
* 
* To add a new Tier 3 link (e.g. Products/Awards, etc) create a new Tier 3 Node
* within the appropriate Tier 2.
*   - The Tier 3 Node consists of the node name (e.g. Benefits, etc), and the 
*		Tier 3 Node URL.
*
* In the "parent" HTML file, two parameters should be defined: nav2 and nav3.
*   - nav2 is the Tier 2 Node name of the currently selected Tier 2 site.
*   - nav3 is the Tier 3 Node name of the currently selected Tier 3 within the 
*		Tier 2.
* 
* The "renderNavigation()" function should be called from the parent HTML file
* in the place where the navigation menu should be displayed.
* 
**/


var navigationMenu = new Array(

	new Array("Products", "/products/", 	// Tier 2 Node	
	
//		(Link Name)						(Link Label)								(Link URL)

		new Array("Ultrastar", 				"Ultrastar<br />(server 3.5&quot;)", 				"http://www.hitachigst.com/portal/site/hgst/?epi_menuItemID=91f450632c1aa6fd25ad4e8060e4f0a0&epi_menuID=f3422d6ea3268f8d5f5a530560e4f0a0&epi_baseMenuID=22f0deefa8f3967dafa0466460e4f0a0"),
		new Array("Deskstar", 				"Deskstar<br />(desktop 3.5&quot;)", 				"http://www.hitachigst.com/portal/site/hgst/?epi_menuItemID=8d237906f078b6fd25ad4e8060e4f0a0&epi_menuID=f3422d6ea3268f8d5f5a530560e4f0a0&epi_baseMenuID=22f0deefa8f3967dafa0466460e4f0a0"),
		new Array("Travelstar", 			"Travelstar<br />(mobile 1.8&quot;, 2.5&quot;)", 		"http://www.hitachigst.com/portal/site/hgst/?epi_menuItemID=0f34be57a7adb6fd25ad4e8060e4f0a0&epi_menuID=f3422d6ea3268f8d5f5a530560e4f0a0&epi_baseMenuID=22f0deefa8f3967dafa0466460e4f0a0"),
		new Array("Endurastar",				"Endurastar<br />(temperature extremes)",			"http://www.hitachigst.com/portal/site/hgst/?epi_menuItemID=8ef700563ec9add891da5972aac4f0a0&epi_menuID=f3422d6ea3268f8d5f5a530560e4f0a0&epi_baseMenuID=22f0deefa8f3967dafa0466460e4f0a0"),
		new Array("Microdrive", 			"Microdrive Digital Media",					"http://www.hitachigst.com/portal/site/hgst/?epi_menuItemID=2dcd772d4d32c6fd25ad4e8060e4f0a0&epi_menuID=f3422d6ea3268f8d5f5a530560e4f0a0&epi_baseMenuID=22f0deefa8f3967dafa0466460e4f0a0"),
		new Array("",					"",										""),
		new Array("Research & technology",		"Research and Technology",					"http://www.hitachigst.com/portal/site/hgst/?epi_menuItemID=fcb84918655f65f694d64eb7bac4f0a0&epi_menuID=f3422d6ea3268f8d5f5a530560e4f0a0&epi_baseMenuID=22f0deefa8f3967dafa0466460e4f0a0 "),
		new Array("Case Studies", 			"Case Studies", 						"http://www.hitachigst.com/portal/site/hgst/?epi_menuItemID=5fd016a28b6d46acbe8fce24aac4f0a0&epi_menuID=f3422d6ea3268f8d5f5a530560e4f0a0&epi_baseMenuID=22f0deefa8f3967dafa0466460e4f0a0"),
		new Array("Awards", 				"Awards", 							"http://www.hitachigst.com/portal/site/hgst/?epi_menuItemID=570f04d5664fc6fd25ad4e8060e4f0a0&epi_menuID=f3422d6ea3268f8d5f5a530560e4f0a0&epi_baseMenuID=22f0deefa8f3967dafa0466460e4f0a0"),
		new Array("Reviews", 				"Reviews", 							"http://www.hitachigst.com/portal/site/hgst/?epi_menuItemID=635d7f86b212d6fd25ad4e8060e4f0a0&epi_menuID=f3422d6ea3268f8d5f5a530560e4f0a0&epi_baseMenuID=22f0deefa8f3967dafa0466460e4f0a0")
	),


	new Array("About",  "/about/",			// Tier 2 Node

//		(Link Name)						(Link Label)								(Link URL)

		new Array("Overview",  				"Overview",									"overview.html"),
		new Array("Executive team",			"Executive team",								"bios.html"),
		new Array("Value",				"Creating value for customer",					"value.html"),
		new Array("Timeline",      			"Technology timeline",							"timeline.html"),
		new Array("Milestone",     			"Technology milestone",							"milestones.html"),
		new Array("Awards",       			"Awards",									"awards.html"),
		new Array("Events",        			"Events",									"events.html"),
		new Array("Employment",   			"Employment",								"employment.html"),
		new Array("Community Relations",   		"Community Relations",							"community.html"),
		new Array("Press room",   			"Press room",								"pressrm.html"),
		new Array("Contact",     			"Contact us",								"http://www.hitachigst.com/contact/index.html"),
		new Array("Privacy",   				"Privacy Policy",								"http://www.hitachigst.com/privacy.html")

	)

);

function renderNavigation() {


/**
*
* The HTML rendered is completely configurable. Simply modify the document.write() statements.
*
*/
	for ( var i = 0; i < navigationMenu.length; i++ ) {
		if ( nav2 == navigationMenu[i][0] ) {
			var navroot = navigationMenu[i][1];
			var navlinks = navigationMenu[i].slice(2);


			for ( var j = 0; j < navlinks.length; j++ ) {
				var link_url = "";

				if ( navlinks[j][2].indexOf("http") == 0 ) {
					link_url = navlinks[j][2];
				}

				else {
					link_url = navroot + navlinks[j][2];
				}

				if ( navlinks[j][0] == "" ) {
					document.write('<tr>\n');
					document.write('\t' + '<td class="nav">&nbsp;</td>\n');
					document.write('\t' + '<td colspan="2" class="nav">&nbsp;</td>\n');
					document.write('</tr>\n');
				}
				else {
					document.write('<tr class="' + ((nav3==navlinks[j][0])?'hil':'nav') + '">\n');
					document.write('\t' + '<td width="10">&nbsp;</td>\n');
					document.write('\t' + '<td colspan="2"><a href="' + link_url + '" class="' + ((nav3==navlinks[j][0])?'hil':'nav') + '">' + navlinks[j][1] + '</a></td>\n');
					document.write('</tr>\n');
				}
				document.write('<tr>\n');
				document.write('\t' + '<td class="nav">&nbsp;</td>\n');
				document.write('\t' + '<td colspan="2" class="nav">&nbsp;</td>\n');
				document.write('</tr>\n');
			}

		}

	}

}

/*
** Selected **
<tr class="hil"> 
	<td width="10">&nbsp;</td>
	<td colspan="2"><a href="%%URL%%" class="hil">%%LABEL%%</a></td>
</tr>
<tr> 
	<td class="nav">&nbsp;</td>
	<td colspan="2" class="nav">&nbsp;</td>
</tr>

** Not selected **
<tr class="nav"> 
	<td width="10">&nbsp;</td>
	<td colspan="2"><a href="%%URL%%" class="nav">%%LABEL%%</a></td>
</tr>
<tr> 
	<td class="nav">&nbsp;</td>
	<td colspan="2" class="nav">&nbsp;</td>
</tr>

** Blank line **
<tr> 
	<td class="nav">&nbsp;</td>
	<td colspan="2" class="nav">&nbsp;</td>
</tr>
<tr> 
	<td class="nav">&nbsp;</td>
	<td colspan="2" class="nav">&nbsp;</td>
</tr>
*/