//***** ¸ÞÀÎ ¸Þ´º *****//
function main_menu(idx, tmpl) {
                      if(idx == "00") { 
		if(document.getElementById("main_menu_07") != null) document.getElementById("main_menu_07").style.display = 'none';
	}
	if(idx == null || idx == "null" || document.getElementById("img_main_menu_" + idx) == null) return;

	document.getElementById("img_main_menu_01").src='http://www.daejeon.go.kr/images/new_main/tmpl/top_menu01.gif'; 
	document.getElementById("img_main_menu_02").src='http://www.daejeon.go.kr/images/new_main/tmpl/top_menu02.gif';
	document.getElementById("img_main_menu_03").src='http://www.daejeon.go.kr/images/new_main/tmpl/top_menu03.gif';
	document.getElementById("img_main_menu_04").src='http://www.daejeon.go.kr/images/new_main/tmpl/top_menu04.gif';
	document.getElementById("img_main_menu_05").src='http://www.daejeon.go.kr/images/new_main/tmpl/top_menu05.gif';
	document.getElementById("img_main_menu_06").src='http://www.daejeon.go.kr/images/new_main/tmpl/top_menu06.gif';
        document.getElementById("img_main_menu_07").src='http://www.daejeon.go.kr/images/new_main/tmpl/top_menu07.gif';
	document.getElementById("img_main_menu_" + idx).src='http://www.daejeon.go.kr/images/new_main/tmpl/top_menu' + idx + '_on.gif';	
	
	document.getElementById("main_menu_01").style.display = 'none';	
	document.getElementById("main_menu_02").style.display = 'none';
	document.getElementById("main_menu_03").style.display = 'none';
	document.getElementById("main_menu_04").style.display = 'none';
	document.getElementById("main_menu_05").style.display = 'none';	
	document.getElementById("main_menu_06").style.display = 'none';                     	
	document.getElementById("main_menu_07").style.display = 'none';
	document.getElementById("main_menu_" + idx).style.display = 'block';		
}

//***** ¼­ºê ¸Þ´º *****//
function sub_menu(idx, tmpl) {
	if(idx == null || idx == "null" || document.getElementById("img_sub_menu_" + idx) == null) return;

	document.getElementById("img_sub_menu_01").src='http://www.daejeon.go.kr/images/new_main/tmpl/top_menu01.gif'; 
	document.getElementById("img_sub_menu_02").src='http://www.daejeon.go.kr/images/new_main/tmpl/top_menu02.gif';
	document.getElementById("img_sub_menu_03").src='http://www.daejeon.go.kr/images/new_main/tmpl/top_menu03.gif';
	document.getElementById("img_sub_menu_04").src='http://www.daejeon.go.kr/images/new_main/tmpl/top_menu04.gif';
	document.getElementById("img_sub_menu_05").src='http://www.daejeon.go.kr/images/new_main/tmpl/top_menu05.gif';
	document.getElementById("img_sub_menu_06").src='http://www.daejeon.go.kr/images/new_main/tmpl/top_menu06.gif';
                     	document.getElementById("img_sub_menu_07").src='http://www.daejeon.go.kr/images/new_main/tmpl/top_menu07.gif';
	document.getElementById("img_sub_menu_" + idx).src='http://www.daejeon.go.kr/images/new_main/tmpl/top_menu' + idx + '_on.gif';	

	document.getElementById("sub_menu_01").style.display = 'none';	
	document.getElementById("sub_menu_02").style.display = 'none';
	document.getElementById("sub_menu_03").style.display = 'none';
	document.getElementById("sub_menu_04").style.display = 'none';
	document.getElementById("sub_menu_05").style.display = 'none';	
	document.getElementById("sub_menu_06").style.display = 'none';                     	
	document.getElementById("sub_menu_07").style.display = 'none';
	document.getElementById("sub_menu_" + idx).style.display = 'block';	
}


//***** ´º½º ºÎºÐ *****//

function ma_news_idx(idx, tmpl) {
	if(idx == null || idx == "null" || document.getElementById("ma_newsimg_" + idx) == null) return;


	document.getElementById("ma_newsimg_01").src='http://www.daejeon.go.kr/images/new_main/main/new_title_01.gif'; 
	document.getElementById("ma_newsimg_02").src='http://www.daejeon.go.kr/images/new_main/main/new_title_02.gif';
	document.getElementById("ma_newsimg_03").src='http://www.daejeon.go.kr/images/new_main/main/new_title_03.gif';
	document.getElementById("ma_newsimg_04").src='http://www.daejeon.go.kr/images/new_main/main/new_title_04.gif';
	document.getElementById("ma_newsimg_05").src='http://www.daejeon.go.kr/images/new_main/main/new_title_05.gif';
	document.getElementById("ma_newsimg_" + idx).src='http://www.daejeon.go.kr/images/new_main/main/new_title_' + idx + '_ov.gif';	

	if(idx == '04') return;

	document.getElementById("ma_news_01").style.display = 'none';	
	document.getElementById("ma_news_02").style.display = 'none';
	document.getElementById("ma_news_03").style.display = 'none';
	document.getElementById("ma_news_04").style.display = 'none';
	document.getElementById("ma_news_05").style.display = 'none';	
	document.getElementById("ma_news_" + idx).style.display = 'block';	
}


