<!-- #include file="config.asp" -->
<!-- #include file="jk_encrypt.asp" -->
<!-- #include file="functions.asp" -->
<%

dim web_width,user_ip,user_sys,cookies_true,head_js,skin_dir,iframe,page_load,login_is_abate,is_refur_true
dim lefter,righter,web_left_wid,web_center_height,m_channel,web_img_m,web_img_h,pic_w,pic_h,max_w,max_h,img_emoney,m_hei,max_word
dim online_num,login_msg,num_topic,num_data,num_reg,new_username,total_counter,max_online,max_tim,start_tim,new_num,today_tim,stamp_num

web_left_wid=185
web_center_height=300
pic_w=dim_num(15)
pic_h=dim_num(16)
max_w=dim_num(17)
m_hei=dim_num(6)
max_word=dim_num(4)
img_emoney="<img border=0 src='"&joekoe_cms.web_dir_skin&"small/emoney.gif' alt='"&joekoe_cms.web_unit&"' align=absmiddle>"

web_width=""
user_ip=joekoe_cms.ip_sys(0)
user_sys=joekoe_cms.code_form(left(joekoe_cms.ip_sys(1),250))
skin_dir=joekoe_cms.web_dir_skin
iframe=false
page_load=false
is_refur_true=true
cookies_true=true
if trim(request.cookies(joekoe_cms.web_cookies)("cookies_true"))<>"yes" then
  response.cookies(joekoe_cms.web_cookies).path=joekoe_cms.web_dir
  response.cookies(joekoe_cms.web_cookies)("cookies_true")="yes"
  cookies_true=false
end if

call web_is_open()
call web_ip_shield()

dim dim_menu
dim_menu=split(web_dim(20),"|")

sub web_head_tit()
  tit=joekoe_cms.code_form(tit)
  tit_fir=joekoe_cms.code_form(tit_fir)
  joekoe_cms.web_tit=tit
  call skin_load()
  call joekoe_cms.web_title()
  if iframe then
    response.write vbcrlf&"<iframe width=0 height=0 src=''id=hiddenframe name=hiddenframe></iframe>"
  end if
  lefter="<table border=0 width='"&web_width&"' cellspacing=0 cellpadding=0><tr><td width=1 class=bg_frame></td><td width=* align=center class=bg>"
  righter="</td><td width=1 class=bg_frame></td></tr></table>"
end sub

sub web_ads(ads_sort,ads_t)
  if var_null(ads_sort)="" then exit sub
  response.write vbcrlf&"<script language=javascript src='ads/ads_"&ads_sort&".js'></script>"
  if ads_t=1 then
    response.write ukong
  end if
end sub

sub day_initialize(today_tim)
  call joekoe_cms.exec("update configs set num_new=0,today_tim='"&today_tim&"'",0)
  application.lock
  application(joekoe_cms.web_cookies&"_configs_new_num")=0
  application(joekoe_cms.web_cookies&"_configs_today_tim")=today_tim
  application.unlock
  call joekoe_cms.exec("update bbs_forum set forum_new_num=0",0)
  sql="update user_data set abate=1 where estate=1 and otim<#"&today_tim&"#"
  call joekoe_cms.exec(sql,0)
end sub

