

//¸ÞÀÎ_°Ô½ÃÆÇ
	function tabpage(str){
		for (i=1;i<=3;i++){
			document.getElementById('tabpage'+i).style.display="none";
			document.getElementById('tabh4'+i).className="tab"+'_link'+i+"_out";
		}
		document.getElementById('tabpage'+str).style.display="block";
	}
	function tabpane(){
		for (i=1;i<=3;i++){	
			document.getElementById('tabh4'+i).onclick=function(e) {
				tabpage(this.id.charAt(5));
				this.className=this.id;
			}
			document.getElementById('tabh4'+i).onfocus=function(e) {
				tabpage(this.id.charAt(5));
				this.className=this.id;
			}
		}
	}
	function intwebpage(){
		tabpane();
	}

// ¾Ë¸²ÆÇ ¹è³Ê

function mainBoardChange(idx)
{
	var obj;
	var obj3;
	
	for (var z=1; z<=5; z++){
		obj = document.getElementById('mainBoard' + z);    
		obj3 = document.getElementById('bImg' + z);                
		if ( typeof(obj) != "undefined" )
		{
			
			if (z == idx){                
				obj.className="";
				//obj2.className="more";
				obj3.className = "b0"+z +"_on";
			} else {
				obj.className="hid";
				//obj2.className="more_hid";
				obj3.className ="b0"+z +"_off";				
			}
		}
	}
}

var k=0;
var gbn = true;
var setLocation = setInterval("imgLocation()",4000);
function imgLocation(){
	
	if(!gbn){
		setLocation = setInterval("imgLocation()",4000);
	}
	gbn = true;
	mainBoardChange(k+1);
	k++;
	if(k==5){
		k = 0;
	}
}

function imgStop(){
	clearInterval(setLocation);
	gbn = false;

}


