// JavaScript Document
function DoTitle(addTitle) { 
var revisedTitle; 
var currentTitle = document.frmAnnounce.subject.value; 
revisedTitle = currentTitle+addTitle; 
document.frmAnnounce.subject.value=revisedTitle; 
document.frmAnnounce.subject.focus(); 
return; }

function ctlent(eventobject){if(event.ctrlKey && window.event.keyCode==13){this.document.frmAnnounce.submit();}}

function getCookie (CookieName) { 
var CookieString = document.cookie; 
var CookieSet = CookieString.split (';'); 
var SetSize = CookieSet.length; 
var CookiePieces 
var ReturnValue = ""; 
var x = 0; 
for (x = 0; ((x < SetSize) && (ReturnValue == "")); x++) { 
CookiePieces = CookieSet[x].split ('='); 

if (CookiePieces[0].substring (0,1) == ' ') { 
CookiePieces[0] = CookiePieces[0].substring (1, CookiePieces[0].length); 
}

if (CookiePieces[0] == CookieName) {
ReturnValue = CookiePieces[1];
var value =ReturnValue
}}
return value;
}

function show_newpost(id,username,site_name,notp,post,topic,content,picture)
{
//document.write("<br>");
var userdengluinfo,undefined;
if(getCookie('ltusername')==undefined)
userdengluinfo="您目前是匿名发表 <a href=login.asp?action=in>登录</a>| <a href=../club.asp>注册</a><input type=hidden name=username>";
else
userdengluinfo=""+username+"<input type=radio name=username value="+getCookie('ltusername')+" checked>匿名发表<input type=radio name=username>";


var html="disabled",ubb="disabled",membercode=getCookie('membercode');
if(post==2)
{document.write("<TABLE cellSpacing=1 cellPadding=3 width=60% align=center bgColor=#ffffff border=1  bordercolor=#848BD0  bordercolordark=#ffffff><form name=form method=post action=do_index.asp?action=2 onSubmit='return mycheck()'><TBODY><TR bgColor=#ffffff> <TD vAlign=top nowap width=20%>标　题:<input type=hidden name=bbsid  class=input value="+id+"></TD><TD width=90%><input name=topic type=text id=topic size=50 maxlength=255>");
switch(getCookie('membercode')){case "5":html="",ubb="";document.write("<select name=ztlanguage><option value=0 selected>无语法</option><option value=2>UBB</option><option value=7>红色</option><option value=8>绿色</option><option value=9>蓝色</option></select>");break;case "2":ubb="";document.write(" <select name=ztlanguage><option value=0 selected>无语法</option><option value=7>红色</option><option value=8>绿色</option><option value=9>蓝色</option></select>");break;case "1":ubb="";document.write(" <select name=ztlanguage><option value=0 selected>无语法</option>");break;default:document.write(" <select name=ztlanguage><option value=0 selected>无语法</option>");break;}
}
if(post==3)
{switch(getCookie('membercode')){case "5":html="",ubb="";break;case "2":ubb="";break;case "1":ubb="";break;}
document.write("<TABLE cellSpacing=1 cellPadding=3 width=97% align=center bgColor=#ffffff border=0 class=a2><form name=form method=post action=do_index.asp?action=3 onSubmit='return mycheck()'><TBODY><input type=hidden name=postid value="+id+"><a name=sub></a> <TR bgColor=#ffffff> <TD vAlign=top nowap>标　题:</TD><TD width=90%><input name=topic type=text id=topic size=60 maxlength=255 value="+topic+">");}

if(post==4)
{document.write("<TABLE cellSpacing=1 cellPadding=3 width=97% align=center bgColor=#ffffff border=0 class=a2><form name=form method=post action=do_index.asp?action=6 onSubmit='return mycheck()'><TBODY><input type=hidden name=postid value="+id+"><a name=sub></a> <TR bgColor=#ffffff> <TD vAlign=top nowap>标　题:</TD><TD width=90%><input name=topic type=text id=topic size=60 maxlength=255 value="+topic+">");
switch(getCookie('membercode')){case "5":html="",ubb="";document.write("<select name=ztlanguage><option value=0 selected>无语法</option><option value=2>UBB</option><option value=7>红色</option><option value=8>绿色</option><option value=9>蓝色</option></select>");break;case "2":ubb="";document.write(" <select name=ztlanguage><option value=0 selected>无语法</option><option value=7>红色</option><option value=8>绿色</option><option value=9>蓝色</option></select>");break;case "1":ubb="";document.write(" <select name=ztlanguage><option value=0 selected>无语法</option>");break;default:document.write(" <select name=ztlanguage><option value=0 selected>无语法</option>");break;}
}
document.write("</TD></TR><TR bgColor=#ffffff> <TD vAlign=top width=10% nowap>内　容:<br><input name=ztlanguage type=radio value=0 checked>无语法<br><input type=radio name=ztlanguage value=2 "+ubb+">UBB</TD><TD width=90%><textarea name=content cols=60 rows=8 id=content>"+htmluncode(content)+"</textarea> </TD></TR><TR bgColor=#ffffff> <TD vAlign=top width=10% nowap>图片链接:</TD><TD width=90%> <input name=picture type=text id=picture value=http://"+picture+" size=60></TD></TR><TR bgColor=#ffffff> <TD width=10% nowap colspan=2>用户名:");
document.write(""+userdengluinfo+"&nbsp;&nbsp;&nbsp;&nbsp; </TD></TR><TR bgColor=#ffffff> <TD vAlign=top width=7%>&nbsp;</TD><TD width=93%><INPUT name=Submit type=submit id=Submit value=发表帖子> &nbsp;&nbsp; </TD></TR></TBODY></form></TABLE><br>");
}

