function BoardWrite( id ) { location.href = "?id=" + id + "&mode=write"; } function BoardList( id ) { if( document.getElementById("pg").value != "" ) { location.href = "?id="+id+"&pg="+document.getElementById("pg").value; } else { location.href = "?id="+id; } } function BoardView( id, no ) { location.href = "?id=" + id + "&mode=view&no=" + no; } function BoardModify( id, no ) { location.href = "?id=" + id + "&mode=modify&no=" + no; } function BoardPost( id ) { var frm = document.form; var title = document.getElementById("title"); var content = document.getElementById("content"); var mode = document.getElementById("mode"); if( title.value.length < 1) { alert ("작성하실 글 제목을 입력하여 주십시오."); title.focus(); return false; } else if( content.value == "
" ) { alert ("작성하실 글 내용을 입력하여 주십시오."); return false; } if( mode.value == "write" ) { frm.method = "post"; frm.action = "./post/"; frm.submit(); } else if( mode.value == "modify" ) { frm.method = "post"; frm.action = "./modify/"; frm.submit(); } else { alert("해당 글에 권한이 없습니다."); } } function BoardDelete( id, no ) { location.href = "./delete/?id=" + id + "&no=" + no + "&"; } function BoardReset() { var title = document.getElementById("title"); var content = document.getElementById("content"); title.value = ""; content.value = ""; } function BoardSearch() { var id = document.getElementById("id"); var search = document.getElementById("search"); var searchtext = document.getElementById("searchtext"); if( !searchtext.value ) { alert("검색어를 입력하여 주십시오."); } else { location.href = "?id=" + id.value + "&search=" + search.value + "&searchtext="+searchtext.value; } }