sub web_head(var1,var2,var3,var4,var5)
  if page_load then
    call format_redirect("page_load.asp")
  end if
  call web_head_tit()
  
  dim temp1,ttt
  num_topic=0
  num_data=0
  num_reg=0
  new_username=""
  total_counter=0
  max_online=0
  max_tim=joekoe_cms.now_time
  start_tim=joekoe_cms.time_type(joekoe_cms.now_time,5)
  login_msg=0
  online_num=0
  new_num=0
  today_tim=joekoe_cms.time_type(joekoe_cms.now_time,4)
  tit=joekoe_cms.code_form(tit)
  stamp_num=format_mid_num(1)
  
  '-------------------------------------------------------------------------
  if not application(joekoe_cms.web_cookies&"_configs_true") then
    sql="select top 1 id,num_topic,num_data,num_reg,new_username,num_news,num_article,num_down,num_product,counter,max_online,max_tim,start_tim,num_new,today_tim from configs"
    set rs=joekoe_cms.exec(sql,1)
    if rs.eof then
      rs.close
      call joekoe_cms.exec("insert into configs(id,num_topic,num_data,num_reg,new_username,num_news,num_article,num_down,num_product,counter,max_online,max_tim,start_tim,num_new,today_tim) values(1,"&num_topic&","&num_data&","&num_reg&",'"&new_username&"',0,0,0,0,"&total_counter&","&max_online&",'"&max_tim&"','"&start_tim&"',0,'"&today_tim&"')",0)
      set rs=joekoe_cms.exec(sql,1)
    end if
    application.lock
    application(joekoe_cms.web_cookies&"_configs_true")=true
    application(joekoe_cms.web_cookies&"_configs_num_topic")=rs(1)
    application(joekoe_cms.web_cookies&"_configs_num_data")=rs(2)
    application(joekoe_cms.web_cookies&"_configs_num_reg")=rs(3)
    application(joekoe_cms.web_cookies&"_configs_new_username")=rs(4)
    application(joekoe_cms.web_cookies&"_configs_num_news")=rs(5)
    application(joekoe_cms.web_cookies&"_configs_num_article")=rs(6)
    application(joekoe_cms.web_cookies&"_configs_num_down")=rs(7)
    application(joekoe_cms.web_cookies&"_configs_num_product")=rs(8)
    application(joekoe_cms.web_cookies&"_configs_counter")=rs(9)
    application(joekoe_cms.web_cookies&"_configs_max_online")=rs(10)
    application(joekoe_cms.web_cookies&"_configs_max_tim")=rs(11)
    application(joekoe_cms.web_cookies&"_configs_start_tim")=rs(12)
    application(joekoe_cms.web_cookies&"_configs_new_num")=rs(13)
    application(joekoe_cms.web_cookies&"_configs_today_tim")=rs(14)
    application.unlock
    rs.close
  end if
  num_topic=application(joekoe_cms.web_cookies&"_configs_num_topic")
  num_data=application(joekoe_cms.web_cookies&"_configs_num_data")
  num_reg=application(joekoe_cms.web_cookies&"_configs_num_reg")
  new_username=application(joekoe_cms.web_cookies&"_configs_new_username")
  total_counter=application(joekoe_cms.web_cookies&"_configs_counter")
  max_online=application(joekoe_cms.web_cookies&"_configs_max_online")
  max_tim=application(joekoe_cms.web_cookies&"_configs_max_tim")
  start_tim=application(joekoe_cms.web_cookies&"_configs_start_tim")
  new_num=application(joekoe_cms.web_cookies&"_configs_new_num")
  
  if cstr(joekoe_cms.time_type(application(joekoe_cms.web_cookies&"_configs_today_tim"),4))<>cstr(joekoe_cms.time_type(today_tim,4)) then
    call day_initialize(today_tim)
    total_counter=total_counter+1
    new_num=0
  end if
  
  if cookies_true then
    call joekoe_cms.exec("delete from user_login where datediff('s',l_tim_end,'"&joekoe_cms.now_time&"')>"&dim_num(2)&"*60",0)
    login_password=jk_decrypt(login_password)
    if symbol_name(login_username)=false or symbol_ok(login_password)=false then
      call cookies_clear(0)
    else
      sql="select top 1 id,username,power,popedom,emoney,integral,last_tim,face,face_w,face_h,isper,sex,estate,otim from user_data where hidden=1 and abate=0 and username='"&login_username&"' and password='"&login_password&"'"
      call joekoe_cms.exec("",-1)
      rs.open sql,conn,1,3
      if rs.eof then
        call cookies_clear(0)
      else
        login_id=rs(0)
        login_username=rs(1)
        login_mode=rs(2)
        login_popedom=rs(3)
        login_emoney=rs(4)
        login_integral=rs(5)
        login_faces=rs(7)&"|"&rs(8)&"|"&rs(9)
		login_isper=rs("isper")
        login_sex=rs("sex")
        login_is_abate=rs(10)
        if int(login_is_abate)>0 then
          if int(dateDiff("d",today_tim,rs(11)))<1 then login_is_abate=0
        end if
        rs(6)=joekoe_cms.now_time
        rs.update
        login_modep=format_power(login_mode,2)
        response.cookies(joekoe_cms.web_cookies)("login_id")=login_id
        response.cookies(joekoe_cms.web_cookies)("login_password")=jk_encrypt(login_password)
      end if
      rs.close
	  if login_isper=true then
  set rs=conn.execute("select iname from person where username='"&login_username&"'")
  if not(rs.eof and rs.bof) then login_cname=rs(0)
  rs.close
else
  set rs=conn.execute("select cname from company where username='"&login_username&"'")
  if not(rs.eof and rs.bof) then login_cname=rs(0)
  rs.close
