function fSendMail(){
  if(document.getElementById("idLst01Email_ID") != null && document.getElementById("idLst01Email_Host") != null){
    location.href="mailto:"+document.all.idLst01Email_ID.innerText+"@" + document.all.idLst01Email_Host.innerText
  }
}
function enAbleReturnMail(){
  if(document.all.chkLst01ReturnMail.checked){
    if(!validEMAIL(document.all.edtLst01EMail.value)){
      document.all.chkLst01ReturnMail.checked = false;
      //document.all.edtLst01EMail.focus();
    }
  }
}
//.
function inBoardDoc_SendForm(pType,pMode){
  if (pMode){
	frm.txtLst01Text.value = document.all.editBox.html;
  }
  switch(pType){
    case "insert" :
    case "update" :
    case "reply" :
      if(frm.edtLst01Title.value == "" ){ alert("Enter the Title.");frm.edtLst01Title.focus(); return ; }
      if(frm.edtLst01Writer.value == ""){ alert("Enter the Writer.");frm.edtLst01Writer.focus(); return ; }
      if(frm.edtLst01Password.value == ""){ alert("Enter the Password."); frm.edtLst01Password.focus(); return ; }
      if(document.getElementById("edtLst01IDNumber") != null){
        //if(!chkresno(frm.edtLst01IDNumber.value)){
        //frm.edtLst01IDNumber.focus();
        //return;
        //}
      }
	  
//	  if(document.getElementById("edtLst01Telephone") != null){
	    if(document.all.idPBTelephone.style.display != 'none' ){
  		  if(!frm.edtLst01Telephone.value){ 
          alert("Enter the phone number.");
          frm.edtLst01Telephone.focus();
          return ;
    		}
      }
    //}
    
	  
    if(document.getElementById("edtLst01Homepage") != null){
        if((document.all.frm.edtLst01Homepage.value).length  > 50) {
          alert("Homepage URL shouldn't exceed 50 letters");
          document.all.edtLst01Homepage.focus();
          return;
        }
      }

      if(document.getElementById("edtLst01EMail") != null){
        if((document.all.frm.edtLst01EMail.value).length  > 50) {
          alert("Email address shouldn't exceed 50 letters");
          document.all.edtLst01EMail.focus();
          return;
        }
        
        if((frm.edtLst01EMail.value).length > 0 ){
          if(!validEMAIL(frm.edtLst01EMail.value)){
            frm.edtLst01EMail.focus();
            return ;
          }
        }
      }

      if(document.all.idPBAddress.style.display != 'none' ){
  		  if(!frm.edtLst01Address1.value){ 
          alert("Enter the address.");
          frm.edtLst01Address1.focus();
          return ;
    		}
      }
      
      if(document.getElementById("edtLst01Address1") != null){
        if((document.all.frm.edtLst01Address1.value).length  > 120) {
          alert("Address shouldn't exceed 120 letters.");return;document.all.edtLst01Address1.focus();
        }
      }
      
      if(frm.txtLst01Text.value == ""){ 
      alert("Enter the Content.");
      frm.txtLst01Text.focus(); 
      return ; 
    }
    
      break;
    case "restore" : 
      break;
    case "complete" :
      if(!confirm('You have selected complete deletion. \nCompletely deleted data will be removed from the database. \nDo you want to continue?')){return;}
      break;
    case "delete" :
      if(document.all.frm.edtLst01Password.value == ''){ document.all.frm.edtLst01Password.focus(); alert("Enter the password.");return ; }
      if(!confirm("Deleted data can't be restored.")){return;}
      break;
    case "checkpwd" :
      if(frm.edtLst01Password.value == ""){ frm.edtLst01Password.focus(); alert("Enter the password.");return ; }
      break;
  }
  document.all.frm.amode.value =  pType;
  document.all.frm.action = "frmBoardDoc.asp"
  document.all.frm.encoding = "multipart/form-data";
  document.all.frm.method = "POST";
  document.all.frm.submit();
}

modBoardDoc_SendForm = inBoardDoc_SendForm;
repBoardDoc_SendForm = inBoardDoc_SendForm;
outBoardDoc_SendForm = inBoardDoc_SendForm;
//

