/* ¸ÞÀÎ ¸Þ´º ½ÃÀÛ */
function displaySub(id) {
	var imgName;
	var re;
	for(i=1 ; i<=5 ; i++) {
		document.getElementById("subnav_list"+i).style.display="none";
		imgName = document.getElementById("subMenuImg_"+i).src;
		re = /over\./g;
		document.getElementById("subMenuImg_"+i).src = imgName.replace(re,"out.");		
	}
	if(document.getElementById("subnav_list"+id)){
		document.getElementById("subnav_list"+id).style.display="block";
		imgName = document.getElementById("subMenuImg_"+id).src;
		re = /out\./g;
		document.getElementById("subMenuImg_"+id).src = imgName.replace(re,"over.");	
	}
}


function returnSub(id) {
	var imgName;
	var re;
	for(i=1 ; i<=5 ; i++) {
		document.getElementById("subnav_list"+i).style.display="none";
		imgName = document.getElementById("subMenuImg_"+i).src;
		re = /over\./g;
		document.getElementById("subMenuImg_"+i).src = imgName.replace(re,"out.");		
	}
	if(document.getElementById("subnav_list"+id)){
		document.getElementById("subnav_list"+id).style.display="block";
		imgName = document.getElementById("subMenuImg_"+id).src;
		re = /out\./g;
		document.getElementById("subMenuImg_"+id).src = imgName.replace(re,"over.");		
	}
}
function chImg(img) {
	imgName = img.src;
	if( imgName.indexOf("over.") > -1 ) {
		var re = /over\./g;
		img.src = imgName.replace(re,"out.");
	} else {
		var re = /out\./g;
		img.src = imgName.replace(re,"over.");
	}
}
function chImgATag(a) {
	img = a.getElementsByTagName("img")[0];
	imgName = img.src
	if( imgName.indexOf("over.") > -1 ) {
		var re = /over\./g;
		img.src = imgName.replace(re,"out.");
	} else {
		var re = /out\./g;
		img.src = imgName.replace(re,"over.");
	}
}
/* ¸Þ´º ¿­°í ´Ý±â */


function view_hide_menu(div_name) {
	if(document.getElementById(div_name) != null) {
		var status = document.getElementById(div_name).style.display;
		if(status=="none") {
			document.getElementById(div_name).style.display="block";
		} else {
			document.getElementById(div_name).style.display="none";
		}
	}
}
/* È­¸é È®´ë Ãà¼Ò ½ÃÀÛ IE Àü¿ë */
 var nowZoom = 100; // ÇöÀçºñÀ²
 var maxZoom = 200; // ÃÖ´ëºñÀ²(500À¸·ÎÇÏ¸é 5¹è Ä¿Áø´Ù)
 var minZoom = 80; // ÃÖ¼ÒºñÀ²



 //È­¸é Å°¿î´Ù.
 function zoomIn() {
  if (nowZoom < maxZoom) {
   nowZoom += 10; //25%¾¿ Ä¿Áø´Ù.
  } else {
   return;
  }

  document.body.style.zoom = nowZoom + "%";
 }


 //È­¸é ÁÙÀÎ´Ù.
 function zoomOut() {
  if (nowZoom > minZoom) {
   nowZoom -= 10; //25%¾¿ ÀÛ¾ÆÁø´Ù.
  } else {
   return;
  }

  document.body.style.zoom = nowZoom + "%";
 }
 
 function cookieVal(cookieName) {
    thisCookie = document.cookie.split("; ")
		for (i = 0; i < thisCookie.length; i++) {
		if (cookieName == thisCookie[i].split("=")[0]) {
				return thisCookie[i].split("=")[1];
		   }
		}
    return 0;
}
/* È­¸é È®´ë Ãà¼Ò ³¡ */

