<!-- #include file="include/config.asp" -->
<!-- #include file="../common/HtmlEdit/Include/DeCode.asp"-->
<!-- #include file="../include/jk_put.asp" -->
<!-- #include file="include/main.asp" -->
<!-- #include file="../pet/pet_conn.asp" -->
<%
call time_lock()
if not isnumeric(forumid) then
  call format_redirect("index.asp")
end if
%>
<!-- #include file="../include/jk_convert.asp" -->
<!-- #include file="include/fir.asp" -->
<!-- #include file="include/write.asp" -->
<%
dim isvote,filetype,filetypes,mode,tiptrue
isvote=trim(request.querystring("isvote"))
filetypes="rar,zip,dst,emb,gif,jpg,swf,mpg,wav,mid,txt,torrent,xls,wma,wmv,url,tar,sql,rm,ram,ra,rmvb,ppt,png,mp3,mov,mid,mdb,m3u,html,htm,ftp,exe,down,doc,dmv,dll,com,chm,cad,cab,avi,av,asp,arj,app,ace"
ftit="发表主题"
if isvote="yes" then
  ftit="发表投票"
end if

call forum_first()

iframe=true
call web_head(2,1,h_var3,0,0)
if int(login_modep)=1 or int(login_modep)=2 or int(login_modep)=3 or int(login_modep)=4 or int(login_modep)=5 or int(login_modep)=6 or int(login_modep)=7 then tiptrue=1
call forum_readonly()
call convert_load(login_mode)
etc=format_convert(etc,"-")
etb=format_convert(etb,"-")
call forum_load()
'----------------------------中间 开始----------------------------
call forum_ad()
call forum_grade()
call forum_top(tit)
if trim(request.querystring("online"))="view" then 
  call forum_user_online()
end if
if forumw=false then
call forum_msg("本论坛已设置为不可发贴模式！",1)
else
  if joekoe_cms.chk() then
    call forum_write_chk()
  else
    call forum_write_main()
  end if
end if
'----------------------------中间 结束----------------------------
call forum_end()
call web_end(0,0)

