function tabContents(tabContainerID, tagName) {

	var tabContainer = document.getElementById(tabContainerID);
	var tabAnchor = tabContainer.getElementsByTagName(tagName);

	var i = 0;

	for(i=0; i<tabAnchor.length; i++) {
		if (tabAnchor.item(i).className == "tablist")
			thismenu = tabAnchor.item(i);
		else
			continue;
		thismenu.container = tabContainer;
		thismenu.targetEl = document.getElementById(tabAnchor.item(i).href.split("#")[1]);
		thismenu.targetEl.style.display = "none";
		thismenu.imgEl = thismenu.getElementsByTagName("img").item(0);

		(thismenu.parentElement?thismenu.parentElement:thismenu.parentNode).style.position = "absolute";
		thismenu.onclick = function tabMenuClick() {
			currentmenu = this.container.current;
			if (currentmenu == this)
				return false;
			if (currentmenu) {
				currentmenu.targetEl.style.display = "none";
				if (currentmenu.imgEl) {
					currentmenu.imgEl.src = currentmenu.imgEl.src.replace(/_on\.gif$/, '.gif');
				} else {
					currentmenu.className = currentmenu.className.replace(" selected", "");
				}
			}
			this.targetEl.style.display = "";
			if (this.imgEl) {
				this.imgEl.src = this.imgEl.src.replace(/\.gif$/, '_on.gif');
			} else {
				this.className += " selected";
			}
			this.container.current = this;
			return false;
		};
		if (!thismenu.container.first) thismenu.container.first = thismenu;
	}
	if (tabContainer.first)	tabContainer.first.onclick();
}

/* rolloverimg */
function rollOverImg(elId, tagName) {
	var el = document.getElementById(elId).getElementsByTagName(tagName);
	for (i=0; i<el.length; i++) {
		  if (el[i].src.substring(el[i].src.indexOf(".gif"))
				||el[i].src.substring(el[i].src.indexOf("_on.gif"))) {
				el[i].onmouseover = changeOver;
				el[i].onmouseout = changeOut;
		}
	}
}
function changeOver() {
	this.src=this.src.replace(".gif", "_on.gif");
}
function changeOut() {
  this.src=this.src.replace("_on.gif", ".gif");
}