/* È­¸é È®´ë Ãà¼Ò ½ÃÀÛ IE Àü¿ë
 var nowZoom = 100; // ÇöÀçºñÀ²
 var maxZoom = 200; // ÃÖ´ëºñÀ²(500À¸·ÎÇÏ¸é 5¹è Ä¿Áø´Ù)
 var minZoom = 80; // ÃÖ¼ÒºñÀ²



 //È­¸é Å°¿î´Ù.
 function zoomIn() {
	var mainContent=cookieVal("mainContent");
	if(mainContent != 0 && mainContent != 100) {
		nowZoom = mainContent;
	}
	if (nowZoom < maxZoom) {
	   nowZoom += 10; //25%¾¿ Ä¿Áø´Ù.
	} else {
	   return;
	}

	  document.body.style.zoom = nowZoom + "%";
	  document.cookie = "mainContent="+nowZoom;
		 
	
 }

 //È­¸é ÁÙÀÎ´Ù.
 function zoomOut() {
	var mainContent=cookieVal("mainContent");
	if(mainContent != 0 && mainContent != 100) {
		nowZoom = mainContent;
	}
		if (nowZoom > minZoom) {
		   nowZoom -= 10; //25%¾¿ ÀÛ¾ÆÁø´Ù.
		   
	  } else {
	   return;
	  }

	  document.body.style.zoom = nowZoom + "%";
	  document.cookie = "mainContent="+nowZoom;

 }


function zoomInCookie(size) {
	document.body.style.zoom = size + "%";
}
function zoomOutCookie(size) {
	document.body.style.zoom = size + "%";
}
 function cookieVal(cookieName) {
    thisCookie = document.cookie.split("; ")
		for (i = 0; i < thisCookie.length; i++) {
		if (cookieName == thisCookie[i].split("=")[0]) {
				return thisCookie[i].split("=")[1];
		   }
		}
    return 0;
}

 È­¸é È®´ë Ãà¼Ò ³¡ */




// ½ºÅ©·Ñ µû¶ó´Ù´Ï´Â ·¹ÀÌ¾î
  var stmnGAP1 = 0; // ÆäÀÌÁö Çì´õºÎºÐÀÇ ¿©¹é
  var stmnGAP2 = 100; // ½ºÅ©·Ñ½Ã ºê¶ó¿ìÀú »ó´Ü°ú ¾à°£ ¶ç¿ò. ÇÊ¿ä¾øÀ¸¸é 0À¸·Î ¼¼ÆÃ
  var stmnBASE = 10; // ½ºÅ©·Ñ¸Þ´º ÃÊ±â ½ÃÀÛÀ§Ä¡ (¾Æ¹«·¸°Ô³ª ÇØµµ »ó°üÀº ¾øÁö¸¸ stmnGAP1°ú ¾à°£ Â÷ÀÌ¸¦ ÁÖ´Â°Ô º¸±â ÁÁÀ½)
  var stmnActivateSpeed = 500; // ¿òÁ÷ÀÓÀ» °¨ÁöÇÏ´Â ¼Óµµ (¼ýÀÚ°¡ Å¬¼ö·Ï ´Ê°Ô ¾Ë¾ÆÂ÷¸²)
  var stmnScrollSpeed = 10; // ½ºÅ©·ÑµÇ´Â ¼Óµµ (Å¬¼ö·Ï ´Ê°Ô ¿òÁ÷ÀÓ)

  function RefreshStaticMenu() {
    var stmnStartPoint, stmnEndPoint, stmnRefreshTimer;
    stmnStartPoint = parseInt(document.getElementById("STATICMENU").style.top, 10);
    stmnEndPoint = document.body.scrollTop + stmnGAP2;
    if (stmnEndPoint < stmnGAP1) { stmnEndPoint = stmnGAP1; }

    stmnRefreshTimer = stmnActivateSpeed;
    if ( stmnStartPoint != stmnEndPoint ) {
      stmnScrollAmount = Math.ceil( Math.abs( stmnEndPoint - stmnStartPoint ) / 15 );
      document.getElementById("STATICMENU").style.top = parseInt(document.getElementById("STATICMENU").style.top, 10) + ( ( stmnEndPoint<stmnStartPoint ) ? -stmnScrollAmount : stmnScrollAmount );
      stmnRefreshTimer = stmnScrollSpeed;
    }
    stmnTimer = setTimeout ("RefreshStaticMenu();", stmnRefreshTimer);
  }

  function InitializeStaticMenu() {
    document.getElementById("STATICMENU").style.top = document.body.scrollTop + stmnBASE;

    RefreshStaticMenu();
  }

  function StartStaticMenu(stmnGAP2Plus) {
	stmnGAP2 = stmnGAP2 +stmnGAP2Plus ;
    document.getElementById("STATICMENU").style.top = stmnGAP2;

    RefreshStaticMenu();
  }
  	function StatusText() {
	window.status = "http://www.mohw.go.kr";
	setTimeout("StatusText()", 0);
	}
