<%@ Language=VBScript %>
<%Option Explicit%>
<!-- #INCLUDE FILE = "inc.asp" -->
<!-- #INCLUDE FILE = "config.asp" -->
<%
Response.Buffer = True

Dim oChat
Set oChat = Server.CreateObject("LSChat.XML")
oChat.Configure g_SiteName, g_SiteDomain, g_DBString, g_ErrFile, g_ScriptName
%>
<html>
<head>
<title></title>
<link rel="stylesheet" href="chatroom.css" type="text/css">
<script language="javascript" src="chatinc.js"></script>
</head>
<body bgColor="Thistle" leftMargin="5" topMargin="5" rightmargin="0">
<div id="FloatingBoard" class="FloatingBoard"></div>
<script language="javascript">
<!--

function formatPrompt(myguid, mysex, myage, itguid, itsex, itage, itsexshow, itageshow, itnickname){
	var sWords, sMySex, sItsex;
	sMySex = (mysex?"男":"女");
	sItsex = (itsex?"男":"女");
	
	if(itguid==0)
		sWords = "各位聊友，大家好！欢迎光临<b>" + thisChatRoom.roomname + "</b>！";
	else if(itguid==myguid)
		sWords = "聊天代号<b>" + "<%=Session("NickName")%>" + "(" + myguid + ")</b>，性别<b>" + sMySex + "</b>，今年<b>" + myage + "</b>岁。"
	else if(!itsexshow&&!itageshow)
		sWords = "<b>" + itnickname + "(" + itguid + ")</b>似乎并不愿意公开" + sItSex;
	else if(itsexshow&&itageshow)
		sWords = "<b>" + itnickname + "(" + itguid + ")</b>，性别" + sItsex + "</b>，今年<b>" + itage + "</b>岁。";
	showBoard(sWords);
}

var thisChatRoom = new parent.chatroom();
function showBoard(text){
	if (document.all&&document.readyState == "complete"){
		document.all.FloatingBoard.innerHTML = "<marquee class=\"FloatingText\">" + text + "</marquee>";
		//document.all.FloatingBoard.style.pixelLeft = event.clientX/4;
		
		if((event.clientX - 50) < 10)
			document.all.FloatingBoard.style.pixelLeft = 10;
		else
			document.all.FloatingBoard.style.pixelLeft = event.clientX - 50;
		
		document.all.FloatingBoard.style.pixelTop = event.clientY + document.body.scrollTop + 5;
		document.all.FloatingBoard.style.visibility = "visible";
	}
}

function hideBoard(){
	if(document.all)
		document.all.FloatingBoard.style.visibility = "hidden";
}

function ignore(iGUID, bIgnored, sNickName, bSex, bShowSex){
	var thislocation = "ignore.asp?Ignore=" + bIgnored + "&GUID=" + iGUID;
	parent.HandleMessage.location = thislocation;
	msgIgnoreResult(iGUID, sNickName, bIgnored, bSex, bShowSex);
}

function msgIgnoreResult(iGUID, sNickName, bIgnored, bSex, bShowSex){
	var sMessage, Sex;
	window.setTimeout("window.history.go(0)", 300, "javascript");
	if(bShowSex){
		if(bSex)
			Sex = "他";
		else
			Sex = "她";
		}
	else
		Sex = "他(她)";		
	
	if(bIgnored){
		sMessage = "<span class=\"SystemInfo\"><b>[系统提示]</b>：您已经屏蔽了 “<b>" + sNickName + "(" + iGUID + ")</b>”。<br>可是，" + Sex + "真的那么讨厌吗？！--- 再次双击该用户可以取消忽略！</span><br>";
	}else
		sMessage = "<span class=\"SystemInfo\"><b>[系统提示]</b>：您已经取消了对 “<b>" + sNickName + "(" + iGUID + ")</b>” 的屏蔽。<br>祝你们再次成为朋友！不过，如果 “<b>" + sNickName + "</b>” 仍然那么讨厌，双击该用户仍然可以忽略" + Sex + "！</span><br>";
	parent.Message.document.writeln(sMessage);
}
//-->
</script>
<%
If Not oChat.writeUserList(adIMGWidth ,adIMGHeight) Then err("聊天室发生错误，请与作者联系。") '没有起到错误处理的作用
Set oChat = Nothing
%>
</body>
</html>