option explicit dim m_CatchingRead dim m_ImgPath function SetImagePath(strImgPath) m_ImgPath = strImgPath end function function open_panel() if document.all("expand_panel").style.display = "none" then document.all("expand_panel").style.display = "" document.all("expand_arrow").src=m_ImgPath & "/ya_01.gif" else document.all("expand_panel").style.display = "none" document.all("expand_arrow").src=m_ImgPath & "/ya_02.gif" end if end function function explain_upload() msgbox "ファイル名は半角でなければなりません。",vbInformation,"掲示板 KANNA SYSTEM" end function function explain_ml() msgbox "記事MLにメールIDを入れて「入会」すると掲示板の投稿がメールで届きます",vbInformation,"掲示板 KANNA SYSTEM" end function function SetWriterNameDefault() 'on error resume next document.forms(0).c_writer.value = getCookie("name") end function function AlertMsg(oCtrl) on error resume next oCtrl.select() oCtrl.focus() 'vbExclamation 48 msgbox "データが入力させていないか、不正なデータです。",vbExclamation,"掲示板 KANNA SYSTEM" end function function SetResponse(nArticleCd) dim szTemp ,szSplit,i szTemp = document.all("article_content" & nArticleCd).innertext szSplit = split(sztemp,vbnewline) szTemp = "" for i=0 to ubound(szSplit) select case true case left(szSplit(I),1) = ">" szTemp = sztemp & ">" & szSplit(I) & vbnewline case else szTemp = sztemp & "> " & szSplit(I) & vbnewline end select next ' szTemp = "> " & replace(document.all("article_content" & nArticleCd).innertext,vbnewline, vbnewline & "> ") document.frmMain.c_article_content.value = szTemp szTemp = document.all("article_title" & nArticleCd).innertext if ucase(left(szTemp,3)) <> "RE:" then szTemp = "Re: " & szTemp document.frmMain.c_article_title.value = szTemp end function function SubmitForm(strOrder) if IsSubmitable(strOrder) then document.forms(0).btn_submit.style.display="none" document.all("submitting").style.display="inline" document.frmMain.submit() end if end function function IsHasDoubleByte(strData) dim i if "" = trim(strData) then IsHasDoubleByte = false exit function end if for i = 1 to len(strData) if 0 > asc(mid(strData,i,1)) or 255 < asc(mid(strData,i,1)) then IsHasDoubleByte = true exit function end if next IsHasDoubleByte = false end function function GetFileBaseName(strPath) GetFileBaseName =mid(strPath,instrRev(strPath,"\")+1) end function function IsSubmitable(strOrder) dim strFile dim i dim blnErr IsSubmitable = false with document if strOrder = "contribute" then blnErr = false strFile = .all("fileUpload").value if strFile <> "" then strFile = GetFileBaseName(strFile) if IsHasDoubleByte(strFile) then AlertMsg .all("fileUpload") blnErr = true end if end if select case true case blnErr = true case trim(.all("c_writer").value) = "" AlertMsg .all("c_writer") ' case trim(.all("c_article_title").value) = "" ' AlertMsg .all("c_article_title") case trim(.all("c_article_content").value) = "" AlertMsg .all("c_article_content") case else seteverCookie "name=" & document.forms(0).c_writer.value IsSubmitable = true exit function end select else if trim(.all("c_member_mail")) = "" then AlertMsg .all("c_member_mail") else IsSubmitable = true .all("hdnAction").value = "ml" exit function end if end if on error resume next window.event.returnValue = false window.event.cancelBubble = false 'onsubmit は、この2つでやるんだ。 end with end function function ReceiveMouseOver() window.event.srcelement.src = m_ImgPath & "/" & window.event.srcelement.id & "_1.gif" end function function ReceiveMouseOut() window.event.srcelement.src = m_ImgPath & "/" & window.event.srcelement.id & "_0.gif" end function