function htmluncode(temp)
{var temp;
temp = temp.replace(/<br>/ig,"\n");
return (temp);
}

function htmlend(ver,Copyright)
{
document.write("<table width=100% border=0 cellpadding=0 cellspacing=0><tr><td bgcolor=#ffffff><br><br><br><div align=center>Powered By <a href=http://www.inbook.net>花雨网</a> Version "+ver+" "+Copyright+"</div><script src=\"http:\/\/s17.cnzz.com\/stat.php?id=1216546&web_id=1216546\" language=\"JavaScript\" charset=\"gb2312\"><\/script><script src=\"http:\/\/count27.51yes.com\/click.aspx?id=276902771&logo=1\" language=\"JavaScript\" charset=\"gb2312\"><\/script></td>  </tr></table></body></html>");
}

function showbbskuang(bbsid,bbsname,site_name,moderated,intro)
{
//var str=w,w="";
//for (i=0;i<10;i++)
//{w=w+str.charAt(i)
//}
var csuper,csuper1;
if(getCookie('membercode')==5)
{csuper="",csuper1="text",csuper2="hidden";}
else
{csuper="disabled",csuper1="hidden",csuper2="text";}
document.write("<form name=form method=post width=100% action=do_index.asp?action=1>  <TABLE cellSpacing=1 cellPadding=3 width=100% align=center bgColor=#ffffff border=0><TBODY><TR bgColor=#ffffff><TD vAlign=top width=10% nowap>&nbsp;</TD><TD width=90%><a name=fayan></a></TD></TR><TR bgColor=#ffffff><TD vAlign=top nowap>标　题:</TD><TD width=90%><input name=bbsid type=hidden size=60 maxlength=20 value="+bbsid+"><input name=bbsname type="+csuper1+" size=60 maxlength=20 value="+bbsname+"><input type="+csuper2+" size=60 maxlength=20 value="+bbsname+" disabled><font color=#FF0000>*必须填</font></TD></TR><TR bgColor=#ffffff><TD vAlign=top width=10% nowap>内　容:</TD><TD width=90%><textarea name=intro cols=80 rows=8>"+intro+"</textarea> </TD></TR><TR bgColor=#ffffff><TD vAlign=top width=10% nowap>论坛版主:</TD><TD width=90%> <input name=moderated type=text size=60 maxlength=10 "+csuper+" value="+moderated+"><a title=版主&#13;可以对论坛进行管理>(什么是版主？) </a></TD></TR><TR><TD width=10% nowap>用户名:</TD><TD width=90%>");
document.write("&nbsp;&nbsp;(<font color=#0000FF>"+site_name+"协议</font>) </TD></TR><TR bgColor=#ffffff> <TD vAlign=top width=7%>&nbsp;</TD><TD width=93%><INPUT name=Submit type=submit id=Submit value=新建版块> &nbsp;&nbsp; </TD></TR><TR align=left> <TD vAlign=top colSpan=2></TD></TR></TBODY></TABLE></form>");
}

