// -- Global º¯¼ö ¼±¾ðºÎ -- gs_nwbWebRoot = "http://hamane.org/webboard"; // ------------------------------------------------------------------------------ // -- JavaScript ÇÔ¼ö ¼±¾ðºÎ -- // ------------------------------------------------------------------------------ function nwbLoginSetFocus() { document.form_check_password.user_id.focus(); } function nwbLoginFormSubmit() { user_id = document.form_check_password.user_id; password = document.form_check_password.password; if ( !nwbCheckInputText( user_id, "¾ÆÀ̵𰡠ÀԷµÇÁö ¾Ê¾Ò½À´Ï´Ù." ) ) return false; else if ( !nwbCheckInputText( password, "ºñ¹Ð¹øÈ£°¡ ÀԷµÇÁö ¾Ê¾Ò½À´Ï´Ù." ) ) return false; else return true; } function nwbFindPasswordFormSubmit() { user_id = document.form_find_password.user_id; user_email = document.form_find_password.user_email; if ( !nwbCheckInputText( user_id, "¾ÆÀ̵𰡠ÀԷµÇÁö ¾Ê¾Ò½À´Ï´Ù." ) ) return false; if ( !nwbCheckInputText( user_email, "email ÁÖ¼Ò°¡ ÀԷµÇÁö ¾Ê¾Ò½À´Ï´Ù." ) ) return false; return true; } function nwbOpenWindow( 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 nwbShowUserInfo( nUserIdx ) { sUrl = gs_nwbWebRoot + "/script/user_info.php?user_idx=" + nUserIdx ; //nwbOpenWindow( "user_information", sUrl, 0, 0, 405, 500, 0, 0, 1, 0, 1 ); window.open( sUrl, 'User_Infomation', 'scrollbars=yes,resizable=yes,width=430 ,height=680'); } // -- list page -- function nwbChangeCategory( nIdx ) { var oForm = document.form_category_change; oForm.ct.value = nIdx; oForm.submit(); } function nwbTrim( sStr ) { var il, ir, sl, sr, fComplete = false; il = 0; ir = sStr.length-1; while ( il <= ir && !fComplete ) { sl = sStr.charAt( il ); sr = sStr.charAt( ir ); if ( sl == ' ' || sl == '\t' ) { il++; fComplete = false; } else { fComplete = true; } if ( sr == ' ' || sr == '\t' ) { ir--; fComplete = false; } else { fComplete = true; } } return ( "" + sStr.slice( il, ir+1 ) ); } function nwbIsNumeric( sInput ) { return !isNaN( sInput ); } function nwbIsAlphaNuberic( sInput ) { var sValid = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; var i; var nLength = sInput.length; for ( i = 0; i < nLength; i++ ) { { if ( sValid.indexOf( sInput.charAt(i) ) < 0 ) { return false; } } } return true; } // -- °¢Á¾ Check ÇÔ¼öµé -- function nwbCheckInputText( oInput, sMsg, fFocus ) { var sTmp = nwbTrim( oInput.value ); var args = nwbCheckInputText.arguments; if ( sTmp == "" ) { alert( sMsg ); if ( fFocus || args.length == 2 ) { oInput.focus(); } return false; } return true; } function nwbCheckInputSelect( oInput, sMsg, fFocus ) { } function nwbCheckSearch() { form = document.form_search; fCheck = nwbCheckInputText(form.q, "°Ë»ö¾î¸¦ ÀÔ·ÂÇØÁֽʽÿÀ."); if ( !fCheck ) return false; if ( form["qt[n]"].checked == false && form["qt[s]"].checked == false && form["qt[c]"].checked == false ) { alert( "°Ë»öÇ׸ñÀ» ÁöÁ¤ÇØÁֽʽÿÀ." ); return false; } return true; } // -- Write/Reply/Modify ÆäÀÌÁö ÆÄÀÏ ¾÷·Îµå °ü·Ã ÇÔ¼öµé -- var gfInProcessing = false; function nwbCheckWriteForm() { var form_write = document.form_write; var args = nwbCheckWriteForm.arguments; var nArgNum = args.length; // Submit Process°¡ ÁøÇàÁßÀÎ °æ¿ì, Áߺ¹ SubmitµÇ´Â °ÍÀ» ¸·À½. if ( gfInProcessing ) { return false; } for ( var i = 0; i < nArgNum; i++ ) { if (args[i] == "name") { if (nwbTrim(form_write.name.value) == "") { form_write.name.focus(); alert("ÀÛ¼ºÀÚ À̸§ÀÌ ¾ø½À´Ï´Ù."); return false; } } if (args[i] == "password") { if (nwbTrim(form_write.password.value) == "") { form_write.password.focus(); alert("ºñ¹Ð¹øÈ£°¡ ¾ø½À´Ï´Ù."); return false; } } if (args[i] == "subject") { if (nwbTrim(form_write.subject.value) == "") { form_write.subject.focus(); alert("Á¦¸ñÀÌ ¾ø½À´Ï´Ù."); return false; } } if (args[i] == "content") { if (nwbTrim(form_write.content.value) == "") { form_write.content.focus(); alert("±Û ³»¿ëÀÌ ¾ø½À´Ï´Ù."); return false; } if (form_write.content.value.length > 65536 ) { alert("±Û ¿ë·®ÀÌ ÃÊ°úµÇ¾î ÀúÀåÇÒ ¼ö ¾ø½À´Ï´Ù.\n±Û ¼ö¸¦ ÁÙÀ̽ñ⠹ٶø´Ï´Ù."); return false; } } if (args[i] == "category") { if (form_write.category.options[0].selected) { form_write.category.focus(); alert("Ä«Å×°í¸®¸¦ ¼±ÅÃÇÏÁö ¾Ê¾Ò½À´Ï´Ù."); return false; } } if (args[i] == "file") { if (document.form_upload_file.file_list.options.length < 2) { alert("ÆÄÀÏÀ» ¼±ÅÃÇÏÁö ¾Ê¾Ò½À´Ï´Ù."); return false; } } if (args[i] == "email") { if (nwbTrim(form_write.email.value) == "") { form_write.email.focus(); alert("À̸ÞÀÏ ÁÖ¼Ò°¡ ¾ø½À´Ï´Ù."); return false; } } if (args[i] == "homepage") { if (nwbTrim(form_write.homepage.value) == "") { form_write.homepage.focus(); alert("ȨÆäÀÌÁö ÁÖ¼Ò°¡ ¾ø½À´Ï´Ù."); return false; } } if (args[i] == "fileupload") { var sFileList = nwbGetFileList(); form_write.file_list.value = sFileList; } } // Submit form form_write.submit(); gfInProcessing = true; return false; } function nwbAddFile(sFileName, sTempDirFileName) { var oOption = new Option(sFileName, sTempDirFileName); var nLength = document.form_upload_file.file_list.length; document.form_upload_file.file_list.options[nLength] = oOption; // file °³¼ö üũ // nFileNum++; } function nwbDeleteFile() { var sDoc = document.form_upload_file.file_list; for (var i = 1; i < sDoc.options.length; i++) // "ÃÖ´ë ÆÄÀÏ ¸ñ·Ï °³¼ö" ¸Þ½ÃÁö ¶§¹®¿¡ 1 ºÎÅÍ ½ÃÀÛ { if (sDoc.options[i].selected) { sDoc.options[i] = null; break; } } } function nwbDeleteTmpFile() { var sDoc = document.form_upload_file.file_list; for (var i = 1; i < sDoc.options.length; i++) { if (sDoc.options[i].selected) { document.form_delete_file.file_path.value = sDoc.options[i].value; break; } } document.form_delete_file.submit(); } function nwbGetFileList() { var oSelect = document.form_upload_file.file_list; var aFileName = new Array(); var nCnt = 0; for (var i = 0; i < oSelect.options.length; i++) { if ( oSelect.options[i].value == -1 ) continue; aFileName[nCnt++] = oSelect.options[i].value; } var sFileList = aFileName.join(" "); return sFileList; } // ȸ¿ø°¡ÀÔ, ȸ¿øÁ¤º¸ ¼öÁ¤ ÆäÀÌÁö ½ºÅ©¸³Æ® // °ü¸®ÀÚ ÆäÀÌÁö(Admin)¿µ¿ª¿¡¼­´Â »ç¿ëµÇÁö ¾ÊÀ½. // Â÷ÈÄ¿¡ »èÁ¦°¡ ÇÊ¿äÇÑ ÇÔ¼öÀÓ nwbCheckRegistForm() --> 2003.09.26 by commented by shrimp function nwbCheckRegistForm( ) { var sDoc = window.document.form_regist; if (nwbTrim(sDoc.id.value) == "") { sDoc.id.focus(); alert("¾ÆÀ̵𰡠ÀԷµÇÁö ¾Ê¾Ò½À´Ï´Ù."); return; } if (nwbTrim(sDoc.password1.value) == "") { sDoc.password1.focus(); alert("ºñ¹Ð¹øÈ£°¡ ÀԷµÇÁö ¾Ê¾Ò½À´Ï´Ù."); return; } if (nwbTrim(sDoc.password2.value) == "") { sDoc.password2.focus(); alert("È®ÀÎ¿ë ºñ¹Ð¹øÈ£°¡ ÀԷµÇÁö ¾Ê¾Ò½À´Ï´Ù."); return; } if (sDoc.password1.value != sDoc.password2.value) { sDoc.password1.focus(); alert("ºñ¹Ð¹øÈ£°¡ ÀÏÄ¡ÇÏÁö ¾Ê½À´Ï´Ù."); return; } if (nwbTrim(sDoc.name.value) == "") { sDoc.name.focus(); alert("À̸§ÀÌ ÀԷµÇÁö ¾Ê¾Ò½À´Ï´Ù."); return; } if (nwbTrim(sDoc.email.value) == "") { sDoc.email.focus(); alert("email ÁÖ¼Ò°¡ ÀԷµÇÁö ¾Ê¾Ò½À´Ï´Ù."); return; } if ( nwbTrim( sDoc.b_year.value ) == "" && nwbTrim( sDoc.b_month.value ) == "" && nwbTrim( sDoc.b_date.value ) == "" ) { sDoc.b_year.focus(); alert("»ý³â¿ùÀÏÀÌ ÀԷµÇÁö ¾Ê¾Ò½À´Ï´Ù."); return; } sBirthYear = parseInt( sDoc.b_year.value ); sBirthMonth = parseInt( sDoc.b_month.value ); sBirthDate = parseInt( sDoc.b_date.value ); if ( ( nwbIsNumeric( sBirthYear ) || nwbIsNumeric( sBirthMonth ) || nwbIsNumeric( sBirthDate ) ) && ( sBirthYear + sBirthMonth + sBirthDate ) != 0 ) { if ( !nwbIsNumeric( sBirthYear ) ) { sDoc.b_year.focus(); alert("³¯Â¥ Çü½ÄÀÌ ¿Ã¹Ù¸£Áö ¾Ê½À´Ï´Ù. ¿Ã¹Ù¸¥ ¼ýÀÚ¸¦ ÀÔ·ÂÇØÁÖ¼¼¿ä."); return; } if ( !nwbIsNumeric( sBirthMonth ) ) { sDoc.b_month.focus(); alert("³¯Â¥ Çü½ÄÀÌ ¿Ã¹Ù¸£Áö ¾Ê½À´Ï´Ù. ¿Ã¹Ù¸¥ ¼ýÀÚ¸¦ ÀÔ·ÂÇØÁÖ¼¼¿ä."); return; } if ( !nwbIsNumeric( sBirthDate ) ) { sDoc.b_date.focus(); alert("³¯Â¥ Çü½ÄÀÌ ¿Ã¹Ù¸£Áö ¾Ê½À´Ï´Ù. ¿Ã¹Ù¸¥ ¼ýÀÚ¸¦ ÀÔ·ÂÇØÁÖ¼¼¿ä."); return; } oCheckDate = new Date( sBirthYear, sBirthMonth-1, sBirthDate ); if ( oCheckDate.getFullYear() != sBirthYear ) { sDoc.b_year.focus(); alert("»ý³â¿ùÀÏÀÌ ¿Ã¹Ù¸£Áö ¾Ê½À´Ï´Ù."); return; } if ( oCheckDate.getMonth()+1 != sBirthMonth ) { sDoc.b_month.focus(); alert("»ý³â¿ùÀÏÀÌ ¿Ã¹Ù¸£Áö ¾Ê½À´Ï´Ù."); return; } if ( oCheckDate.getDate() != sBirthDate ) { sDoc.b_date.focus(); alert("»ý³â¿ùÀÏÀÌ ¿Ã¹Ù¸£Áö ¾Ê½À´Ï´Ù."); return; } sDoc.birthday.value = sBirthYear + "-" + sBirthMonth + "-" + sBirthDate; } else { sDoc.birthday.value = null; } if (nwbTrim(sDoc.home_addr1.value) == "" || nwbTrim(sDoc.home_addr2.value) == "") { sDoc.home_addr2.focus(); alert("ÁÖ¼Ò°¡ ÀԷµÇÁö ¾Ê¾Ò½À´Ï´Ù."); return; } if (nwbTrim(sDoc.office_phone.value) == "") { sDoc.office_phone.focus(); alert("ÀüÈ­¹øÈ£°¡ ÀԷµÇÁö ¾Ê¾Ò½À´Ï´Ù."); return; } if (nwbTrim(sDoc.mobile_phone.value) == "") { sDoc.mobile_phone.focus(); alert("ÈÞ´ëÆù ¹øÈ£°¡ ÀԷµÇÁö ¾Ê¾Ò½À´Ï´Ù."); return; } if (nwbTrim(sDoc.comment.value) == "") { sDoc.comment.focus(); alert("Àڱ⠼Ұ³°¡ ÀԷµÇÁö ¾Ê¾Ò½À´Ï´Ù."); return; } ret = sDoc.submit(); return true; } // ȸ¿ø °¡ÀÔ ÆäÀÌÁö¿¡¼­ ID Áߺ¹ üũ ÇÔ¼ö function nwbOpenIdCheck() { link = "http://hamane.org/webboard/script/check_id.php?id=" + document.form_regist.id.value; window.open(link, '', 'scrollbars=yes,resizable=yes,width=350 ,height=170'); } function nwbOpenZipCode(form_name, tag_postcode, tag_addr) { link = "http://hamane.org/webboard" + "/script/post_code.php"; link += "?form_name=" + form_name; link += "&tag_postcode=" + tag_postcode; link += "&tag_addr=" + tag_addr; window.open( link, 'home_zipcode', 'scrollbars=yes,resizable=yes,width=350 ,height=300'); } function nwbSetFocusRegisterForm() { document.form_regist.id.focus(); } function nwbAdminHelp( sUrl ) { window.open( 'http://hamane.org/webboard/admin/' + sUrl, 'admin_help', 'scrollbars=yes,toolbar=yes,resizable=yes,width=730 ,height=700'); } function nwbServerInfo() { window.open( 'http://hamane.org/webboard/admin/admin.php?adm=server_env', 'server_info', 'scrollbars=no,resizable=yes,width=623 ,height=464'); }