function ybbcode(temp) {

if (getCookie('ybbcode')!='0'){ //是否打开YBB代码
temp = temp.replace(/&/ig,"&");
temp=temp.replace(/\[(\/|)b\]/ig,"<$1b>");
temp=temp.replace(/\[(\/|)i\]/ig,"<$1i>");
temp=temp.replace(/\[(\/|)u\]/ig,"<$1u>");
temp=temp.replace(/\[(\/|)strike\]/ig,"<$1strike>");
temp=temp.replace(/\[(\/|)center\]/ig,"<$1center>");
temp=temp.replace(/\[(\/|)marquee\]/ig,"<$1marquee>");
temp=temp.replace(/\[QUOTE\]/ig,"<BLOCKQUOTE><strong>引用</strong>：<HR Size=1>");
temp=temp.replace(/\[\/QUOTE\]/ig,"<HR SIZE=1><\/BLOCKQUOTE>");
temp=temp.replace(/(\[font=)([^.:;`'"=\]]*)(\])/ig,"<FONT face='$2'>");
temp=temp.replace(/\[\/font\]/ig,"<\/FONT>");
temp=temp.replace(/(\[COLOR=)([^.:;`'"=\]]*)(\])/ig,"<FONT COLOR='$2'>");
temp=temp.replace(/\[\/COLOR\]/ig,"<\/FONT>");
temp=temp.replace(/(\[size=)([0-9]*)(\])/ig,"<FONT size='$2'>");
temp=temp.replace(/\[\/size\]/ig,"<\/FONT>");
temp=temp.replace(/(\[URL\])([^]]*)(\[\/URL\])/ig,"<A TARGET=_blank HREF='$2'>$2</A>");
temp=temp.replace(/(\[URL=)([^]]*)(\])/ig,"<A TARGET=_blank HREF='$2'>");
temp=temp.replace(/\[\/URL\]/ig,"<\/A>");
temp=temp.replace(/(\[EMAIL\])(\S+\@[^]]*)(\[\/EMAIL\])/ig,"<a href=mailto:$2>$2</a>");
temp=temp.replace(/<A HREF=\"([^"]*)\">/ig,"<A TARGET=_blank HREF=\"$1\">");
temp=temp.replace(/<IMG src=\"([^"]*)\">/ig,"<IMG src=\"$1\" border=0 onmousewheel='return yuzi_img(event,this)' onload='javascript:if(this.width>body.clientHeight)this.width=body.clientHeight'>");
}

if (getCookie('YbbMedia')!='0'){  //是否打开[FLASH][RM][MP]代码
temp=temp.replace(/(\[FLASH=([0-9]*)\,([0-9]*)\])([^]]*)(\[\/FLASH\])/ig,"<object classid=clsid:05589FA1-C356-11CE-BF01-00AA0055595A width=$2 height=$3><param name=Filename value=$4><param name=AutoStart value=0></object><br>文件地址：<A TARGET=_blank HREF='$4'>$4</A>");
temp=temp.replace(/(\[MP=([0-9]*)\,([0-9]*)\])([^]]*)(\[\/MP\])/ig,"<object classid=clsid:05589FA1-C356-11CE-BF01-00AA0055595A width=$2 height=$3><param name=Filename value=$4></object>");
temp=temp.replace(/(\[RM=([0-9]*)\,([0-9]*)\,([A-Z]*)\])([^]]*)(\[\/RM\])/ig,"<OBJECT classid=clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA width=$2 height=$3><PARAM NAME=SRC VALUE=$5><PARAM NAME=CONSOLE VALUE=Clip1><PARAM NAME=CONTROLS VALUE=imagewindow><PARAM NAME=AUTOSTART VALUE=$4><\/OBJECT><br><OBJECT classid=CLSID:CFCDAA03-8BE4-11CF-B84B-0020AFBBCCFA height=60 width=$2><PARAM NAME=CONTROLS VALUE=ControlPanel,StatusBar><PARAM NAME=CONSOLE VALUE=Clip1><\/OBJECT>");
}

if (getCookie('ybbimg')!='0')
{  //是否打开[IMG]代码
temp.Indexof
temp = temp.replace("login.asp?menu=out","askjhdwohalfhalkfh");
temp = temp.replace(/(\[IMG\])([^];]*)(\[\/IMG\])/ig,"<img border=0 src=\"$2\" 			onmousewheel='return yuzi_img(event,this)' onload='javascript:if(this.width>body.clientHeight)this.width=body.clientHeight'>");
}

if (getCookie('ybbbrow')!='0'){  //是否打开表情代码
temp = temp.replace(/(\[em)([0-9]*)(\])/ig,"<IMG border=0 SRC=images/Emotions/$2.gif>");
}

return (temp);
}