function mycheck()
{if(document.form.topic.value.length<1||document.form.content.value.length<1)
{alert("帖子的标题或内容包含太少的文字，请修改后再发表");
return false;}}

function g(url){
var url;
location.href=url;}
function h(obj,url){
obj.style.behavior='url(#default#homepage)';
obj.setHomePage(url);}
function done()
{if(confirm('确定操作吗?')){this.document.selform.submit();return true;}return false;}

function search_f()
{if(document.form1.word.value.length<2)
{alert("搜索关键词不能小于2个字符");
return false;}
}

function ubbcode(temp) {
var temp;
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'>");
temp=temp.replace(/(\[FLASH=([0-9]*)\,([0-9]*)\])([^]]*)(\[\/FLASH\])/ig,"<embed width=$2 height=$3 src=$4 wmode=transparent>");
temp=temp.replace(/(\[MP=([0-9]*)\,([0-9]*)\,([A-Z]*)\])([^]]*)(\[\/MP\])/ig,"<embed width=$2 height=$3 autostart=$4 src=$5 ShowStatusBar=1>");
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>");
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'>");
temp = temp.replace(/(\[em)([0-9]*)(\])/ig,"<IMG border=0 SRC=images/Emotions/$2.gif>");
return (temp);
}

function htmlcode(temp)
{var temp;
temp = temp.replace(/&#59;/ig,";");
temp = temp.replace(/&lt;/ig,"<");
temp = temp.replace(/&gt;/ig,">");
temp = temp.replace(/&#92;/ig,"\\");
temp = temp.replace(/&#45;&#45;/ig,"--");
temp = temp.replace(/&#39;/ig,"\'");
temp = temp.replace(/&quot;/ig,"\"");
return (temp);
}

function URLDecode(EncodeString) 
{
var lsRegExp = /\+/g;
return unescape(String(EncodeString).replace(lsRegExp, " ")); 
}




function colortopic(temp,i)
{var i,temp
if(i==7)
{temp ="<font color=red>"+temp.replace(/<(.*)>(.*)<\/\1>/ig,"$2")+"</font>";}
else if(i==8)
{temp ="<font color=green>"+temp.replace(/<(.*)>(.*)<\/\1>/ig,"$2")+"</font>";}
else if(i==9)
{temp ="<font color=blue>"+temp.replace(/<(.*)>(.*)<\/\1>/ig,"$2")+"</font>";}
return (temp);
}

//贴子选择
function selectall(ok)
{var a = document.managelist("postid");
for(var i=0;i<a.length;i++)
{a[i].checked = ok;}}
function selectno(no)
{var a = document.managelist("postid");
for(var i=0; i<a.length; i++){
a[i].checked = no;}}
function selectfan()
{var a = document.managelist("postid");
for(var i=0; i<a.length; i++)
{if(a[i].checked == false)
{a[i].checked =true;}
else
{a[i].checked = false;}}}
