var HiddenMenus = new Array();

function HiddenMenu(id, objectID)
{
	this.id = id;
	this.objectID = objectID;
	HiddenMenus[HiddenMenus.length] = this;
	this.off = 6;
	if(navigator != null && navigator.userAgent != null)
		if(navigator.userAgent.indexOf('MSIE') > -1 && navigator.userAgent.indexOf('MSIE 7.') == -1)
		{
			this.off = 2;
		}
	return this;
}
HiddenMenu.prototype.Display = function()
{
	this.visible = true;
	this.evt = (window.event ? window.event : arguments.callee.caller.arguments[0]);
	this.src = (this.evt.srcElement ? this.evt.srcElement : this.evt.target)
	
	this.src.parentNode.parentNode.parentNode.childNodes[0].src = '/img/LeftNavArrowdown.gif'
	for(i = 0; i < HiddenMenus.length; i++)
	{
		if(HiddenMenus[i] != this)
		{
			HiddenMenus[i].visible = false;
			HiddenMenus[i].DoHide();
		}
	}
	setTimeout(this.id + '.DoDisplay()', 500);
}
HiddenMenu.prototype.DoDisplay = function(e)
{
	var top, height;
	
	if(this.visible && (!this.obj || this.obj.style.display != 'inline'))
	{
		var evt = this.evt;
		var win = GetWindowInfo();
		var objInfo, srcInfo;
	
		if(evt)
		{
			this.obj = document.getElementById(this.objectID);
			srcInfo = GetObjectInfo(this.src);
			this.obj.style.top = (srcInfo.top + 1) + 'px';
			this.obj.style.left = (srcInfo.left + 200) + 'px';
			this.obj.style.width = '0px';
			this.Expand();	
			this.obj.style.display = 'inline';
			objInfo = GetObjectInfo(this.obj);
			
			if(objInfo.top + objInfo.height > win.top + win.height)
				this.obj.style.top = (srcInfo.top + srcInfo.height - objInfo.height - this.off) + 'px';
				
			if(this.off == 2)
			{
				if(this.obj.insertAdjacentHTML)
				{
					this.iframe = document.getElementById(this.objectID + '_iframe');
					if(this.iframe == null)
					{
						this.obj.insertAdjacentHTML("afterEnd", '<IFRAME style="position: absolute;height:0;width:0;z-index:4;" src="javascript:false;" frameBorder="0" scrolling="no" id="' + this.objectID + '_iframe" />');
						this.iframe = document.getElementById(this.objectID + '_iframe');
					}
					this.iframe.style.top = this.obj.style.top;
					this.iframe.style.left = this.obj.style.left
					this.iframe.style.width = this.obj.offsetWidth;
					this.iframe.style.height = this.obj.offsetHeight;
				}
			}
		}
	}
}
HiddenMenu.prototype.Show = function()
{
	this.visible = true;
	return true;
}
HiddenMenu.prototype.Hide = function()
{
	this.visible = false;
	setTimeout(this.id + '.DoHide()', 150);
}
HiddenMenu.prototype.DoHide = function()
{
	if(!this.visible)
	{
		if(this.src)
			this.src.parentNode.parentNode.parentNode.childNodes[0].src = '/img/LeftNavArrowdown.gif'
		if(this.off == 2)
		{
			var iframe = document.getElementById(this.objectID + '_iframe');
			if(iframe != null)
				document.getElementById(this.objectID).parentNode.removeChild(iframe);
		}
		document.getElementById(this.objectID).style.display = 'none';
	}
}
HiddenMenu.prototype.Expand = function()
{
	if(parseInt(this.obj.style.width, 10) < 200)
	{
		this.obj.style.width = (parseInt(this.obj.style.width, 10) + 40) + 'px';
		if(this.off == 2)
		{
			if(this.iframe != null)
			{
				this.iframe.style.width = this.obj.offsetWidth;
				this.iframe.style.height = this.obj.offsetHeight;
			}
		}
		setTimeout(this.id + '.Expand()', 5);
	}
}