sub forum_write_chk()
  dim tmp1,topic,icon,word,tc,tcolor,tbb,is_vote,v_type,v_day,v_name,v_num,v_dim,v_dim_num,integral_del,cb_var,found_err,nistop,nisgood,nislock,tip_id
  nistop=0
  nisgood=0
  nislock=0
  if forum_power_true(forumpower)=true then
    if trim(request.form("istop"))="yes" then nistop=1
    if	forum_super_true()=true and trim(request.form("istops"))="yes" then nistop=2
    if trim(request.form("isgood"))="yes" then nisgood=1
    if trim(request.form("islock"))="yes" then nislock=1
  end if
  tip_id=0
  integral_del=0
  cb_var=""
  topic=joekoe_cms.code_form(request.form("topic"))
  if tiptrue=1 and isarray(dimforumtip) then tip_id=joekoe_cms.code_form(request.form("tip_id"))
  icon=form_icon()
  word=request.form("jk_word")
  tc=trim(request.form("tc"))
  tcolor=trim(request.form("tcolor"))
  tbb=0
  is_vote=0
  found_err=""
  
  if not post_tim() then
    found_err=found_err&"+对不起，发帖的间隔时间为 <font class=red>"&int(dim_num(28))&"</font> 秒！<br>"
  end if
  if login_mode="" then
    found_err=found_err&"+<font class=red>您还没有注册或登陆本站！因此不能发表主题。</font><br>"
  end if
  if val_chk("f_write_"&forumid)=false then
    found_err=found_err&"+您输入的 <font class=red>验 证 码</font> 为空或有错误，请勿非法提交！<br>"
  end if
  if topic="" or len(topic)>50 then
    found_err=found_err&"+贴子的 <font class=red>主题</font> 是必须要的，且长度不能超过50个字符！<br>"
  end if
  if login_strength<"0" then
    found_err=found_err&"+您的 <font class=red>体力</font> 不够发贴了,要多多在线增加体力哦！<br>"
  end if
  if word_size_true(word)=false then
    found_err=found_err&"+贴子的 <font class=red>内容</font> 是必须要的，不能少于 "&min_word_size&" B或超过 "&max_word_size&" KB！<br>"
  end if
  if tc="yes" then
    if len(tcolor)<>6 then
      found_err=found_err&"+请输入正确的 <font class=red>颜色代码</font> ！（请正确填写<font class=red2>6</font>位颜色代码）<br>"
    end if
    cb_var="加色"
    integral_del=etc
  else
    tcolor=""
  end if
  if trim(request.form("tbb"))="yes" then
    tbb=1
    integral_del=integral_del+etb
    cb_var=cb_var&"加粗"
  end if
  if int(login_integral)<int(integral_del) then
    found_err=found_err&"+发布"&cb_var&"主题要扣<font class=red>"&integral_del&"</font>分，您的积分不足（只有<font class=red>"&login_integral&"</font>分）！<br>"
  end if
  if isvote="yes" then
    is_vote=1
    v_type=0
    if trim(request.form("v_type"))="more" then
      v_type=1
    end if
    v_day=trim(request.form("v_day"))
    if not isnumeric(v_day) then
      v_day=0
    end if
    if int(v_day)>365 then
      v_day=0
    end if
    v_name=trim(request.form("v_name"))
    v_name=replace(v_name,"'","")
    v_name=replace(v_name,"|","")
    if v_name="" then
      found_err=found_err&"+请输入投票的项目，不能为空或超过<font class=red>"&vote_n&"</font>项！<br>"
    else
      v_dim=split(v_name,vbcrlf)
      v_name=""
      v_num=""
      v_dim_num=0
      for i=0 to ubound(v_dim)
        if int(v_dim_num)>(vote_n-1) then exit for
        if v_dim(i)<>"" then
          if v_name="" then
            v_name=v_dim(i)
            v_num="0"
          else
            v_name=v_name&"|"&v_dim(i)
            v_num=v_num&"|0"
          end if
          v_dim_num=v_dim_num+1
        end if
      next
      if int(v_dim_num)<2 then
        found_err=found_err&"+请输入投票的项目至少不能低于两项！<br>"
      end if
    end if
  end if
  
     '图标 这里只显示JPG与GIF
    mode=""
    if Instr(Lcase(word),".jpg") then mode="jpg"
	if Instr(Lcase(word),".gif") then mode="gif"  'GIF优先
	
	'特殊贴处理
	dim t_isspecial,tmp_s_emoney,tmp_s_integral,tmp_s_exp,tmp_s_strength,tmp_s_bbs_counter,mp_s_prestige,t_special_data
   t_isspecial= Toint(request.form("t_isspecial"))
    if t_isspecial>0 then
      'tmp_s_emoney,tmp_s_integral,tmp_s_exp,tmp_s_strength,tmp_s_prestige,tmp_s_bbs_counter,tmp_s_online
      't_special_num=""
      't_special_data=""
      tmp_s_emoney=Toint(request.form("s_emoney"))
      tmp_s_integral=Toint(request.form("s_integral"))
      'tmp_s_exp=trim(request.form("s_exp"))
      tmp_s_strength=trim(request.form("s_strength"))
      'tmp_s_prestige=trim(request.form("s_prestige"))
	  tmp_s_exp=0
	  mp_s_prestige=0
      tmp_s_bbs_counter=Toint(request.form("s_bbs_counter"))
      tmp_s_online=Toint(request.form("s_online"))
      t_special_data=trim(request.form("t_special_data"))
      if t_special_data<>"" then
        dim tmpdimdata
        tmpdimdata=split(t_special_data,",")
        t_special_data="|"
        for i=0 to ubound(tmpdimdata)
              t_special_data=t_special_data&user_check(tmpdimdata(i))
        next
        erase tmpdimdata
		if t_special_data="|" then t_special_data="||"
      end if
      select case int(t_isspecial)
      case 1
        'if tmp_s_emoney<=0 and tmp_s_integral<=0  then
        '   found_err=found_err&"+特殊贴的分值至少有一项为有效值<br>"
       ' else
       '   t_special_num="0,"&tmp_s_emoney&","&tmp_s_integral&",0,0,0,0,0,0"
       ' end if
	       found_err=found_err&"+对不起，奖励贴功能正在制作中...[暂时不能使用]<br>"
      case 2,3
        if tmp_s_emoney<=0 and tmp_s_integral<=0 and tmp_s_exp<=0 and tmp_s_strength<=0 then
           found_err=found_err&"+特殊贴的分值至少要有一项为有效分值！<br>"
        else
         ' tmp_s_prestige=0
         ' tmp_s_bbs_counter=0
          'tmp_s_online=0
          t_special_num="0,"&tmp_s_emoney&","&tmp_s_integral&","&tmp_s_exp&","&tmp_s_strength&","&tmp_s_prestige&","&tmp_s_bbs_counter&","&tmp_s_online&",0"
        end if
      case 4
        t_special_num="0,0,0,0,0,0,0,0,0"
      case 5
        t_special_num="0,0,0,0,0,0,0,0,0"
        if t_special_data="" or t_special_data="||"  then  found_err=found_err&"+指定用户特殊贴的权限用户不能为空！<br>"
      end select
      if int(t_isspecial)<>1 then
        t_subhead=trim(request.form("t_special_remark"))
        if t_subhead="" then   found_err=found_err&"+特殊贴说明不能为空且不得超过250位！<br>"
      end if
    end if
    '--------------------------------------
  
  if found_err<>"" then
    response.write found_error(found_err,320)
    exit sub
  end if 
  
	
  sql="insert into bbs_topic (forum_id,username,userid,topic,tcolor,tbb,icon,counter,tim,re_username,re_counter,re_tim,istop,islock,isgood,isvote,vote_num,mode,form_id,special,special_num,special_data,subhead,tipid) " & _
      "values ("&forumid&",'"&login_username&"',"&login_id&",'"&topic&"','"&tcolor&"',"&tbb&",'"&icon&"',0,'"&joekoe_cms.now_time&"','"&login_username&"',0,'"&joekoe_cms.now_time&"',"&nistop&","&nislock&","&nisgood&","&is_vote&",0,'"&mode&"',0,"&t_isspecial&",'"&t_special_num&"','"&t_special_data&"','"&t_subhead&"',"&tip_id&")"
  call joekoe_cms.exec(sql,0)
  viewid=first_id("bbs_topic","id")
  if isvote="yes" then
    sql="insert into bbs_vote (reply_id,v_name,v_num,v_type,v_tim,v_day,v_username) " & _
	"values ("&viewid&",'"&v_name&"','"&v_num&"',"&v_type&",'"&joekoe_cms.now_time&"',"&v_day&",'')"
    conn.execute(sql)
  end if
  sql="select * from bbs_data where id is null"
  call joekoe_cms.exec("",-1)
  rs.open sql,conn,1,3
  rs.addnew
  rs("forum_id")=forumid
  rs("reply_id")=viewid
  rs("username")=login_username
  rs("userid")=login_id
  rs("topic")=topic
  rs("icon")=icon
  rs("word")=word
  rs("tim")=joekoe_cms.now_time
  rs("ip")=user_ip
  rs("sys")=user_sys
  rs("cod")=cod_type()
  rs("pb")=false
  rs.update
  rs.close
  dim getinter '发贴得分
  getinter=dim_num(9)
  if forum_config(7)>0 then
    getinter=forum_config(7)
  end if
  sql="update user_data set bbs_counter=bbs_counter+1,strength=strength-"&dim_num(40)&",integral=integral+"&getinter&"-"&integral_del&" where id="&login_id
  call joekoe_cms.exec(sql,0)
  sql="update configs set num_topic=num_topic+1,num_data=num_data+1,num_new=num_new+1 where id=1"
  call joekoe_cms.exec(sql,0)
  sql="update bbs_forum set forum_new_num=forum_new_num+1,forum_topic_num=forum_topic_num+1,forum_data_num=forum_data_num+1 where forum_id in ("&forumparent&")"
  call joekoe_cms.exec(sql,0)
  sql="update bbs_forum set forum_new_info='"&login_username&"|"&joekoe_cms.now_time&"|"&viewid&"|"&topic&"' where forum_id="&forumid
  call joekoe_cms.exec(sql,0)
  
