function ybbcode(temp) {

if (getCookie('ybbcode')!='0'){ //是否打开YBB代码
temp = temp.replace(/&amp;/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>");
temp=temp.replace(/(\[MP=([0-9]*)\,([0-9]*)\,([A-Z]*)\])([^]]*)(\[\/MP\])/ig,"<object classid=clsid:05589FA1-C356-11CE-BF01-00AA0055595A width=$2 height=$3><param name=Filename value=$5><param name=AutoStart 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 = 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 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;
}

//menu
function ShowPost(count,id,title,aspurl)
{
document.write("<tr><td></td></tr><tr><td height=36 background=/img/leftmenu"+count+".jpg align=center><img src=/images/menuico.gif width=18 height=9><b><a href="+aspurl+""+id+">"+title+"</a></b></td></tr>");
document.write("<tr><td><hr size=1 color=#ff9c00></td></tr>")
}

function ShowPosten(count,id,title)
{
document.write("<tr><td></td></tr><tr><td height=32 align=right><b><a href=/en/profile.asp?id="+id+"><span class=p9>&nbsp;"+title+"&nbsp;</span></a></b>&nbsp;</td></tr>");
document.write("<tr><td background=/images/line3.gif><img width=1 height=1></td></tr>")
}

function ShowProduct(count,id,title)
{
document.write("<tr><td></td></tr><tr><td height=73 background=/img/leftmenu"+count+".jpg>&nbsp;&nbsp;<img src=/images/menuico.gif width=18 height=9><b><a href=?type_id="+id+"><span class=p9>"+title+"</span></a></b></td></tr>");
document.write("<tr><td><hr size=1></td></tr>")
}

//detail
//<script>Showdetail('best','<%=myrs("newsimg")%>','<%=myrs("imglink")%>','<%=myrs("content")%>','<%=formatdatetime(myrs("newsdate"),1)%>');</script>
function Showdetail(it,newsimg,imglink,content,newsdate)
{
document.write("<table width=100% border=0 cellspacing=0 cellpadding=0>");
if (newsimg>0){
document.write("<tr><td><hr size=1 color=#CCCCCC></td></tr><tr><td align=center valign=top>");
if (imglink!=""){
document.write("<img src=/news/news_images/"+newsimg+" border=0 alt=新闻图片>");
}else{
document.write("<a href="+imglink+"><img src=/news/news_images/"+newsimg+" border=0 alt=新闻图片></a>");
}
document.write("</td></tr>");
}
document.write("<tr><td align=right valign=top>");

document.write("<table width=98% border=0 cellspacing=0 cellpadding=0 align=center class=p9><tr><td><hr size=1 color=#CCCCCC></td></tr><tr><td class=ptzi>");
document.write("<span id="+it+">"+content+"</span>");
document.write("</td></tr><tr><td height=10></td></tr><tr><td align=right><hr size=1 color=#CCCCCC></td></tr></table>");

document.write("发布日期："+newsdate+"&nbsp;&nbsp;|&nbsp;&nbsp;功能：<SELECT ID=CCZ onchange="+it+".style.fontSize=this.options[this.selectedIndex].value;"+it+".style.lineHeight=this.options[this.selectedIndex].value;><OPTION value=0pt>改变字号大小</OPTION><OPTION value=9pt>9pt</OPTION><OPTION value=10pt>10pt</OPTION><OPTION value=11pt>11pt</OPTION><OPTION value=12pt>12pt</OPTION><OPTION value=14pt>14pt</OPTION><OPTION value=16pt>16pt</OPTION><OPTION value=18pt>18pt</OPTION><OPTION value=20pt>20pt</OPTION><OPTION value=22pt>22pt</OPTION><OPTION value=24pt>24pt</OPTION><OPTION value=28pt>28pt</OPTION><OPTION value=32pt>32pt</OPTION></SELECT>&nbsp;&nbsp;&nbsp;");
document.write("</td></tr></table>");
}

function loadhotnews(newsid){
document.frames["hiddenframe"].location.replace("hotloading.asp?class="+newsid+"");
}
function loadnews1(newsid){
document.frames["hiddenframe1"].location.replace("inloading1.asp?class="+newsid+"");
}
function loadnews2(newsid){
document.frames["hiddenframe2"].location.replace("inloading2.asp?class="+newsid+"");
}
function loadingnewslist(newsid){
document.frames["hiddenframe"].location.replace("loadingnewslist.asp?class="+newsid+"");
}

function modelesswin(url){
  if (document.all&&window.print)
    eval('window.showModelessDialog(url,"","dialogWidth:50em; dialogHeight:40em;help:0;resizable:0;status:0")') 
  else
    eval('window.open(url,"","resizable=1,scrollbars=1")')
  }
//gsm
//检测到弹出窗口阻止程序是用该方式打开
function gsmwin(url){
  if (document.all&&window.print)
    eval('window.showModelessDialog(url,"","dialogWidth:18em; dialogHeight:33em;help:0;resizable:0;status:0;scrollbars:0;top:0;left:0")') 
  else
    eval('window.open(url,"","resizable=1,scrollbars=1")')
  }
//正常方式打开
function OnClick_StartWebMessenger()
{
window.open("/gsm/logingsm.asp","GSMwindow", "height=500,width=100,menubar=no,titlebar=no,resizable=yes,scrollbars=no,status=no,toolbar=no");
}
//gsm end
function viewPage(ipage){
        document.frm_page.me_page.value=ipage;
        document.frm_page.submit();        
}

function ValidateTextboxAdd(box, button)
{
 var buttonCtrl = document.getElementById( button );
 if ( buttonCtrl != null )
 {
 if (box.value == "" || box.value == box.helptext)
 {
 buttonCtrl.disabled = true;
 }
 else
 {
 buttonCtrl.disabled = false;
 }
 }
}

document.write("<iframe height=0 width=0 name=hiddenframe></iframe>")
document.write("<iframe height=0 width=0 name=hiddenframe1></iframe>")
document.write("<iframe height=0 width=0 name=hiddenframe2></iframe>")