var NBMenu = [];

function bw_check()
{
	var is_major = parseInt(navigator.appVersion);

	this.ver=navigator.appVersion;
	this.agent=navigator.userAgent;
	this.dom=document.getElementById?1:0;
	this.opera=this.agent.indexOf("Opera")>-1;
	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom && !this.opera)?1:0;
	this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom && !this.opera)?1:0;
	this.ie4=(document.all && !this.dom && !this.opera)?1:0;
	this.ie=this.ie4||this.ie5||this.ie6;
	this.mac=this.agent.indexOf("Mac")>-1;
	this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0;
	this.ie3 = (this.ver.indexOf("MSIE") && (is_major < 4));
	this.hotjava = (this.agent.toLowerCase().indexOf('hotjava') != -1)? 1:0;
	this.ns4=(document.layers && !this.dom && !this.hotjava)?1:0;
	this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera);
	this.ver3 = (this.hotjava || this.ie3);
	return this;
}
function MenuFormat(fmt, item)
{
	this.bw = new bw_check();
	NBMenu = new Array();
	NBMenu[0] = this;
	
	this.show_description = function(item, desc, status)
	{
		var a = document.getElementById('menu' + item);
		var b = document.getElementById('desc' + desc);

		if (status==1)
		{
			a.style.color = "#404080";
			a.style.cursor = "hand";
			b.style.visibility = "visible";
		}
		else
		{
			a.style.color = "#C02040";
			b.style.visibility = "hidden";
		}
	}
	this.drawmenu = function()
	{
		var i;
		var j = this.bw.ie?(fmt.length-1):fmt.length;

		document.write('<div id="MenuDiv"><BR><BR><BR><BR><BR><BR><table border="0"><tr>');
		document.write('<td class="ImageLink" id="menu0" align="center" width="' + fmt[0][2] + '"><img src="' + fmt[0][0] + '" onmouseover="javascript:NBMenu[0].show_description(0, 0, 1)" onmouseout="javascript:NBMenu[0].show_description(0, 0, 0)" onclick="window.location=\'' + fmt[0][1] + '\'"></td>');

		for (i=1;i < j;i++)
		{
			document.write('<td class="MenuItem">|</td>');

			if (i==item)
			{
				document.write('<td class="MenuItemSolid" id="menu' + i + '" width="' + fmt[i][2] + '">' + fmt[i][0] + '</td>');
			}
			else
			{
				document.write('<td class="MenuItem" id="menu' + i + '" width="' + fmt[i][2] + '" onmouseover="javascript:NBMenu[0].show_description(' + i + ', ' + i + ', 1)" onmouseout="javascript:NBMenu[0].show_description(' + i + ', ' + i + ', 0)" onclick="window.location=\'' + fmt[i][1] + '\'">' + fmt[i][0] + '</td>');
			}
		}
		
		document.write('</tr><tr>');

		for (i=0;i < j;i++)
		{
			document.write('<td class="MenuDescription" id="desc' + i + '" width="' + fmt[i][2] + '">' + fmt[i][3] + '</td>');

			if (i<(j-1))
			{
				document.write('<td class="MenuItem">&nbsp;</td>');
			}
		}
		
		document.write('</tr></table></div>');
		
	}
	this.init = function()
	{
		this.drawmenu();
	}
	this.init();
}
window.onresize = function()
{
	document.location.reload();
}
function show_desc(item)
{
	var a = document.getElementById('td' + item);

	a.style.visibility = "visible";
}
function hide_desc(item)
{
	var a = document.getElementById('td' + item);

	a.style.visibility = "hidden";
}
function Display_Photo(Item)
{
	window.open("./photos/art of rowing/" + Item + ".htm")
}