function level(experience,membercode,username,moderated,mana,Level)
{
var clevel;
if (membercode=='0'){levelname="尚未激活";levelimage="<img src=images/level/1.gif>";clevel=-1;}
else
if (membercode=='4'){levelname="<FONT color=#6600ff>管 </FONT><FONT color=#cc00ff>理 </FONT><FONT color=#ff00ff> 员</FONT>";levelimage="<img src=images/level/Top.gif>";clevel=-1;}
else
if (membercode=='5'){levelname="<FONT color=#6600ff>社</FONT><FONT color=#cc00ff>区</FONT><FONT color=#ff00ff>站</FONT><FONT color=#ff0099>长</FONT>";levelimage="<img src=images/level/Top.gif>";clevel=-1;}
else
if(moderated.indexOf("|"+username+"|") != -1 && moderated!=""){levelname="<FONT color=#6600ff>本</FONT><FONT color=#cc00ff>区</FONT><FONT color=#ff00ff>版</FONT><FONT color=#ff0099>主</FONT>";levelimage="<img src=images/level/Top.gif>";clevel=-1;}
else
if (membercode=='2'){levelname="<FONT color=#6600ff>贵</FONT><FONT color=#cc00ff>宾</FONT><FONT color=#ff00ff>战</FONT><FONT color=#ff0099>魂</FONT>";levelimage="<img src=images/level/Top.gif>";
clevel=-1;}
else
if (experience<= 50){levelname="第 20 级";levelimage="<img src=images/level/1.gif>";clevel=10;
Level=20;}
else
if (experience<= 150){levelname="第 19 级";levelimage="<img src=images/level/2.gif>";clevel=9;
Level=19;}
else
if (experience<= 500){levelname="<FONT color=#3370CC>第 18 级</FONT>";levelimage="<img src=images/level/3.gif>";clevel=9;Level=18;}
else
if (experience<= 1000){levelname="<FONT color=#2B6FD5>第 17 级</FONT>";levelimage="<img src=images/level/4.gif>";clevel=8;Level=17;}
else
if (experience<= 2000){levelname="<FONT color=#2B6FD5>第 16 级</FONT>";levelimage="<img src=images/level/5.gif>";clevel=8;Level=16;}
else
if (experience<= 4000){levelname="<FONT color=#1A6BE6>第 15 级</FONT>";levelimage="<img src=images/level/6.gif>";clevel=7;Level=15;}
else
if (experience<= 8000){levelname="<FONT color=#0066FF>第 14 级</FONT>";levelimage="<img src=images/level/7.gif>";clevel=7;Level=14;}
else
if (experience<= 12000){levelname="<FONT color=#996666>第 13 级</FONT>";levelimage="<img src=images/level/8.gif>";clevel=6;Level=13;}
else
if (experience<= 20000){levelname="<FONT color=#A25E5E>第 12 级</FONT>";levelimage="<img src=images/level/9.gif>";clevel=6;Level=12;}
else
if (experience<= 30000){levelname="<FONT color=#AA5555>第 11 级</FONT>";levelimage="<img src=images/level/10.gif>";clevel=5;Level="11";}
else
if (experience<= 50000){levelname="<FONT color=#B34D4D>第 10 级</FONT>";levelimage="<img src=images/level/11.gif>";clevel=5;Level=10;}
else
if (experience<= 70000){levelname="<FONT color=#BB4444>第 9 级</FONT>";levelimage="<img src=images/level/12.gif>";clevel=4;Level=9;}
else
if (experience<= 100000){levelname="<FONT color=#C43C3C>第 8 级</FONT>";levelimage="<img src=images/level/13.gif>";clevel=4;Level=8;}
else
if (experience> 100000)
	{
		levelname="<FONT color=#CC3333>第 7 级</FONT>";levelimage="<img src=images/level/14.gif>";
		clevel=3;
		if (mana >  5){levelname="<FONT color=#D52B2B>第 6 级</FONT>";levelimage="<img src=images/level/14.gif>";clevel=3;}
		if (mana > 25){levelname="<FONT color=#DD2222>第 5 级</FONT>";levelimage="<img src=images/level/14.gif>";clevel=2;}
		if (mana > 40){levelname="<FONT color=#E61A1A>第 4 级</FONT>";levelimage="<img src=images/level/14.gif>";clevel=2;}
		if (mana > 60){levelname="<FONT color=#EE1111>第 3 级</FONT>";levelimage="<img src=images/level/14.gif>";clevel=1;}
		if (mana > 85){levelname="<FONT color=#F70909>第 2 级</FONT>";levelimage="<img src=images/level/14.gif>";clevel=1;}
		if (mana > 100){levelname="<FONT color=#FF0000>第 1 级</FONT>";levelimage="<img src=images/level/14.gif>";clevel=0;}
	}
return(clevel);
}

//放大缩小图片
function yuzi_img(e, o)
{
var zoom = parseInt(o.style.zoom, 10) || 100;
zoom += event.wheelDelta / 12;
if (zoom > 0) o.style.zoom = zoom + '%';
return false;
}

