// document.domain = "mopas.go.kr";
// Main Menu Layer
var SubMenuArray = Array("sub_menu1","sub_menu2","sub_menu3");

// ÀÌ¹ÌÁö ¿À¹ö ÇÔ¼ö
function imgChg(obj){
	var img = null;
	var imgName = null;
	
	// A °´Ã¼¿¡¼­ IMG°´Ã¼¸¦ ÃßÃâ
	// Á¢±Ù¼ºÀ» À§ÇØ ¿À¹ö ÀÌ¹ÌÁöÀÇ ÄÁÆ®·ÑÀº A¿¡¼­ ÀÌº¥Æ®¸¦ °É¾î Ã³¸®µÇµµ·Ï ÇÔ.
	if(obj != null){
		for(i=0; i<obj.childNodes.length; i++){
			if(obj.childNodes[i].nodeName == "IMG"){
				img = obj.childNodes[i];
			}
		}
	}

	if(img != null){
		imgName = img.src;
		if(imgName.indexOf("_ov") > -1){
			img.src = imgName.replace(/_ov\.gif/g, ".gif");
		}else{
			img.src = imgName.replace(/\.gif/g, "_ov.gif");
		}
	}
}

function TopMenu(obj, id){
	// ÀÌ¹ÌÁö ¿À¹ö
	imgChg(obj);
	// TopMenu ·¹ÀÌ¾î Display
	for(i=0; i<SubMenuArray.length; i++){
		if(SubMenuArray[i] == id){
			eval("document.getElementById('"+id+"')").style.display = "block";
		}else{
			document.getElementById(SubMenuArray[i]).style.display = "none";
		}
	}
}

function TopMenuClose(){
	// TopMenu Display : none
	for(i=0; i<SubMenuArray.length; i++){
		//document.getElementById(SubMenuArray[i]).style.display = "none";
	}
}
/*¸Þ´º ÀüÃ¼º¸±â ¼³Á¤
function AllMenu(){
	var smap = document.getElementById("s_map");
	var smapimg = document.getElementById("sMapImg");
	var member = document.getElementById("member");
	var search = document.getElementById("search_word");
	
	if(smap.style.display == "none"){	// s_map open
		smap.style.display = "block";
		smapimg.src = "/gpms/resource/images/korea/main/top_closemenu_btn.jpg";
		smapimg.alt = "ÀüÃ¼¸Þ´º´Ý±â";
		member.style.display = "none";
		search.style.display = "none";
	}else{	// s_map close
		smap.style.display = "none";
		smapimg.src = "/gpms/resource/images/korea/main/top_allmenu_btn.jpg";
		smapimg.alt = "ÀüÃ¼¸Þ´ºº¸±â";
		member.style.display = "block";
		search.style.display = "block";
		document.getElementById("nextTab").focus();
	}
	TopMenuClose();
}*/
//¸ÞÀÎ °øÁö»çÇ×ÅÇ ÀÌ¹ÌÁö
function LayerChg(chk, id){
	var objList = null;
	var objImg = null;

	if(chk == "ar"){
		for(i=0; i<5; i++){//ÅÇ ÀÌ¹ÌÁö ¼ö
			objList = "ArList"+(i+1);
			objImg = "ArImg"+(i+1);
			if(objList == id){
				document.getElementById(objList).style.display = "block";
				document.getElementById(objImg).src = "/main2_images/notice_0"+(i+1)+"_ov.gif";
			}else{
				document.getElementById(objList).style.display = "none";
				document.getElementById(objImg).src = "/main2_images/notice_0"+(i+1)+".gif";
			}
		}
	}
	//¸ÞÀÎ ¸ÂÃã ¼­ºñ½º ÀÌ¹ÌÁö
	if(chk == "svc"){
		for(i=0; i<3; i++){
			objList = "SvcList"+(i+1);
			objImg = "SvcImg"+(i+1);
			if(objList == id){
				document.getElementById(objList).style.display = "block";
				document.getElementById(objImg).src = "/image/service_t"+(i+1)+"_ov.gif";
			}else{
				document.getElementById(objList).style.display = "none";
				document.getElementById(objImg).src = "/image/service_t"+(i+1)+".gif";
			}
		}
	}
	// ¸ÞÀÎ µ¿¿µ»ó&Æ÷Åä ÅÇ
	if(chk == "ns"){
		if(id == "NsList1"){
			document.getElementById("NsList1").style.display = "block";
			document.getElementById("NsImg1").src = "/gpms/resource/images/korea/main/mp_t1_ov.gif";
			document.getElementById("NsList2").style.display = "none";
			document.getElementById("NsImg2").src = "/gpms/resource/images/korea/main/mp_t2.gif";
			document.getElementById("NsList3").style.display = "none";
			document.getElementById("NsImg3").src = "/gpms/resource/images/korea/main/mp_t3.gif";			
		}
		if(id == "NsList2"){
			document.getElementById("NsList1").style.display = "none";
			document.getElementById("NsImg1").src = "/gpms/resource/images/korea/main/mp_t1.gif";
			document.getElementById("NsList2").style.display = "block";
			document.getElementById("NsImg2").src = "/gpms/resource/images/korea/main/mp_t2_ov.gif";
			document.getElementById("NsList3").style.display = "none";
			document.getElementById("NsImg3").src = "/gpms/resource/images/korea/main/mp_t3.gif";		
		}
		if(id == "NsList3"){
			document.getElementById("NsList1").style.display = "none";
			document.getElementById("NsImg1").src = "/gpms/resource/images/korea/main/mp_t1.gif";
			document.getElementById("NsList2").style.display = "none";
			document.getElementById("NsImg2").src = "/gpms/resource/images/korea/main/mp_t2.gif";
			document.getElementById("NsList3").style.display = "block"
			document.getElementById("NsImg3").src = "/gpms/resource/images/korea/main/mp_t3_ov.gif";	
		}		
		
	}

	TopMenuClose();
}



