<!--
function MM_findObj(n, d) { //v3.0
  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); return x;
}

function MM_showHideLayers() { //v3.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 MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

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_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 ShowContent(SC_No) {



	if(eval("dis"+SC_No+".style.display == 'none'")) {

		eval("dis"+SC_No+".style.display = 'block'");
		document.getElementById("arrow_"+SC_No).src= "/images/arrow01.gif";

	} else {

		eval("dis"+SC_No+".style.display = 'none'");
		document.getElementById("arrow_"+SC_No).src= "/images/arrow02.gif";

	}

}


function na_open_window(name, url, left, top, width, height, toolbar, menubar, statusbar, scrollbar, resizable)
{
  toolbar_str = toolbar ? 'yes' : 'no';
  menubar_str = menubar ? 'yes' : 'no';
  statusbar_str = statusbar ? 'yes' : 'no';
  scrollbar_str = scrollbar ? 'yes' : 'no';
  resizable_str = resizable ? 'yes' : 'no';
  window.open(url, name, 'left='+left+',top='+top+',width='+width+',height='+height+',toolbar='+toolbar_str+',menubar='+menubar_str+',status='+statusbar_str+',scrollbars='+scrollbar_str+',resizable='+resizable_str);
}


function pop_type(form_nm, type,src,w,h){
  var newsrc = src.lastIndexOf(".");
  switch(type){
    case 1 :
      var scroll = "yes"
    break;
    case 2 :
      var scroll = "no"
    break;
    case 3 :
      popup = window.open(src,"new"+ h +"",'fullscreen,scrollbars,width="100%",height="100%"');
    break;
    default :
      var scroll = "yes";
    break;
  }
  var winleft = (screen.width - w) / 2;
  var wintop = (screen.height - h) / 2;
  var poptype = 'width='+w+',height='+h+',top='+wintop+',left='+winleft+',resizable=yes,scrollbars='+scroll+',toolbars=no,status=no,menu=no';
  popup = window.open(src, form_nm, poptype)
  if (parseInt(navigator.appVersion) >= 4) { popup.window.focus(); }
}


//Only Eng or Number
function checkNumEng(obj) {
  var strings    = obj.value ;
  for(i=0;i<strings.length;i++) {
	c = strings.charAt(i);
	if((c < '0' || c > '9') && (c < 'a' || c > 'z') && (c < 'A' || c > 'Z')){
	  alert("영문과 숫자만 입력 가능 합니다..");
	  obj.value=strings.substr(0,i);
	  obj.focus();
	  return(false);
	}
  }
}

//Only Number
function checkNum(obj) {
  var strings    = obj.value ;
  for(i=0;i<strings.length;i++) {
	c = strings.charAt(i);
	if((c < '0' || c > '9')){
	  alert("숫자만 입력 가능 합니다..");
	  obj.value=strings.substr(0,i);
	  obj.focus();
	  return(false);
	}
  }
}


/* 최대 글자 수 제한하는 함수 */  
function CheckStrLength(maxlen, obj) { 
	
	var ls_str = obj.value;  
    var li_str_len = ls_str.length;  
 
    var li_max = maxlen;   
    var i = 0;   
    var li_byte = 0;   
    var li_len = 0;   
    var ls_one_char = "";  
    var ls_str2 = "";  
 
    for(i=0; i<li_str_len; i++) {  
     ls_one_char = ls_str.charAt(i);  
 
     if (escape(ls_one_char).length > 4)  
      li_byte += 2;  
     else  
      li_byte++;  
      
     if(li_byte <= li_max)  
      li_len = i + 1;  
    }  
 
    if(li_byte > li_max) {  
     alert("영문 "+li_max+"자 한글 "+li_max/2+"자를 초과 입력할 수 없습니다. \n\n초과된 내용은 자동으로 삭제됩니다. ");  
     ls_str2 = ls_str.substr(0, li_len);  
     obj.value = ls_str2;  
    }   
    obj.focus();   
   
}  


function resizeImg(img, maxWidth, maxHeight){



   // 원본 이미지 사이즈 저장
   var width = img.width;
   var height = img.height;
 
	var resizeWidth = 0;
	var resizeHeight = 0;
 

   // 가로, 세로 최대 사이즈 설정
  //var maxWidth = width * 0.5;   // 원하는대로 설정. 픽셀로 하려면 maxWidth = 100  이런 식으로 입력
   //var maxHeight = height * 0.5;   // 원래 사이즈 * 0.5 = 50%

 

   // 가로나 세로의 길이가 최대 사이즈보다 크면 실행  
   if(width > maxWidth || height > maxHeight){

 

      // 가로가 세로보다 크면 가로는 최대사이즈로, 세로는 비율 맞춰 리사이즈
      if(width > height){
         resizeWidth = maxWidth;
         resizeHeight = ((height * resizeWidth) / width);

 

      // 세로가 가로보다 크면 세로는 최대사이즈로, 가로는 비율 맞춰 리사이즈
      }else{
         resizeHeight = maxHeight;

         resizeWidth = (width * resizeHeight) / height;
      }

 

   // 최대사이즈보다 작으면 원본 그대로
   }else{
      resizeWidth = width;
      resizeHeight = height;
   }

 

   // 리사이즈한 크기로 이미지 크기 다시 지정
   img.width = resizeWidth;
   img.height = resizeHeight;
}




/**
 * 주민등록 여부를 확인한다.
 * param : sID 입력문자열(주민번호 13자리)
 * return : Boolean true이면 적합한 주민번호
 */
function isIdentifyNo(sID)
{
  cBit = 0;
  sCode="234567892345";

  for(i=0;i<12;i++)
  {
    cBit = cBit+parseInt(sID.substring(i,i+1))*parseInt(sCode.substring(i,i+1));
  }
   	
  cBit=11-(cBit%11);
  cBit=cBit%10;
  	
  if(parseInt(sID.substring(12,13))==cBit) 
  {
    return true;
  }
  else
  {
    return false;
  }
}