connpet.ExeCute="update mypetdata set mypetexp=mypetexp+"&dim_num(9)&" where username='"&login_username&"' and mypetdead=0"
  call upload_note(index_url,viewid)
  
  application.lock
  application.contents.remove(joekoe_cms.web_cookies&"_web_config")
  select case cstr(nistop)
  case "1"
    application(joekoe_cms.web_cookies&"_forum_istop_state_"&forumid)=empty
  case "2"
    application(joekoe_cms.web_cookies&"_forum_istops_state")=empty
  end select
  application.unlock
  
  tmp1=vbcrlf&"<tr><td class=bbs_td>"&tit&"</td></tr><tr class=bbs_tr><td height=220>" & _
             vbcrlf&"<table border=0 width=300 align=center>" & _
        	 vbcrlf&"<tr><td align=center height=30><font class=red>"&tit&"成功！谢谢您的发贴。</font></td></tr>" & _
        	 vbcrlf&"<tr><td height=30>您现在可以选择以下操作：</td></tr>" & _
        	 vbcrlf&"<tr><td>　　1、<a href='view.asp?forum_id=" & forumid & "&view_id=" & viewid & "'>您所发表的主题</a>" & _
        	 vbcrlf&"<tr><td>　　2、<a href='list.asp?forum_id=" & forumid & "'>返回 <b>" & forumname & "</b></a></td></tr>" & _
        	 vbcrlf&"<tr><td>　　3、<a href='index.asp'>返回论坛首页</a></td></tr>" & _
        	 vbcrlf&"<tr><td height=30>系统将在 "&dim_num(21)&" 秒钟后自动返回 您所发表的主题 ……</td></tr>" & _
		 vbcrlf&"</table></td></tr><meta http-equiv='refresh' content='"&dim_num(21)&"; url=view.asp?view_id=" & viewid & "'>"
  call forum_bar_top(tit,tmp1,1)
  call val_chk_end_forum("f_write_"&forumid)
