<%@ Language=VBScript %>
<%Option Explicit%>
<!-- #INCLUDE FILE = "../inc.asp" -->
<%
CheckAdminLogin()
Dim oChat, iRoomNumber

%>
<html>
<head>
<title>添加新房间页面</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="manager.css" type="text/css">
<script language="javascript">
function submitform()
{
	if(form.Priority.value==""||!fucCheckNUM(form.Priority.value))
		{alert("房间序号不能为空，只能填写数字！");
		form.Priority.focus();
		return false;
		}
	if(form.RoomName.value=="")
		{alert("房间名称不能为空！");
		form.RoomName.focus();
		return false;
		}
	if(form.Welcome.value=="")
		{alert("欢迎致词不能为空！");
		form.Welcome.focus();
		return false;
		}
	if(form.Description.value=="")
		{alert("房间描述不能为空！");
		form.Description.focus();
		return false;
		}
	if(form.Style.value=="")
		{alert("样式不能为空！");
		form.Style.focus();
		return false;
		}
	if(form.Capacity.value==""||!fucCheckNUM(form.Capacity.value))
		{alert("人数限制不能为空，只能填写数字！");
		form.Capacity.focus();
		return false;
		}
	return true;
}

function fucCheckNUM(NUM) 
{ 
	var i,j,strTemp; 
	strTemp="0123456789"; 
	if (NUM.length== 0) 
		return false; 
	for (i=0;i<NUM.length;i++) 
		{j=strTemp.indexOf(NUM.charAt(i)); 
		if (j==-1) 
			{ 
			//说明有字符不是数字 
			return false; 
			}
		} 
	//说明是数字 
	return true; 
}

</script>
<script src="../inc.js" language="javascript"></script>
</head>
<body <%=g_BodyTag%>>
<table border="0" cellspacing="0" cellpadding="0" align="center" width="80%" class="solid1">
  <tr>
    <td bgcolor="#FFFFFF"> 
      <table width="100%" border="0" cellspacing="1" cellpadding="3">
        <tr>
          <td background="images/admin_bg_1.gif" align="center"><font color="#FFFFFF"><b>添加新房间页面</b></font></td>
        </tr>
        <form name="form" method="post" action="m_aroom.asp" onsubmit="return submitform();">
          <tr> 
            <td bgcolor="#DEE5FA">索引序号： 
              <input type="text" name="Priority" size="3" maxlength="3" value="<%=iRoomNumber%>">
              房间名称： 
              <input type="text" name="RoomName" size="15" maxlength="15">
              状态： 
              <select name="State">
                <option value="1" selected class="Open">开放</option>
                <option value="0" class="Close">关闭</option>
              </select>
            </td>
          </tr>
          <tr> 
            <td bgcolor="#DEE5FA">欢迎致词： 
              <textarea name="Welcome" rows="4" cols="85"></textarea>
            </td>
          </tr>
          <tr> 
            <td bgcolor="#DEE5FA">房间说明： 
              <textarea name="Description" rows="4" cols="85"></textarea>
            </td>
          </tr>
          <tr> 
            <td bgcolor="#DEE5FA">样式文件： 
              <input type="text" name="Style" size="15" maxlength="15">
            </td>
          </tr>
          <tr> 
            <td bgcolor="#DEE5FA"> Emote功能： 
              <select name="Emote">
                <option value="1" selected class="Open">开</option>
                <option value="0" class="Close">关</option>
              </select>
              最大用户限制： 
              <input type="text" name="Capacity" maxlength="3" size="3" value="50">
              （如果不限人数，就填写0） </td>
          </tr>
          <tr> 
            <td align="right" bgcolor="#DEE5FA"> 
              <input type="button" name="back" value="返回" onClick="history.go(-1);">
              <input type="submit" name="Submit" value="添加">
            </td>
          </tr>
        </form>
      </table>
    </td>
  </tr>
</table>
<!-- #INCLUDE File = "../bottom.asp" -->
</body>
</html>