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

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

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; // ÃÖ¼ÒºñÀ²


// È®´ë, Ãà¼Ò ÇÔ¼ö
var skycontentid = 'Layer2';



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

  document.body.style.zoom = nowZoom + "%";
 // document.cookie = "mainContent="+nowZoom;
 // document.all[skycontentid].style.zoom = nowZoom + "%";
 

//		if (document.all[skycontentid].style.left) {
//			skyWidth = parseInt(document.all[skycontentid].style.left);
//			skyWidth = skyWidth + 228;			
//			document.all[skycontentid].style.left = skyWidth + 'px';
//		}

 }


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

  document.body.style.zoom = nowZoom + "%";
//  document.all[skycontentid].style.zoom = nowZoom + "%";

//  if (document.all[skycontentid].style.left) {
//			skyWidth = parseInt(document.all[skycontentid].style.left);
//			skyWidth = skyWidth - 228;			
//			document.all[skycontentid].style.left = skyWidth + 'px';
//		}
 }

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


  // ½ºÅ©·Ñ µû¶ó´Ù´Ï´Â ·¹ÀÌ¾î

  var stmnLEFT = 900; // ½ºÅ©·Ñ¸Þ´ºÀÇ ÁÂÃø À§Ä¡
  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.left = stmnLEFT;
    document.getElementById("STATICMENU").style.top = document.body.scrollTop + stmnBASE;

    RefreshStaticMenu();
  }

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

    RefreshStaticMenu();
  }


  /* ¿ìÆí¹øÈ£ Ã£±â */
 
  function searchZip() {
        open_win("/common/searchZip.jsp","500","200","","");
  }
  
  /* window »õÃ¢ ¿­±â */      
  function open_win(opn_url, wth, hgt, scr, opt){
        posi = 'top='+((screen.height-hgt)/2-50) + ',left='+((screen.width-wth)/2-190) + ',scrollbars='+scr;
        posi = posi + ',width='+wth + ',height='+hgt+opt;
        win  = window.open(opn_url, '', posi);
        if (win.focus)  win.focus();
        return win;
  }
  
  function jsReady() {
        alert("ÁË¼ÛÇÕ´Ï´Ù. ÀÛ¾÷ÁßÀÔ´Ï´Ù.");
  }
  
  function newWorking() {
        alert("ÁË¼ÛÇÕ´Ï´Ù. ÁØºñÁßÀÔ´Ï´Ù.");
  }
  
  function prinPopUp(str,gubun) {
  	if(str == 'main'){
  		open_win("/gpms/view/print/mainPrintPopUp.jsp","950","500","yes","");
  	} else if(str == 'sub') {
  		open_win("/gpms/view/print/printPopUp.jsp?cssGubun=" + gubun,"650","430","yes","");
  	} else {
  		alert("¿À·ù°¡ ¹ß»ýÇÏ¿´½À´Ï´Ù.");
  	}
  }
 