end sub

sub forum_write_main()
dim tmp1
  response.write forum_main_head()
   call forum_write_frm_check()  
%>
<tr><td colspan=2 class=bbs_td><%response.write tit%></td></tr>
       <form name=frm_post action='?forum_id=<%response.write forumid&"&isvote="&isvote%>' method=post onsubmit="javascript:frm_submitonce(this);">
       <input type=hidden name=chk value='yes'>
       <input type=hidden name=upid value=''>
       <%response.write val_code_num("f_write_"&forumid,1)%>
       <tr class=bbs_tr>
       <td width='20%' class=s>用户信息：</td>
       <td width='80%' class=s>&nbsp;<font class=blue><b><%response.write login_username%></b></font>&nbsp;&nbsp;您现在有&nbsp;<font class=red><b><%response.write login_emoney%></b></font>&nbsp;<%response.write joekoe_cms.web_unit%>,&nbsp;<font class=red><b><%response.write login_integral%></b></font>&nbsp;积分 
       &nbsp;<font class=gray>[ <a href='../user/'>用户中心</a> ]&nbsp;&nbsp;[ <a href='../user/login.asp?action=logout'>退出登陆</a> ]</font></td>
       </tr>
       <tr class=bbs_tre>
       <td class=s>贴子主题：</td>
       <td class=s>	   
         <table border=0 cellspacing=0 cellpadding=0>
         <tr>
         <td><%response.write frm_topic("frm_post","topic")%></td>
         <td>&nbsp;<input type=text name=topic size=50 maxlength=50><%response.write redx%>长度不能超过50</td>
         </tr>
         </table>
       </td>
       </tr>
<%if isarray(dimforumtip) then%>
<tr class=bbs_tr>
<td>所属专题：</td>
<td>
<%if tiptrue=1 then call forum_tip_select(0,0)%> 您可以为该主题选择一个对应专题!</td>
</tr>
<%end if%>
<tr class=bbs_tr>
<td class=s>发表心情：</td>
<td class=s><script language=javascript>post_icon(10,0,'icon');</script></td>
</tr>
       <tr class=bbs_tr>
       <td class=s>主题特效：</td>
       <td class=s><input type=checkbox name=tbb value='yes'>选择加粗功能后将扣取你<font class=red><%response.write etb%></font>积分
       &nbsp;<input type=checkbox name=tc value='yes'>选择加色功能后将扣取你<font class=red><%response.write etc%></font>积分
       &nbsp;<input type=text name=tcolor value='' size=8 maxlength=7><a href='javascript:;' onClick="javascript:slect_color('tcolor');"><img border=0 src="../common/html_edit/images/btn_fgcolor.gif" width=23 height=22 align=absmiddle alt='点击选取主题字体颜色'></a></td>
	   </tr>
  <%if isvote="yes" then%>
    <tr class=bbs_tre>
       <td class=s>投票选项：</td>
       <td class=s><input type=radio name=v_type value='only' class=bbs_tre  checked>&nbsp;单选&nbsp;<input type=radio name=v_type value='more' class=bbs_tre >&nbsp;多选&nbsp;&nbsp;&nbsp;过期时间：<select name=v_day size=1>
       <option value='0'>永不过期</option>
       <option value='1'>一天</option>
       <option value='7'>一周</option>
       <option value='30'>一个月</option>
       <option value='365'>一年</option>
       </select></td>
       </tr>
       <tr class=bbs_tre>
       <td class=htd class=s>1、每行作为一个选项；<br>2、至少不能低于两项；<br>3、最多有 <font class=red><%response.write vote_n%></font> 个选项；<br>4、超过的将自动作废；<br>5、一经发布不得修改；</td>
       <td class=s><script language=javascript>post_textarea(0,12,'','v_name');</script></td>
       </td>
       </tr>
  <%end if%>
