/* ¸ÞÀÎ ¸Þ´º ½ÃÀÛ */
function displaySub(id) {
	var imgName;
	var re;
	for(i=1 ; i<=6 ; 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) {
	return;
	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 = /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("_ov.") > -1 ) {
		var re = /_ov\./g;
		img.src = imgName.replace(re,".");
	} else {
		var re = /\.jpg/g;
		img.src = imgName.replace(re,"_ov.jpg");
	}
}
/* ¸Þ´º ¿­°í ´Ý±â */

function view_hide_menu(div_name) {
	if(document.getElementById(div_name) != null) {
		var status1 = document.getElementById(div_name).style.display;
		if(status1=="none") {
			document.getElementById(div_name).style.display="block";
		} else {
			document.getElementById(div_name).style.display="none";
		}
		/*
		var status1 = document.getElementById(div_name).style.display;
		var status2 = div_name.substr(0,6);
		var status;
		for(i=1;i<100;i++){
			if(i<10){
				if(document.getElementById(status2+'0'+i) != null) {
					document.getElementById(status2+'0'+i).style.display="none";
				}
			}else{
				if(document.getElementById(status2+i) != null) {
					document.getElementById(status2+i).style.display="none";
				}
			}
		}

		if(status1=="none") {
			document.getElementById(div_name).style.display="block";
		} else {
			document.getElementById(div_name).style.display="none";
		}
		*/
	}
}

//Äü¸Þ´º
var stmnLEFT = 880; // ½ºÅ©·Ñ¸Þ´ºÀÇ ÁÂÃø À§Ä¡
var stmnGAP1 = 300; // ÆäÀÌÁö À§ÂÊ ¿©¹é
var stmnGAP2 = 100; // ½ºÅ©·Ñ½Ã ºê¶ó¿ìÀú »ó´Ü°ú ¾à°£ ¶ç¿ò. ÇÊ¿ä¾øÀ¸¸é 0À¸·Î Á¶Á¤ÇÏ¼¼¿ä
var stmnBASE = 50; // ½ºÅ©·Ñ¸Þ´º ÃÊ±â ½ÃÀÛÀ§Ä¡
var stmnActivateSpeed = 200; // ¿òÁ÷ÀÓÀ» °¨ÁöÇÏ´Â ¼Óµµ (¼ýÀÚ°¡ Å¬¼ö·Ï ´À¸®´Ù)
var stmnScrollSpeed = 2; // ½ºÅ©·ÑµÇ´Â ¼Óµµ (Å¬¼ö·Ï ´À¸²)
var stmnTimer;

function RefreshStaticMenu(){
	var stmnStartPoint, stmnEndPoint, stmnRefreshTimer;
	stmnStartPoint = parseInt(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 );
		STATICMENU.style.top = parseInt(STATICMENU.style.top, 10) + ( ( stmnEndPoint<stmnStartPoint ) ? -stmnScrollAmount : stmnScrollAmount );
		stmnRefreshTimer = stmnScrollSpeed;
	}

	stmnTimer = setTimeout ("RefreshStaticMenu();", stmnRefreshTimer);
}

function InitializeStaticMenu(){
	STATICMENU.style.left = stmnLEFT;
	STATICMENU.style.top = document.body.scrollTop + stmnBASE;
	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("¿À·ù°¡ ¹ß»ýÇÏ¿´½À´Ï´Ù.");
  	}
  }

