var divTimeIt;
function Menu(left, top, width, space, backgroundcolor, backgroundchange, fontsize)
{

	
	if(((navigator.appName.indexOf("Netscape") != -1)) && (parseInt(navigator.appVersion) < 5))
	{
		space = space + 2;
		left=left-3
		top = top -3
	}
	if(isaMac=="true")
	{
		if(!(agt.indexOf("msie 4.0")==-1)){ left = left +1;}
		else if(browser=="IE"){ space = space -1;}
	}
	this.top = top;
	this.left = left;	
	this.width = width;
	this.backgroundcolor = backgroundcolor;
	this.backgroundchange = backgroundchange;	
	this.fontsize = fontsize;
	this.space = space;
	this.links = new Array();
	this.totalHeightpx = this.top;	

	Menu.prototype.addStyle=function(id,bottomBorder,topBorder,leftBorder,rightBorder,padding,newWidth,newHeight) 
	{
		
		// make adjustments to divs height and width if different than default
		if(newWidth) { width = newWidth; } else { width = this.width;}
		if(newHeight)
		{
			if( (browser=="NS4")||((isaMac)&&(!(agt.indexOf("msie 4.0")==-1))) ){ newHeight=newHeight+3;}
                	var height = newHeight; 
		} 
		else { var height = this.space; }
		
		makeStyle(id,left,width,height,this.totalHeightpx,fontsize,bottomBorder,topBorder,rightBorder,leftBorder,padding)

		// this variable keeps track of the total height of the menu in pixels to know where to place next item
		this.totalHeightpx = this.totalHeightpx + height;
	}

	Menu.prototype.addDiv=function(menuParent,id,body,link,arrow,noBGChange,noBGColor) 
	{
		var num = this.links.length;
		this.links[num] = new DivEl(menuParent,window,id,body,arrow);
		this.links[num].output();

		var linkref = this.links[num];
		if((backgroundcolor) && (!(noBGColor))) 
		{ 
			this.links[num].setBgColor(backgroundcolor); 
		}

		if(link) 
		{
			this.links[num].addEventHandler("onmouseup", 
				function(d) 
				{
					window.top.location.href = link;		
				
				});
		}

		this.links[num].addEventHandler("onmouseover", 
				function(d) 
				{
					if((backgroundchange) && !(noBGChange)) { d.setBgColor(backgroundchange); }
					if(link)
					{
						window.status = link; 
						d.setCursor("hand");
					}
					clearTimeout(divTimeIt);
			
				});
		this.links[num].addEventHandler("onmouseout", 				
				function(d) 
				{
					if((backgroundcolor) && (!(noBGColor))) { d.setBgColor(backgroundcolor); }
					window.status = "";
					menuHide = d.menuParent + ".hide()";
					divTimeIt = setTimeout(menuHide, 500);
				});
	

	} // end addDiv


	Menu.prototype.hide = function()
	{	
		for(var i=0; i < this.links.length; i++)
		{
			this.links[i].hide();
		} 
			
	}

	Menu.prototype.show = function()
	{
		for(var i=0; i < this.links.length; i++)
		{
		this.links[i].show();
		} 		
	}


}
	
// to squash Netscape resize bug
Netscape4 = (document.layers) ? true : false;
if(Netscape4)
{        
        window.captureEvents(Event.RESIZE);
        window.onresize = HandleResize;
}                       
                 
function HandleResize()                 
{                
        location.reload();         
        return false;
}  