//***** ´ëÀü ÀÌ½´ *****//

function main_issue(idx, tmpl) {
	if(idx == null || idx == "null" || document.getElementById("img_issue_" + idx) == null) return; 


	document.getElementById("img_issue_01").src='http://www.daejeon.go.kr/images/new_main/main/issue_01.gif'; 
	document.getElementById("img_issue_02").src='http://www.daejeon.go.kr/images/new_main/main/issue_02.gif';
	document.getElementById("img_issue_03").src='http://www.daejeon.go.kr/images/new_main/main/issue_03.gif';
	document.getElementById("img_issue_04").src='http://www.daejeon.go.kr/images/new_main/main/issue_04.gif';
	document.getElementById("img_issue_" + idx).src='http://www.daejeon.go.kr/images/new_main/main/issue_' + idx + '_ov.gif';	

	document.getElementById("issue_img_01").style.display = 'none';	
	document.getElementById("issue_img_02").style.display = 'none';
	document.getElementById("issue_img_03").style.display = 'none';
	document.getElementById("issue_img_04").style.display = 'none';
	document.getElementById("issue_img_" + idx).style.display = 'block';	

}

function submenu_over01(idx,menu_num,sub_num){

if(idx == null || idx == "null" || document.getElementById("popu_t_0"+sub_num+"_0"+menu_num) == null) return; 
	for(i=1; i <= parseInt(idx) ;i++){
		document.getElementById("popu_t_0"+sub_num+"_0"+ i).src = "http://www.daejeon.go.kr/images/new_main/info/popu_t_0"+sub_num+"_00"+ i +".gif"
	}
	document.getElementById("popu_t_0"+sub_num+"_0"+ menu_num).src = "http://www.daejeon.go.kr/images/new_main/info/popu_t_0"+sub_num+"_00"+ menu_num +"_ov.gif"
}


function submenu_out01(idx,menu_num,sub_num){

if(idx == null || idx == "null" || document.getElementById("popu_t_0"+sub_num+"_0"+menu_num) == null) return; 
	for(i=1; i <= parseInt(idx) ;i++){
		document.getElementById("popu_t_0"+sub_num+"_0"+ i).src = "http://www.daejeon.go.kr/images/new_main/info/popu_t_0"+sub_num+"_00"+ i +".gif"
	}
}

function submenu_over(idx,menu_num,sub_num){

if(idx == null || idx == "null" || document.getElementById("cult_0"+sub_num+"_0"+menu_num) == null) return; 

	for(i=1; i <= parseInt(idx) ;i++){
		document.getElementById("cult_0"+sub_num+"_0"+ i).src = "http://www.daejeon.go.kr/images/new_main/info/cult_t_0"+sub_num+"_00"+ i +".gif"
	}
	document.getElementById("cult_0"+sub_num+"_0"+ menu_num).src = "http://www.daejeon.go.kr/images/new_main/info/cult_t_0"+sub_num+"_00"+ menu_num +"_ov.gif"
}


function submenu_out(idx,menu_num,sub_num){

if(idx == null || idx == "null" || document.getElementById("cult_0"+sub_num+"_0"+menu_num) == null) return; 
	for(i=1; i <= parseInt(idx) ;i++){
		document.getElementById("cult_0"+sub_num+"_0"+ i).src = "http://www.daejeon.go.kr/images/new_main/info/cult_t_0"+sub_num+"_00"+ i +".gif"
	}
}


/* Àü¸Þ´º °øÅëÀûÀÎ ½ºÅ©¸³Æ® */

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}




/*
 °ü·Ã»çÀÌÆ® ¹Ù·Î°¡±â
*/
function goUrl(obj)
{
	//window.open(obj.value, '_blank');
	if (document.all[obj].value!=""){
		window.open(document.all[obj].value, '_blank');
		document.all[obj].value = "";
		return;
	}
}

/* ÀÎÅÍ³Ý¹æ¼Û °ü·Ã */

function internet01(){
document.getElementById("internet_visible01").style.display ='block';
document.getElementById("ingernet01").src='http://www.daejeon.go.kr/images/new_main/main/internet_m01_on.gif';
document.getElementById("internet_visible02").style.display ='none';
document.getElementById("ingernet02").src='http://www.daejeon.go.kr/images/new_main/main/internet_m02.gif';
}
function internet02(){
document.getElementById("internet_visible02").style.display ='block';
document.getElementById("ingernet02").src='http://www.daejeon.go.kr/images/new_main/main/internet_m02_on.gif';
document.getElementById("internet_visible01").style.display ='none';
document.getElementById("ingernet01").src='http://www.daejeon.go.kr/images/new_main/main/internet_m01.gif';
}