end if
    end if
    if is_refur_true=true then call time_load()
 '完整型,用户和游客都进行识别,这里识别游客
    if int(stamp_num)>1 and login_mode="" and cookies_true=true then
      ttt=trim(request.cookies(joekoe_cms.web_cookies)("guest_name"))
      ttt=joekoe_cms.code_html(ttt,1,0)
      if ttt="" then
        ttt="游客"&Session.SessionID
        response.cookies(joekoe_cms.web_cookies)("guest_name")=ttt
      end if
      sql="select top 1 l_id from user_login where l_username='"&ttt&"'"
      set rs=joekoe_cms.exec(sql,1)
      if rs.eof then
        call joekoe_cms.exec("insert into user_login(l_username,l_type,l_where,l_tim_login,l_tim_end,l_ip,l_sys) values('"&ttt&"',1,'"&left(tit,50)&"','"&joekoe_cms.now_time&"','"&joekoe_cms.now_time&"','"&user_ip&"','"&user_sys&"')",0)
        total_counter=total_counter+1
        call joekoe_cms.exec("update configs set counter=counter+1",0)
      else
        call joekoe_cms.exec("update user_login set l_where='"&left(tit,50)&"',l_tim_end='"&joekoe_cms.now_time&"' where l_id="&rs("l_id"),0)
        if format_mid_num(9)=1 then
          total_counter=total_counter+1
          call joekoe_cms.exec("update configs set counter=counter+1",0)
        end if
      end if
      rs.close
    end if
    
    if int(stamp_num)>0 and login_mode<>"" and cookies_true=true then
      sql="select count(id) from user_mail where accept_u='"&login_username&"' and types=1 and isread=0"
      set rs=joekoe_cms.exec(sql,1)
      login_msg=rs(0)
      rs.close
      sql="select top 1 l_id from user_login where l_username='"&login_username&"'"
      set rs=joekoe_cms.exec(sql,1)
      if rs.eof then
        call joekoe_cms.exec("insert into user_login(l_username,l_type,l_where,l_tim_login,l_tim_end,l_ip,l_sys) values('"&login_username&"',0,'"&left(tit,50)&"','"&joekoe_cms.now_time&"','"&joekoe_cms.now_time&"','"&user_ip&"','"&user_sys&"')",0)
        total_counter=total_counter+1
        call joekoe_cms.exec("update configs set counter=counter+1",0)
      else
        if format_mid_num(9)=1 then
          total_counter=total_counter+1
          call joekoe_cms.exec("update configs set counter=counter+1",0)
        end if      
        call joekoe_cms.exec("update user_login set l_where='"&left(tit,50)&"',l_tim_end='"&joekoe_cms.now_time&"' where l_username='"&login_username&"'",0)
      end if
      rs.close
    end if
  end if
  
  sql="select count(l_id) from user_login"
  set rs=joekoe_cms.exec(sql,1)
  online_num=rs(0)
  rs.close
  if int(online_num)>application(joekoe_cms.web_cookies&"_configs_max_online") then
    application.lock
    application(joekoe_cms.web_cookies&"_configs_max_online")=online_num
    application(joekoe_cms.web_cookies&"_configs_max_tim")=joekoe_cms.now_time
    application.unlock
    call joekoe_cms.exec("update configs set max_online="&online_num&",max_tim='"&joekoe_cms.now_time&"'",0)
  end if
  if int(total_counter)>application(joekoe_cms.web_cookies&"_configs_counter") then
    application.lock
    application(joekoe_cms.web_cookies&"_configs_counter")=total_counter
    application.unlock
    call joekoe_cms.exec("update configs set counter="&total_counter,0)
  end if
  
  if page_power<>"" and instr("."&page_power&".","."&login_modep&".")<1 then call web_error("power")
  select case var1
  case 1
    if int(format_mid_num(8))=1 and login_mode="" then call my_login()
  case 2
    if login_mode="" then call my_login()
  end select
  if var2=1 and login_mode<>"" then
    if popedom_p(41)=1 then call web_error("locked")
  end if
  if var3=5 then exit sub
  call web_js()
  response.write vbcrlf&"<body topmargin=0 leftmargin=0><center>"  
   if login_msg>0 then
    response.write "<bgsound src='"&joekoe_cms.web_dir_skin&"mail/message.wav'>"
  end if
  if var3=4 then exit sub
  if var3<>2 then response.write vbcrlf&lefter
response.write vbcrlf&"<table>"

%><tr><td colspan=2 height=48 valign=bottom align=center><!-- #include file="../top88852.asp" --></td></tr><%
                 response.write vbcrlf&"</table>" & _
                 vbcrlf&righter
 if var3<>2 then response.write web_left(var3)
end sub




function popedom_p(popedom_n)
  if cint(popedom_n)>len(login_popedom) or len(login_popedom)<>50 then
    popedom_p=0
    exit function
  end if
  popedom_p=int(mid(login_popedom,popedom_n,1))
end function

function web_left(lt)
  select case cint(lt)
  case 1
    web_left="<table border=0 width='100%' cellspacing=0 cellpadding=0><tr valign=top align=center><td width="&web_left_wid&" height="&web_center_height&" class=bg_left>"
  case 2
    web_left="<table border=0 width='100%' cellspacing=0 cellpadding=0><tr><td align=center class=bg_1>"
  case 3
    web_left="<table border=0 width='100%' cellspacing=0 cellpadding=0><tr><td height="&web_center_height&" align=center class=bg_1>"
  case 4
    web_left="<table width='100%'><tr valign='top'><td width='78%' align=center>"
    case else
    web_left="<table border=0 width='100%' cellspacing=0 cellpadding=0><tr valign=top align=center><td width="&web_left_wid&" class=bg_left>"
  end select
  web_left=lefter&web_left
