/////////////////////////////////////////////////////////////////////////////
// Class : FishbowlLeftNav
// Comments : 
/////////////////////////////////////////////////////////////////////////////

function FishbowlLeftNav(strTextColor, strHoverColor, strFocusColor, strClassName,temp)
{
	this.m_TextColor  = '';
	this.m_HoverColor = '';
	this.m_FocusColor = '';
	this.m_ClassName  = 'FishbowlLeftNav';

	this.m_NavPath    = g_navNode_Path;
		
	FishbowlLeftNav.prototype.Display = FishbowlLeftNav_Display;
	FishbowlLeftNav.prototype.DisplayNode = FishbowlLeftNav_DisplayNode;
	
	if (strTextColor != '')
		this.m_TextColor = strTextColor;
		
	if (strHoverColor != '')
		this.m_HoverColor = strHoverColor;

	if (strFocusColor != '')
		this.m_FocusColor = strFocusColor;

	if (strClassName != '')
		this.m_ClassName = strClassName;
}

function FishbowlLeftNav_Display (node)
{
	document.write('<dl>');
	this.DisplayNode(node);
	document.write('</dl>');
}

function FishbowlLeftNav_DisplayNode(node)
{
	var bSelected = false;
	var nodeColor = this.m_TextColor;
	var nodeClass = this.m_ClassName;
	var nodeLevel = node.m_level;
	
	if (nodeLevel > 6)
		nodeLevel = 6;
	
	if (this.m_NavPath.length > 0 && node.m_level < this.m_NavPath.length)
	{
		if (this.m_NavPath[node.m_level] == node.m_id)
		{
			bSelected = true;
			nodeColor = this.m_FocusColor;
			
			if(this.m_NavPath[this.m_NavPath.length-1] == node.m_id)
			{
			nodeClass += '-focus';
			}
			
		}
	}
	
	nodeClass += '-' + nodeLevel;
	
	if (nodeLevel >= 1 && (node.m_label != "Login" && node.m_label != 'Register'))
	{	
		var ds = new Array();
		var di = 0;
		
		ds[di++] = (nodeLevel <= 2) ? '<dt' : '<dd';
		ds[di++] = ' class="' + nodeClass + '"';
		ds[di++] = '>';
		
		if (node.m_label == "WebEx")
		{
			ds[di++] = '<a target="_blank" href="http://advancedmeetings.webex.com/media/redir/index.html"';
		}
//		else if (node.m_label == "Login" || node.m_label == 'Register') 
//		{
			//var url= "/fishbowl/idcplg?IdcService=SS_LOGIN&PREV_QUERY_STRING=IdcService=SS_GET_PAGE&ssUrlType=1&siteId=Fishbowl_Solutions&siteRelativeUrl=/StellentSolutions/StellentComponents/StellentComponents.htm";
			//ds[di++] = '<a href="' + url + '"';
//		}
		else
		{
			ds[di++] = '<a href="' + node.m_href + '"';
			ds[di++] = ' class="' + nodeClass + '"';
		}
		
		
		if (nodeColor != '')
		{	
			ds[di++] = ' style="color:' + nodeColor + ';"';

			if (!bSelected && this.m_HoverColor != '')
			{
				ds[di++] = ' onmouseover="this.style.color=\'' + this.m_HoverColor + '\'"';
				ds[di++] = ' onmouseout="this.style.color=\'' + nodeColor + '\'"';
			}
		}
		
		var temp1 = node.m_label.replace(" for Oracle UCM (Stellent)","");		
		temp1=temp1.replace("Fishbowl PTC","PTC");
		temp1=temp1.replace(" by Fishbowl Solutions","");
		temp1=temp1.replace("Oracle UCM (Stellent) ","Oracle UCM ");
		temp1=temp1.replace("Oracle Components","Fishbowl Components");

//		if (node.m_label == "Login" || node.m_label == 'Register') 
//		{
//		}
//		else
//		{
			ds[di++] = '>'
			ds[di++] =temp1;
			ds[di++] = '</a>';
//		}
		document.write(ds.join(''));
		
	
	}
	
	if (bSelected)
	{	// expand sub-levels (if any)
		for (var i = 0; i < node.m_subNodes.length; i++)
		{
			this.DisplayNode(node.m_subNodes[i]);
		}
	}
}
