/*********************************************************************************************************
	onload function
**********************************************************************************************************/
function addLoadEvent(func) {
	var oldonload = window.onload;
	if (typeof window.onload != 'function') {
		window.onload = func;
	} else {
		window.onload = function() {
			oldonload();
			func();
		}
	}
}


// ¸ÞÀÎ ÅÇ °Ô½ÃÆÇ
function mainTabShowHide(param,showElement){
	if(!document.getElementsByTagName) return false;
	if(!document.getElementById) return false;
	if(!document.getElementById("mainBoard")) return false;

	var mainBoard = document.getElementById("mainBoard");
	var subLi = mainBoard.getElementsByTagName("li");
	var subBoard = mainBoard.getElementsByTagName("table");

	tabimg = new Array(2);
	tabimg[0] = document.getElementById("tabImg01");
	tabimg[1] = document.getElementById("tabImg02");
	//tabimg[2] = document.getElementById("tabImg03");

	for(var i=0; i<subBoard.length; i++){
		tabimg[i].setAttribute("src","/images/main/main_bbs_tab0" + (i+1) + ".gif");
		subBoard[i].style.display = "none";
		subLi[i].style.zIndex = "1";
	}

	if(showElement){
		tabimg[param-1].setAttribute("src","/images/main/main_bbs_tab0" + param + "_on.gif");
		subBoard[param-1].style.display = "block";
		subLi[param-1].style.zIndex = "10";
	} else {
		document.getElementById("tabImg01").setAttribute("src","/images/main/main_bbs_tab01_on.gif");
		subBoard[0].style.display = "block";
		subLi[0].style.zIndex = "10";
	}
}
addLoadEvent(mainTabShowHide);