<%response.write bbs_html_edit(1,"frm_post","jk_word","")%>
	   

<input type=hidden name=sp_cod value="1">
<tr class=bbs_tr><script language="Javascript" src="trans_ubb.js"></script>
<td class=s><script language=javascript>post_textarea_caption('贴子内容：','<!--<input type=checkbox name=d_isubb value="yes" checked><使用UBB标签<br><input type=checkbox name=d_issign value="yes" checked>显示个性签名--><%response.write web_frm_word%>');</script></td>
<td class=s><script language=javascript>post_textarea(0,12,'');</script><br><font color=red>☆论坛贴图更轻松：</font><IFRAME 
id=rtf style="WIDTH: 0px; HEIGHT: 0px" marginWidth=0 marginHeight=0 
src="about:blank" scrolling=no></IFRAME><INPUT onclick="document.getElementById('jk_word').value += trans()" type=button class=btn value=转换剪切板超文本数据> 
<script>
rtf.document.designMode="On";
</script></td>
</tr>
<tr class=bbs_tre style="display:none;" id=div_special_remark>
<td class=s>
  <table border=0 cellspacing=0 cellpadding=0 height="100%">
  <tr><td valign=top>特殊贴说明：<br><br>最多250字节</td></tr>
  </table>
</td>
<td class=s><script language=javascript>post_textarea(0,8,'','t_special_remark');</script></td>
</tr>
	 

       <tr class=bbs_tr>
       <td>上传文件：</td>
       <td class=bg><iframe frameborder=0 name=upload_frame width='98%' height=30 scrolling=no src='../common/upload.asp?uppath=forum&upname=&uptext=jk_word'></iframe></td>
       </tr>
       <tr class=bbs_tr>
       <td>E M 贴图：</td>
       <td><%response.write jk_em("frm_post","jk_word")%></td>
       </tr>
       <tr class=bbs_tr>
       <td>魔法心情：<br><br>[<font color="red">左键插入，右键播放</font>]</td>
       <td id="Magic_menu">魔法心情载入中...</td>
       </tr>
       <tr class=bbs_tr>
       <td>巧嘴娃娃：</td>
       <td oncontextmenu=self.event.returnvalue=false> <%response.write jk_wawa("frm_post","jk_word")%></td>
       </tr>
       <script language = "JavaScript">
       <!--
       var em_frm="frm_post"
       var em_word="jk_word"
       -->
       </script>
       <script language = "JavaScript" src = "../style/magicface.Js"></script>
       <script language = "JavaScript" src = "../style/magic.js"></script>
       	   <tr class=bbs_tre>
       <td class=s>特 殊 贴：</td>
       <td class=s>
         <table border=0 cellspacing=0 cellpadding=0 width="100%">
         <tr><td>请选择特殊贴类型：<select name=t_isspecial size=1 onchange="javascript:change_special(this.options[this.selectedIndex].value);">
       <option value="0" selected>不使用特殊贴</option>
        <option value="1">&nbsp;1.奖励贴&nbsp;</option>
        <option value="2">&nbsp;2.购买贴&nbsp;</option>
        <option value="3">&nbsp;3.可见贴&nbsp;</option>
         <option value="4">&nbsp;4.回复贴&nbsp;</option>
         <option value="5">&nbsp;5.指定贴&nbsp;</option>
        </select> 发布特殊贴后将不可随意修改，请注意填写！</td></tr>
           <tr style="display:none;" id=div_special><td>
            <table border=0 cellspacing=0 cellpadding=0 width="100%">
             <tr><td height=5></td></tr>
           <tr><td id=div_special2></td></tr>
           </table>
        </td></tr>
        </table>
      </td>
      </tr>

  <%if forum_power_true(forumpower)=true then%>
    <tr class=bbs_tr>
       <td  class=s>高级选项：</td>
      <td class=s>
  <table border=0 cellspacing=2 cellpadding=0>
  <tr>
  <td><input type=checkbox name=istop value='yes' >固顶</td>
  <%if forum_super_true()=true then%>
    <td> <input type=checkbox name=istops value='yes' >总固顶</td>
	   <%end if%>
	    <td width=5></td>
     <td><input type=checkbox name=isgood value='yes' >精华</td>
	   <td> <input type=checkbox name=islock value='yes' >锁定</td>
         </tr>
  </table>
  </td></tr>
	   
  <%end if%>
  <tr class=bbs_trb>
       <td>发表新贴：</td>
       <td height=40><input type=submit class=btn value='可以发表啦' onclick="javascript:return check_post('post');">　&nbsp;<%response.write preview_b("frm_post","jk_word","内容预览")%>　&nbsp;<input type=reset class=btn value='清除重写'>　&nbsp;（按 Ctrl + Enter 可快速发表）</td>
       </tr>
       </form>
