
var toolbarScript = 
{
	init: function()
	{
		var subRows = Core.getElementsByClass("subMenu");
		var shownCells = new Array();
		var hiddenCells = new Array();
		var browser=navigator.appName
		for(i=0; i<subRows.length; i++)
		{
			var j = shownCells.length;
			if(browser=="Microsoft Internet Explorer")
			{
				shownCells[j] = subRows[i].firstChild.firstChild.firstChild;
			}
			else if(browser=="Netscape")
			{
				shownCells[j] = subRows[i].childNodes[1].firstChild.firstChild;
			};
			subRows[i].onmouseover=toolbarScript.hoverHandler;
			subRows[i].onmouseout=toolbarScript.outHandler;
		};
		for(i=0;i<subRows.length;i++)
		{
			var j=subRows[i].getElementsByTagName("td");
			for(k=1;k<j.length;k++)
			{
				nextNumber = hiddenCells.length;
				hiddenCells[nextNumber]=j[k];
			};
		};
		for(i=0;i<shownCells.length;i++)
		{
			if(browser=="Microsoft Internet Explorer")
			{
				shownCells[i].style.display="inline";
			}
			else if(browser=="Netscape")
			{
				shownCells[i].style.display="block";
			}
			shownCells[i].style.backgroundColor="SkyBlue";
			shownCells[i].firstChild.style.color="DarkRed";
			shownCells[i].onclick=toolbarScript.clickHandler;
			shownCells[i].onmouseover=toolbarScript.hoverHandler;
		};
		for(i=0;i<hiddenCells.length;i++)
		{
			hiddenCells[i].style.display="none";
			hiddenCells[i].onclick=toolbarScript.clickHandler;
		};
		var pageWidth=0;
		if(browser=="Microsoft Internet Explorer")
		{
			pageWidth=document.body.offsetWidth;
		}
		else if(browser=="Netscape")
		{
			pageWidth=screen.width;
		};
		if(pageWidth<=1000)
		{
			subRows[0].style.left=0+"px";
			subRows[1].style.left=142+"px";
			subRows[2].style.left=284+"px";
			subRows[3].style.left=426+"px";
			subRows[4].style.left=568+"px";
			subRows[5].style.left=710+"px";
			subRows[6].style.left=852+"px";
			subRows[7].style.left=0+"px";
			subRows[8].style.left=142+"px";
			subRows[9].style.left=284+"px";
			subRows[10].style.left=426+"px";
			subRows[11].style.left=568+"px";
			subRows[12].style.left=710+"px";
			subRows[13].style.left=859+"px";
		}
		else if(pageWidth>1000)
		{
			var marginWidth
			if(browser=="Microsoft Internet Explorer")
			{
				marginWidth=(pageWidth-1000)/2
			}
			else if(browser=="Netscape")
			{
				marginWidth=((pageWidth-1000)/2)-10;
			};
			subRows[0].style.left=2+marginWidth+"px";
			subRows[1].style.left=144+marginWidth+"px";
			subRows[2].style.left=286+marginWidth+"px";
			subRows[3].style.left=428+marginWidth+"px";
			subRows[4].style.left=570+marginWidth+"px";
			subRows[5].style.left=712+marginWidth+"px";
			subRows[6].style.left=854+marginWidth+"px";
			subRows[7].style.left=2+marginWidth+"px";
			subRows[8].style.left=144+marginWidth+"px";
			subRows[9].style.left=286+marginWidth+"px";
			subRows[10].style.left=428+marginWidth+"px";
			subRows[11].style.left=570+marginWidth+"px";
			subRows[12].style.left=712+marginWidth+"px";
			subRows[13].style.left=854+marginWidth+"px";
		};
		for(i=0;i<7;i++)
		{
			subRows[i].style.top="222px";
		};
		for(i=7;i<14;i++)
		{
			subRows[i].style.top="252px";
		};
	},
	clickHandler: function()
	{
		href=this.firstChild.href;
		window.location=href;
	},	
	hoverHandler: function()
	{
		browser=navigator.appName;

		if(browser=="Microsoft Internet Explorer")
		{
			this.style.zIndex=1;
			thisSubMenu=this.getElementsByTagName("td");
			for(i=1;i<thisSubMenu.length;i++)
			{
				thisSubMenu[i].style.display="inline";
			};
			thisSubMenu[0].style.backgroundColor="DarkRed";
			thisSubMenu[0].firstChild.style.color="white";
		}
		else if(browser=="Netscape")
		{
			this.style.zIndex=1;
			thisSubMenu=this.getElementsByTagName("td")
			thisSubMenu[0].style.backgroundColor="DarkRed";
			thisSubMenu[0].firstChild.style.color="white";
			thisSubMenu[0].valign="Center";
		};
	},
	outHandler: function()
	{
		var browser=navigator.appName;
		if(browser=="Microsoft Internet Explorer")
		{
			this.style.zIndex=0;
			thisSubMenu=this.getElementsByTagName("td");
			for(i=1;i<thisSubMenu.length;i++)
			{
				thisSubMenu[i].style.display="none";
			};
			thisSubMenu[0].style.backgroundColor="SkyBlue";
			thisSubMenu[0].firstChild.style.color="DarkRed";
		}
		else if(browser=="Netscape")
		{
			this.style.zIndex=0;
			thisSubMenu=this.getElementsByTagName("td");
			thisSubMenu[0].style.backgroundColor="SkyBlue";
			thisSubMenu[0].firstChild.style.color="DarkRed";
		};
	}
};
Core.start(toolbarScript);
