// -- Global º¯¼ö ¼±¾ðºÎ -- gs_nwbWebRoot = "http://hamane.org/webboard/skin/js/../.."; // ------------------------------------------------------------------------------ // -- JavaScript ÇÔ¼ö ¼±¾ðºÎ -- // ------------------------------------------------------------------------------ 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, , 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 ); } // -- °¢Á¾ 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; } // reply¸¦ checkÇßÀ» °æ¿ì¿¡ mailÀÇ ÀÔ·ÂÀ» È®ÀÎÇÏ´Â ÇÔ¼ö function nwbCheckReplyMail( reply_field, mail_field ) { if ( reply_field.checked ) { if ( nwbTrim( mail_field.value ) == "" ) { mail_field.focus(); alert("À̸ÞÀÏ ÁÖ¼Ò°¡ ¾ø½À´Ï´Ù."); return false; } } } // -- 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 nwbCheckWriteFormEx(form_name) { var form_write = document.forms[form_name]; var args = nwbCheckWriteFormEx.arguments; var nArgNum = args.length; // Submit Process°¡ ÁøÇàÁßÀÎ °æ¿ì, Áߺ¹ SubmitµÇ´Â °ÍÀ» ¸·À½. if ( gfInProcessing ) { return false; } for ( var i = 1; 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; // Save on Cookie gaAttachedFileList[gaAttachedFileList.length] = new Array( sTempDirFileName, sFileName ); sAttachedFileList = array2String( gaAttachedFileList ); setCookie( gsTempDirName, sAttachedFileList, getExpDate( 1, 0, 0 ) ); } 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; sAttachedFileList = array2String( gaAttachedFileList ); var sDoc = document.form_upload_file.file_list; for (var i = 1; i < sDoc.options.length; i++) { if (sDoc.options[i].selected) { gaAttachedFileList[i-1] = null; document.form_delete_file.file_path.value = sDoc.options[i].value; break; } } // Save on Cookie sAttachedFileList = array2String( gaAttachedFileList ); setCookie( gsTempDirName, sAttachedFileList, getExpDate( 1, 0, 0 ) ); 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; } // ȸ¿ø°¡ÀÔ, ȸ¿øÁ¤º¸ ¼öÁ¤ ÆäÀÌÁö ½ºÅ©¸³Æ® function nwbCheckRegistForm(mode, prev_photo_path) { var sDoc = window.document.form_regist; if (mode == "user_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 (nwbTrim(sDoc.name.value) == "") { sDoc.name.focus(); alert("À̸§ÀÌ ÀԷµÇÁö ¾Ê¾Ò½À´Ï´Ù."); return; } } if (sDoc.password1.value != sDoc.password2.value) { sDoc.password1.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/skin/js/../../script/check_id.php?id=" + document.form_regist.id.value; window.open(link, '', 'scrollbars=yes,resizable=yes,width=350 ,height=230'); } function nwbOpenZipCode(form_name, tag_postcode, tag_addr) { link = "http://hamane.org/webboard/skin/js/../.." + "/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 nwbCheckIdForm() { var sDoc = window.document.form_check_id; if (nwbTrim(sDoc.user_id.value) == "" ) { alert("¾ÆÀ̵𸦠ÀÔ·ÂÇϽʽÿÀ."); sDoc.user_id.focus(); return; } sDoc.submit(); return true; } function nwbCloseWindow() { var sDoc = window.opener.document.form_regist; sDoc.id.value = document.form_check_id.user_id.value; self.close(); } function nwbLoginSetFocus() { document.form_check_password.user_id.focus(); } function nwbLoginShowWarning() { fCheck = true; if ( document.form_check_password.f_save_user_id.checked == true ) fCheck = confirm( "¾ÆÀ̵ð ÀúÀåÀ» üũÇÏ½Ã¸é ´ÙÀ½¹ø ·Î±×ÀÎ ÇÏ½Ç ¶§, ¾ÆÀ̵𸦠´Ù½Ã ÀÔ·ÂÇÒ ÇÊ¿ä°¡ ¾ø½À´Ï´Ù.\n´Ü, ¸ðµç »ç¶÷ÀÌ °øÀ¯ÇÏ´Â ÄÄÇ»Åͳª PC¹æ¿¡¼­´Â ³ëÃâÀÌ µÉ ¼ö ÀÖÀ¸´Ï »ç¿ëÇÏÁö ¸¶½Ê½Ã¿À." ); return fCheck; } 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; } var gOnLoadHandler = new Array(); function nwbAddOnLoad( funcOnLoad ) { isMac = (navigator.appVersion.indexOf("Mac")!=-1) ? true : false; IEmac = ((document.all)&&(isMac)) ? true : false; IE4 = ((document.all)&&(navigator.appVersion.indexOf("MSIE 4.")!=-1)) ? true : false; if (IEmac && IE4) { window.onload = nwbOnLoad; gOnLoadHandler[gOnLoadHandler.length] = funcOnLoad; } else if (window.onload) { if (window.onload != nwbOnLoad) { gOnLoadHandler[0] = window.onload; window.onload = nwbOnLoad; } gOnLoadHandler[gOnLoadHandler.length] = funcOnLoad; } else { window.onload = funcOnLoad; } } function nwbOnLoad() { for (var i=0;i' + sPreview + ''; oDivPreview.innerHTML= sPreview; oDivPreview.style.visibility = "visible"; return false; } function nwb_preview_photo_hide() { oDivPreview.style.visibility="hidden"; } document.write( '' );