function changeImages()
	{
	if (document.images)
		{
		document.getElementById(this.o).src = this.oImg;
		}
	}

function cancelHide()
	{
	if (this.tid) clearTimeout(this.tid);
	}

function show()
	{
	this.cancelHide();
	
	if (prevMenu && prevMenu!=this.oID)
		{
		eval(prevMenu+"Obj.hideCallback();");
		eval(prevMenu+"Obj.cancelHide();");
		}
	
	prevMenu = this.oID;
	document.getElementById(this.oID).style.visibility = "visible";
	this.oImg = "images/new/" + this.o + "_on"+this.ext;
	this.changeImages();
	}

function hide()
	{
	this.tid = eval("setTimeout('"+this.oID+"Obj.hideCallback()', 250);");
	}

function hideCallback()
	{
	document.getElementById(this.oID).style.visibility = 'hidden';
	this.oImg = "images/new/" + this.o + this.ext;
	this.changeImages();
	}

function mmAlign(edge, v) {
	var h; var w; var d = document.getElementById(this.oID);
	if (navigator.appName=="Microsoft Internet Explorer") {
		h = d.clientHeight; //msie
		w = d.clientWidth;
	} else {
		h = d.scrollHeight; //others
		w = d.scrollWidth;
	}
	if (edge=="top") {
		d.style.top = v+"px";
	} else if (edge=="right") {
		v = v-w;
		d.style.left = v+"px";
	} else if (edge=="bottom") {
		v = v-h;
		d.style.top = v+"px";
	} else if (edge=="left") {
		d.style.left = v+"px";
	} else {
		return false;
	}
}

//first object attempt
function menuMaker(oID, o)
	{
	//properties
	this.oID = oID;
	this.o = o;
	this.oImg;
	this.tid;
	this.ext = ".gif";
	
	//methods
	this.show = show;
	this.hide = hide;
	this.hideCallback = hideCallback;
	this.cancelHide = cancelHide;
	this.changeImages = changeImages;
	this.align = mmAlign;
	}