
function ToggleDisplay(oButton, oItems)
{

	if ((oItems.style.display == "") || (oItems.style.display == "none"))	{
		oItems.style.display = "block";
		oButton.src = "folder/nav_minus.gif";
	}	else {
		oItems.style.display = "none";
		oButton.src = "folder/nav_plus.gif";
	}
	return false;
}

function leftnav_keyup()
{
	var iKey = window.event.keyCode;
	
	// BUGBUG: IE4 returns BODY instead of element with the focus. Use event object instead
	//var oActive = document.activeElement;
	var oActive = window.event.srcElement;
	
	if( DHTML_LEFT_ARROW == iKey || DHTML_RIGHT_ARROW == iKey )
	{
		if ('clsTocHead' == oActive.className)
		{
			// handle headings that expand/collapse
			HandleKeyForHeading(oActive, iKey);
		} 
		else if( "A" == oActive.tagName )
		{
			MoveFocus( oActive, iKey );
		}
	}
	
	return;
}

function MoveFocus( oActive, iKey )
{
	iSrcIndex = oActive.sourceIndex;
	
	if( iKey == DHTML_RIGHT_ARROW)
	{
		while( oItem = document.all[ ++iSrcIndex ] )
		{
			if( !leftNavTable.contains( oItem ) ) return;
			if( "A" == oItem.tagName )
			{
				oItem.focus();
				break;
			}

		}
	}
	else
	{
		while( oItem = document.all[ --iSrcIndex ] )
		{
			if( ( "clsTocHead" == oItem.className || "clsTocHead" == oItem.parentElement.className ) && "A" == oItem.tagName )
			{
				oItem.focus();
				break;
			}

		}
	}
}

// Handle keyboard action on a section
function HandleKeyForHeading(oActive, iKey)
{
	
	sActiveId = oActive.id;
	oItem = document.all[ sActiveId + "Items" ];
	oBtn = document.all[ sActiveId + "Btn" ];

	if( ( "block" != oItem.style.display ) ^ ( DHTML_LEFT_ARROW == iKey ) )
	{
		ToggleDisplay( oBtn ,oItem );
	}
	else
	{
		MoveFocus( oActive, iKey );		
	}
}


// BrowserCheck Object
function BrowserCheck() {
	var b = navigator.appName
	if (b=="Netscape") this.b = "ns"
	else if (b=="Microsoft Internet Explorer") this.b = "ie"
	else this.b = b
	this.version = navigator.appVersion
	this.v = parseInt(this.version)
	this.ns = (this.b=="ns" && this.v>=4)
	this.ns4 = (this.b=="ns" && this.v==4)
	this.ns5 = (this.b=="ns" && this.v==5)
	this.ie = (this.b=="ie" && this.v>=4)
	this.ie4 = (this.version.indexOf('MSIE 4')>0)
	this.ie5 = (this.version.indexOf('MSIE 5')>0)
	this.min = (this.ns||this.ie)
}

is = new BrowserCheck()