var G_MAIN_IMAGE_IDX = 1;
function main_ima_List(direction, el_id, view_item_count, scroll_count, style)
{
    var menu = document.getElementById(el_id);
    var menu_list = menu.getElementsByTagName('li');
    var menu_count = menu_list.length;
    var start_no = G_MAIN_IMAGE_IDX ;

    style = (typeof(style) != 'undefined') ? style : 'block';

    // ÇöÀç º¸¿©Áö°í ÀÖ´Â ¿¤¸®¸ÕÆ®ÀÇ ½ÃÀÛÀ» È®ÀÎ
    for(var i=0;i<menu_count;i++){
        if(menu_list[i].style.display == style){
            start_no = i;
            break;
        }
    }
    
    // ¹æÇâ¿¡ µû¸¥ ÀÌµ¿
    if(direction == 'next'){
        if(menu_list[menu_count-1].style.display == style) return false;
        else{
            for(var i=0;i<menu_count;i++){
                if(i>=start_no + scroll_count && i<start_no + scroll_count + view_item_count){
                    menu_list[i].style.display = style;
                }else{
                    menu_list[i].style.display = 'none';
                }
            }
        }
    }else if(direction == 'prev'){
        if(menu_list[0].style.display == style) return false;
        else{
            for(var i=0;i<menu_count;i++){
                if(i>=start_no - scroll_count && i<start_no - scroll_count + view_item_count){
                    menu_list[i].style.display = style;
                }else{
                    menu_list[i].style.display = 'none';
                }
            }
        }
    }
}

/* ÀÚÁÖÃ£´Â¸Þ´º °ü·Ã */
var G_USEFULLINK = 1
function usefulLinkRestore() {
	var img = document.getElementById("info0" + G_USEFULLINK);
	if(img != null) {
		img.src = "http://www.daejeon.go.kr/images/new_main/main/new_info_m0" + G_USEFULLINK + "_on.gif";
	}
}
function usefulLink(id){
	document.getElementById("new_info_m_sub_1").style.display ='none';
	document.getElementById("new_info_m_sub_2").style.display ='none';	
	document.getElementById("new_info_m_sub_3").style.display ='none';	
	document.getElementById("new_info_m_sub_4").style.display ='none';	
	document.getElementById("new_info_m_sub_5").style.display ='none';	
	document.getElementById("new_info_m_sub_6").style.display ='none';	
	document.getElementById("new_info_m_sub_7").style.display ='none';	
	document.getElementById("new_info_m_sub_8").style.display ='none';	
	document.getElementById("new_info_m_sub_" + id).style.display ='block';
	var img = document.getElementById("info0" + G_USEFULLINK);
	if(img != null) {
		img.src = "http://www.daejeon.go.kr/images/new_main/main/new_info_m0" + G_USEFULLINK + ".gif";
	}
	G_USEFULLINK = id;
}

/* ·Î±×ÀÎ/·Î±×¾Æ¿ô Á¤º¸ °ü·Ã */
function memberSession(priCd, name) {
	var aLink = document.getElementById("aLogInOut");
	var img  = document.getElementById("imgLogInOut");
	var info  = document.getElementById("sessionInfo");
	if(aLink != null && img != null && info != null) {
		if(priCd == 0) {
			img.alt="·Î±×ÀÎ";
			img.src="/images/new_main/tmpl/top_txt_login.gif";
			aLink.href="http://www.daejeon.go.kr/dj2009/login.action";
			info.innerHTML="&nbsp;";
		} else if(priCd == 1) {
			//img.alt="·Î±×¾Æ¿ô";
			//img.src="/images/new_main/tmpl/top_txt_logout.gif";
			//aLink.href="http://www.daejeon.go.kr/dj2009/logout.action";
			//info.innerHTML = "¢À " + name + "´Ô º»ÀÎÈ®ÀÎÀÌ µÇ¾ú½À´Ï´Ù.";
                                                                img.alt="·Î±×ÀÎ";
			img.src="/images/new_main/tmpl/top_txt_login.gif";
			aLink.href="http://www.daejeon.go.kr/dj2009/login.action";
			info.innerHTML="&nbsp;";

		} else if(priCd == 2) {
			img.alt="·Î±×¾Æ¿ô";
			img.src="/images/new_main/tmpl/top_txt_logout.gif";
			aLink.href="http://www.daejeon.go.kr/dj2009/logout.action";
			info.innerHTML= "¢À " + name + " È¸¿ø´Ô È¯¿µÇÕ´Ï´Ù.  <a href='http://www.daejeon.go.kr/dj2009/login.action'>[¸¶ÀÌÆäÀÌÁö]</a>";
		}
	}
	
}