<%
function UBB_IMG(strText)
	dim strContent
	dim re,Test
	
	Set re=new RegExp
	re.IgnoreCase =true
	re.Global=True
	strContent=strText
	re.Pattern="\[IMG\]"
	Test=re.Test(strContent)
	if Test then
		strContent=re.replace(strContent, chr(1) & "IMG" & chr(2))
		re.Pattern="\[\/IMG\]"
		Test=re.Test(strContent)
		if Test then
			strContent=re.replace(strContent, chr(1) & "/IMG" & chr(2))
			re.Pattern="\x01IMG\x02(.[^\x01]*)\x01\/IMG\x02"
				strContent=re.Replace(strContent,"<a onfocus=this.blur() href=""$1"" target=_blank><IMG SRC=""$1"" border=0 alt=´ͼƬ onload=""javascript:if(this.width>screen.width-400)this.width=screen.width-400""></a>")
			re.Pattern="\x02"
			strContent=re.replace(strContent, "]")
		end if
		re.Pattern="\x01"
		strContent=re.replace(strContent, "[")
	end if
	set re=Nothing
	UBB_IMG=strContent
end function

function UBB_UPLOAD(strText)
	dim strContent
	dim re,Test
	
	Set re=new RegExp
	re.IgnoreCase =true
	re.Global=True
	strContent=strText
	re.Pattern="\[UPLOAD=(gif|jpg|jpeg|bmp|png)\]"
	Test=re.Test(strContent)
	if Test then
		strContent=re.replace(strContent, chr(1) & "UPLOAD=$1" & chr(2))
		re.Pattern="\[\/UPLOAD\]"
		Test=re.Test(strContent)
		if Test then
			strContent=re.replace(strContent, chr(1) & "/UPLOAD" & chr(2))
			re.Pattern="\x01UPLOAD=(gif|jpg|jpeg|bmp|png)\x02(.[^\x01]*)\x01\/UPLOAD\x02"
				strContent= re.Replace(strContent,"<br><IMG SRC=""images/files/$1.gif"" border=0>ͼƬ£<br><A HREF=""$2"" TARGET=_blank><IMG SRC=""$2"" border=0 alt=´ͼƬ onload=""javascript:if(this.width>screen.width-400)this.width=screen.width-400""></A>")
			re.Pattern="\[UPLOAD=(.[^\[]*)\]"
			strContent=re.replace(strContent, chr(1) & "UPLOAD=$1" & chr(2))
			re.Pattern="\x01UPLOAD=(.[^\x01]*)\x02(.[^\x01]*)\x01\/UPLOAD\x02"
			strContent= re.Replace(strContent,"<br><IMG SRC=""images/files/$1.gif"" border=0> <a href=""$2"">ļ</a>")
			re.Pattern="\x02"
			strContent=re.replace(strContent, "]")
		end if
		re.Pattern="\x01"
		strContent=re.replace(strContent, "[")
	end if
	re.Pattern="\[UPLOAD=(.[^\[]*)\](.[^\[]*)\[\/UPLOAD\]"
        strContent= re.Replace(strContent,"<br><IMG SRC=""images/files/$1.gif"" border=0> <a href=""$2"">ļ</a>")
	set re=Nothing
	UBB_UPLOAD=strContent
end function

function UBB_DIR(strText)
	dim strContent
	dim re,Test
	
	Set re=new RegExp
	re.IgnoreCase =true
	re.Global=True
	strContent=strText
	re.Pattern="\[DIR=*([0-9]*),*([0-9]*)\]"
	Test=re.Test(strContent)
	if Test then
		strContent=re.replace(strContent, chr(1) & "DIR=$1,$2" & chr(2))
		re.Pattern="\[\/DIR\]"
		Test=re.Test(strContent)
		if Test then
			strContent=re.replace(strContent, chr(1) & "/DIR" & chr(2))
				re.Pattern="\x01DIR=*([0-9]*),*([0-9]*)\x02(.[^\x01]*)\x01\/DIR\x02"
				strContent=re.Replace(strContent,"<object classid=clsid:166B1BCA-3F9C-11CF-8075-444553540000 codebase=http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=7,0,2,0 width=$1 height=$2><param name=src value=$3><embed src=$3 pluginspage=http://www.macromedia.com/shockwave/download/ width=$1 height=$2></embed></object>")
			re.Pattern="\x02"
			strContent=re.replace(strContent, "]")
		end if
		re.Pattern="\x01"
		strContent=re.replace(strContent, "[")
	end if
	set re=Nothing
	UBB_DIR=strContent
end function

