function checkAttachDel(){
    if(trim(this.form.attach.value) != ''){
        this.form.attach_delete.checked = true;
    }else{
        this.form.attach_delete.checked = false;
    }
}

function jump(url, keyword){
    this.jumpForm.action  = url;
    this.jumpForm.keyword.value = keyword;
    this.jumpForm.submit();
}

function checkKeyWord(){
    if(!(this.searchform.category[0].checked | this.searchform.category[1].checked | this.searchform.category[2].checked)){
        alert('°Ë»öÁ¶°ÇÀÌ ¼±ÅÃµÇÁö ¾Ê¾Ò½À´Ï´Ù.');
        return false;
    }else if(trim(this.searchform.keyword.value).length == 0){
        alert('°Ë»ö¾î¸¦ ÀÔ·ÂÇÏÁö ¾Ê¾Ò½À´Ï´Ù.');
        return false;
    }else{
        return true;
    }
}

function check_write(){
    if(this.form.writer.value==''){
        alert("ÀÌ¸§À» ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
        this.form.writer.focus();
        return false;
    }else if(this.form.title.value==''){
        alert("Á¦¸ñÀ» ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
        this.form.title.focus();
        return false;
    }
    return true;
    this.form.submit();
}

function read(url){
    this.readForm.action = url;
    this.readForm.submit();
}

function trim(inputString) {
   if (typeof inputString != "string") { return inputString; }
   var retValue = inputString;
   var ch = retValue.substring(0, 1);
   while (ch == " ") {
      retValue = retValue.substring(1, retValue.length);
      ch = retValue.substring(0, 1);
   }
   ch = retValue.substring(retValue.length-1, retValue.length);
   while (ch == " ") {
      retValue = retValue.substring(0, retValue.length-1);
      ch = retValue.substring(retValue.length-1, retValue.length);
   }
   while (retValue.indexOf("  ") != -1) {
      retValue = retValue.substring(0, retValue.indexOf("  ")) + retValue.substring(retValue.indexOf("  ")+1, retValue.length); // Again, there are two spaces in each of the strings
   }
   return retValue;
}

