    
 function jsAllchk(form) {
	var chk = document.all;

	if (chk.allCheck.checked == true) {
		for (var i=0; i<chk.length;i++) {
			if (chk[i].type == "checkbox" && chk[i].checked == false) {
				chk[i].checked = true;
			}
		}
	}
	else {
		for (var i=0; i<chk.length;i++) {
			if (chk[i].type == "checkbox" && chk[i].checked == true) {
				chk[i].checked = false;
			}
		}
	}
 }

 function checkChk(){
	var chk = document.all;
	var count = 0;

	for(var i = 0; i < chk.length; i++){
		if(chk[i].type == "checkbox" && chk[i].name != "allCheck" && chk[i].checked == true){
			count++;
		}
	}
	if(count == 0){
		alert("¼±ÅÃÇÑ Ç×¸ñÀÌ ¾ø½À´Ï´Ù");
		return ;
	}

	var vde = confirm('°Ô½Ã¹°À» »èÁ¦ÇÏ½Ã°Ú½À´Ï±î?');
	if(!vde) return ;

        document.frmList.mode.value = "many";
        document.frmList.action ="delete.php";
	document.frmList.target = "_self";
        document.frmList.method = "post";
	document.frmList.submit();
 }

 function viewDel(ccode, bname, vcode, lpath){
	var vde = confirm('°Ô½Ã¹°À» »èÁ¦ÇÏ½Ã°Ú½À´Ï±î?');
	if(!vde) return ;

	document.location = lpath+"?code="+ccode+"&bname="+bname+"&vcode="+vcode;
 }

 function reDel(ccode, bname, vcode, rnum, lpath){
	var vde = confirm('°Ô½Ã¹°À» »èÁ¦ÇÏ½Ã°Ú½À´Ï±î?');
	if(!vde) return ;

	document.location = lpath+"?code="+ccode+"&bname="+bname+"&vcode="+vcode+"&rnum="+rnum;
 }

 function bbs_move(num){
   var f = document.frmList;
   if(f.target_bbs.options[0].selected){
       alert("ÀÌµ¿ÇÒ °Ô½ÃÆÇ¸íÀ» ¼±ÅÃÇÏ¼Å¾ß ÇÕ´Ï´Ù.");
       return;
   }

   var vde = confirm('°Ô½Ã¹°À» ÀÌµ¿ÇÏ½Ã°Ú½À´Ï±î?');
   if(!vde) return ;

   f.vcode.value = num;
   f.mode.value = "";
   f.action = "move_ok.php";
   f.target = "_self";
   f.method = "post";
   f.submit();
 }

 function bbs_list(cpage){
   var f = document.frmList;
   f.vcode.value = "";
   f.cpage.value = cpage;
   f.action = "list.php";
   f.target = "_self";
   f.method = "post";
   f.submit();
 }

 function bbs_modify(num, mode){
   var f = document.frmList;
   f.vcode.value = num;
   f.m.value = mode;
   f.action = "write.php";
   f.target = "_self";
   f.method = "post";
   f.submit();
 }

 function bbs_answer(num, pnum, depth, thread, mode){
   var f = document.frmList;
   f.vcode.value = num;
   f.pnum.value = pnum;
   f.depth.value = depth;
   f.thread.value = thread;
   f.m.value = mode;
   f.action = "write.php";
   f.target = "_self";
   f.method = "post";
   f.submit();
 }

 function bbs_delete(num){
   var vde = confirm('°Ô½Ã¹°À» »èÁ¦ÇÏ½Ã°Ú½À´Ï±î?');
   if(!vde) return ;

   var f = document.frmList;
   f.vcode.value = num;
   f.mode.value = "";
   f.action = "http://www.horimartcenter.org/bbs/delete.php";
   f.target = "_self";
   f.method = "post";
   f.submit();
 }

 function bbs_redelete(num, rnum){
   var vde = confirm('°Ô½Ã¹°À» »èÁ¦ÇÏ½Ã°Ú½À´Ï±î?');
   if(!vde) return ;

   var f = document.reply;
   f.vcode.value = num;
   f.rnum.value = rnum;
   f.action = "reply_del.php";
   f.target = "_self";
   f.method = "post";
   f.submit();
 }

 function bbs_add(mode, cpage){
   var f = document.frmList;
   f.m.value = mode;
   f.cpage.value = cpage;
   f.depth.value = "1";
   f.thread.value = "1";
   f.action = "write.php";
   f.target = "_self";
   f.method = "post";
   f.submit();
 }

 function bbs_add_vote(mode, cpage){
   var f = document.frmList;
   f.m.value = mode;
   f.cpage.value = cpage;
   f.action = "/manager/write.php";
   f.target = "_self";
   f.method = "post";
   f.submit();
 }

 function bbs_info(num, cpage, vnum) {
    if ( num != "" ) {
      var f = document.frmList;
      f.vcode.value = num;
      f.cpage.value = cpage;
      f.vNum.value = vnum;
      f.action = "view.php";
      f.target = "_self";
      f.method = "post";
      f.submit();
    }
 }

 function main_bbs_info(num, cpage, vnum, code, bname) {
    if ( num != "" ) {
      var f = document.frmList;
      f.code.value = code;
      f.bname.value = bname;
      f.vcode.value = num;
      f.cpage.value = cpage;
      f.vNum.value = vnum;
      f.action = "/bbs/view.php";
      f.target = "_self";
      f.method = "post";
      f.submit();
    }
 }

 function checkEnter(keyValue)
 {
    if(keyValue == 13)
    {
        checkWord();
        return false;
    }
 }

 function checkWord(){
   f = document.frmList;
   //if(f.sword.value == "") {
   //  alert("°Ë»öÇÒ ´Ü¾î¸¦ ÀÔ·ÂÇÏ¼¼¿ä");
   //  f.sword.focus();
   //  return;
   //}

   f.action = "list.php";
   f.target = "_self";
   f.method = "post";
   f.submit();
 }

 function goPageTo( num ){
   f = document.frmList;
   f.cpage.value=num;
   f.action = "list.php";
   f.target = "_self";
   f.method = "post";
   f.submit();

   return;
 }

 function bbs_check_submit(){
   var f = document.frmWrite;
   if(f.subject.value == ""){
       alert("Á¦¸ñÀ» ÀÔ·ÂÇÏ¼¼¿ä.");
       f.subject.focus();
       return;
   }

   if(f.memo.value == ""){
       alert("³»¿ëÀ» ÀÔ·ÂÇÏ¼¼¿ä.");
       f.memo.focus();
       return;
   }

   //if(f.bname.value == "free2") {
   //  f.action = "http://www.horimartcenter.org/bbs/write_ok.php";
   //}
   //else {
   //  f.action = "write_ok.php";
   //}
   f.action = "http://www.horimartcenter.org/bbs/write_ok.php";
   f.target = "_self";
   f.method = "post";
   f.submit();
 }

 function goPageTo_board( num ){
   f = document.frmList;
   f.cpage.value=num;
   f.action = "board_list.php";
   f.target = "_self";
   f.method = "post";
   f.submit();

   return;
 }

