<dialog id="roomlist" style="max-width: 90%;max-height: 80%; text-align: left;">
<span class="yellow b"><div id="roomerror" style="padding-bottom: 5px;"></div></span>
<form method="post" name="roomact" onsubmit="return false;" >
<input type="hidden" name="roomact" id="roomact" value="">

<!--{eval $now_rooms = !empty($roomlist) ? count($roomlist) : 0;}-->
	<span class="evergreen">当前房间列表（{$now_rooms}/{$max_rooms}） 
<!--{if $now_rooms < $max_rooms && !$groomid && (!empty($cuser) && !empty($cpass))}-->
	<input type="button" value="点击创建一个新的房间" onclick="$('roomact').value='create';postCmd('roomact','index.php');" >
<!--{/if}-->
	<br>
	<div style="height:5px;">&nbsp;</div>
		<table CellSpacing=0 CellPadding=0 class="infotable">
			<tr>
				<td class="b1" width="60px">编号</td>
				<!--<td class="b1" width="80px">游戏模式</td>-->
				<td class="b1" width="60px">状态</td>
				<td class="b1" width="120px">创建者/房主</td>
				<td class="b1" width="60px">人数</td>
				<!--<td class="b1" width="120px">运行时间</td>-->
				<td class="b1" width="80px">操作</td>
			</tr>
		<!--{if !empty($now_rooms)}-->
			<!--{loop $roomlist $rkey $rinfo}-->
			<tr>
				<td class="b3" width="60px" height="30px">
					$rkey
				</td>
				<!--<td class="b3" width="80px">游戏模式</td>-->
				<td class="b3" width="60px">
					$gstate[$rinfo['gamestate']]
				</td>
				<td class="b3" width="120px">
					$rinfo['groomownid']
				</td>
				<td class="b3" width="60px">
					$rinfo['groomnums']
				</td>
				<!--<td class="b3" width="120px">运行时间</td>-->
				<td class="b3" width="80px">
				<!--{if !empty($cuser) && !empty($cpass)}-->
					<!--{if !empty($groomid)}-->
						<!--{if $groomid == $rkey}-->
							<span tooltip2="退出房间后，如房间内没有其他玩家，则房间会解散；房主退出房间会将房主权限转移给房间内其他玩家；">
								<input type="button" value="退出" onclick="$('roomact').value='exit';postCmd('roomact','index.php');" >
							</span>
							<!--{if !empty($rinfo['groomownid']) && $rinfo['groomownid'] == $cuser}-->
								<span tooltip2="不能解散正在进行游戏且尚有其他玩家存活的房间">
									<input type="button" value="解散" onclick="$('roomact').value='close';postCmd('roomact','index.php');" >
								</span>
							<!--{/if}-->
						<!--{else}-->
							<span class="grey">-</span>
						<!--{/if}-->
					<!--{else}-->
						<input type="button" value="加入" onclick="$('roomact').value='join{$rkey}';postCmd('roomact','index.php');" >
					<!--{/if}-->
				<!--{else}-->
					<span class="grey">-</span>
				<!--{/if}-->
				</td>
			</tr>
			<!--{/loop}-->
		<!--{/if}-->
		</table>
</form>
<img class="dialog-background" src="img/profile.gif" onclick="closeDialog($('roomlist'))">
</dialog>