<%
  response.write forum_main_end()   
  call preview_form("frm_post","jk_word")
%>
<script language=javascript>
var special_num=9;
var ary_special=new Array(special_num);
var special_no_limit="<br>注：以下用户不受限制，多个用户名之间用“,”分开。<br> &nbsp; &nbsp; 错误的用户名将被过滤去。<br><textarea name=t_special_data class=txtarea cols=70 rows=4></textarea>";
var special_var_num="货币<input type=input class=txt_num name=s_emoney value=\"0\" size=6 maxlength=10><%=joekoe_cms.web_unit%>";
special_var_num+="、积分<input type=input class=txt_num name=s_integral value=\"0\" size=6 maxlength=10>分";
//special_var_num+="、经验<input type=input class=txt_num name=s_exp value=\"0\" size=6 maxlength=10>点";
special_var_num+="、体力<input type=input class=txt_num name=s_strength value=\"0\" size=6 maxlength=10>点";
var special_var_num2="";
//special_var_num2="、威望<input type=input class=txt_num name=s_prestige value=\"0\" size=6 maxlength=10>点";
special_var_num2+="、发贴<input type=input class=txt_num name=s_bbs_counter value=\"0\" size=6 maxlength=10>贴";
special_var_num2+="、在线<input type=input class=txt_num name=s_online value=\"0\" size=6 maxlength=10>分钟";
ary_special[0]="";
ary_special[1]="本贴进行主题奖励，共奖励 "+special_var_num+"，当设置主题奖励时，发帖后将暂时扣除您的相应分值，您可以对不同回复用户在分值范围内分别赠送，赠送完毕可结帖，结帖后剩余分值(未送出)还入您的个人帐户中。"+special_no_limit;
ary_special[2]="购买本贴内容需 "+special_var_num+"，在未审核前用户购买分值将记录在系统中，当审核后将直接计入您的的个人帐户中。"+special_no_limit;
ary_special[3]="本贴内容需 "+special_var_num+special_var_num2+" 可见。"+special_no_limit;
ary_special[4]="只有回复本贴的用户才可浏览本贴的主要内容。"+special_no_limit;
ary_special[5]="只有指定用户才可浏览本贴的主要内容，多个用户名之间用“,”分开。<br>注：错误的用户名将被过滤去。<br><textarea name=t_special_data class=txtarea cols=70 rows=4></textarea>";

function change_special(strn)
{
  if (strn>special_num || special_num<0) return true;
  var tmpobj,tmpvalue,tmpdisplay;
  tmpvalue=ary_special[strn];
  tmpdisplay=""
  if (tmpvalue=="" || tmpvalue==null) tmpdisplay="none";
  tmpobj=get_id("div_special");
  tmpobj.style.display=tmpdisplay;
  if (strn==1) tmpdisplay="none";
  tmpobj_remark=get_id("div_special_remark");
  tmpobj_remark.style.display=tmpdisplay;
  tmpobj=get_id("div_special2");
  tmpobj.innerHTML=tmpvalue;
}

function change_load()
{
  tmpobj=get_id("t_isspecial");
  change_special(tmpobj.options[tmpobj.options.selectedIndex].value);
}