function UBB_QT(strText)
	dim strContent
	dim re,Test
	
	Set re=new RegExp
	re.IgnoreCase =true
	re.Global=True
	strContent=strText
	re.Pattern="\[QT=*([0-9]*),*([0-9]*)\]"
	Test=re.Test(strContent)
	if Test then
		strContent=re.replace(strContent, chr(1) & "QT=$1,$2" & chr(2))
		re.Pattern="\[\/QT\]"
		Test=re.Test(strContent)
		if Test then
			strContent=re.replace(strContent, chr(1) & "/QT" & chr(2))
				re.Pattern="\x01QT=*([0-9]*),*([0-9]*)\x02(.[^\x01]*)\x01\/QT\x02"
				strContent=re.Replace(strContent,"<embed src=$3 width=$1 height=$2 autoplay=true loop=false controller=true playeveryframe=false cache=false scale=TOFIT bgcolor=#000000 kioskmode=false targetcache=false pluginspage=http://www.apple.com/quicktime/>")
			re.Pattern="\x02"
			strContent=re.replace(strContent, "]")
		end if
		re.Pattern="\x01"
		strContent=re.replace(strContent, "[")
	end if
	set re=Nothing
	UBB_QT=strContent
end function

function UBB_MP(strText)
	dim strContent
	dim re,Test
	
	Set re=new RegExp
	re.IgnoreCase =true
	re.Global=True
	strContent=strText
	re.Pattern="\[MP=*([0-9]*),*([0-9]*)\]"
	Test=re.Test(strContent)
	if Test then
		strContent=re.replace(strContent, chr(1) & "MP=$1,$2" & chr(2))
		re.Pattern="\[\/MP\]"
		Test=re.Test(strContent)
		if Test then
			strContent=re.replace(strContent, chr(1) & "/MP" & chr(2))
				re.Pattern="\x01MP=*([0-9]*),*([0-9]*)\x02(.[^\x01]*)\x01\/MP\x02"
				strContent=re.Replace(strContent,"<object align=middle classid=CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95 class=OBJECT id=MediaPlayer width=$1 height=$2 ><param name=ShowStatusBar value=-1><param name=Filename value=$3><embed type=application/x-oleobject codebase=http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701 flename=mp src=$3 width=$1 height=$2></embed></object>")
			re.Pattern="\x02"
			strContent=re.replace(strContent, "]")
		end if
		re.Pattern="\x01"
		strContent=re.replace(strContent, "[")
	end if
	set re=Nothing
	UBB_MP=strContent
end function