end function

sub web_center(ct)
  response.write "</td>"
  response.write "<td width=1 background='"&joekoe_cms.web_dir_skin&"bg_c.gif'></td>"
  response.write "<td wdith=*>"
end sub

function web_right()
  web_right=vbcrlf&"</td></tr></table>"&righter
end function

sub web_end(var1,var2)
  if var2=0 then 
if var1=0 then response.write web_right&lefter
response.write vbcrlf&"<TABLE border=0 cellspacing=0 cellpadding=0>" & _
           vbcrlf&"<tr><td class=td style='font-weight: normal;' align=center>" & _
           vbcrlf&"<a class=h_td href='help.asp'><font color=000000>关于我们</font></a>&nbsp;<font color=000000>┋</font>&nbsp;" & _
           vbcrlf&"<a class=h_td href='chat.asp'><font color=000000>阳光聊天</font></a>&nbsp;<font color=000000>┋</font>&nbsp;" & _
           vbcrlf&"<a class=h_td href='links.asp'><font color=000000>友情链接</font></a>&nbsp;<font color=000000>┋</font>&nbsp;" & _
           vbcrlf&"<a class=h_td href='hkfs.asp'><font color=000000>汇款方式</font></a>&nbsp;<font color=000000>┋</font>&nbsp;" & _
           vbcrlf&"<a class=h_td href='gbook.asp'><font color=000000>留言</font></a>&nbsp;<font color=000000>┋</font>&nbsp;" & _
           vbcrlf&"<a class=h_td href='#top'><font color=000000>TOP</font></a>" & _
           vbcrlf&"</td></tr>" & _
           vbcrlf&"<tr><td height=3></td></tr>" & _
           vbcrlf&"<tr><td align=center>" & _
           vbcrlf&"  <table border=0 cellspacing=0 cellpadding=2>" & _
           vbcrlf&"  <tr lign=center>" & _

           vbcrlf&"  <td>" & _
           vbcrlf&"    <table border=0 cellspacing=0 cellpadding=2 width=777>" & _
           vbcrlf&"    <tr><td align=center>版权所有：<a href='"&joekoe_cms.web_url&"' target=_blank>"&joekoe_cms.web_name&"</a>&nbsp;&nbsp;<a href='"&joekoe_cms.web_url&"' target=_blank>"&joekoe_cms.web_url&"</a>&nbsp;&nbsp;&nbsp;</td></tr>" & _
           vbcrlf&"    <tr><td align=center>"&web_copyright&"&nbsp;&nbsp;&nbsp;88852门户网售前客服:：<a target=blank href=http://wpa.qq.com/msgrd?V=1&Uin=86628384&Site=出售中的源码和当前看到的是同步的，带全部数据。&Menu=yes><img border=0 SRC=http://wpa.qq.com/pa?p=1:86628384:5 alt=出售中的源码和当前看到的是同步的，带全部数据。></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='http://www.miibeian.gov.cn/'><font color=blue>晋ICP备06000701号</font></a>&nbsp;&nbsp;&nbsp;<script src='http://s17.cnzz.com/stat.php?id=79283&web_id=79283&show=pic' language='JavaScript' charset='gb2312'></script></td></tr>" & _
           vbcrlf&"    " & _
           vbcrlf&"    </table>" & _
           vbcrlf&"  </td>" & _
           vbcrlf&"  <td width=60></td>" & _
           vbcrlf&"  </tr>" & _
           vbcrlf&"  </table>" & _
           vbcrlf&"</td></tr>" & _
           vbcrlf&"<tr><td height=3></td></tr>" & _

           vbcrlf&"</table>"&righter & _
           vbcrlf&"</center></body></html>"
  end if
  call web_clears(1)
end sub

sub web_branch(jst)
  response.write web_right()
  response.write web_left(2)
  response.buffer
end sub

sub web_js_type(jtt)
  if joekoe_cms.js_mod then exit sub
  response.write joekoe_cms.js_type("",jtt)
end sub

