	function lib_bwcheck()
	{ 
		this.ver=navigator.appVersion
		this.agent=navigator.userAgent
		this.dom=document.getElementById?1:0
		this.opera5=this.agent.indexOf("Opera 5")>-1
		this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom && !this.opera5)?1:0; 
		this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom && !this.opera5)?1:0;
		this.ie4=(document.all && !this.dom && !this.opera5)?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.ns4=(document.layers && !this.dom)?1:0;
		this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5)
		return this
	}

	var bw = new lib_bwcheck();
	var scrollTim = 1;
	var autoID = 0;
	var stopID = 0;
	var active = 0;
	var timSpeed = 50;
	var autoTimSpeed = 30;
	var contHeight = 280;
	var autoContHeight = 0;
	var speed = 50;
	var autoSpeed = -1;
	var available_width = 800;
	var available_height = 600;

	var dontRun = false;
	
	function makeScrollObj(obj,nest)
	{
		nest=(!nest) ? "":'document.'+nest+'.'	
		this.el=bw.dom?document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?eval(nest+'document.'+obj):0;
		this.css=bw.dom?document.getElementById(obj).style:bw.ie4?document.all[obj].style:bw.ns4?eval(nest+'document.'+obj):0;
		this.height=bw.ns4?this.css.document.height:this.el.offsetHeight
		this.top=b_gettop										
		return this
	}

	var px = bw.ns4||window.opera?"":"px";

	function b_gettop()
	{
		var gleft=(bw.ns4 || bw.ns6)?parseInt(this.css.top):eval(this.css.pixelTop);
		return gleft;
	}
	
	var px = bw.ns4||window.opera?"":"px";

	function nm_over(cell, style) 
	{     
		if (dontRun == true)
		{
			if (style != "")
			{
				cell.className = style;
			}
			else
			{
				cell.className = "highlight";
			}
		}
	}

	function nm_out(cell, style) 
	{
		if (dontRun == true)
		{
			if (style != "")
			{
				cell.className = style;
			}
			else
			{
				cell.className = "unHighlight";
			}
		}
	}
	
	function menuInit()
	{

		oMenuArea	 = new Array()
		oMenuArea[0] = new makeScrollObj('menuArea')

		oDynMenu	 = new Array()

		oDynMenu[0]  = new makeScrollObj('dynMenu0')
		oDynMenu[1]  = new makeScrollObj('dynMenu1')

		//Update this if you add another dynamic menu!!!
		dynMenuCount = 1;

		dontRun = true;

		alignToImage(0);

	}

	function alignToImage(num)
	{
		el = document["grains"];
	
		xPos = el.offsetLeft;
	    tempEl = el.offsetParent;
		while (tempEl != null) 
		{
			xPos += tempEl.offsetLeft;
	        tempEl = tempEl.offsetParent;
		}
	
		yPos = el.offsetTop;
	    tempEl = el.offsetParent;
		while (tempEl != null) 
		{
			yPos += tempEl.offsetTop;
	        tempEl = tempEl.offsetParent;
		}

		oDynMenu[num].css.left = xPos + 90;
		oMenuArea[0].css.left = xPos + 12;
		
		if (num == 0)
		{
			oDynMenu[num].css.top = yPos + 36;
			oMenuArea[0].css.top = yPos + 9;
		}
		else
		{
			oDynMenu[num].css.top = yPos + 62;
			oMenuArea[0].css.top = yPos + 9;
		}

	}

	//Dynamic menus functions
	function showDynMenu(num)
	{
		if (dontRun == true)
		{
			oDynMenu[num].css.visibility = "visible";

			for (i=0;i<=dynMenuCount;i++)
			{
				if (i != num)
				{
					oDynMenu[i].css.visibility = "hidden";
				}
			}
		}
	}

	function hideDynMenu(num)
	{
		if (dontRun == true)
		{
			oDynMenu[num].css.visibility = "hidden";
		}
	}

	function delayedhideDynMenu(num)
	{
		if (dontRun == true)
		{
			oDynMenu[num].timeoutID = setTimeout("hideDynMenu("+num+")",2000);
		}
	}

	function cancelTimeOut(num)
	{
		if (dontRun == true)
		{
			clearTimeout(oDynMenu[num].timeoutID);
		}
	}
