<%
Function code_jk(strer)
  strer=strer
  if strer="" or isnull(strer) then
    code_jk="":exit function
  end if

  strer=replace(strer,"<","&lt;")
  strer=replace(strer,">","&gt;")
  strer=replace(strer,CHR(32),"&nbsp")    '空格
  strer=replace(strer,CHR(9),"&nbsp")    'table
  strer=replace(strer,CHR(39),"&#39;")    '单引号
  strer=replace(strer,CHR(34),"&quot;")    '双引号
  
  dim re
  set re=new RegExp
  re.IgnoreCase =true
  re.Global=true
  
  re.Pattern="(javascript)"
  strer=re.Replace(strer,"&#106avascript")
  re.Pattern="(jscript:)"
  strer=re.Replace(strer,"&#106script:")
  re.Pattern="(js:)"
  strer=re.Replace(strer,"&#106s:")
  re.Pattern="(value)"
  strer=re.Replace(strer,"&#118alue")
  re.Pattern="(about:)"
  strer=re.Replace(strer,"about&#58")
  re.Pattern="(file:)"
  strer=re.Replace(strer,"file&#58")
  re.Pattern="(document.cookie)"
  strer=re.Replace(strer,"documents&#46cookie")
  re.Pattern="(vbscript:)"
  strer=re.Replace(strer,"&#118bscript:")
  re.Pattern="(vbs:)"
  strer=re.Replace(strer,"&#118bs:")
  re.Pattern="(on(mouse|exit|error|click|key))"
  strer=re.Replace(strer,"&#111n$2")
  
  re.Pattern="\[pic\](http|https|ftp):\/\/(.[^\[]*)\[\/pic\]"
  strer=re.Replace(strer,"<IMG SRC='http://$2' border=0 onload=""javascript:if(this.width>screen.width-430)this.width=screen.width-430"">")
  re.Pattern="\[IMG\](http|https|ftp):\/\/(.[^\[]*)\[\/IMG\]"
  strer=re.Replace(strer,"<a href='http://$2' target=_blank><IMG SRC='http://$2' border=0 alt='按此在新窗口浏览图片' onload=""javascript:if(this.width>screen.width-430)this.width=screen.width-430""></a>")
  re.Pattern="(\[FLASH=*([0-9]*),*([0-9]*)\])(.[^\[]*)(\[\/FLASH\])"
  strer= re.Replace(strer,"<a href='$4' TARGET=_blank>[全屏欣赏]</a><br><OBJECT codeBase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=4,0,2,0 classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 width=$2 height=$3><PARAM NAME=movie VALUE='$4'><PARAM NAME=quality VALUE=high><embed src='$4' quality=high pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' width=$2 height=$3>$4</embed></OBJECT>")
  re.Pattern="(\[FLASH\])(http://.[^\[]*(.swf))(\[\/FLASH\])"
  strer= re.Replace(strer,"<a href=""$2"" TARGET=_blank>[全屏欣赏]</a><br><OBJECT codeBase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=4,0,2,0 classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 width=500 height=400><PARAM NAME=movie VALUE=""$2""><PARAM NAME=quality VALUE=high><embed src=""$2"" quality=high pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' width=500 height=400>$2</embed></OBJECT>")
  re.Pattern="(\[URL\])(.[^\[]*)(\[\/URL\])"
  strer= re.Replace(strer,"<A HREF='$2' class=blue TARGET=_blank>$2</A>")
  re.Pattern="(\[URL=(.[^\[]*)\])(.[^\[]*)(\[\/URL\])"
  strer= re.Replace(strer,"<A HREF='$2' class=blue TARGET=_blank>$3</A>")
  re.Pattern="(\[EMAIL\])(\S+\@.[^\[]*)(\[\/EMAIL\])"
  strer= re.Replace(strer,"<A HREF=""mailto:$2"">$2</A>")
  re.Pattern="(\[EMAIL=(\S+\@.[^\[]*)\])(.[^\[]*)(\[\/EMAIL\])"
  strer= re.Replace(strer,"<A HREF=""mailto:$2"" TARGET=_blank>$3</A>")
  re.Pattern = "^(http://[A-Za-z0-9\./=\?%\-&_~`@':+!]+)"
  strer = re.Replace(strer,"<a target=_blank href=$1>$1</a>")
  re.Pattern = "(http://[A-Za-z0-9\./=\?%\-&_~`@':+!]+)$"
  strer = re.Replace(strer,"<a target=_blank href=$1>$1</a>")
  re.Pattern = "([^>='])(http://[A-Za-z0-9\./=\?%\-&_~`@':+!]+)"
  strer = re.Replace(strer,"$1<a target=_blank href=$2>$2</a>")
  re.Pattern = "^(ftp://[A-Za-z0-9\./=\?%\-&_~`@':+!]+)"
  strer = re.Replace(strer,"<a target=_blank href=$1>$1</a>")
  re.Pattern = "(ftp://[A-Za-z0-9\./=\?%\-&_~`@':+!]+)$"
  strer = re.Replace(strer,"<a target=_blank href=$1>$1</a>")
  re.Pattern = "[^>='](ftp://[A-Za-z0-9\.\/=\?%\-&_~`@':+!]+)"
  re.Pattern="\[color=(.[^\[]*)\](.[^\[]*)\[\/color\]"
  strer=re.Replace(strer,"<font color=$1>$2</font>")
  re.Pattern="\[face=(.[^\[]*)\](.[^\[]*)\[\/face\]"
  strer=re.Replace(strer,"<font face=$1>$2</font>")
  re.Pattern="\[align=(.[^\[]*)\](.[^\[]*)\[\/align\]"
  strer=re.Replace(strer,"<div align=$1>$2</div>")
  re.Pattern="\[align=(.[^\[]*)\](.*)\[\/align\]"
  strer=re.Replace(strer,"<div align=$1>$2</div>")
  re.Pattern="\[center\](.[^\[]*)\[\/center\]"
  strer=re.Replace(strer,"<div align=center>$1</div>")
  re.Pattern="\[i\](.[^\[]*)\[\/i\]"
  strer=re.Replace(strer,"<i>$1</i>")
  re.Pattern="\[u\](.[^\[]*)(\[\/u\])"
  strer=re.Replace(strer,"<u>$1</u>")
  re.Pattern="\[b\](.[^\[]*)(\[\/b\])"
  strer=re.Replace(strer,"<b>$1</b>")
  re.Pattern="\[size=([1-4])\](.[^\[]*)\[\/size\]"
  strer=re.Replace(strer,"<font size=$1>$2</font>")

  set re=Nothing
  
  strer=replace(strer,"[br]","<br>")
  strer=replace(strer,"[BR]","<br>")
  strer=replace(strer,vbCrLf,"<br>")
  code_jk=strer
End Function
'=========================================================
Function code_bl(strer)
  strer=strer
  if strer="" or isnull(strer) then
    code_bl="":exit function
  end if

  strer=replace(strer,"$jbw1209_name$",cityname)
  strer=replace(strer,"$jbw1209_mail$",citymail)
  strer=replace(strer,"$jbw1209_eurl$",cityeurl)
  strer=replace(strer,"$jbw1209_url$",cityurl)

  code_bl=strer
End Function
'=========================================================
Function LeftT(str,n)
If len(str)<=n/2 Then
LeftT=str
Else
Dim TStr
Dim l,t,c
Dim i
l=len(str)
t=l
TStr=""
t=0
for i=1 to l
c=asc(mid(str,i,1))
If c<0 then c=c+65536
If c>255 then
t=t+2
Else
t=t+1
End If
If t>n Then exit for
TStr=TStr&(mid(str,i,1))
next
LeftT = TStr+".."
End If
End Function
%>