function el(elid)
{
	return document.getElementById(elid);
}
//menu object
function MenuObj()
{
	this.subs = new Array();
	
}

var _menu = new MenuObj();

MenuObj.prototype.loadEm = function (num)
{	
	//number string to array
	this.subs[this.subs.length] = num;	
	
	//hide div while loading--eliminates non-js browsers
	this.hideSub(num);
		
}

MenuObj.prototype.hideSub = function (num)
{
	//concat div ids
	var dv = "menu_" + num;
	
	//hide div
	el(dv).style.display = "none";
	
}

MenuObj.prototype.showSub = function (num,lpos)
{
	//concat div
	var dv = "menu_" + num;
	var hd = 'head_' + num;
	for(var i=0; i<this.subs.length; i++)
	{
		this.hideSub(this.subs[i]);
	}
	
	//show div
	el(dv).style.display = "block";
	el(dv).style.left = lpos + "px";
	/*if(document.all)
	{
		el(dv).style.left = el(hd).offsetLeft + ((document.body.offsetWidth - 750)/2) + 'px';
	}*/
}

MenuObj.prototype.togSub = function (num)
{
	var dv = "menu_" + num;
	
	//if hidden, show, if showing, hide
	if(el(dv).style.display=='block') this.hideSub(num);
	else
		this.showSub(num);
}

MenuObj.prototype.setHere = function (here)
{
	//highlight current sublink
	var alinks = el('navbar').getElementsByTagName('a');
	//cycle through array of links, check for match
	for(var i=0; i<alinks.length; i++)
	{
		
		if(here==alinks[i].firstChild.nodeValue)
		{
			//set highlight color
			alinks[i].className='here';
		}
	}
}
