var parentDIV=parent.document.getElementById("onlinetr");
var parentshow=parent.document.getElementById("showstr");
var Strings=new Array();

var nowbodarid=0;
var myid='';
var Count=0;
var pageCount=0;
var PageSize=0;
var page=0;
var action=0;
var onlinestr='';
Strings[0]='查看在线';
Strings[1]='关闭在线';

function reshow(boardid)
{      
	if(document.all&&boardid!=0)
	{
		var parentDIV1=parent.document.getElementById("showtd");  //版快的
	}
  
	if(parentDIV.style.display=='none')
	{
		if(document.all&&boardid!=0)
		{
			parentDIV1.style.display='block';
		}

		parentDIV.style.display='block';
		parentDIV.innerHTML='<span style="width:240px;margin-left:18px;border:1px solid black;background-color:lightyellow;color:black;padding:2px">正在读取在线信息，请稍侯……</span>'
		parentshow.innerHTML='<a href="Online.aspx?action=0&Boardid='+boardid+'" target="hiddenframe">'+Strings[1]+'</a>';
	}
	else
	{
		if(document.all&&boardid!=0)
		{
			parentDIV1.style.display='none';
		}
		parentDIV.style.display='none';	
		parentshow.innerHTML='<a href="Online.aspx?action=1&Boardid='+boardid+'" target="hiddenframe">'+Strings[0]+'</a>';
		parentDIV.innerHTML='';
	}
}

function showonlist(str){
var parentstr='<table width="100%" border="0" cellspacing="0" cellpadding="0">';
var tmpstr='';
var aa=6;
var Img='';
var tmpcount=new Array();
	tmpcount[0]=0;
	tmpcount[1]=0;
	var k=0;
	str=str.split("%#!&")
	for (i=0;i<str.length-1;i++)
	{
		k++;
		if (k==1)(parentstr+='<tr>')
		str[i]=str[i].split("^&%&");
        
		
		switch(str[i][5])
        {
        case '1':
			Img='Online0.gif';  //管理员
		    break;
		case '2':
			Img='Online1.gif'; //版主
			break;
		case '3':
			Img='Online2.gif'; //认正
		    break;
		case '4':
			Img='Online3.gif'; //一般
		    break;
		default :
			Img='Online4.gif';//客人或隐身会员
        }
		
        
        if (str[i][0]==myid)
        {
			parentstr+='<td width="14%" colspan="+k+">&nbsp;<img src="Images/OnlineImg/'+Img+'" width="12" height="11">&nbsp;&nbsp;<a  title="您自己" ><font color="#0000ff">'+str[i][1]+'</font></a></td>';
        }else{
			parentstr+='<td width="14%" colspan="+k+">&nbsp;<a title="来访时间:'+str[i][2]+'\n最后活动:'+str[i][3]+'\n现在位置:'+str[i][4]+'" ><img src="Images/OnlineImg/'+Img+'" width="12" height="11">&nbsp;&nbsp;<font color="#000000">'+str[i][1]+'</font></a></td>';
		}
		
		if(k==6)
		{
			k=0
			parentstr+='</tr>';
		}
	}
	if (k!=0)
	{
		for(i=0;i<6-k;i++)
		{
			parentstr+='<td width="14%" >&nbsp;&nbsp;</td>';
		}
		parentstr+='</tr>';
	}
	parentstr+='</table>';


	if (Count>PageSize)	
	{
		parentstr+='<table width="100%" border="0" cellspacing="0" cellpadding="0" >';
		parentstr+='<tr><td><hr size=1 color=#6595D6 >';
		parentstr+='<tr><td>&nbsp;&nbsp;共有在线记录 '+Count+' 条,每页显示 '+PageSize+' 条,共 '+pageCount+' 页,当前为第 '+page+' 页。转到：';
		if (page!=1)
		{
			parentstr+='<a href="Online.aspx?action=3&Boardid='+nowbodarid+'&page=1" target="hiddenframe" >[首页]</a> ';
		}
		if (page>2)
		{
			parentstr+='<a href="Online.aspx?action=3&Boardid='+nowbodarid+'&page='+(page-1)+'" target="hiddenframe" >[上一页]</a> ';
		}
		if (page<(pageCount-1))
		{
			parentstr+='<a href="Online.aspx?action=3&Boardid='+nowbodarid+'&page='+(page+1)+'" target="hiddenframe" >[下一页]</a> '
		}
		if(page!=pageCount)
		{
			parentstr+='<a href="Online.aspx?action=3&Boardid='+nowbodarid+'&page='+pageCount+'" target="hiddenframe" >[尾页]</a> ';
		}
		parentstr+='</td></tr>';
		parentstr+='</table>';
	}
	parentDIV.innerHTML='';
	parentDIV.innerHTML=parentstr;


}


