// Popup Zone Script Start

	var popupItemCount;
	var popupZoneVal    = 0;
	var popupZoneTmpVal = 0;
	var popupZoneArea;
	var popupZoneButton;
	var autocontrolvar;

	function startPopupZone()
	{
		for(i=1;i<=popupItemCount;i++)
		{
			if(popupZoneTmpVal!=1)
			{
				popupZoneVal = popupZoneTmpVal;
				popupZoneTmpVal = 1;
			}

			if(popupZoneVal == popupItemCount+1)	popupZoneVal = 1;
			if(popupZoneVal==0) popupZoneVal = 1;

			id1 = popupZoneArea + i;
			id2 = popupZoneButton + i;

			if(popupZoneVal==i)
			{
				document.getElementById(id1).setAttribute('src',"/img/btn/popup_0"+i+"_on.gif");
				document.getElementById(id2).style.display	= "";
			}
			else
			{
				document.getElementById(id1).setAttribute('src',"/img/btn/popup_0"+i+"_off.gif");
				document.getElementById(id2).style.display	= "none";
			}
		}

		popupZoneVal = popupZoneVal + 1;
		autocontrolvar=setTimeout("startPopupZone()",5000);
	}

	function popupZoneStop(chk)
	{
		if(chk)	clearTimeout(autocontrolvar);
		else
		{
			clearTimeout(autocontrolvar);
			startPopupZone();
		}
	}

	function popupZoneMove(num)
	{
		for(i=1;i<=popupItemCount;i++)
		{
			id1 = popupZoneArea+i
			id2 = popupZoneButton+i

			if(num==i)
			{
				document.getElementById(id1).setAttribute('src',"/img/btn/popup_0"+i+"_on.gif");
				document.getElementById(id2).style.display	= "";
			}
			else
			{
				document.getElementById(id1).setAttribute('src',"/img/btn/popup_0"+i+"_off.gif");
				document.getElementById(id2).style.display	= "none";
			}
		}

		popupZoneVal = num;
		popupZoneTmpVal = num;
		popupZoneStop(1);
	}

	function setPopupZoneInt(cnt,popupArea,popupButton)
	{
		popupItemCount = cnt;
		popupZoneArea = popupArea;
		popupZoneButton = popupButton;
	}

// Popup Zone Script End


/* //이미지홍보  */

//### 메인 탭용
/**** 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("main-col")) return false;
	
	document.getElementById("main-col").style.display="none";

	var mtab1=document.getElementById("article-tab1");
	var mtab2=document.getElementById("article-tab2");

	var links1 = mtab1.getElementsByTagName("li");
	var links2 = mtab2.getElementsByTagName("li");

	for(var i=0;i< links1.length;i++)
	{

		if(links1[i].className=="m_tab2 deselected")
		{
			links1[i].onclick=function(){
					document.getElementById("main-col").style.display="block";
					document.getElementById("main-pds").style.display="none";
					document.getElementById("pro").focus();
					return false;
			}
		}
		

	}


	for(var i=0;i< links2.length;i++)
	{
		
		
		if(links2[i].className=="m_tab1 deselected")
		{
			links2[i].onclick=function(){

					document.getElementById("main-pds").style.display="block";
					document.getElementById("main-col").style.display="none";
					document.getElementById("psd").focus();
					return false;
			}
		}
	}

}

addLoadEvent(mainTap);

