<%
function UBBs(Content)
	Content = HTMLcode(Content)
dim re
Set re=new RegExp
re.IgnoreCase =true
re.Global=True
	
	re.Pattern="(javascript)"
	Content=re.Replace(Content,"&#106avascript")
	re.Pattern="(jscript:)"
	Content=re.Replace(Content,"&#106script:")
	re.Pattern="(js:)"
	Content=re.Replace(Content,"&#106s:")
	re.Pattern="(value)"
	Content=re.Replace(Content,"&#118alue")
	re.Pattern="(about:)"
	Content=re.Replace(Content,"about&#58")
	re.Pattern="(file:)"
	Content=re.Replace(Content,"file&#58")
	re.Pattern="(document.cookie)"
	Content=re.Replace(Content,"documents&#46cookie")
	re.Pattern="(vbscript:)"
	Content=re.Replace(Content,"&#118bscript:")
	re.Pattern="(vbs:)"
	Content=re.Replace(Content,"&#118bs:")
	re.Pattern="(on(mouse|exit|error|click|key))"
	Content=re.Replace(Content,"&#111n$2")

	re.Pattern = "\[IMG\](http|https|ftp)://(.[^\[]*)\[\/IMG\]"
	Content = re.Replace(Content,"Ïà¹ØÍ¼Æ¬:<br><A onfocus=""this.blur()"" href=""$1://$2"" TARGET=_blank><IMG SRC=""$1://$2"" border=""0"" onload=""javascript:if(this.width>screen.width-380){this.width=screen.width-380;}"" onmousewheel=""return img(this)""></A><br>")

	re.Pattern = "^((http|https|ftp|rtsp|mms):(\/\/|\\\\)[A-Za-z0-9\./=\?%\-&_~`@[\]\':+!]+([^<>""])+)"
	Content = re.Replace(Content,"<a target=_blank href=$1>$1</a>")

	re.Pattern = "((http|https|ftp|rtsp|mms):(\/\/|\\\\)[A-Za-z0-9\./=\?%\-&_~`@[\]\':+!]+)$([^\[]*)"
	Content = re.Replace(Content,"<a target=_blank href=$1>$1</a>")

	re.Pattern = "([^>=""])((http|https|ftp|rtsp|mms):(\/\/|\\\\)[A-Za-z0-9\./=\?%\-&_~`@[\]\':+!]+)"
	Content = re.Replace(Content,"$1<a target=_blank href=$2>$2</a>")

	re.Pattern = "(^[(http://|http:\\)])((www|cn)[.](\w)+[.]{1,}(net|com|cn|org|cc)(((\/[\~]*|\\[\~]*)(\w)+)|[.](\w)+)*(((([?](\w)+){1}[=]*))*((\w)+){1}([\&](\w)+[\=](\w)+)*)*)"
	Content = re.Replace(Content,"<a target=_blank href=http://$2>$2</a>")

	're.Pattern = "([^(=)])((\w)+[@]{1}((\w)+[.]){1,3}(\w)+)"
	'Content = re.Replace(Content,"<img align=absmiddle src=Images/File/mail.gif border=0><a target=_blank href='mailto:$2'>$2</a>")

	if instr(lcase(Content),"[FACE")>0 then
		for FaceCount = 0 to 29
		Content=replace(lcase(Content),"[FACE"&FaceCount&"]","<img src=Face/FACE"&FaceCount&".gif border=0 align=middle>")
		next
	end if
	re.Pattern="(\[FACE(.[^\[]*)\])"
	Content= re.Replace(Content,"<img src=Face/FACE$2.gif border=0 align=middle>")

set re=Nothing
UBBs=Content
end function

Function FilterJS(v)
	if not isnull(v) then
		dim t
		dim re
		dim reContent
		Set re=new RegExp
		re.IgnoreCase =true
		re.Global=True
		re.Pattern="(javascript)"
		t=re.Replace(v,"&#106avascript")
		re.Pattern="(jscript:)"
		t=re.Replace(t,"&#106script:")
		re.Pattern="(js:)"
		t=re.Replace(t,"&#106s:")
		re.Pattern="(value)"
		t=re.Replace(t,"&#118alue")
		re.Pattern="(about:)"
		t=re.Replace(t,"about&#58")
		re.Pattern="(file:)"
		t=re.Replace(t,"file&#58")
		re.Pattern="(document.cookie)"
		t=re.Replace(t,"documents&#46cookie")
		re.Pattern="(vbscript:)"
		t=re.Replace(t,"&#118bscript:")
		re.Pattern="(vbs:)"
		t=re.Replace(t,"&#118bs:")
		re.Pattern="(on(mouse|exit|error|click|key))"
		t=re.Replace(t,"&#111n$2")
		re.Pattern="(&#)"
		t=re.Replace(t,"£¦#")
		FilterJS=t
		set re=nothing
	end if
End Function

function HTMLcode(Content)
	if not isnull(Content) then
		Content = Replace(Content, "  ","&nbsp;&nbsp;")
		Content = Replace(Content, ">", "&gt;")
		Content = Replace(Content, "<", "&lt;")
		Content = Replace(Content, "\", "\\")
		Content = Replace(Content, CHR(34), "&quot;")
		Content = Replace(Content, CHR(39), "&#39;")
		Content = Replace(Content, CHR(13), "")
		Content = Replace(Content, CHR(10) & CHR(10), "</P><P> ")
		Content = Replace(Content, CHR(10), "<BR>")
		HTMLcode = Content
	end if
end function
%>