<%
dim val_rnd,val_is_true
val_rnd=joekoe_cms.rand_num(4)
val_is_true=true
if int(format_mid_num(34))=1 then val_is_true=false

function val_chk(vsort)
  if not val_is_true then
    val_chk=true
    exit function
  end if
  dim valcode,valc
  val_chk=false
  valcode="jk"&trim(request.form("valcode"))
  valc=trim(request.cookies(joekoe_cms.web_cookies)("vc_"&vsort))
  if valcode<>"" and valcode<>"jk" and cstr(valcode)=cstr(valc) then
    val_chk=true
  end if
end function

sub val_chk_end(vsort)
  if not val_is_true then exit sub
  response.cookies(joekoe_cms.web_cookies)("vc_"&vsort)=empty
end sub

function val_code_num(vsort,vt)
  if not val_is_true then
    val_code_num="<input type=hidden name=valcode value=''>"
    exit function
  end if
  response.cookies(joekoe_cms.web_cookies)("vc_"&vsort)="jk"&val_rnd
  if vt=0 then
    val_code_num=val_rnd
    exit function
  end if
  val_code_num="<input type=hidden name=valcode value='"&val_rnd&"'>"
end function

function val_code(vsort)
  if not val_is_true then
    val_code="<table border=0 cellspacing=0 cellpadding=0><tr>" & _
  	     "<td><font class=red2>验证码机制已关闭</font></td>" & _
	     "</tr></table>"
    exit function
  end if
  response.cookies(joekoe_cms.web_cookies)("vc_"&vsort)="jk"&val_rnd
  val_code="<table border=0 cellspacing=0 cellpadding=0><tr>" & _
  	   "<td><input type=text name=valcode size=15 maxlength=10>&nbsp;<font class=red>*</font>&nbsp;</td>" & _
	   "<td><img src='rnd_num.asp?"&val_rnd&"' border=0></td>" & _
	   "</tr></table>"
end function
%>