function navBar( tableCellRef, hoverFlag, navStyle, selectedMenuItem ) {
	if ( hoverFlag ) {
		switch ( navStyle ) {
			case 1:
			case 2:
			case 3:
			case 4:
				tableCellRef.style.backgroundColor = '#ff9900';
				if ( document.getElementsByTagName ) {
					tableCellRef.getElementsByTagName( 'a' )[0].style.color = 'white';
				}
				break;
			default:
				if ( document.getElementsByTagName ) {
					tableCellRef.getElementsByTagName( 'a' )[0].style.color = '#c00';
				}
		}
	} else {
		if( selectedMenuItem )
		{
			switch ( navStyle ) {
				case 1:
					tableCellRef.style.backgroundColor = '#999999';
					if ( document.getElementsByTagName ) {
						tableCellRef.getElementsByTagName( 'a' )[0].style.color = 'white';
					}
					break;
				case 2:
				case 3:
				case 4:
					tableCellRef.style.backgroundColor = 'white';
					if ( document.getElementsByTagName ) {
						tableCellRef.getElementsByTagName( 'a' )[0].style.color = '#ff9900';
					}
					break;
				default:
					if ( document.getElementsByTagName ) {
						tableCellRef.getElementsByTagName( 'a' )[0].style.color = '#000';
					}
			}
		} else {
			switch ( navStyle ) {
				case 1:
					tableCellRef.style.backgroundColor = '#999999';
					if ( document.getElementsByTagName ) {
						tableCellRef.getElementsByTagName( 'a' )[0].style.color = 'black';
					}
					break;
				case 2:
				case 3:
				case 4:
					tableCellRef.style.backgroundColor = 'white';
					if ( document.getElementsByTagName ) {
						tableCellRef.getElementsByTagName( 'a' )[0].style.color = 'black';
					}
					break;
				default:
					if ( document.getElementsByTagName ) {
						tableCellRef.getElementsByTagName( 'a' )[0].style.color = '#000';
					}
			}
		}
	}
}

function navBarClick( tableCellRef, navStyle, url ) {
	navBar( tableCellRef, 0, navStyle );
	goTo( url );
}

function navBarClickExternal( tableCellRef, navStyle, url ) {
	navBar( tableCellRef, 0, navStyle );
	loadExternal( url );
}

function navBarClickNewWindow( tableCellRef, navStyle, url ) {
	navBar( tableCellRef, 0, navStyle );
	load( url );
}

function goTo( url ) {
	window.location.href = url;
}