// Tab Content
function initTabMenu(tabContainerID)
{
	var tabContainer = document.getElementById(tabContainerID);
	var tabAnchor = tabContainer.getElementsByTagName("a");
	var i = 0;
	var tabClassName;
	
	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(".gif", "_off.gif");
				} else
				{
					currentmenu.parentNode.parentNode.className = "";
				}
			}
			
			this.targetEl.style.display = "";
			if (this.imgEl)
			{
				this.imgEl.src = this.imgEl.src.replace("_off.gif", ".gif");
			} else
			{
				this.parentNode.parentNode.className = "sel";
			}
			this.container.current = this;

			return false;
		};

		if (!thismenu.container.first)
			thismenu.container.first = thismenu;
	}
	if (tabContainer.first)
		tabContainer.first.onclick();
}

var tab_rolling = true;
var tab_play = true;
var tabCnt;
function initTabMenu2(tabContainerID, tabClassName, cnt)
{
	var tabContainer = document.getElementById(tabContainerID);
	var tabAnchor = tabContainer.getElementsByTagName("a");
	var i = 0;
	var j = 1;
	var tabClassName;
	tabCnt = cnt;
	tabContainer.onmouseover=function()
	{
		tab_rolling = false;
	}
	tabContainer.onmouseout=function()
	{
		tab_rolling = true;
	}
	
	for(i=0; i<tabAnchor.length; i++)
	{
		if (tabAnchor.item(i).className == tabClassName)
			thismenu = tabAnchor.item(i);
		else if(tabAnchor.item(i).className == "rollingBtn")
		{
			tabAnchor.item(i).onclick = function rollingClick()
			{
				for(j=1; j<tabCnt; j++) {
					var nm = "tab3_"+j;
					document.getElementById(nm).style.display = "none";
				}
				//document.getElementById("tab3_2").style.display = "none";
				//document.getElementById("tab3_3").style.display = "none";
				var targetEl = document.getElementById(this.href.split("#")[1]).style.display = "";
				return false;
			}
			continue;
		}else if(tabAnchor.item(i).className == "stopBtn")
		{
			tabAnchor.item(i).onclick=function()
			{
				tab_play = !tab_play;
				//alert(this.getElementsByTagName("img").item(0).src);
				var tabImgSrc; 
				if(tab_play)
					tabImgSrc = this.getElementsByTagName("img").item(0).src.replace("_stop.gif", ".gif");
				else
					tabImgSrc = this.getElementsByTagName("img").item(0).src.replace(".gif", "_stop.gif");
				
				for(j=1; j<tabCnt; j++) {
					var nm = "playstopBtn"+j;
					document.getElementById(nm).src = tabImgSrc;
				}
				//document.getElementById("playstopBtn"+(String)j).src = tabImgSrc;
				//document.getElementById("playstopBtn2").src = tabImgSrc;
				//document.getElementById("playstopBtn3").src = tabImgSrc;
				
				
				//alert(this.getElementsByTagName("img").item(0).src);
				return false;
			}
			continue;
		}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()
		{
			for(j=1; j<tabCnt; j++) {
				var nm = "tab3_"+j;
				document.getElementById(nm).style.display = "none";
			}
			//document.getElementById("tab3_2").style.display = "none";
			//document.getElementById("tab3_3").style.display = "none";
			var targetEl = document.getElementById(this.href.split("#")[1]).style.display = "";

			return false;
		};

		if (!thismenu.container.first)
		{
			thismenu.container.first = thismenu;
		}
	}
	//if (tabContainer.first)
	//	tabContainer.first.onclick();
	document.getElementById("tab3_1").style.display = "";
	for(j=2; j<tabCnt; j++) {
		var nm = "tab3_"+j;
		document.getElementById(nm).style.display = "none";
	}
	//document.getElementById("tab3_3").style.display = "none";
	
	//초 설정 단위 : 1/1000초 
	this.time_timer = setInterval(tabRolling, 5*1000);
}
function tabRolling()
{
	if(!tab_rolling) return;
	if(!tab_play) return;

	var currentCnt = 1;
	for(j=1; j<tabCnt; j++) {
		var nm = "tab3_"+j;
		if( document.getElementById(nm).style.display == "" )
		{
			currentCnt = j;
			break;
		}
	}
	
	var next	= currentCnt == tabCnt-1 ? 1 : currentCnt+1;

	for(j=1; j<tabCnt; j++) {
		var nm = "tab3_"+j;
		if( j==currentCnt )
		{
			document.getElementById(nm).style.display = "none";
		}
		else if( j==next) {
			document.getElementById(nm).style.display = "";			
		}
		else
			document.getElementById(nm).style.display = "none";
			
	}
}
<!--
// 탑메뉴 클릭시
//-->
function openLink(siteUrl){
	window.open(siteUrl);
}