function outBoardDocCmt_SendForm(pType, pCode){
    setValue("amode", "");
    setValue("amode", pType);
    setValue("hdnCmt01ID", "");
    setValue("hdnCmt01ID", pCode);
    switch(pType){
      case "delete" :
        if(!confirm("Deleted data can't be restored.")){return;}
        break;
      case "insert" :
        if(isBlank("edtCmt01Writer")){focus("edtCmt01Writer");alert('Enter the Writer.');return;}
        if(isBlank("txtCmt01Text")) { focus("txtCmt01Text");alert('Enter the Content.');return;}
        break;
      case "update" :
        if(isBlank("edtCmt01Writer")){focus("edtCmt01Writer");alert('Enter the Writer.');return;}
        if(isBlank("txtCmt01Text")) { focus("txtCmt01Text");alert('Enter the Content.');return;}
        break;
    }
	  document.all.frm.action = "frmBoardCmt.asp"
	  document.all.frm.method = "POST";
		document.all.frm.submit();
}

//
function repBoardDoc_Open(pCode){
  if(document.getElementById("crobot") != null){
    document.all.frm.crobot.value = calcMD5(pCode);
  }
  document.all.frm.action = "./repBoardDoc.asp"
  document.all.frm.method = "GET";
  document.all.frm.submit();  
}

function modBoardDoc_Open(){
  document.all.frm.action = "modBoardDoc.asp"
  document.all.frm.method = "GET";
  document.all.frm.submit();  
}

function pwdBoardDoc_Open(pType){
  document.all.frm.amode.value = pType;
  document.all.frm.action = "pwdBoardDoc.asp"
  document.all.frm.method = "GET";
  document.all.frm.submit();  
}

function delBoardDoc_Open(){
  document.all.frm.action = "delBoardDoc.asp"
  document.all.frm.method = "GET";
  document.all.frm.submit();  
}

function lstBoardDoc_Open(){
  location.href="lstBoardDoc.asp?GrpID=" + document.all.frm.GrpID.value
  "&hdnPage="+document.all.frm.hdnPage.value+"&hdnGubun="+document.all.frm.hdnGubun.value
//  document.all.frm.action = "lstBoardDoc.asp"
//  document.all.frm.method = "GET";
//  document.all.frm.submit();  
}

//°Ô½Ã¹° ÀÐ±â ÆÄÀÏ ¿­±â
function outBoardDoc_Open(pCode, pSort, pSame){
  document.all.frm.LstSort.value = pSort;
  document.all.frm.LstSame.value = pSame;
  document.all.frm.LstID.value = pCode;
  document.all.frm.action = "outBoardDoc.asp"
  document.all.frm.submit();
}

function setOutBoardDoc_Open(pCode, pSame, pSort){
  document.all.frm.LstSort.value = pSort;
  document.all.frm.LstSame.value = pSame;
  document.all.frm.LstID.value = pCode;
}

function lstBoardDoc_SendOrder(pType, pCode){
  document.all.frm.hdnOrder.value = pType;
  document.all.frm.OType.value = pCode
  document.all.frm.action = ""
  document.all.frm.submit();
}

//
function inBoardDoc_Open(pCode){
  if(document.getElementById("crobot") != null){
    document.all.frm.crobot.value = calcMD5(pCode);
  }
  document.all.frm.action = "inBoardDoc.asp"
  document.all.frm.method = "GET";
  document.all.frm.submit();
}

function setEditMode(sMode) {
	document.all.editBox.editmode = sMode;
}

//
function addRecommand(){
  var checkedButton = ""   
  for (var i=0; i < document.frm.Lst01Recom.length; i++) {      
    if (document.frm.Lst01Recom[i].checked == true) {         
      checkedButton=true
    }   
  }
  
  if( checkedButton){
    document.all.frm.amode.value = 'recommand';
    document.all.frm.action = "frmBoardDoc.asp"
    document.all.frm.method = "POST";
    document.all.frm.encoding = "multipart/form-data";
    document.all.frm.submit();
  }else{
    alert("Recommendation has not been selected.");
    return;
  }

}