var bbsStyle=9;
var OldStyle=1;
var OldIndex=0;
var indent;
function T(pg,id,n,s,r,d,c,m,u,i,l,p){
	if(( p & 64) == 64 )
	{
		if((OldStyle & 64 ) == 64 )
			return;
		if(( OldStyle & 32) != 32 && n > 0)
			return;
	}
	if( ( bbsStyle & 1 ) == 1)
	{
	if(n==0){
		document.write('&nbsp;&nbsp;<img src=\'image/r.gif\' width=18 height=24>');
	} 
	else{
		indent = 30+n*20;
		document.write('<img src=\'/wdot.gif\' height=1 width='+indent+'><img src=\'image/b.gif\' width=5 height=16>'); 
	}
	}
	document.write(' <A HREF=\'viewtopic.asp?id='+id+'&pg='+pg+'\'>'+s+'</a>');
	if (id > OldIndex) document.write(" <img src=\"image/new.gif\" width=20 height=5>"); 
	if ((p & 32) == 32) document.write(' <投票> ');
	if (u) document.write(' <链接> ');
	if (i) document.write(' <图像> ');
	if(u==false && i==false && l==0) document.write(' <无内容> ');
	document.write(' - <a href=\'userinfo.asp?id='+r+'\'><font color=#006699>['+r+']</font></a> '+d+' ( '+l+' 字节, 点击:'+c);
	if(m>0){
	if(n==0) document.write(', 分数:<font color=\'#FF3300\'>'+m+'</font>');
	else document.write(', 分数:<font color=\'#009900\'>'+m+'</font>');
	}
	if(p & 1 == 1) document.write(' <img src=\"image/rf.gif\" width=10 height=10>');
	document.write(' )<br>');
}
function readCookie(cookieName) {
	cookie_array = document.cookie.split ("; ")
	for (x=0; x < cookie_array.length; x++) {
		cookieParts_array = cookie_array[x].split("=")
		if (cookieParts_array[0] == cookieName) {
			return cookieParts_array[1];
		}
	}
	return null;
}

function ReadOldIndex() {
	sOldIndex = readCookie(IndexName);
	if ( sOldIndex )
		OldIndex = parseInt(sOldIndex);
	else
		OldIndex = 0;
}

function WriteIndex(NewIndex){
	if ( NewIndex > OldIndex )
	{
	expiresday = new Date();
	expiresday.setYear(2010);
	expiresday.setMonth(11);
	expiresday.setDate(31);
	document.cookie = IndexName + "=" + NewIndex + ";expires=" + expiresday.toGMTString();
	}
}

function ReadOldStyle() {
	sOldStyle = readCookie("bbsStyle");
	if ( sOldStyle )
		OldStyle = parseInt(sOldStyle);
	else
		OldStyle = 9;
}

function WriteStyle(NewStyle){
	expiresday = new Date();
	expiresday.setYear(2010);
	expiresday.setMonth(11);
	expiresday.setDate(31);
	document.cookie = "bbsStyle=" + NewStyle + ";expires=" + expiresday.toGMTString();
}

function IsNew(index)
{
	if ( index > OldIndex )
	   document.write("<img src=\"image/new.gif\" width=20 height=5>");
}
ReadOldStyle();
