var iTopMenu = 0;

function topMenu(chk){
	iTopMenu = chk;
}

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;
  if(iTopMenu!=0) MM_swapImage('Image'+(0+iTopMenu),'','../img/leftmenu_'+iTopMenu+'_on.gif',1)
}
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_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_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

//Á¡¼±¾Èº¸ÀÌ°ÔÇÏ´Â...
function autoBlur(){ 
  if(event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG") 
  document.body.focus(); 
} 
  document.onfocusin=autoBlur; 


//TopÀ¸·Î ÀÌµ¿
function back_top(){
x = document.body.scrollLeft;
y = document.body.scrollTop;
step = 2;

while ((x != 0) || (y != 0)) {
scroll (x, y);
step += (step * step / 100);
x -= step;
y -= step;

if (x < 0) x = 0;
if (y < 0) y = 0;} 
scroll (0, 0);}


//¹öÆ° ·Ñ¿À¹ö
	function overImg(imgFile,imgName){
		document[imgName].src=imgFile
	}
	function outImg(imgFile,imgName){
		document[imgName].src=imgFile
	}


function play_flash(flash, width, height){
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="'+width+'" height="'+height+'">');
	document.write('<param name=movie value="'+flash+'">');
	document.write('<param name=quality value=high>');
	document.write('<param name=wmode value=transparent>');
	document.write('<embed src="'+flash+'" quality=high wmode=transparent pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="'+width+'" height="'+height+'">');
	document.write('</embed>');
	document.write('</object>');
}

/****** ÆÈ°ø»ê *****************/
function menu1() { location.href = "/sub01/main01.html"; }
function menu2() { location.href = "/sub02/main01.html"; }
function menu3() { location.href = "/sub03/main01.html"; }
function menu4() { location.href = "/sub04/main01.html"; }
function menu5() { location.href = "/sub05/main01.html"; }


/******* ÆÈ°ø»ê¼Ò°³ *****************/
function menu1sub1() { location.href = "/sub01/main01.html"; }
function menu1sub2() { location.href = "/sub01/main02.html"; }
function menu1sub3() { location.href = "/sub01/main03.html"; }


/******* Âûº¸¸®»§ *****************/
function menu2sub1() { location.href = "/sub02/main01.html"; }


/******* °æÁÖ»§ *****************/
function menu3sub1() { location.href = "/sub03/main01.html"; }


/******* È£µÎ°úÀÚ *****************/
function menu4sub1() { location.href = "/sub04/main01.html"; }


/******* °í°´¼¾ÅÍ *****************/
function menu5sub1() { location.href = "/sub05/main01.html"; }
function menu5sub2() { location.href = "/sub05/main02.html"; }
function menu5sub3() { location.href = "/sub05/main03.html"; }


/* Display°ü·Ã ========== */
//º¸ÀÌ±â°¨Ãß±â Åä±Û ex) displayToggle('id');
function displayToggle(myobj,id) {
    var obj = document.getElementById(id);
    if(myobj){
        if(myobj.parentNode.className=="on") myobj.parentNode.className = "";
        else myobj.parentNode.className = "on";
    }
    if(obj){
        if(obj.style.display=="block") obj.style.display = "none";
        else obj.style.display = "block";
    }
}
//º¸ÀÌ±â°¨Ãß±â ¿©·¯°³ ex) displayOn('id1','id2'); displayOff('id1','id2');//ÀÎ¼ö °³¼ö¿¡ »ó°ü¾ø´Ù.
function displayOn() {//º¸ÀÌ±â
    var i,j,a=displayOn.arguments;
    for(var i=0;i<a.length;i++){
        var obj = document.getElementById(a[i]);
        if(obj){ obj.style.display = "block"; }
    }
}
function displayOff() {//°¨Ãß±â
    var i,j,a=displayOff.arguments;
    for(var i=0;i<a.length;i++){
        var obj = document.getElementById(a[i]);
        if(obj){ obj.style.display = "none"; }
    }
}
//ÇÏ³ª¸¸º¸ÀÌ±â ex) displayOnly('id¹®ÀÚ¿­°øÅëºÎºÐ',ÀüÃ¼¼ö,ÇöÀç¼ø¹ø);//ÇöÀç¼ø¹øÀÇ °´Ã¼¸¸ º¸¿©ÁØ´Ù.
function displayOnly(coId,num,curr) {
    for(var i=0;i<=num;i++){
        var obj = document.getElementById(coId+i);
        if(obj){ obj.style.display = "none"; }
    }
    var obj = document.getElementById(coId+curr);
    if(obj){ obj.style.display = "block"; }
}

//openDrop Layer
function viewInfo(list,total,num){
var size = total;// list count +1
var id = list;
    for(i=1;i<size;i++){
        var liEI = document.getElementById(id+i);
        if(i==num){
            if(liEI.className == "open"){
                liEI.className = "";
            }else{
                liEI.className = "open";
            }
        }else{
            liEI.className = "";
        }
    }
}
