function Menu(SM){

//	junk specific to this menu.
//	this will be cleaned and accessed properly
//	in the next version

	this.xpos = new Array();
	
	this.xpos['menu1'] = 365;
	this.xpos['menu2'] = 430;
	this.xpos['menu3'] = 610;
	this.xpos['menu4'] = 102;
	this.xpos['menu5'] = 189;

	this.y = 45;

//	INSTANCE VARIABLES
	//	my stylemanager is SM
	this.SM = SM;

	//	is the menu gonna drop over flash content?
	this.MENU_IS_OVER_FLASH = false;

	//	what is the id of the div flash is going in?
	this.flashDiv = 'flashDiv';

	//	how many menus are there?
	this.numMenus = 0;

	//	strings for css visibility property
	//	just in case these need to change, i
	//	made them vars
	this.hidden = 'hidden';
	this.visible = 'visible';

	//	array of visibilities
	this.visArray = new Array(this.hidden,this.visible);

	this.menuList = new Array();

//	METHOD IMPLEMENTATIONS
	this.addMenu = function(m){
		var count = this.menuList.length;
		this.menuList[count] = m;
	}


	//	is this menu gonna drop over flash?
	//	call only if so
	this.menuIsOverFlash=function(){
		this.MENU_IS_OVER_FLASH = 1;
	}

	//	getter for the above prop
	this.isMenuOverFlash=function(){
		return this.MENU_IS_OVER_FLASH;
	}


	this.show = function(menuId, eventObj) {
		if(this.timeout_hide){clearTimeout(this.timeout_hide);}
		if(this.timeout_toggleflash){clearTimeout(this.timeout_toggleflash);}
		if(this.menuIsOut != menuId){
			this.hide();
			this.menuIsOut = menuId;
		}

		//	test for DHTML compatibility
		if(this.SM.getStyle(menuId)){
			// flash hiding here?
			if(this.isMenuOverFlash()) this.toggleFlash(0);

			var ie5 = (document.getElementById && document.all);
			var ns6 = (document.getElementById && !document.all);

			// Sudden Industries
			// 4.30.04
			// Make menu positioning for a site positioned in the upper left instead of centered
			// var x = (ie5 || ns6) ? ( Math.abs((document.body.offsetWidth - 695)/2) + this.xpos[menuId] ) : (Math.abs((window.innerWidth - 695)/2) + this.xpos[menuId]);
			var x = this.xpos[menuId]
			
			this.SM.setLocOfObj(menuId, x, this.y);

			if(this.SM.setVisOfObj(menuId, this.visible)) {
				eventObj.cancelBubble = true;
				return true;
			} else {
				return false;
			}
		}
	}

	this.hide = function() {
		for(var counter = 0; counter < this.menuList.length; counter++) {
			var currMenu = this.menuList[counter];
			this.SM.setVisOfObj(currMenu, this.hidden);
		}
		//	 no menu is out right now, so...
		this.menuIsOut = null;
	}

	this.mOver = function(menu,e){
		this.show(menu,e);
	}

	this.mOut = function(){
		this.timeout_hide = setTimeout('hideAll();',1000);
		if(this.isMenuOverFlash()) this.timeout_toggleflash = setTimeout("myMenu.toggleFlash(1);",1000);
	}

	this.toggleFlash=function(bool) {
		this.SM.setVisOfObj(this.flashDiv, this.visArray[bool]);
		(bool==0)?this.SM.setYLocOfObj(this.flashDiv,"-300"):this.SM.setYLocOfObj(this.flashDiv,"0");
		var style = this.SM.getStyle(this.flashDiv);
	}

	this.getName = function(){
		return this.name;
	}

	this.init = function(n){
		//	if on mac ie, reset all the methods
		//	this is a hack, and a quick fix, but
		//	whatever, mac ie sucks.
		this.name = n;

		var mac = navigator.appVersion.indexOf("Mac");
		if (mac>=0) {mac=1} else {mac=0}
	
		if (navigator.appVersion.indexOf("MSIE")!=-1){
			var ie=1;
		}

		if(mac&&ie) document.MACIE = 1;

		eval("window.hideAll = function(){"+this.getName()+".hide();}");
		document.onclick = window.hideAll;
	}
}

