<!--#include file="chat/config.asp"-->
<!--#include file="inc/conn.asp"-->
<!--#include file="inc/safe.asp"-->
<!--#include file="inc/config.asp"-->
<!--#include file="inc/const.asp"-->
<%
'on error resume next'错误忽略，以便能捕获错误信息

Response.CacheControl = "no-cache"
Response.AddHeader "Pragma", "no-cache"
Response.Expires = 0

'----------------------------------------------------------------------------------------
rem 判断global.asa是否被正确执行
if not Application("initialized") then response.Redirect("chat/initchat.asp")
%>
<script language="JavaScript">
//打开窗口宽度的设置
//暂时只支持1024*768 和 800*600两种分辨率,且暂时只打开两种分辩率下的窗口.不会在过大分辩率下显示全屏

Win_width=screen.availWidth;

if (Win_width>1024)Win_width=1024;
Win_width-=10;

Win_height=screen.availHeight;
if (Win_height>600)
Win_height=768;
Win_height-=50;

function openWin() 
{winst="Status=no,scrollbars=yes,resizable=yes,width="+(Win_width)+",height="+(Win_height)+",top=0,left=0";
 window.open('about:blank','G_chatsystemWindow',winst);
} 
function openWin2(str,w,h) 
{winst="Status=yes,scrollbars=yes,resizable=yes,width="+(w)+",height="+(h)+",top=0,left=0";
 window.open(str,'G_chatsystemWindow2',winst);
} 
function check(){
f=document.form1
if (f.username.value.length<1){alert("请输入呢称！");return false;}
if (f.room_id.value<0){alert("请选择房间（点击您想要进入的房间）之后再提交！");return false;}
openWin();
f.submit();
f.username.value="";
f.password.value="";
preload()
}
function preload(){window.location.reload()}
</script>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>欢迎光临<%=chat_name%></title>
<meta name="keywords" content="情感,在线,新新,照片,动感影片,诗歌,爱情,纯洁,心连心">
<meta name="description" content="红嫂视屏交友情缘 情感在线">
<link href="style.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
body {
	background-image: url();
}
-->
</style>
</head>
<body>
<%
sheng=request("prov")
if sheng="" then sheng=8
if not isnumeric(sheng) then
  response.Write "参数传递错误！"
  response.end
end if
%>
<table width="510" border="0" align="center" cellpadding="0" cellspacing="0">
                     <!--<form name="form1" method="post" action="chat/process.asp" target="G_chatsystemWindow">-->
					
<form name="form1" method="post" action="chat/setchatok.asp" target="G_chatsystemWindow">


                      <tr>
                        <td height="502" align="center" valign="top"><table width="510" border="0" cellpadding="0" cellspacing="0" class="STYLE4">
                            <tr>
                              <td height="8" colspan="5"></td>
                            </tr>
                            
                            <tr>
                              <td colspan="5" align="left"><hr size="1" class="STYLE88" /></td>
                            </tr>
                            <tr>
                              <td height="30" colspan="5" align="left" class="STYLE1"><strong><font color="#4193DD">会员-聊天室登录</font></strong></td>
                            </tr>
                            <%if MemberName<>"" then
					   sql="select sex from user_info where username='"& membername &"' and userid="& userid &""
					   set res=server.CreateObject("adodb.recordset")
					   res.open sql,conn,1
					   sex1=res("sex")
					   res.close
					   set res=nothing
					   %>
                            <tr>
                              <td height="30" colspan="5" align="center">欢迎 <b><%=MemberName%></b> 来到红嫂视屏交友聊天系统，在聊天室列表中选择聊天室进入&nbsp;&nbsp;
                                  <input type="hidden" name="username" value="<%=MemberName%>">
                                  <input type="hidden" name="password" value="">
                                  <input type="hidden" name="sex" value="<%=sex1%>">                              </td>
                            </tr>
                            <%else%>
                            <tr>
                              <td width="48" height="30" align="center">昵称：</td>
                              <td width="110" align="left"><input name="username" type="text" class="STYLE88" id="username" style="height:18px; width:80px;" maxlength="20" value="游客<%=Application("c_useronline")+1%>"/>                              </td>
                              <td width="50" align="center">密码：</td>
                              <td width="117" align="center"><input name="password" type="password" class="STYLE88" id="password" style="height:18px; width:80px;"></td>
                              <td width="235" align="center">性别：
                                  <input type="radio" name="sex" value="女" />
              女
              <input name="sex" type="radio" value="男" checked />
              男 &nbsp;&nbsp; </td>
                            </tr>
                            <%end if%>
                            <tr>
                              <td height="30" colspan="5" class="STYLE4">&nbsp;如果您刚才已经登录过，请<A href="javascript:openWin2('chat/chat.htm')" class="a4">点击这里</A>直接进入或者在这儿<A href="javascript:openWin2('chat/out.asp');" class="a4">注销</A>!</td>
                            </tr>
                          </table>
                            <table width="510" border="0" cellpadding="0" cellspacing="0" class="STYLE4">
                              <tr>
                                <td align="left"><%roominfo=Application("c_roominfo")
if not isarray(roominfo) then
 response.Write "<DIV align='center'>聊天系统暂时未开放！</DIV>"
else
%>
                                    <table width="99%" border="1" align="center" cellspacing="0" bordercolorlight="#FFFFFF" bordercolordark="#9DCCF6" class="style30">
                                      
                                      <input type="hidden" name="room_name" value="">
                                      <input type="hidden" name="room_id" value="-5">
									  <tr align="middle">
                                      <%
set rs=server.CreateObject("adodb.recordset")
sql="select * from room where sheng="& sheng &""
rs.open sql,conn,1
dim nny:nny=1
do while not rs.eof
if application("c_roomusernum"&rs("id"))<>0 then    
	  user=application("c_roomusernum"&rs("id"))    
 else    
  user=0    
 end if    
 max_user=rs("max_user") 
 sumuser=sumuser+user
 if max_user>user then
%>
                                      
                                        <td width="252" height="30"><a href="#" onclick="javascript:document.form1.room_id.value='<%=rs("id")%>';document.form1.room_name.value='<%=rs("room_name")%>';return check();" class="b1"><%=rs("room_name")%></a>&nbsp;&nbsp;&nbsp;(<font color="#993333"><%=user%></font> / <%=rs("max_user")%>) </td>
<%
else
%>
                                        <td width="252"><%=rs("room_name")%>&nbsp;&nbsp;&nbsp;(<%=user%> /<%=rs("max_user")%>)</td>     <%
end if
rs.movenext
nny=nny+1
if nny>2 then 
 response.Write "</tr><tr align='middle'>"
 nny=1
end if 
loop
if nny>1  then response.Write "<td width=252>&nbsp;</td>"
rs.close
set rs=nothing
Application("c_useronline")=sumuser
%>
                                    </table>
                                    <%end if%>
                                </td>
                              </tr>
                              <tr>
                                <td align="center">&nbsp;</td>
                              </tr>
                          </table></td>
                      </tr>
                    </form>
</table>
<!--#include file="chat/client_error_deal.asp"--> 
</body>
</html>
<%
conn.close
set conn=nothing
%>			  
