
	// #### Generic Part: DO NOT EDIT BELOW THIS LINE #### //	

	function menu(){
		this.children = new Object();
		this.addItem = function(i, w, h, alt, href){
			this.children[i] = new menuItem(i, w, h, alt, href, document.getElementById("menuContainer"), "horizontal");
			return this.children[i];
		}
	}
	
	function menuItem(i, w, h, alt, href, parent, direction){
		this.parent = parent;
		this.children = new Object();
		this.direction = direction;
		this.iOn = new Image(); this.iOn.src = "/i/"+i+"_o.gif";
		this.iOff = new Image(); this.iOff.src = "/i/"+i+".gif";
		
		this.href = document.createElement('a'); if(href){
		this.href.setAttribute("href", href); }

		this.div = document.createElement('div');
		this.div.style.position = "absolute";
		this.div.style.visibility = "hidden"
		this.div.obj = this;
		this.div.onmouseover = openItem;
		this.div.onmouseout = closeItem;
		
		this.img = document.createElement('img');
		this.img.setAttribute("src", this.iOff.src);
		this.img.setAttribute("width", w);
		this.img.setAttribute("height", h);
		this.img.setAttribute("alt", alt);
		this.img.setAttribute("border", 0);
		this.img.obj = this;
		this.img.onmouseover = openItem;
		this.img.onmouseout = closeItem;

		this.href.appendChild(this.img);
		this.parent.appendChild(this.href);
		this.parent.appendChild(this.div);
		
		if(this.direction=="vertical"){
			var br = document.createElement('br');
			this.parent.appendChild(br);
		} 
		
		this.addItem = function(i, w, h, alt, href){
			this.children[i] = new menuItem(i, w, h, alt, href, this.div, "vertical");
			return this.children[i];
		}
	}
	
	function openItem(){
		var o = this.obj;
		var pos = getOffsetFromBody(o.img);
		var x = pos.left;
		var y = pos.top;
		
		if(o.direction=="horizontal"){ y += o.img.height; }
		else { x += o.img.width; }
		
		o.div.style.top = y;
		o.div.style.left = x;
		o.div.style.visibility = "visible";

		this.src = o.iOn.src;
	}
	
	function closeItem(){
		this.obj.div.style.visibility = "hidden";
		this.src = this.obj.iOff.src;
	}
	
	function getOffsetFromBody(o){
		var orgO = o;
		var pos = new Object(); pos.left = 0; pos.top = 0;	
		while(o){ 
			pos.left += o.offsetLeft; 
			pos.top += o.offsetTop;
			o = o.offsetParent; 
		}	
		pos.right = pos.left + orgO.offsetWidth; 
		pos.bottom = pos.top + orgO.offsetHeight;	
		return pos;
	}