
var gotabs={

	subcontainers:[], last_accessed_tab:null,

	revealsubmenu:function(curtabref){
	
	this.hideallsubs()

	if (this.last_accessed_tab!=null)

		this.last_accessed_tab.className=""
	
	// Show sub-menu tab if defined for this item
	if (curtabref.getAttribute("rel"))

	document.getElementById(curtabref.getAttribute("rel")).style.display="block"
	
	curtabref.className="current"
	
	this.last_accessed_tab=curtabref
	
	},

	hideallsubs:function(){
	
	for (var i=0; i<this.subcontainers.length; i++)
		document.getElementById(this.subcontainers[i]).style.display="none"
	},

	init:function(menuId, selectedIndex){
	
	var tabItems=document.getElementById(menuId).getElementsByTagName("a")

		for (var i=0; i<tabItems.length; i++){

			if (tabItems[i].getAttribute("rel"))

				// Store sub-menu div ID for tab menu item
				this.subcontainers[this.subcontainers.length]=tabItems[i].getAttribute("rel")

			// Specialness if tab item is set as the default
			if (i==selectedIndex){

				tabItems[i].className="current"
				this.revealsubmenu(tabItems[i])
			}

		tabItems[i].onmouseover=function(){

		gotabs.revealsubmenu(this)

		}

		} //END FOR LOOP
	}

}