function UBB_RM(strText)
	dim strContent
	dim re,Test
	
	Set re=new RegExp
	re.IgnoreCase =true
	re.Global=True
	strContent=strText
	re.Pattern="\[RM=*([0-9]*),*([0-9]*)\]"
	Test=re.Test(strContent)
	if Test then
		strContent=re.replace(strContent, chr(1) & "RM=$1,$2" & chr(2))
		re.Pattern="\[\/RM\]"
		Test=re.Test(strContent)
		if Test then
			strContent=re.replace(strContent, chr(1) & "/RM" & chr(2))
				re.Pattern="\x01RM=*([0-9]*),*([0-9]*)\x02(.[^\x01]*)\x01\/RM\x02"
				strContent=re.Replace(strContent,"<table border=0 cellspacing="0" width=100% cellpadding=0 align=center>
</tr>
<tr><td align="center">
<object ID=video1 CLASSID=clsid:CFCDAA03-8BE4-11CF-B84B-0020AFBBCCFA HEIGHT=$2 WIDTH=$1>
<param name="_ExtentX" value="22304">
<param name="_ExtentY" value="14288">
<param name="AUTOSTART" value="-1">
<param name="SHUFFLE" value="0">
<param name="PREFETCH" value="0">
<param name="NOLABELS" value="0">
<param name="SRC" value=$3">
<param name="CONTROLS" value="ImageWindow">
<param name="CONSOLE" value="Clip1">
<param name="LOOP" value="0">
<param name="NUMLOOP" value="0">
<param name="CENTER" value="0">
<param name="MAINTAINASPECT" value="0">
<param name="BACKGROUNDCOLOR" value="#000000">
</object></td></table></div></table>
<table border="0" cellspacing="0" width="100%" cellpadding="0" align="center">
</tr>
<tr><td align="center">
<object ID="video1" CLASSID="clsid:CFCDAA03-8BE4-11CF-B84B-0020AFBBCCFA" HEIGHT="60" WIDTH="400">
<param name="controls" value="ControlPanel,StatusBar">
<param name="console" value="Clip1">
<embed type="audio/x-pn-realaudio-plugin" CONSOLE="Clip1" CONTROLS="ControlPanel,StatusBar" HEIGHT="60" WIDTH="300" AUTOSTART="true">
</object>")
			re.Pattern="\x02"
			strContent=re.replace(strContent, "]")
		end if
		re.Pattern="\x01"
		strContent=re.replace(strContent, "[")
	end if
	set re=Nothing
	UBB_RM=strContent
end function

function UBB_FLASH(strText)
	dim strContent
	dim re,Test
	
	Set re=new RegExp
	re.IgnoreCase =true
	re.Global=True
	strContent=strText
	re.Pattern="\[FLASH\]"
	Test=re.Test(strContent)
	if Test then
		strContent=re.replace(strContent, chr(1) & "FLASH" & chr(2))
		re.Pattern="\[\/FLASH\]"
		Test=re.Test(strContent)
		if Test then
			strContent=re.replace(strContent, chr(1) & "/FLASH" & chr(2))
				re.Pattern="\x01FLASH\x02(.[^\x01]*)\x01\/FLASH\x02"
				strContent=re.Replace(strContent,"<a href=""$1"" TARGET=_blank><IMG SRC=pic/swf.gif border=0 alt=´͸FLASH! height=16 width=16>[ȫ]</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=""$1""><PARAM NAME=quality VALUE=high><embed src=""$1"" quality=high pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' width=500 height=400>$1</embed></OBJECT>")
			re.Pattern="\x02"
			strContent=re.replace(strContent, "]")
		end if
		re.Pattern="\x01"
		strContent=re.replace(strContent, "[")
	end if
	re.Pattern="\[FLASH=*([0-9]*),*([0-9]*)\]"
	Test=re.Test(strContent)
	if Test then
		strContent=re.replace(strContent, chr(1) & "FLASH=$1,$2" & chr(2))
		re.Pattern="\[\/FLASH\]"
		Test=re.Test(strContent)
		if Test then
			strContent=re.replace(strContent, chr(1) & "/FLASH" & chr(2))
				re.Pattern="\x01FLASH=*([0-9]*),*([0-9]*)\x02(.[^\x01]*)\x01\/FLASH\x02"
				strContent=re.Replace(strContent,"<a href=""$3"" TARGET=_blank><IMG SRC=pic/swf.gif border=0 alt=´͸FLASH! height=16 width=16>[ȫ]</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=$1 height=$2><PARAM NAME=movie VALUE=""$3""><PARAM NAME=quality VALUE=high><embed src=""$3"" quality=high pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' width=$1 height=$2>$3</embed></OBJECT>")
			re.Pattern="\x02"
			strContent=re.replace(strContent, "]")
		end if
		re.Pattern="\x01"
		strContent=re.replace(strContent, "[")
	end if
	set re=Nothing
	UBB_FLASH=strContent
end function

function UBB_SOUND(strText)
	dim strContent
	dim re,Test
	
	Set re=new RegExp
	re.IgnoreCase =true
	re.Global=True
	strContent=strText
	re.Pattern="\[SOUND\]"
	Test=re.Test(strContent)
	if Test then
		strContent=re.replace(strContent, chr(1) & "SOUND" & chr(2))
		re.Pattern="\[\/SOUND\]"
		Test=re.Test(strContent)
		if Test then
			strContent=re.replace(strContent, chr(1) & "/SOUND" & chr(2))
				re.Pattern="\x01SOUND\x02(.[^\x01]*)\x01\/SOUND\x02"
				strContent=re.Replace(strContent,"<a href=""$1"" target=_blank><IMG SRC=pic/mid.gif border=0 alt=''></a><bgsound src=""$1"" loop=""-1"">")
		end if
		re.Pattern="\x01"
		strContent=re.replace(strContent, "[")
	end if
	set re=Nothing
	UBB_SOUND=strContent
end function

function UBB_URL(strText)
	dim strContent
	dim re,Test
	
	Set re=new RegExp
	re.IgnoreCase =true
	re.Global=True
	strContent=strText
	re.Pattern="\[URL\]"
	Test=re.Test(strContent)
	if Test then
		strContent=re.replace(strContent, chr(1) & "URL" & chr(2))
		re.Pattern="\[\/URL\]"
		Test=re.Test(strContent)
		if Test then
			strContent=re.replace(strContent, chr(1) & "/URL" & chr(2))
			re.Pattern="\x01URL\x02(.[^\x01]*)\x01\/URL\x02"
			strContent=re.Replace(strContent,"<A HREF=""$1"" TARGET=_blank>$1</A>")
			re.Pattern="\x02"
			strContent=re.replace(strContent, "]")
		end if
		re.Pattern="\x01"
		strContent=re.replace(strContent, "[")
	end if
	re.Pattern="\[URL=(.[^\[]*)\]"
	Test=re.Test(strContent)
	if Test then
		strContent=re.replace(strContent, chr(1) & "URL=$1" & chr(2))
		re.Pattern="\[\/URL\]"
		Test=re.Test(strContent)
		if Test then
			strContent=re.replace(strContent, chr(1) & "/URL" & chr(2))
			re.Pattern="\x01URL=(.[^\x01]*)\x02(.[^\x01]*)\x01\/URL\x02"
			strContent=re.Replace(strContent,"<A HREF=""$1"" TARGET=_blank>$2</A>")
			re.Pattern="\x02"
			strContent=re.replace(strContent, "]")
		end if
		re.Pattern="\x01"
		strContent=re.replace(strContent, "[")
	end if
	set re=Nothing
	UBB_URL=strContent
end function

function UBB_EMAIL(strText)
	dim strContent
	dim re,Test
	
	Set re=new RegExp
	re.IgnoreCase =true
	re.Global=True
	strContent=strText
	re.Pattern="\[EMAIL\]"
	Test=re.Test(strContent)
	if Test then
		strContent=re.replace(strContent, chr(1) & "EMAIL" & chr(2))
		re.Pattern="\[\/EMAIL\]"
		Test=re.Test(strContent)
		if Test then
			strContent=re.replace(strContent, chr(1) & "/EMAIL" & chr(2))
			re.Pattern="\x01EMAIL\x02(\S+\@.[^\x01]*)\x01\/EMAIL\x02"
			strContent=re.Replace(strContent,"<img align=absmiddle src=pic/email1.gif><A HREF=""mailto:$1"">$1</A>")
			re.Pattern="\x02"
			strContent=re.replace(strContent, "]")
		end if
		re.Pattern="\x01"
		strContent=re.replace(strContent, "[")
	end if
	re.Pattern="\[EMAIL=(\S+\@.[^\[]*)\]"
	Test=re.Test(strContent)
	if Test then
		strContent=re.replace(strContent, chr(1) & "EMAIL=$1" & chr(2))
		re.Pattern="\[\/EMAIL\]"
		Test=re.Test(strContent)
		if Test then
			strContent=re.replace(strContent, chr(1) & "/EMAIL" & chr(2))
			re.Pattern="\x01EMAIL=(\S+\@.[^\x01]*)\x02(.[^\x01]*)\x01\/EMAIL\x02"
			strContent=re.Replace(strContent,"<img align=absmiddle src=pic/email1.gif><A HREF=""mailto:$1"" TARGET=_blank>$2</A>")
			re.Pattern="\x02"
			strContent=re.replace(strContent, "]")
		end if
		re.Pattern="\x01"
		strContent=re.replace(strContent, "[")
	end if
	set re=Nothing
	UBB_EMAIL=strContent
end function

function UBB_HTML(strText)
	dim strContent
	dim re,Test
	
	Set re=new RegExp
	re.IgnoreCase =true
	re.Global=True
	strContent=strText
	re.Pattern="\[HTML\]"
	Test=re.Test(strContent)
	if Test then
		strContent=re.replace(strContent, chr(1) & "HTML" & chr(2))
		re.Pattern="\[\/HTML\]"
		Test=re.Test(strContent)
		if Test then
			strContent=re.replace(strContent, chr(1) & "/HTML" & chr(2))
			re.Pattern="\x01HTML\x02(.[^\x01]*)\x01\/HTML\x02"
			strContent=re.Replace(strContent,"<table width='100%' border='0' cellspacing='0' cellpadding='6' class='"&abgcolor&"'><td><b>Ϊ:</b><br>$1</td></table>")
			re.Pattern="\x02"
			strContent=re.replace(strContent, "]")
		end if
		re.Pattern="\x01"
		strContent=re.replace(strContent, "[")
	end if
	set re=Nothing
	UBB_HTML=strContent
end function

function UBB_CODE(strText)
	dim strContent
	dim re,Test
	
	Set re=new RegExp
	re.IgnoreCase =true
	re.Global=True
	strContent=strText
	re.Pattern="\[CODE\]"
	Test=re.Test(strContent)
	if Test then
		strContent=re.replace(strContent, chr(1) & "CODE" & chr(2))
		re.Pattern="\[\/CODE\]"
		Test=re.Test(strContent)
		if Test then
			strContent=re.replace(strContent, chr(1) & "/CODE" & chr(2))
			re.Pattern="\x01CODE\x02(.[^\x01]*)\x01\/CODE\x02"
			strContent=re.Replace(strContent,"<table width='100%' border='0' cellspacing='0' cellpadding='6' class='"&abgcolor&"'><td><b>Ϊ:</b><br>$1</td></table>")
			re.Pattern="\x02"
			strContent=re.replace(strContent, "]")
		end if
		re.Pattern="\x01"
		strContent=re.replace(strContent, "[")
	end if
	set re=Nothing
	UBB_CODE=strContent
end function

function UBB_COLOR(strText)
	dim strContent
	dim re,Test
	
	Set re=new RegExp
	re.IgnoreCase =true
	re.Global=True
	strContent=strText
	re.Pattern="\[COLOR=(.[^\[]*)\]"
	Test=re.Test(strContent)
	if Test then
		strContent=re.replace(strContent, chr(1) & "COLOR=$1" & chr(2))
		re.Pattern="\[\/COLOR\]"
		Test=re.Test(strContent)
		if Test then
			strContent=re.replace(strContent, chr(1) & "/COLOR" & chr(2))
			re.Pattern="\x01COLOR=(.[^\x01]*)\x02(.[^\x01]*)\x01\/COLOR\x02"
			strContent=re.Replace(strContent,"<font color=$1>$2</font>")
			re.Pattern="\x02"
			strContent=re.replace(strContent, "]")
		end if
		re.Pattern="\x01"
		strContent=re.replace(strContent, "[")
	end if
	set re=Nothing
	UBB_COLOR=strContent
end function

function UBB_FACE(strText)
	dim strContent
	dim re,Test
	
	Set re=new RegExp
	re.IgnoreCase =true
	re.Global=True
	strContent=strText
	re.Pattern="\[FACE=(.[^\[]*)\]"
	Test=re.Test(strContent)
	if Test then
		strContent=re.replace(strContent, chr(1) & "FACE=$1" & chr(2))
		re.Pattern="\[\/FACE\]"
		Test=re.Test(strContent)
		if Test then
			strContent=re.replace(strContent, chr(1) & "/FACE" & chr(2))
			re.Pattern="\x01FACE=(.[^\x01]*)\x02(.[^\x01]*)\x01\/FACE\x02"
			strContent=re.Replace(strContent,"<font face=$1>$2</font>")
			re.Pattern="\x02"
			strContent=re.replace(strContent, "]")
		end if
		re.Pattern="\x01"
		strContent=re.replace(strContent, "[")
	end if
	set re=Nothing
	UBB_FACE=strContent
end function

function UBB_ALIGN(strText)
	dim strContent
	dim re,Test
	
	Set re=new RegExp
	re.IgnoreCase =true
	re.Global=True
	strContent=strText
	re.Pattern="\[ALIGN=(center|left|right)\]"
	Test=re.Test(strContent)
	if Test then
		strContent=re.replace(strContent, chr(1) & "ALIGN=$1" & chr(2))
		re.Pattern="\[\/ALIGN\]"
		Test=re.Test(strContent)
		if Test then
			strContent=re.replace(strContent, chr(1) & "/ALIGN" & chr(2))
			re.Pattern="\x01ALIGN=(center|left|right)\x02(.[^\x01]*)\x01\/ALIGN\x02"
			strContent=re.Replace(strContent,"<div align=$1>$2</div>")
			re.Pattern="\x02"
			strContent=re.replace(strContent, "]")
		end if
		re.Pattern="\x01"
		strContent=re.replace(strContent, "[")
	end if
	set re=Nothing
	UBB_ALIGN=strContent
end function

function UBB_FLY(strText)
	dim strContent
	dim re,Test
	
	Set re=new RegExp
	re.IgnoreCase =true
	re.Global=True
	strContent=strText
	re.Pattern="\[FLY\]"
	Test=re.Test(strContent)
	if Test then
		strContent=re.replace(strContent, chr(1) & "FLY" & chr(2))
		re.Pattern="\[\/FLY\]"
		Test=re.Test(strContent)
		if Test then
			strContent=re.replace(strContent, chr(1) & "/FLY" & chr(2))
			re.Pattern="\x01FLY\x02(.[^\x01]*)\x01\/FLY\x02"
			strContent=re.Replace(strContent,"<marquee width=90% behavior=alternate scrollamount=3>$1</marquee>")
			re.Pattern="\x02"
			strContent=re.replace(strContent, "]")
		end if
		re.Pattern="\x01"
		strContent=re.replace(strContent, "[")
	end if
	set re=Nothing
	UBB_FLY=strContent
end function

function UBB_MOVE(strText)
	dim strContent
	dim re,Test
	
	Set re=new RegExp
	re.IgnoreCase =true
	re.Global=True
	strContent=strText
	re.Pattern="\[MOVE\]"
	Test=re.Test(strContent)
	if Test then
		strContent=re.replace(strContent, chr(1) & "MOVE" & chr(2))
		re.Pattern="\[\/MOVE\]"
		Test=re.Test(strContent)
		if Test then
			strContent=re.replace(strContent, chr(1) & "/MOVE" & chr(2))
			re.Pattern="\x01MOVE\x02(.[^\x01]*)\x01\/MOVE\x02"
			strContent=re.Replace(strContent,"<MARQUEE scrollamount=3>$1</marquee>")
			re.Pattern="\x02"
			strContent=re.replace(strContent, "]")
		end if
		re.Pattern="\x01"
		strContent=re.replace(strContent, "[")
	end if
	set re=Nothing
	UBB_MOVE=strContent
end function

function UBB_CENTER(strText)
	dim strContent
	dim re,Test
	
	Set re=new RegExp
	re.IgnoreCase =true
	re.Global=True
	strContent=strText
	re.Pattern="\[CENTER\]"
	Test=re.Test(strContent)
	if Test then
		strContent=re.replace(strContent, chr(1) & "CENTER" & chr(2))
		re.Pattern="\[\/CENTER\]"
		Test=re.Test(strContent)
		if Test then
			strContent=re.replace(strContent, chr(1) & "/CENTER" & chr(2))
			re.Pattern="\x01CENTER\x02(.[^\x01]*)\x01\/CENTER\x02"
			strContent=re.Replace(strContent,"<div align=center>$1</div>")
			re.Pattern="\x02"
			strContent=re.replace(strContent, "]")
		end if
		re.Pattern="\x01"
		strContent=re.replace(strContent, "[")
	end if
	set re=Nothing
	UBB_CENTER=strContent
end function

function UBB_SHADOW(strText)
	dim strContent
	dim re,Test
	
	Set re=new RegExp
	re.IgnoreCase =true
	re.Global=True
	strContent=strText
	re.Pattern="\[SHADOW=*([0-9]*),*(#*[a-z0-9]*),*([0-9]*)\]"
	Test=re.Test(strContent)
	if Test then
		strContent=re.replace(strContent, chr(1) & "SHADOW=$1,$2,$3" & chr(2))
		re.Pattern="\[\/SHADOW\]"
		Test=re.Test(strContent)
		if Test then
			strContent=re.replace(strContent, chr(1) & "/SHADOW" & chr(2))
			re.Pattern="\x01SHADOW=*([0-9]*),*(#*[a-z0-9]*),*([0-9]*)\x02(.[^\x01]*)\x01\/SHADOW\x02"
			strContent=re.Replace(strContent,"<table width=$1><tr><td style=""filter:shadow(color=$2, strength=$3)"">$4</td></tr></table>")
			re.Pattern="\x02"
			strContent=re.replace(strContent, "]")
		end if
		re.Pattern="\x01"
		strContent=re.replace(strContent, "[")
	end if
	set re=Nothing
	UBB_SHADOW=strContent
end function

function UBB_GLOW(strText)
	dim strContent
	dim re,Test
	
	Set re=new RegExp
	re.IgnoreCase =true
	re.Global=True
	strContent=strText
	re.Pattern="\[GLOW=*([0-9]*),*(#*[a-z0-9]*),*([0-9]*)\]"
	Test=re.Test(strContent)
	if Test then
		strContent=re.replace(strContent, chr(1) & "GLOW=$1,$2,$3" & chr(2))
		re.Pattern="\[\/GLOW\]"
		Test=re.Test(strContent)
		if Test then
			strContent=re.replace(strContent, chr(1) & "/GLOW" & chr(2))
			re.Pattern="\x01GLOW=*([0-9]*),*(#*[a-z0-9]*),*([0-9]*)\x02(.[^\x01]*)\x01\/GLOW\x02"
			strContent=re.Replace(strContent,"<table width=$1><tr><td style=""filter:glow(color=$2, strength=$3)"">$4</td></tr></table>")
			re.Pattern="\x02"
			strContent=re.replace(strContent, "]")
		end if
		re.Pattern="\x01"
		strContent=re.replace(strContent, "[")
	end if
	set re=Nothing
	UBB_GLOW=strContent
end function

function UBB_I(strText)
	dim strContent
	dim re,Test
	
	Set re=new RegExp
	re.IgnoreCase =true
	re.Global=True
	strContent=strText
	re.Pattern="\[I\]"
	Test=re.Test(strContent)
	if Test then
		strContent=re.replace(strContent, chr(1) & "I" & chr(2))
		re.Pattern="\[\/I\]"
		Test=re.Test(strContent)
		if Test then
			strContent=re.replace(strContent, chr(1) & "/I" & chr(2))
			re.Pattern="\x01I\x02(.[^\x01]*)\x01\/I\x02"
			strContent=re.Replace(strContent,"<i>$1</i>")
			re.Pattern="\x02"
			strContent=re.replace(strContent, "]")
		end if
		re.Pattern="\x01"
		strContent=re.replace(strContent, "[")
	end if
	set re=Nothing
	UBB_I=strContent
end function

function UBB_U(strText)
	dim strContent
	dim re,Test
	
	Set re=new RegExp
	re.IgnoreCase =true
	re.Global=True
	strContent=strText
	re.Pattern="\[U\]"
	Test=re.Test(strContent)
	if Test then
		strContent=re.replace(strContent, chr(1) & "U" & chr(2))
		re.Pattern="\[\/U\]"
		Test=re.Test(strContent)
		if Test then
			strContent=re.replace(strContent, chr(1) & "/U" & chr(2))
			re.Pattern="\x01U\x02(.[^\x01]*)\x01\/U\x02"
			strContent=re.Replace(strContent,"<u>$1</u>")
			re.Pattern="\x02"
			strContent=re.replace(strContent, "]")
		end if
		re.Pattern="\x01"
		strContent=re.replace(strContent, "[")
	end if
	set re=Nothing
	UBB_U=strContent
end function

function UBB_B(strText)
	dim strContent
	dim re,Test
	
	Set re=new RegExp
	re.IgnoreCase =true
	re.Global=True
	strContent=strText
	re.Pattern="\[B\]"
	Test=re.Test(strContent)
	if Test then
		strContent=re.replace(strContent, chr(1) & "B" & chr(2))
		re.Pattern="\[\/B\]"
		Test=re.Test(strContent)
		if Test then
			strContent=re.replace(strContent, chr(1) & "/B" & chr(2))
			re.Pattern="\x01B\x02(.[^\x01]*)\x01\/B\x02"
			strContent=re.Replace(strContent,"<b>$1</b>")
			re.Pattern="\x02"
			strContent=re.replace(strContent, "]")
		end if
		re.Pattern="\x01"
		strContent=re.replace(strContent, "[")
	end if
	set re=Nothing
	UBB_B=strContent
end function

function UBB_SIZE(strText)
	dim strContent
	dim re,Test
	
	Set re=new RegExp
	re.IgnoreCase =true
	re.Global=True
	strContent=strText
	re.Pattern="\[SIZE=([1-7])\]"
	Test=re.Test(strContent)
	if Test then
		strContent=re.replace(strContent, chr(1) & "SIZE=$1" & chr(2))
		re.Pattern="\[\/SIZE\]"
		Test=re.Test(strContent)
		if Test then
			strContent=re.replace(strContent, chr(1) & "/SIZE" & chr(2))
			re.Pattern="\x01SIZE=([1-7])\x02(.[^\x01]*)\x01\/SIZE\x02"
			strContent=re.Replace(strContent,"<font size=$1>$2</font>")
			re.Pattern="\x02"
			strContent=re.replace(strContent, "]")
		end if
		re.Pattern="\x01"
		strContent=re.replace(strContent, "[")
	end if
	set re=Nothing
	UBB_SIZE=strContent
end function

function UBB_QUOTE(strText)
	dim strContent
	dim re,Test
	
	Set re=new RegExp
	re.IgnoreCase =true
	re.Global=True
	strContent=strText
	re.Pattern="\[QUOTE\]"
	Test=re.Test(strContent)
	if Test then
		strContent=re.replace(strContent, chr(1) & "QUOTE" & chr(2))
		re.Pattern="\[\/QUOTE\]"
		Test=re.Test(strContent)
		if Test then
			strContent=re.replace(strContent, chr(1) & "/QUOTE" & chr(2))
			do
				re.Pattern="\x01QUOTE\x02(.[^\x01]*)\x01\/QUOTE\x02"
				strContent=re.Replace(strContent,"<table style=""width:100%"" cellpadding=5 cellspacing=1 class=tablegubb><TR><TD width=""100%""><b>ã</b><br>$1</td></tr><tr><td height=1 bgcolor=#CCCCCC></td></tr></table><br>")
				Test=re.Test(strContent)
			loop while(Test)
			re.Pattern="\x02"
			strContent=re.replace(strContent, "]")
		end if
		re.Pattern="\x01"
		strContent=re.replace(strContent, "[")
	end if
	set re=Nothing
	UBB_QUOTE=strContent
end function


'strContent
function UBBCode(strContent)
'HTML Code
	strContent = HTMLcode(strContent)

'UbbCode
dim re,ii,po
dim reContent,Test
Set re=new RegExp
re.IgnoreCase =true
re.Global=True

'űַ	
re.Pattern="(javascript)"
strContent=re.Replace(strContent,"&#106avascript")
re.Pattern="(jscript:)"
strContent=re.Replace(strContent,"&#106script:")
re.Pattern="(js:)"
strContent=re.Replace(strContent,"&#106s:")
re.Pattern="(vbscript:)"
strContent=re.Replace(strContent,"&#118bscript:")
re.Pattern="(vbs:)"
strContent=re.Replace(strContent,"&#118bs:")
re.Pattern="(on(mouse|exit|error|click|key))"
strContent=re.Replace(strContent,"&#111n$2")
re.Pattern="(value)"
strContent=re.Replace(strContent,"&#118alue")
re.Pattern="(about:)"
strContent=re.Replace(strContent,"about&#58")
re.Pattern="(file:)"
strContent=re.Replace(strContent,"file&#58")
re.Pattern="(document.cookie)"
strContent=re.Replace(strContent,"documents&#46cookie")

'IMG Code
strContent=UBB_IMG(strContent)

'FLASH Code
strContent=UBB_FLASH(strContent)

'URL Code
strContent=UBB_URL(strContent)

'EMAIL Code
strContent=UBB_EMAIL(strContent)

'COLOR Code
strContent=UBB_COLOR(strContent)

'FACE Code
strContent=UBB_FACE(strContent)

'ALIGN Code
strContent=UBB_ALIGN(strContent)

'FLY Code
strContent=UBB_FLY(strContent)

'MOVE Code
strContent=UBB_MOVE(strContent)

'CENTER Code
strContent=UBB_CENTER(strContent)

'SHADOW Code
strContent=UBB_SHADOW(strContent)

'GLOW Code
strContent=UBB_GLOW(strContent)

'I Code
strContent=UBB_I(strContent)

'U Code
strContent=UBB_U(strContent)

'B Code
strContent=UBB_B(strContent)

'QUOTE Code
strContent=UBB_QUOTE(strContent)

'SIZE Code
strContent=UBB_SIZE(strContent)

'MP Code
strContent=UBB_MP(strContent)

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

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

'Զʶ Email ַ
're.Pattern = "([^(=)])((\w)+[@]{1}((\w)+[.]){1,3}(\w)+)"
'strContent = re.Replace(strContent,"<img align=absmiddle src=pic/url.gif border=0><a target=_blank href=""mailto:$2"">$2</a>")

set re=Nothing
UBBCode=strContent
end function

function HTMLcode(HtmlStr)
if not isnull(HtmlStr) then
    HtmlStr = replace(HtmlStr, ">", "&gt;")
    HtmlStr = replace(HtmlStr, "<", "&lt;")
    HtmlStr = Replace(HtmlStr, CHR(32), "<I></I>&nbsp;")
    HtmlStr = Replace(HtmlStr, CHR(9), "&nbsp;")
    HtmlStr = Replace(HtmlStr, CHR(34), "&quot;")
    HtmlStr = Replace(HtmlStr, CHR(39), "&#39;")
    HtmlStr = Replace(HtmlStr, CHR(13), "")
    HtmlStr = Replace(HtmlStr, CHR(10) & CHR(10), "</P><P> ")
    HtmlStr = Replace(HtmlStr, CHR(10), "<BR> ")
    HTMLcode = HtmlStr
end if
end function
function address(sip)
	dim str1,str2,str3,str4
	dim num,sql
	dim country,city
	dim irs
	if isnumeric(left(sip,2)) then
	if sip="127.0.0.1" then sip="192.168.0.1"
	str1=left(sip,instr(sip,".")-1)
	sip=mid(sip,instr(sip,".")+1)
	str2=left(sip,instr(sip,".")-1)
	sip=mid(sip,instr(sip,".")+1)
	str3=left(sip,instr(sip,".")-1)
	str4=mid(sip,instr(sip,".")+1)
	if isNumeric(str1)=0 or isNumeric(str2)=0 or isNumeric(str3)=0 or isNumeric(str4)=0 then

	else
		num=cint(str1)*256*256*256+cint(str2)*256*256+cint(str3)*256+cint(str4)-1
		sql="select Top 1 country,city from address where ip1 <="&num&" and ip2 >="&num&""
		set irs=server.createobject("adodb.recordset")
		irs.open sql,conn,1,1
		if irs.eof and irs.bof then 
		country=""
		city=""
		else
		country=irs(0)
		city=irs(1)
		end if
		irs.close
		set irs=nothing
	end if
	address=country&city
	else
	address="δ֪"
	end if
end function
%>