/* ¸ÞÀÎ ¸Þ´º ½ÃÀÛ */
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("subMenuImg_"+id)){
		//document.getElementById("subMenuImg_"+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 menuOn(imgEl) {
	imgEl.src = imgEl.src.replace("_out.gif", "_over.gif");
}
function menuOut(imgEl) {
	imgEl.src = imgEl.src.replace("_over.gif", "_out.gif");
}

/* ÀÌ¹ÌÁö 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.");
	}
}
/* ÀÌ¹ÌÁö 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";
		}
	}
}
/* ¸Þ´º ¿­°í ´Ý±â */


/* »õÃ¢ ¶ç¿ì±â */
function openWindowOpt(url, name, width, height, etcOpt)   {

    if (etcOpt.length > 0) {
        var top  = screen.height / 2 - height / 2 - 50;

        var left = screen.width / 2 - width / 2 ;

        var win =
            open(url,
                name,
                'width=' + width + ', height=' + height + ', top=' + top +
                ', left=' + left + ', resizable=no, status=yes, toolbar=no, menubar=no, ' + etcOpt);

        win.focus();

        return win;
    } else {
        return openWindow(url, name, width, height);
    }
}
/* »õÃ¢ ¶ç¿ì±â */


/* µ¿¿µ»ó ¶ç¿ì±â */
function jsMoviePlayer(file_path){
	document.write("<object id=\"Player\" width=\"320\" height=\"280\" classid=\"CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95\" standby=\"Loading Windows Media Player components...\" type=\"application/x-oleobject\" codebase=\"http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,7,1112\' VIEWASTEXT>");
	document.write("	<param name=\"autostart\" value=\"True\">");
	document.write("	<param name=\"filename\" value=\""+file_path+"\">");
	document.write("	<embed type=\"application/x-mplayer2\" name=\"MediaPlayer\" width=\"320\" height=\"280\" src=\""+file_path+"\">	");
	document.write("	</embed>");
	document.write("</object>");
}
/* µ¿¿µ»ó ¶ç¿ì±â */



/* È­¸é È®´ë Ãà¼Ò ½ÃÀÛ 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 + "%";
 }

/* È­¸é È®´ë Ãà¼Ò ³¡ */




// ½ºÅ©·Ñ µû¶ó´Ù´Ï´Â ·¹ÀÌ¾î
  var stmnGAP1 = 0; // ÆäÀÌÁö Çì´õºÎºÐÀÇ ¿©¹é
  var stmnGAP2 = 220; // ½ºÅ©·Ñ½Ã ºê¶ó¿ìÀú »ó´Ü°ú ¾à°£ ¶ç¿ò. ÇÊ¿ä¾øÀ¸¸é 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 isAccess(e) {
	
	var keynum;
	var ismouseClick = 1;
	
	if (window.event) {		//IE & Safari
		keynum = e.keyCode;
		
		//SafariÀÇ °æ¿ì ¸¶¿ì½ºÅ¬¸¯Àº keynum 0 ÀÌ ³Ñ¾î¿È
		if (event.button == 0 || keynum == 0){
			ismouseClick = 0;
		}		
		
	} else if ( e.which ){		// Netscape/Firefox/Opera
		keynum = e.which;
		
		if (keynum == 1) {
			ismouseClick = 0;
		}		
		
	}
	
	//¸¶¿ì½º Å¬¸¯ÀÌ°Å³ª ¿£ÅÍÅ°¸¦ ´©¸¥°æ¿ì true°ª ¹ÝÈ¯
	if ( ismouseClick == 0 || keynum == 13 ) {
		return true;
	} else {
		return false;
	}
}


	//°øÁö»çÇ×/ÀÔÂûÁ¤º¸/Àç¿ë°ø°í div Ã¼ÀÎÁö ½ºÅ©¸³Æ®

			function jsTabChange(key, e) {		
			
			if ( isAccess(e) ) {
				if (key == 1) { //°øÁö
					
					document.getElementById("noticeTitle").style.background = "url(./images/main/tablist_1_on.gif) no-repeat 0px 0px";				
					document.getElementById("tenderTitle").style.background = "url(./images/main/tablist_2_off.gif) no-repeat 0px 0px";
					document.getElementById("employTitle").style.background = "url(./images/main/tablist_3_off.gif) no-repeat 0px 0px";
					document.getElementById("noticelist").style.display = "block";
					document.getElementById("tenderlist").style.display = "none";
					document.getElementById("employlist").style.display = "none";					
					return;
				}
				else if(key==2) //ÀÔÂû
				{				
					document.getElementById("noticeTitle").style.background = "url(./images/main/tablist_1_off.gif) no-repeat 0px 0px";				
					document.getElementById("tenderTitle").style.background = "url(./images/main/tablist_2_on.gif) no-repeat 0px 0px";
					document.getElementById("employTitle").style.background = "url(./images/main/tablist_3_off.gif) no-repeat 0px 0px";
					document.getElementById("noticelist").style.display = "none";
					document.getElementById("tenderlist").style.display = "block";
					document.getElementById("employlist").style.display = "none";	
					return;
				}
				else if(key==3) //Ã¤¿ë
				{
					document.getElementById("noticeTitle").style.background = "url(./images/main/tablist_1_off.gif) no-repeat 0px 0px";				
					document.getElementById("tenderTitle").style.background = "url(./images/main/tablist_2_off.gif) no-repeat 0px 0px";
					document.getElementById("employTitle").style.background = "url(./images/main/tablist_3_on.gif) no-repeat 0px 0px";
					document.getElementById("noticelist").style.display = "none";
					document.getElementById("tenderlist").style.display = "none";
					document.getElementById("employlist").style.display = "block";
					return;
				}
			}
		}
