/*
	Tab Contents
*/
function initTabMenu(tabContainerID) {
	var tabContainer = document.getElementById(tabContainerID);
	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.targetEl = document.getElementById(tabAnchor.item(i).href.split("#")[1]);
		thismenu.targetEl.style.display = "none";
		thismenu.imgEl = thismenu.getElementsByTagName("img").item(0);
		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(" on", "");
				}
			}
			this.targetEl.style.display = "";
			if (this.imgEl) {
				this.imgEl.src = this.imgEl.src.replace(".gif", "_on.gif");
			} else {
				this.className += " on";
			}
			this.container.current = this;

			return false;
		};

		if (!thismenu.container.first)
			thismenu.container.first = thismenu;
	}
	if (tabContainer.first)
		tabContainer.first.onclick();
}
/* add even row class */
function addEvenRowClass(tagName, addClass) {
	var count = 0;
	var el = document.getElementsByTagName(tagName);

	for (i=0; i<el.length; i++) {
		if (el[i]) {
			if (!(count%4-1)) {
				el[i].className = addClass;
				} else if(!(count%4-2)){
					el[i].className = addClass;
				}
			count++;
		}
	}
}

/*
	change class
*/
function changeOverRowClass(elId, tagName, searchClass){
	var el = document.getElementById(elId).getElementsByTagName(tagName);

	for (i = 0; i < el.length; i++) {
		if (el[i].className == searchClass || el[i].className == searchClass + " on") {
			el[i].onmouseover = changeOverRowClassOver;
			el[i].onmouseout = changeOverRowClassOut;
		}
	}
}
function changeOverRowClassOver(){
	if (this.className == "") {
		this.className = this.className + " on";
	}
	else {
		this.className = "on";
	}
}
function changeOverRowClassOut(){
	if (this.className == "on") {
		this.className = "";
	}
	else {
		this.className = this.className.replace(" on", "");
	}
}

/*
	Menu flash
*/
function openMenu(){document.getElementById('mnb').style.height='360'+"px";}
function closeMenu(){document.getElementById('mnb').style.height='40'+"px";}

/*
	toggle(Åä±Û)
*/
function toggleView(target){
    var sTarget = target.href.split("#");
    var aTarget = document.getElementById(sTarget[sTarget.length-1]);
    if(aTarget.style.display == "none") aTarget.style.display = "block";
    else aTarget.style.display = "none";
}

