﻿	//	+, - 키를 입력하면 화면 확대, 축소를 한다.
	document.onkeypress = getKey;

	function getKey(keyStroke) {
		isNetscape=(document.layers);
		eventChooser = (isNetscape) ? keyStroke.which : event.keyCode;
		which = String.fromCharCode(eventChooser).toLowerCase();
		which2 = eventChooser;

		var el=event.srcElement;

		if ((el.tagName != "INPUT") && (el.tagName != "TEXTAREA"))		//input,textarea 안에서의 +.-값은 실행안되도록
		{
			if(which == "+" )
				zoomInOut('zoom', 'in');
			else if(which == "-" )
				zoomInOut('zoom', 'out');
		}
	}

//////////////////////////////////////////////////////////////////
// 영역 줌
	var zoomRate = 20;			// 확대/축소시 증감률
	var maxRate = 300;			//최대확대률
	var minRate = 100;			//최소축소률

	function zoomInOut(contentid, how) {
		
		var currZoom = document.all[contentid].style.zoom;
		
		if(currZoom == null || currZoom == ""){
			currZoom = '100%';
		}
		
		if (how == "in" && parseInt(currZoom) < maxRate) {
			document.all[contentid].style.zoom = parseInt(currZoom)+zoomRate+'%'
		}
		
		if (how == "out" && parseInt(currZoom) > minRate) {
			document.all[contentid].style.zoom = parseInt(currZoom)-zoomRate+'%'
		}
	}

	function SetCookie(name,value){
		document.cookie = name + "=" + escape (value)+";domain=www.airport.kr";
	}

	function GetCookie(name){
		if (document.cookie != "") {
			zoomc = document.cookie.split("; ");
			for (var i=0; i < zoomc.length; i++) {
                zoomv = zoomc[i].split("=");
                if (zoomv[0] == name) {
				    return  unescape(zoomv[1]);
                }
			}
		}else{
			return "";
		}
	}
	function GoZoom(contentid){
		if(GetCookie("zoomVal") != null && GetCookie("zoomVal") != ""){
			document.all[contentid].style.zoom = GetCookie("zoomVal");
			currZoom=GetCookie("zoomVal");
		}
		else{
			document.all[contentid].style.zoom = '100%';
			currZoom = '100%';
		}
	}

	function printPreview(){
			left = (document.body.clientWidth - 625) / 2;
			height = (document.body.clientHeight - 50);
			document.printForm.printHtml.value = printBody.innerHTML;
			var ppp=window.open('/print.html','', config='height='+height +',width=645, left='+ left +', top = 50,scrollbars=yes');
	}
	
	function printPreview01(){
			left = (document.body.clientWidth - 625) / 2;
			height = (document.body.clientHeight - 50);
			document.printForm.printHtml.value = printBody.innerHTML;
			var ppp=window.open('/print01.html','', config='height='+height +',width=645, left='+ left +', top = 50,scrollbars=yes');
	}
	
	function printPreview02(){
			left = (document.body.clientWidth - 625) / 2;
			height = (document.body.clientHeight - 50);
			document.printForm.printHtml.value = printBody.innerHTML;
			//alert(left + height);
			var ppp=window.open('/print02.html','', config='height='+height +',width=700, left='+ left +', top = 50,scrollbars=yes');
	}

	function newWin(url){

			var ppp=window.open(url,'_blank');
	}
	// 링크테두리 없애주는 스크립트
	/*
	function bluring(){ 	if(event.srcElement!=null){
			if(event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG") document.body.focus(); 	}
	}
	document.onfocusin=bluring;
	*/
	var w = "";
	function open_win(fname, width, height) {
	  if (w!="") w.close();
	  w = window.open(fname, '', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=auto,resizable=no,width='+width+',height='+height);
	}
	//업로드 파일 확장자 체크 스크립트(폼안에 file타입은 모두 체크)-인자타입은 폼
	function UploadFileCheck_Form(form){
		for(var i=0;form!=undefined&&i<form.elements.length;i++){
			var Obj = form.elements[i];
			if(Obj.type == 'file'){
				if(!UploadFileCheck(Obj)){
					return false;
				}
			}
		}
		return true;
	}
	
	function open_win1(fname, width, height, left, top) {
	  if (w!="") w.close();
	  w = window.open(fname, '', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=auto,resizable=no,width='+width+',height='+height+',left='+left+',top='+top);
	}
	//업로드 파일 확장자 체크 스크립트(폼안에 file타입은 모두 체크)-인자타입은 폼
	function UploadFileCheck_Form(form){
		for(var i=0;form!=undefined&&i<form.elements.length;i++){
			var Obj = form.elements[i];
			if(Obj.type == 'file'){
				if(!UploadFileCheck(Obj)){
					return false;
				}
			}
		}
		return true;
	}
	//파일 확장자 체크 스크립트 - 인자타입 object
	function UploadFileCheck(Object)
	{
	 if (Object.value.match(/\.(jsp|php|exe|asp|cgi|htm|html)$/i)) {
	  alert("확장자가 jsp, php, exe, asp, cgi, htm, html인 파일은 첨부하실 수 없습니다.");
	  return false;
	 }
	 return true;
	}
	
	function checkSearchWord(strPass){

		/*var tempVal = strPass.value;
		var mikExp = /[$\\@\\\#%\^\&\*\(\)\[\]\+\<\>\_\{\}\'\`\"\-\=\|\;]/;

		var strLength = tempVal.length;
		var lchar = tempVal.charAt((strLength) - 1);
		if(lchar.search(mikExp) != -1) {
			window.alert("@ $ % ^ < > _ & * # ( ) [ ] \\ { + }  ` \" - =  | ; \n\n 과 같은 특수문자는 입력하실 수 없습니다.");
			strPass.value="";
			strPass.focus();
			return true;
		}else{
			return false;
		}*/
		return false;
		
	}
	
	function isValidDate(strdate, fmt) {
		var isCheck = true;
		if(fmt == "yymmdd") {
			if(strdate == null) {
				isCheck = false;
			} else if(strdate.length != 6) {
				isCheck = false;
			} else if(!(new RegExp(/[0-9]/).test(strdate))) {
				isCheck = false;
			}
		}
		return isCheck;
	}

function goto_url(url, targetstr)
{
  if (url == 'backward')
    history.back(1);
  else if (url == 'forward')
    history.forward(1);
  else {
     if (targetstr == 'blank') {
       window.open(url, 'win1');
     } else {
       var frameobj;
       if (targetstr == '') targetstr = 'self';
       if ((frameobj = eval(targetstr)) != null)
         frameobj.location = url;
     }
  }
}

function __getURL(u) {
	var h = new String(window.location.host);
	if(window.location.protocol == "https:") {
		if(u.substring(0,1) != "/") {
			u = window.location.pathname.substring(0,window.location.pathname.lastIndexOf("/")) + "/" + u;
		}
		if(window.location.port != "") {
			u = "http://" + h.substring(0, h.length - (new String(window.location.port)).length - 1) + u;
		} else {
			u = "http://" + window.location.host + u;
		}
	}
	return u;
}

//-->


ok=0; old_what="non";

function show(what){
	if((old_what != "non") && (what != old_what)){
			ok=1;
			old_what.style.display="none";
			what.style.display="";
	  }else
	  {
			if(ok){
			  ok=0;
			  what.style.display="none";
			}else
			{
			  ok=1;
			  what.style.display="";
			}
	  }
	  old_what=what;
	}