//ÀüÃ¼¹è³Ê

	var sliderwidth="565px"  //½ºÅ©·Ñ °¡·Î »çÀÌÁî
	var sliderheight="45px"  //½ºÅ©·Ñ ¼¼·Î »çÀÌÁî
	var slidespeed="1"
	var slidebgcolor="#ffffff"  //½ºÅ©·Ñ ¹è°æ »ö»ó

	var leftarrowimage = "/images/main/banner_pre.gif"
	var rightarrowimage = "/images/main/banner_next.gif"
	var playarrowimage = "/images/main/bt_play.gif"
	var stoparrowimage = "/images/main/bt_stop.gif"

	var leftrightslide=new Array()
	var finalslide=''

	var popup_url = new Array("/popup/pop_0430.asp", "/popup/pop_0514_02.asp");
	var popup_name = new Array("popup1", "popup2");
	var popup_width = new Array("500", "570");
	var popup_height = new Array("605", "550");


	leftrightslide[0]='<a href="http://www.teen.go.kr/Main.do" target="_blank"><img src="/images/main/banner_img01.gif" alt="¼±³²¼±³à : »õÃ¢" /></a>'                                
	leftrightslide[1]='<a href="http://www.nec.go.kr:8088/index.jsp" target="_blank"><img src="/images/main/banner_img13.jpg" alt="Á¤Ä¡ÀÚ±Ý ±âºÎ¼¾ÅÍ : »õÃ¢"" /></a>'        
	leftrightslide[2]='<a href="http://town.cyworld.com/cybergamsi" target="_blank"><img src="/images/main/banner_img05.gif" alt="»çÀÌ¹ö¼±°Å ºÎÁ¤°¨½Ã´Ü : »õÃ¢" /></a>'     
	leftrightslide[3]='<a href="http://www.civilzine.or.kr/" target="_blank"><img src="/images/main/banner_img06.gif" alt="À¥Áø : »õÃ¢" /></a>'                                               
	leftrightslide[4]='<a href="/popup/pop_0120.html" target="_blank" onclick="popupConfig();return false;"><img src="/images/main/banner_img07.gif" alt="¼±°Å¹ýÀ§¹ÝÇàÀ§_½Å°íÇÏ¸éÆ÷»ó±Ý ÃÖ°í 5¾ï¿ø : »õÃ¢" /></a>'      
	leftrightslide[5]='<a onclick=mainPopup("'+popup_url[0]+'","'+popup_name[0]+'","'+popup_width[0]+'","'+popup_height[0]+'");return false; style="cursor:pointer"><img src="/images/main/banner_img14.gif" alt="¼±°Å¹Ú¹°ÀÚ·á¸¦ ¼öÁýÇÕ´Ï´Ù.±¹¹Î¿©·¯ºÐÀÇ Àû±ØÀûÀÎ Âü¿©¿Í ÇùÁ¶¸¦ ºÎÅ¹µå¸³´Ï´Ù." /></a>'
	leftrightslide[6]='<a onclick=mainPopup("'+popup_url[1]+'","'+popup_name[1]+'","'+popup_width[1]+'","'+popup_height[1]+'");return false; style="cursor:pointer;"><img src="/images/main/banner_img19.gif" alt="¼±°ÅÄ·ÆäÀÎ-Á¤Ä¡ÈÄ¿ø±Ý ¹Ù·Î¾Ë°í ÈÄ¿øÇÏ¼¼¿ä" /></a>'
	leftrightslide[7]='<a href="http://party.nec.go.kr" target="_blank"><img src="/images/main/banner_img20.gif" alt="Á¤´çÁ¤º¸½Ã½ºÅÛ : »õÃ¢" /></a>'      
	leftrightslide[8]='<a href="http://ok.nec.go.kr" target="_blank"><img src="/images/main/banner_img21.jpg" width="139" height="45" alt="Àç¿Ü¼±°Å È¨ÆäÀÌÁö : »õÃ¢" /></a>'
	leftrightslide[9]='<a href="http://me2day.net/nec" target="_blank"><img src="/images/main/banner_img24.jpg" width="139" height="45" alt="¹ÌÅõµ¥ÀÌ : »õÃ¢" /></a>'
	leftrightslide[10]='<a href="http://www.give.go.kr" target="_blank"><img src="/images/main/banner_img26.gif" alt="Á¤Ä¡ÈÄ¿ø±Ý ±âºÎÇÏ±â" /></a>'
	leftrightslide[11]='<a href="http://epol.nec.go.kr " target="_blank"><img src="/images/main/banner_img27.gif" alt="±ú²ýÇÑ ¼±°Å" /></a>'

	var imagegap=""
	var slideshowgap=0

	var copyspeed=slidespeed
			leftrightslide='<nobr>'+leftrightslide.join(imagegap)+'</nobr>'
	var iedom=document.all||document.getElementById
	var actualwidth=''
	var cross_slide, ns_slide
	var righttime,lefttime,stop,play

	function fillup()
	{
			if (iedom)
			{
					cross_slide=document.getElementById? document.getElementById("test2") : document.all.test2
					cross_slide2=document.getElementById? document.getElementById("test3") : document.all.test3
					cross_slide.innerHTML=cross_slide2.innerHTML=leftrightslide
					actualwidth=document.all? cross_slide.offsetWidth : document.getElementById("test2").offsetWidth
					cross_slide2.style.left=actualwidth+slideshowgap+"px"
			}
			else if (document.layers)
			{
					ns_slide=document.ns_slidemenu.document.ns_slidemenuorange
					ns_slide2=document.ns_slidemenu.document.ns_slidemenu3
					ns_slide.document.write(leftrightslide)
					ns_slide.document.close()
					actualwidth=ns_slide.document.width
					ns_slide2.left=actualwidth+slideshowgap
					ns_slide2.document.write(leftrightslide)
					ns_slide2.document.close()
			}
			lefttime=setInterval("slideleft()",30)
	}
	window.onload=fillup;

	if (window.onload != null ) {
		var oldOnload = window.onload;
		window.onload = function ( e ) {
				oldOnload( e );
				intwebpage();
	}
	}else {
		window.onload = intwebpage;
	}

	function slideleft()
	{
			if (iedom)
			{
					if (parseInt(cross_slide.style.left)>(actualwidth*(-1)+8))
							cross_slide.style.left=parseInt(cross_slide.style.left)-copyspeed+"px"
					else
							cross_slide.style.left=parseInt(cross_slide2.style.left)+actualwidth+slideshowgap+"px"
					if (parseInt(cross_slide2.style.left)>(actualwidth*(-1)+8))
							cross_slide2.style.left=parseInt(cross_slide2.style.left)-copyspeed+"px"
					else
							cross_slide2.style.left=parseInt(cross_slide.style.left)+actualwidth+slideshowgap+"px"
			}
			else if (document.layers)
			{
					if (ns_slide.left>(actualwidth*(-1)+8))
							ns_slide.left-=copyspeed
					else
							ns_slide.left=ns_slide2.left+actualwidth+slideshowgap
					if (ns_slide2.left>(actualwidth*(-1)+8))
							ns_slide2.left-=copyspeed
					else
							ns_slide2.left=ns_slide.left+actualwidth+slideshowgap
			}
	}

	function slideright()
	{
			if (iedom)
			{
					if (parseInt(cross_slide.style.left)<(actualwidth+8))
							cross_slide.style.left=parseInt(cross_slide.style.left)+copyspeed+"px"
					else
							cross_slide.style.left=parseInt(cross_slide2.style.left)+actualwidth*(-1)+slideshowgap+"px"
					if (parseInt(cross_slide2.style.left)<(actualwidth+8))
							cross_slide2.style.left=parseInt(cross_slide2.style.left)+copyspeed+"px"
					else
							cross_slide2.style.left=parseInt(cross_slide.style.left)+actualwidth*(-1)+slideshowgap+"px"
			}
			else if (document.layers)
			{
					if (ns_slide.left>(actualwidth*(-1)+8))
							ns_slide.left-=copyspeed
					else
							ns_slide.left=ns_slide2.left+actualwidth+slideshowgap
					if (ns_slide2.left>(actualwidth*(-1)+8))
							ns_slide2.left-=copyspeed
					else
							ns_slide2.left=ns_slide.left+actualwidth+slideshowgap
			}
	}

	function right()
	{
			if(lefttime)
			{
					clearInterval(lefttime)
					clearInterval(righttime)
					righttime=setInterval("slideright()",30)
			}
	}

	function left()
	{
			if(righttime)
			{
					clearInterval(lefttime)
					clearInterval(righttime)
					lefttime=setInterval("slideleft()",30)
			}
	}

	function stop()
	{
			if(stop)
			{
					clearInterval(lefttime)
					clearInterval(righttime)
					clearInterval(stop)
					lefttime=setInterval("slideleft()",0)
			}
	}


		function play()
	{
			if(lefttime)
			{
					clearInterval(lefttime)
					clearInterval(righttime)
					clearInterval(stop)
					lefttime=setInterval("slideleft()",30)
			}
	}



//À§¿øÈ¸È°µ¿ °¶·¯¸®

function mainGallerychange(num,div_num){
	for(var i=1; i<=div_num;i++){
		document.getElementById("gallery_box0"+i).style.display = "none";
		
	}
		
	document.getElementById("gallery_box0"+num).style.display = "block";
}

var k2=0;
var gbn2 = true;
var setLocation2 = setInterval("mainGalleryLocation()",3000);
function mainGalleryLocation(){
	var gallery_num = document.frm.main_gallery_num.value;
	var div_num =Math.floor((parseInt(gallery_num)+1)/2)*10/10;
	if(!gbn2){
		setLocation = setInterval("mainGalleryLocation()",3000);
	}
	gbn2 = true;
	
	k2++;
	if(k2>div_num){
		k2 = 1;
	}

	mainGallerychange(k2,div_num);
}

function mainGalleryStop(){
	clearInterval(setLocation2);
	gbn2 = false;

}