// ½ºÅ©·Ñ µû¶ó´Ù´Ï´Â ·¹ÀÌ¾î
var stmnLEFT = 0; // ½ºÅ©·Ñ¸Þ´ºÀÇ ÁÂÃø À§Ä¡
var stmnGAP1 = 0; // ÆäÀÌÁö Çì´õºÎºÐÀÇ ¿©¹é
var stmnGAP2 = 100; // ½ºÅ©·Ñ½Ã ºê¶ó¿ìÀú »ó´Ü°ú ¾à°£ ¶ç¿ò. ÇÊ¿ä¾øÀ¸¸é 0À¸·Î ¼¼ÆÃ
var stmnBASE = 10; // ½ºÅ©·Ñ¸Þ´º ÃÊ±â ½ÃÀÛÀ§Ä¡ (¾Æ¹«·¸°Ô³ª ÇØµµ »ó°üÀº ¾øÁö¸¸ stmnGAP1°ú ¾à°£ Â÷ÀÌ¸¦ ÁÖ´Â°Ô º¸±â ÁÁÀ½)
var stmnActivateSpeed = 500; // ¿òÁ÷ÀÓÀ» °¨ÁöÇÏ´Â ¼Óµµ (¼ýÀÚ°¡ Å¬¼ö·Ï ´Ê°Ô ¾Ë¾ÆÂ÷¸²)
var stmnScrollSpeed = 10; // ½ºÅ©·ÑµÇ´Â ¼Óµµ (Å¬¼ö·Ï ´Ê°Ô ¿òÁ÷ÀÓ)

function RefreshStaticMenuMain(){
	var stmnStartPoint, stmnEndPoint, stmnRefreshTimer;
	stmnStartPoint = parseInt(document.getElementById("STATICMENU").style.top, 10);
	stmnEndPoint = document.body.scrollTop + stmnGAP2;
	if (stmnEndPoint < stmnGAP1) { stmnEndPoint = stmnGAP1; }

	// add 09.02.05 : ¹«ÇÑ ½ºÅ©·Ñ ´Ù¿î ¹æÁö
	//if(document.body.scrollTop > 50){ stmnEndPoint = stmnEndPoint - 59; }

	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 ("RefreshStaticMenuMain();", stmnRefreshTimer);
}

function InitializeStaticMenuMain() {
	document.getElementById("STATICMENU").style.left = stmnLEFT;
	document.getElementById("STATICMENU").style.top = document.body.scrollTop + stmnBASE;
	RefreshStaticMenu();
}

function StartStaticMenuMain(stmnGAP2Plus) {
	stmnGAP2 = stmnGAP2 +stmnGAP2Plus ;
	document.getElementById("STATICMENU").style.left = stmnLEFT;
	document.getElementById("STATICMENU").style.top = stmnGAP2;
	RefreshStaticMenuMain();
}

/* È­¸é È®´ë Ãà¼Ò ½ÃÀÛ 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 goSelectUrl(num){
	var obj = document.getElementById('select'+num);
	if(obj.value == '' || obj.value == 'total'){
	}else{
		if(num == 4){
			location.href = obj.value;
		}else{
			window.open(obj.value);
		}
	}
}*/