sub web_js_msg(msg_type,msg_var,msg_url)
  call cookies_load()
  if msg_type=0 then
    response.write "alert("""&msg_var&""");location.href="""&msg_url&""";"
    exit sub
  end if
  response.write joekoe_cms.js_put("alert("""&msg_var&""");location.href="""&msg_url&""";",1)
end sub

sub cookies_load()
  response.cookies(joekoe_cms.web_cookies)("time_load")=dateadd("s",-5,joekoe_cms.now_time)
end sub

sub cookies_clear(tl)
  if tl=1 then call cookies_load()
  response.cookies(joekoe_cms.web_cookies)("login_username")=""
  response.cookies(joekoe_cms.web_cookies)("login_password")=""
  response.cookies(joekoe_cms.web_cookies)("login_id")=""
  login_mode=""
  login_username=""
  login_password=""
end sub

sub my_login()
  if login_mode<>"" then exit sub
  dim temp1
  temp1=trim(request.serverVariables("url"))&"?"&trim(request.serverVariables("QUERY_STRING"))
  temp1=server.urlencode(temp1)
  response.cookies(joekoe_cms.web_cookies)("time_load")=DateAdd("s",-5,joekoe_cms.now_time)
  response.cookies(joekoe_cms.web_cookies)("login_username")=""
  response.cookies(joekoe_cms.web_cookies)("login_password")=""
  response.cookies(joekoe_cms.web_cookies)("login_id")=""
  response.cookies(joekoe_cms.web_cookies)("iscookies")=""
  call format_redirect("login.asp?old_url="&temp1)
end sub

function format_menu(mvar)
  dim i
  format_menu=""
  for i=0 to ubound(dim_menu)
    if mvar=left(dim_menu(i),instr(dim_menu(i),":")-1) then
      format_menu=right(dim_menu(i),len(dim_menu(i))-instr(dim_menu(i),":"))
      exit for
    end if
  next
end function

sub skin_load()
  dim n_skin,n_wid
  n_skin=trim(request.cookies(joekoe_cms.web_cookies)("skin_var"))
  n_wid=trim(request.cookies(joekoe_cms.web_cookies)("skin_wid"))
  if n_skin<>"" and n_wid<>"" then
    joekoe_cms.web_skin=n_skin
    skin_dir=joekoe_cms.web_dir&"skin/"&n_skin&"/"
    joekoe_cms.web_dir_skin=skin_dir
    if web_width="" then web_width=n_wid
  else
    web_width=web_dim(8)
  end if
end sub

sub format_redirect(r_url)
  call web_clears(0)
  response.clear
  response.redirect r_url
  response.end
end sub

sub web_clears(c_end)
  erase dim_menu
  call web_clear(c_end)
end sub

sub web_js()
  response.write joekoe_cms.js_put("style/functions.js",0)
  response.write joekoe_cms.js_put("style/mouse_on_title.js",0)
  'response.write joekoe_cms.js_put("style/joekoe_menu.js",0)
  'response.write joekoe_cms.js_put("style/joekoe_common.js",0)
  'call joekoe_cms.js_type("skin/"&joekoe_cms.web_skin&"/joekoe_common.js",4)
  'response.write vbcrlf&"web_head("&var3&",'"&index_url&"');"
end sub

sub web_is_open()
  if web_dim(0)=0 then
    response.clear
    call web_head_tit()
    call web_no_open()
    call web_clear(1)
  end if
end sub

sub web_ip_shield()
  dim tmp
  tmp=true
  if web_dim(22)="" or user_ip="" then exit sub
  dim sdim,snum
  sdim=split(web_dim(22),"|")
  snum=ubound(sdim)
  for i=0 to snum
    if instr("$"&user_ip&".","$"&sdim(i)&".")>0 then
      erase sdim
      response.clear
      call web_head_tit()
      call web_no_ip()
      call web_clear(1)
    end if
  next
  erase sdim
end sub

sub web_error(etype)
  response.clear
  response.cookies(joekoe_cms.web_cookies)("time_load")=DateAdd("s",-5,joekoe_cms.now_time)
  response.cookies(joekoe_cms.web_cookies)("old_url")=request.servervariables("http_referer")
  response.cookies(joekoe_cms.web_cookies)("error_action")=etype
  call format_redirect("error.asp")
end sub

sub user_login()
  if login_mode="" then
%>
<table cellspacing=1 cellpadding=4 class=table>
<tr><td class=td0>&nbsp;登陆信息</td></tr>
<tr class=bg_td><td align=center height=110>
  <table border=0>
  <form name=login_frm method=post action='login.asp?action=login_chk' onsubmit="return login_true()">
  <input type=hidden name=chk value='yes'>
  <input type=hidden name=re_log value='yes'>
  <tr>
  <td>用户名：</td>
  <td><input type=text name=username value='' size=12 maxlegth=20></td>
  </tr>
  <tr>
  <td>密码：</td>
  <td><input type=password name=password value='' size=12 maxlegth=20></td>
  </tr>
  <tr><td colspan=2 align=center><a href='register.asp'>新注册</a> <a href='user_getpass.asp' style='cursor:help;'>忘记密码</a> <input type=image src='images/index/user_login_button.gif' border=0 align=absmiddle onclick="jacascript:return login_true();"></td></tr>
  <tr><td colspan=2 align=center><a href='register.asp?action=resend' alt='重新发送一次我的注册验证邮件！'>发送注册邮件</a> <input type=checkbox id=id_memery_info name=memery_info value='yes' class=bg_td><label for=id_memery_info id=label_memery_info alt='如选择“记住密码”登陆，以后将自动登陆本站！'>记住密码</label></td></tr>
  </form>
  </table>
</td></tr>
</table>
<%
    exit sub
  end if
%>
<table cellspacing=1 cellpadding=4 class=table>
<tr><td class=td0>&nbsp;登陆信息</td></tr>
<tr class=bg_td><td align=center height=110>
  <table border=0>
  <tr><td align=center>您好，<font class=blue><b><%response.write login_username%></b></font></td></tr>
  <tr><td align=center>你现在已登陆 <font class=red2><%response.write login_mode%></font> 模式</td></tr>
  <tr><td align=center>您目前有<font class=red><%response.write login_emoney%></font><%response.write joekoe_cms.web_unit%>，<font class=red><%response.write login_integral%></font>分</td></tr>
  <tr><td align=center><a href='user_mail.asp'>我的短信箱（<%response.write login_msg%> 新）</a></td></tr>
  <tr><td align=center><a href='user_main.asp'>用户中心</a>　 <a href='login.asp?action=logout'>退出登陆</a></td></tr>
  </table>
</td></tr>
</table>
<%
end sub

sub time_load()
  dim tim_s,var_s
  tim_s=int(dim_num(3))
  if int(tim_s)<1 then exit sub
  if login_mode=format_power2(1,1) then exit sub
  var_s=request.cookies(joekoe_cms.web_cookies)("time_load")
  if isdate(var_s) then
    if int(datediff("s",var_s,joekoe_cms.now_time))<=int(tim_s) then
      call web_error("time_load")
      exit sub
    end if
  end if
  response.cookies(joekoe_cms.web_cookies)("time_load")=joekoe_cms.now_time
end sub

sub time_lock()
  dim tt,tim1,tim2,nh,tl:tl=0
  tt=web_dim(10)
  if len(tt)<1 then tt="0:0"
  tim1=left(tt,instr(1,tt,":")-1)
  tim2=right(tt,len(tt)-instr(1,tt,":"))
  if not(isnumeric(tim1)) or not(isnumeric(tim2)) then exit sub
  tim1=int(tim1):tim2=int(tim2)
  if tim1=tim2 then exit sub
  if tim2=0 then tim2=24
  tim2=tim2-1
  nh=int(hour(joekoe_cms.now_time))
  if tim1>tim2 then
    if (nh>=tim1 and nh<=24) or (nh>=0 and nh<=tim2) then tl=1
  else
    if nh>=tim1 and nh<=tim2 then tl=1
  end if
  if tl=1 then
    call web_error("time_lock")
  end if
end sub

function frm_chk()
  frm_chk=false
  if trim(request.form("chk"))="yes" then
    frm_chk=joekoe_cms.post_chk()
  end if
end function

function post_tim()
  dim pt_var,pt_num
  post_tim=true
  pt_var=session("post_tim")
  if isdate(pt_var) then
    pt_num=datediff("s",pt_var,joekoe_cms.now_time)
    if int(dim_num(28))>0 and int(pt_num)<=int(dim_num(28)) then
      post_tim=false
    end if
  end if
  session("post_tim")=joekoe_cms.now_time
end function

function pic_url(pvar,pt)
  dim temp1,pic_var
  pic_var=pvar
  if pic_var="" then
    pic_var=joekoe_cms.web_upload&"no_pic.gif"
  else
    if instr(pic_var,"://")<1 then
      pic_var=joekoe_cms.web_upload&pic_var
    end if
  end if
  select case int(pt)
  case 1
    temp1="<img border=0 width="&pic_w&" height="&pic_h&" src='" & pic_var & "'>"
  case 2
    temp1="<img border=0 width="&(pic_w*1.5)&" height="&(pic_h*1.5)&" src='" & pic_var & "'>"
  case 3
    temp1="<img border=0 src='" & pic_var & "'>"
  case 4
     temp1="<img border=0 width="&(pic_w*0.7)&" height="&(pic_h*0.7)&" src='" & pic_var & "'>"
  case 5
     temp1="<img border=0 width="&(pic_w*0.5)&" height="&(pic_h*0.5)&" src='" & pic_var & "'>"
  case 8
    temp1="<img border=0 width="&(pic_w*1.2)&" height="&(pic_h*1.2)&" src='" & pic_var & "'>"
  case else
    temp1=pic_var
  end select
  pic_url=temp1
end function

function pic_fk(pvar,pt,purl)
  dim burl,picurl,temp1
  burl="images/fk/"
  picurl=pic_url(pvar,pt)
  if purl<>"" and var_null(purl)<>"" then picurl="<a href='"&purl&"' target=_blank>"&picurl&"</a>"
  temp1=temp1&vbcrlf&"<table border=0 cellpadding=0 cellspacing=0>" & _
              vbcrlf&"<tr><td colspan=3 width='100%' align=center>" & _
              vbcrlf&"  <table border=0 cellpadding=0 cellspacing=0 width='100%'>" & _
              vbcrlf&"  <tr height=4>" & _
              vbcrlf&"  <td width=7><img src='"&burl&"fk_top_left.gif' width=7 height=4 border=0></td>" & _
              vbcrlf&"  <td background='"&burl&"fk_top_bg.gif' width='*'><img src='"&burl&"fk_top_bg.gif' border=0 height=4></td>" & _
              vbcrlf&"  <td width=7 align=right><img src='"&burl&"fk_top_right.gif' border=0 width=7 height=4></td>" & _
              vbcrlf&"  </tr>" & _
              vbcrlf&"  </table>" & _
              vbcrlf&"</td></tr>" & _
              vbcrlf&"<tr><td colspan=3 width='100%' align=center>" & _
              vbcrlf&"  <table border=0 cellpadding=0 cellspacing=0 width='100%'>" & _
              vbcrlf&"  <tr>" & _
              vbcrlf&"  <td width=4 height='100%'>" & _
              vbcrlf&"    <table border=0 cellpadding=0 cellspacing=0 width='100%' height='100%'>" & _
              vbcrlf&"    <tr><td height=4><img src='"&burl&"fk_left_top.gif' border=0 width=4></td></tr>" & _
              vbcrlf&"    <tr><td background='"&burl&"fk_left_bg.gif'></td></tr>" & _
              vbcrlf&"    <tr><td height=4 valign=bottom><img src='"&burl&"fk_left_end.gif' border=0 width=4></td></tr>" & _
              vbcrlf&"    </table>" & _
              vbcrlf&"  </td>" & _
              vbcrlf&"  <td align=center width=*>"&picurl&"</td>" & _
              vbcrlf&"  <td width=4 height='100%'>" & _
              vbcrlf&"    <table border=0 cellpadding=0 cellspacing=0 width='100%' height='100%'>" & _
              vbcrlf&"    <tr><td height=4><img src='"&burl&"fk_right_top.gif' border=0 width=4></td></tr>" & _
              vbcrlf&"    <tr><td background='"&burl&"fk_right_bg.gif'></td></tr>" & _
              vbcrlf&"    <tr><td height=4 valign=bottom><img src='"&burl&"fk_right_end.gif' border=0 width=4></td></tr>" & _
              vbcrlf&"    </table>" & _
              vbcrlf&"  </td>" & _
              vbcrlf&"  </tr>" & _
              vbcrlf&"  </table>" & _
              vbcrlf&"</td></tr>" & _
              vbcrlf&"<tr><td colspan=3 width='100%' align=center>" & _
              vbcrlf&"  <table border=0 cellpadding=0 cellspacing=0 width='100%'>" & _
              vbcrlf&"  <tr height=4>" & _
              vbcrlf&"  <td width=7><img src='"&burl&"fk_end_left.gif' width=7 height=4 border=0></td>" & _
              vbcrlf&"  <td background='"&burl&"fk_end_bg.gif' width='*'><img src='"&burl&"fk_end_bg.gif' border=0 height=4></td>" & _
              vbcrlf&"  <td width=7 align=right><img src='"&burl&"fk_end_right.gif' border=0 width=7 height=4></td>" & _
              vbcrlf&"  </tr>" & _
              vbcrlf&"  </table>" & _
              vbcrlf&"</td></tr>" & _
              vbcrlf&"</table>"
  pic_fk=temp1
end function

function format_topic_type(b_jt,b_username,b_topic,b_c_num,b_url,b_tim,b_counter,b_ispic,b_tit,b_count,b_tim_type)
  dim n_img,tim_type,n_c_num,temp1
  n_c_num=b_c_num
  if b_ispic=true then
    n_img="&nbsp;<img src='"&joekoe_cms.web_dir_skin&"small/img.gif' border=0>"
    n_c_num=n_c_num-2
  end if
  if int(b_tim_type)>0 then
    if int(b_tim_type)=2 then tim_type=tim_type&"</td><td align=right>"
    tim_type=tim_type&"&nbsp;<font class=tims>"&mid(b_tim,6,5)&"</font>"
  end if
  temp1="<tr><td>"&b_jt&"<a href='"&b_url&"' alt='"&b_tit&"："&joekoe_cms.code_html(b_topic,1,0)&"<br>发 布 人："&b_username&"<br>"&b_count&"："&b_counter&" 人次<br>整理时间："&b_tim&"' target=_blank>"&joekoe_cms.code_html(b_topic,1,n_c_num)&"</a>"&n_img&tim_type&"</td></tr>"
  format_topic_type=temp1
end function

function format_pic_type(b_pic,b_topic,b_c_num,b_url)
  dim temp1
  temp1=temp1&vbcrlf&"<table border=0>" & _
              vbcrlf&"<tr><td align=center>"&pic_fk(b_pic,1,b_url)&"</td></tr>" & _
              vbcrlf&"<tr><td align=center><a href='"&b_url&"' title='"&joekoe_cms.code_html(b_topic,1,0)&"'>"&joekoe_cms.code_html(b_topic,1,b_c_num)&"</a></td></tr>" & _
              vbcrlf&"</table>"
  format_pic_type=temp1
end function

sub cms_copyright()
  response.write vbcrlf&"<table cellspacing=1 cellpadding=2 class=table>" & _
                 vbcrlf&"<tr><td class=bg_tds align=center height=30><a href='"&joekoe_cms.web_url&"' target=_blank>"&joekoe_cms.web_name&"</a>　　<a href='javascript:window.close();'>关闭窗口</a></td></tr>" & _
                 vbcrlf&"</table>"
end sub

sub web_no_open()
  response.write vbcrlf&"<body topmargin=0 leftmargin=0>" & _
                 vbcrlf&"<table border=0 width='100%' height='100%' class=bg>" & _
                 vbcrlf&"<tr><td width='100%' height='100%' valign=top>" & _
                 vbcrlf&"  <table border=0 cellpadding=8 cellspacing=8>" & _
                 vbcrlf&"  <tr><td class=htd><a href='"&joekoe_cms.web_url&"'>"&joekoe_cms.web_name&"</a><br><a href='"&joekoe_cms.web_url&"'>"&joekoe_cms.web_url&"</a></td></tr>" & _
                 vbcrlf&"  <tr><td class=htd><font class=red>站点维护中，请稍候再访问本站……</font><br>欢迎您的再次访问！<br><br><a href='admin.asp'>管理员登陆</a></td></tr>" & _
                 vbcrlf&"  <tr><td><a href='mailto:"&joekoe_cms.web_email&"'>邮件联系我们</a></td></tr>" & _
                 vbcrlf&"  </table>" & _
                 vbcrlf&"</td></tr>" & _
                 vbcrlf&"</table>"
end sub

sub web_no_ip()
  response.write vbcrlf&"<body topmargin=0 leftmargin=0>" & _
                 vbcrlf&"<table border=0 width='100%' height='100%' class=bg>" & _
                 vbcrlf&"<tr><td width='100%' height='100%' valign=top>" & _
                 vbcrlf&"  <table border=0 cellpadding=8 cellspacing=8>" & _
                 vbcrlf&"  <tr><td class=htd><a href='"&joekoe_cms.web_url&"'>"&joekoe_cms.web_name&"</a><br><a href='"&joekoe_cms.web_url&"'>"&joekoe_cms.web_url&"</a></td></tr>" & _
                 vbcrlf&"  <tr><td class=htd><font class=red>真对不起！</font><br><font class=red2><b>您目前已被本站列入不受欢迎名单！</b></font></td></tr>" & _
                 vbcrlf&"  <tr><td><a href='mailto:"&joekoe_cms.web_email&"'>邮件联系我们</a></td></tr>" & _
                 vbcrlf&"  </table>" & _
                 vbcrlf&"</td></tr>" & _
                 vbcrlf&"</table>"
end sub

'****************************************************************************************************************
'以下为88852门户网提供********************************************************************************************
'****************************************************************************************************************


function llcenter(rndn,ln)
randomize 
dim k,KK
rndn=9
ln=rndn/2
k=cint(rnd*rndn)
kk="left" 
if k=0 then k=k+1 end if
if k>ln then kk="right"
llcenter="<table align="&KK&" float="&KK&" border=0><tr><td><script language=javascript src='ads/ads_middle_"&k&".js'></script></td></tr></table>"
end function

function llright(rndn)
randomize 
dim k
rndn=8
k=cint(rnd*rndn)
if k=0 then k=k+1 end if
llright="<table align=center  border=0><tr><td align=center><script language=javascript src='ads/ads_right_"&k&".js'></script></td></tr></table>"
end function

function llcenter_n(rndn,ln)
randomize 
dim k,KK,n_pic
rndn=9
ln=rndn/2
k=cint(rnd*rndn)
kk="left" 
if k=0 then k=k+1 end if
if k>ln then kk="right"

  if ispic=true and pic<>"" and var_null(pic)<>"" then n_pic="<table align="&KK&" float="&KK&" border=0><tr><td align=center><img src='"&pic_url(pic,0)&"' border=0 onload=""javascript:if(this.width>"&max_w&")this.width="&max_w&";""></td></tr></table>" else n_pic=llcenter(4,2) end if
llcenter_n=n_pic
end function

function topic_is_new(t_time)
  dim isnew
  isnew=""
  if datediff("d",t_time,joekoe_cms.now_time)<1 then isnew="new"
  topic_is_new=isnew
end function

%>