change_load();	//预加载特殊贴表单

function check_special()
{
  var tmpreturn="";
  var tmpisspecial=post_value("t_isspecial");
  switch (tmpisspecial)
  {
    case "1":
	  var tmpemoney=is_num(post_value("s_emoney"),1,1);
      var tmpintegral=is_num(post_value("s_integral"),0,1);
      var tmpexp=is_num(post_value("s_exp"),0,1);
      var tmpstrength=is_num(post_value("s_strength"),0,1);
      if (tmpintegral<=0 && tmpemoney<=0 && tmpexp<=0 && tmpstrength<=0) tmpreturn="num";
      if (int(cls.user(13))<int(tmpintegral) || int(cls.user(11))<int(tmpemoney) || int(cls.user(14))<int(tmpexp) || int(cls.user(15))<int(tmpstrength)) tmpreturn="nopay";
      break;
    case "2":
      var tmpremark=post_value("t_special_remark");
      var tmpemoney=is_num(post_value("s_emoney"),1,1);
      var tmpintegral=is_num(post_value("s_integral"),0,1);
      var tmpexp=is_num(post_value("s_exp"),0,1);
      var tmpstrength=is_num(post_value("s_strength"),0,1);
      if (tmpintegral<=0 && tmpemoney<=0 && tmpexp<=0 && tmpstrength<=0) tmpreturn="num";
      if (tmpremark=="") tmpreturn="remark";
      break;
    case "3":
      var tmpemoney=is_num(post_value("s_emoney"),1,1);
      var tmpintegral=is_num(post_value("s_integral"),0,1);
      var tmpexp=is_num(post_value("s_exp"),0,1);
      var tmpstrength=is_num(post_value("s_strength"),0,1);
      var tmpprestige=is_num(post_value("s_prestige"),0,1);
      var tmpbbs_counter=is_num(post_value("s_bbs_counter"),0,1);
      var tmponline=is_num(post_value("s_online"),0,1);
      if (tmpintegral<=0 && tmpemoney<=0 && tmpexp<=0 && tmpstrength<=0 && tmpprestige<=0 && tmpbbs_counter<=0 && tmponline<=0) tmpreturn="num";
      break;
    case "4":
      var tmpremark=post_value("t_special_remark");
      if (tmpremark=="") tmpreturn="remark";
      break;
    case "5":
      var tmpremark=post_value("t_special_remark");
      var tmpdata=post_value("t_special_data");
      if (tmpremark=="") tmpreturn="remark";
      if (tmpdata=="") tmpreturn="data";
      break;
  }
  return tmpreturn;
}

//more function
var client_browse="";
if (document.getElementById)	// IE5+,NN6+	document.getElementById("id");
{ client_browse="ie5"; }
else if (document.all)		// IE4		document.all("id");
{ client_browse="ie4"; }
else if (document.layers)	// NN4		document.layers["id"];
{ client_browse="ns4"; }



function get_id(strname)
{
  switch (client_browse)
  {
    case "ie5":
      return document.getElementById(strname);
      break;
    case "ns4":
      return document.layers[strname];
      break;
    default :	//"ie4"
      return document.all(strname);
      break;
  }
}


function is_num(strer,strt,strv)
{
  var tmp_var="0123456789";
  if (strt==1) tmp_var="0123456789.";
  var tmp_value=new Array(1);
  if (strv=="" || strv==null)
  {
    tmp_value[0]=false;
    tmp_value[1]=true;
  }
  else
  {
    tmp_value[0]=0;
    tmp_value[1]=strer;
  }
  if (strer=="" || strer==null) return tmp_value[0];
  for (var i=0;i<strer.length;i++)
  {
    if (tmp_var.indexOf(strer.charAt(i))==-1) return tmp_value[0];
  }
  return tmp_value[1];
}
</script>

<%
end sub

function Toint(tt_int)
dim t_int
t_int=trim(tt_int)
if IsNumeric(t_int) then
Toint=cint(t_int)
else
Toint=0
end if
end function

function user_check(uuname)
uname=trim(uuname)
uname=replace(uname," ","")
sql="select id from user_data where username='"&uname&"'"
set rss=joekoe_cms.exec(sql,1)
if not rss.eof then
user_check=uname&"|"
else
user_check=""
end if
rss.close
end function
%>