// ÇÏ´Ü ¹è³Ê
bTableCount = 1;
function nextB(){
	bTableCount++;
	if(bTableCount > 4) bTableCount = 1;
	for(i = 1 ; i <= 4 ; i++){
		document.getElementById('bTable0' + i).style.display = 'none';
	}
	document.getElementById('bTable0' + bTableCount).style.display = '';
}

/* °Ë»ö
function goSearch() {
	var search = document.searchForm;
	if(search.sType[0].checked == true){
		query = search.query.value;
		if(query.length==0)	{
			alert("°Ë»ö¾î¸¦ ÀÔ·ÂÇÏ¼¼¿ä.");
			search.query.focus();
			return false;
		}

		var pop = autoopen('/gpms/srch/popSearch.html','popSearch','left=0,top=0,width=950,height='+window.screen.availHeight+',resizable=no');

		search.target = "popSearch";
		search.submit();
	}else{
		search.action = "/gpms/ns/mogaha/user/userlayout/adminaddress/kor/adminAddressNewList.action";
		search.searchName.value = search.query.value;
		search.target = "_self";
		search.method = "get";
		search.submit();
	}
}*/



// PNGÀÌ¹ÌÁö ½ºÅ©¸³Æ®
function setPng24(obj) { 
    obj.width=obj.height=1; 
    obj.className=obj.className.replace(/\bpng24\b/i,''); 
    obj.style.filter = 
    "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+ obj.src +"',sizingMethod='image');" 
    obj.src='';  
    return ''; 
} 

<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

<!--
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_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_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_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 detail(url) {
	window.open(url,'detail','width=425, height=265, scrollbars=yes, resizable=no');
}
function popups(url) {
	window.open(url,'mpop','width=425, height=265, scrollbars=no, resizable=no');
}

function popups2(url) {
	window.open(url,'mpop2','top=60,left=50,width=420, height=340, scrollbars=no, resizable=no');
}
function popups11(url) {
	window.open(url,'mpop11','top=60,left=500,width=393, height=315, scrollbars=no, resizable=no');
}
function popups13(url) {
	window.open(url,'mpop13','top=60,left=500,width=503, height=606, scrollbars=no, resizable=no');
}

function popups12(url) {
	window.open(url,'mpop12','top=60,left=300,width=393, height=310, scrollbars=no, resizable=no');
}
function src() {
	window.open('07_etc/src.html','src','width=600, height=400, scrollbars=no, resizable=no');
}
function funeral() {
	window.open('/funeral/index.php','main','width=817,height=650,scrollbars=yes,resizable=no,align=center,valign=top');
}
function js_popup() {
	window.open('popup/www/js_popup.html','js_popup','width=600,height=605,resizable=no,align=center,valign=top');
}
function movig() {
	window.open('popup/www/moving.html','movig','width=350,height=450,resizable=no,align=center,valign=top');
}

function Go_Requiry01() {
	window.open('requiry01/', '', 'scrollbars=yes,status=no,toolbar=no,resizable=0,location=no,menu=no,width=605,height=610, left=100, top=50');
}

function rev_open(r_url) {
	window.open(r_url,'rev_window','width=420,height=600,left=400,top=400,scrollbars=no,resizable=no');
}

function View_Press_List() {
			window.open("press.htm", "", "scrollbars=yes,status=no,toolbar=no,resizable=0,location=no,menu=no,width=610,height=600, left=100, top=50");
}
function View_Press_View(n) {
			window.open("press_view.htm?num="+n, "", "scrollbars=yes,status=no,toolbar=no,resizable=1,location=no,menu=no,width=610,height=600, left=100, top=50");
}
function idsearch() {
	window.open('id_search01.html','id','width=438, height=222, scrollbars=no, resizable=no');
}
function zipcode() {
	window.open('zip_search01.html','id','width=515, height=222, scrollbars=yes, resizable=no');
}
function sub01banner() {
	window.open('/01_about/history_pic01.html','histroy','width=812, height=532, scrollbars=no, resizable=no');
}


//-->ÀÌ¸ÞÀÏÂ÷´Ü ¹× °³ÀÎÁ¤º¸Ãë±Þ¹æÄ§
var win = null;
function NewWindow(mypage,myname,w,h,scroll){
    LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
    TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
    settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable' 
    win = window.open(mypage,myname,settings)
}
//-->

//-->overlayer
function menuOn(name) {
 submenu = eval("submenu"+name+".style");
 submenu.visibility = "visible";
}
function menuOff(name) {
 submenu = eval("submenu"+name+".style");
 submenu.visibility = "hidden";
}
function menuOnNews() {
 document.all.news.style.display = "block";
 document.all.notice.style.display = "none";
}
function menuOnNotice() {
 document.all.notice.style.display = "block";
 document.all.news.style.display = "none";
}


