﻿/**** onload event func ********/
function addLoadEvent(func){
	var oldonload = window.onload;
	if (typeof window.onload != 'function'){
		window.onload = func;
	}else{
		window.onload = function() {
			oldonload();
			func();
		}
	}
}
/**** onload event func ********/

function mainTap() {
	if(!document.getElementsByTagName) return false;
	if(!document.getElementById) return false;
	if(!document.getElementById("varBBS")) return false;
	
	document.getElementById("article2").style.display = "none";
	
	var maintab1 = document.getElementById("article1_tab");
	var maintab2 = document.getElementById("article2_tab");
	
	var mtabLink1 = maintab1.getElementsByTagName("li");
	var mtabLink2 = maintab2.getElementsByTagName("li");
		
	mtabLink1[1].onclick = function() {
		document.getElementById("article2").style.display = "block";
		document.getElementById("article1").style.display = "none";
		return false;
	}
	mtabLink2[0].onclick = function() {
		document.getElementById("article1").style.display = "block";
		document.getElementById("article2").style.display = "none";
		return false;
	}
}
addLoadEvent(mainTap);
addLoadEvent(openPopup);
