// Tab Content
function initTabMenu(tabContainerID) {
	var tabContainer = document.getElementById(tabContainerID);
	var tabLiContainer = tabContainer.getElementsByTagName("li");

	var tabAnchor = tabContainer.getElementsByTagName("a");
	var i = 0;

	for(i=0; i<tabAnchor.length; i++)
	{
		if (tabAnchor.item(i).className == "tab")
		{
			thismenu = tabAnchor.item(i);
		}
		else
			continue;

		thismenu.container = tabContainer;
		thismenu.containerli = tabLiContainer;
		thismenu.targetEl = document.getElementById(tabAnchor.item(i).href.split("#")[1]);
		thismenu.targetEl.style.display = "none";
		thismenu.imgEl = thismenu.getElementsByTagName("img").item(0);
		thismenu.liEl  = tabContainer.getElementsByTagName("li").item(0);

		if (thismenu.imgEl) {
			thismenu.onfocus = function () {
				//this.onfocus();
			}
		}
		thismenu.onmouseover = thismenu.onfocus = tabMenuOver;

		if (!thismenu.container.first)
			thismenu.container.first = thismenu;
	}

	tabContainer.first.onmouseover();
}

function tabMenuOver() {
	currentmenu = this.container.current;


	if (currentmenu != this) {
		if (currentmenu)
		{
			currentmenu.targetEl.style.display = "none";

			if (currentmenu.imgEl) {
				currentmenu.imgEl.src = currentmenu.imgEl.src.replace("_ov.gif", ".gif");
			} else {
				currentmenu.className = currentmenu.className.replace(" on", "");
			}
		}


		this.targetEl.style.display = "block";

		current_num = this.targetEl.id.substring(this.targetEl.id.length, this.targetEl.id.length - 1);

		for(j=0; j < this.containerli.length; j++)
		{
			if(current_num-1 == j)
			{
				this.containerli[j].className = "on"
			}
			else
			{
				this.containerli[j].className = ""
			}
		}

		if (this.imgEl) {
			this.imgEl.src = this.imgEl.src.replace(".gif", "_ov.gif");
		} else {

			this.className += " on";
		}
		this.container.current = this;
	}
	return false;
}