/////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2007, 2008, Oracle. All rights reserved.
// Function : TS_GE_GAMING_HNAV
// Comments : 
/////////////////////////////////////////////////////////////////////////////

function TS_GE_GAMING_HNAV(strHRef, strLabel, strNode) {
	this.NodeName = strNode;
	this.HRef = strHRef;
	this.Label = strLabel;
	this.m_NavPath    = g_navNode_Path;
	TS_GE_GAMING_HNAV.prototype.Display = TS_GE_GAMING_HNAV_Display;
}


function TS_GE_GAMING_HNAV_Display (node) {	
	var nodeLevel = node.m_level+1;//nodeLevel = 1
	var isSelected;
	var isHRef = false;
	var str = "";
	var isMain = true;
	
	document.write('<ul>');
	for (var count = -1; count < node.m_subNodes.length; count++) {
		if (nodeLevel==1) {
			if (count == -1) {//Is main
				if ( (this.m_NavPath.length == nodeLevel) && (this.m_NavPath[node.m_level] == node.m_id) ) {
					isMain = true;
					isSelected = true;
				}
				else {
					isSelected = false;
				}
				if (isSelected) {
					document.write('<li id=\"main\">'+node.m_label+'</li>');
				}
				else {
					document.write('<li id=\"main\"><a href=\"'+node.m_href+'\">'+node.m_label+'</a></li>');
				}
			}
			else {
				if (this.m_NavPath.length >= node.m_subNodes[count].m_level)
				{
					if (this.m_NavPath[node.m_subNodes[count].m_level] == node.m_subNodes[count].m_id)
					{
						isMain = false;
						isSelected = true;
					}
					else {
						isSelected = false;
					}
				}
				if (isSelected) {
					document.write('<li>'+node.m_subNodes[count].m_label+'</li>');
					var str = node.m_subNodes[count].m_label.toLowerCase();
					//alert("Label:" + str + " (" + this.HRef + ")");
					if(str.indexOf(this.HRef.toLowerCase()) > 0){
						isHRef = true;
					}
				}
				else {
					document.write('<li><a href=\"'+node.m_subNodes[count].m_href+'\">'+node.m_subNodes[count].m_label+'</a></li>');
				}
			}
		}
	}
	if(isHRef){
		document.write('<li id=\"contact-experts\">'+this.Label+'</li>');
	}else{
		if(isMain){
			document.write('<li id=\"contact-experts\"><a href=\"/gaming/'+this.HRef+'\">'+this.Label+'</a></li>');
		}else{
			document.write('<li id=\"contact-experts\"><a href=\"/gaming/'+this.HRef+'\">'+this.Label+'</a></li>');
		}
	}
	document.write('<ul>');
}

