<%@ page contentType="text/html;charset=utf-8"
import = "java.io.*"
import = "cn.js.fan.util.*"
import = "com.redmoon.chat.*"
import = "com.redmoon.forum.Privilege"
%>
<%@ page import="com.redmoon.forum.person.*"%>
<%
String skincode = UserSet.getSkin(request);
if (skincode.equals(""))
	skincode = UserSet.defaultSkin;
SkinMgr skm = new SkinMgr();
Skin skin = skm.getSkin(skincode);
if (skin==null)
	skin = skm.getSkin(UserSet.defaultSkin);
String skinPath = skin.getPath();
%>
<%
String nick = "" + System.currentTimeMillis();
Privilege privilege = new Privilege();
String username = StrUtil.getNullString(privilege.getUser(request));
if (!username.equals(""))
	nick = username;
%>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<TITLE><%=Global.AppName%> - 房间列表</TITLE>
<META content="text/html; charset=utf-8" http-equiv=Content-Type>
<META HTTP-EQUIV="Pragma" CONTENT="no-cache"> 
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache"> 
<META HTTP-EQUIV="Expires" CONTENT="0"> 
<link href="../forum/<%=skinPath%>/skin.css" rel="stylesheet" type="text/css">
<SCRIPT LANGUAGE=javascript>
<!--
function GetRooms(url) {
	try {
    	RoomsLoader.src = url;
    } catch(e) {
        return false;
    }
}

var nick = "<%=StrUtil.UrlEncode(nick)%>";
function parseRooms(vrooms)
{
	var infg = "#$#";
	var outfg = "#*#";
	rooms.innerHTML = vrooms;
	var vrooms = rooms.innerHTML;
	var roomary = vrooms.split( outfg );
	vrooms = "";
	var ary;
	
	vrooms += "<table align=center width='100%' border='0' cellpadding='0' cellspacing='1' bgcolor='#CCCCCC'>";
	var i = 0;
	while (i<roomary.length)
	{
		 ary = roomary[i].split(infg)
         vrooms += "<tr align='center' bgcolor='#f8f8f8'> ";
         vrooms += "<td width='20%' height='20'>";
		 vrooms += "<a href=javascript:enterRoom('" + ary[0] + "')>"+ary[0]+"</a>";
         vrooms += "&nbsp;("+ary[1]+")";
         vrooms += "</td>";
		 
         vrooms += "<td width='20%'>";
		 i++;
		 if (i<roomary.length)
		 {
			 ary = roomary[i].split(infg)
			 vrooms += "<a href=javascript:enterRoom('" + ary[0] + "')>"+ary[0]+"</a>";
			 vrooms += "&nbsp;("+ary[1]+")";
		 }
		 else
		 	vrooms += "&nbsp;";
         vrooms += "</td>";
		 
         vrooms += "<td width='20%'>";
		 i++;
		 if (i<roomary.length)
		 {
			 ary = roomary[i].split(infg)
			 vrooms += "<a href=javascript:enterRoom('" + ary[0] + "')>"+ary[0]+"</a>";
			 vrooms += "&nbsp;("+ary[1]+")";
		 }
		 else
		 	vrooms += "&nbsp;";
         vrooms += "</td>";
		 
         vrooms += "<td width='20%'>";
		 i++;
		 if (i<roomary.length)
		 {
			 ary = roomary[i].split(infg)
			 vrooms += "<a href=javascript:enterRoom('" + ary[0] + "')>"+ary[0]+"</a>";
			 vrooms += "&nbsp;("+ary[1]+")";
		 }
		 else
		 	vrooms += "&nbsp;";
         vrooms += "</td>";
		 
         vrooms += "<td width='20%'>";
		 i++;
		 if (i<roomary.length)
		 {
			 ary = roomary[i].split(infg)
			 vrooms += "<a href=javascript:enterRoom('" + ary[0] + "')>"+ary[0]+"</a>";
			 vrooms += "&nbsp;("+ary[1]+")";
		 }
		 else
		 	vrooms += "&nbsp;";
         vrooms += "</td>";
		 
         vrooms += "</tr>";
		 i++;
	}
	
    vrooms += "</table>";	
	rooms.innerHTML = vrooms;
}

function enterRoom(room) {
	form1.room.value = room;
	form1.submit();
}
//-->
</SCRIPT>
<script id="RoomsLoader" language="JavaScript" type="text/javascript" defer></script>
<SCRIPT ID=clientEventHandlersJS LANGUAGE=javascript>
<!--
function window_onload() {
	GetRooms("chatclient.jsp?mode=roomlist&user=<%=nick%>&room=");
}
//-->
</SCRIPT>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</HEAD>
<BODY leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onLoad="return window_onload()" LANGUAGE=javascript>
<%@ include file="../forum/inc/header.jsp"%>
<table width="98%" height="90%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr> 
    <td height="25" valign="bottom" > <div align="center"> 
        <span class="right-title"><strong>聊天室房间列表</strong></span><br>
        <br>
      </div></td>
  </tr>
  <tr> 
    <td height="100%" valign="top" > <div align="center"> 
		<span id=rooms></span>
        </div></td>
  </tr>
  <form name="form1" method="post" action="chatframe.jsp">
  <tr> 
    <td>
	<input name="room" value="" type="hidden">
	<input name="nick" value="<%=nick%>" type="hidden">
	</td>
  </tr>
  </form>
</table>
<%@ include file="../forum/inc/footer.jsp"%>
</BODY>
</HTML>
