<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="top.aspx.cs" Inherits="InfoPath.Inside.top" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Top</title>
    <link href="css/main.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="../JS/JS.js"></script>

<script type="text/javascript" >
    window.setInterval(ShowMSG, 6000);
//    window.setInterval(LoadReminder, 6000);


    function ShowMSG() {
        var userid = document.getElementById("UserID");
        var dept = document.getElementById("Dept");
        var branch = document.getElementById("Branch");

//        GetHttpResult(dept.innerHTML, branch.innerHTML, 'http://localhost/WS/ChatService.asmx/GetPublicMSG', 'Chat', 'ChatBody');
//        GetHttpResultUser(userid.innerHTML, 'http://localhost/WS/ChatService.asmx/GetPublicSMS', 'SMS', 'MsgBody');
//        GetHttpReminder(userid.innerHTML, dept.innerHTML, branch.innerHTML, 'http://localhost/WS/ChatService.asmx/Reminder2SMS');

        GetHttpResult(dept.innerHTML, branch.innerHTML, 'http://218.107.54.131/WS/ChatService.asmx/GetPublicMSG', 'Chat', 'ChatBody');
        GetHttpResultUser(userid.innerHTML, 'http://218.107.54.131/WS/ChatService.asmx/GetPublicSMS', 'SMS', 'MsgBody');
        GetHttpReminder(userid.innerHTML, dept.innerHTML, branch.innerHTML, 'http://218.107.54.131/WS/ChatService.asmx/Reminder2SMS');

    }

    function LoadReminder() {
        var userid = document.getElementById("UserID");
        var dept = document.getElementById("Dept");
        var branch = document.getElementById("Branch");
        GetHttpReminder(userid.innerHTML, dept.innerHTML, branch.innerHTML, 'http://218.107.54.131/WS/ChatService.asmx/Reminder2SMS');

    }
    
    function initDisplay() {
        var element = document.getElementById("Notify");
        element.style.display = 'none';
        var element = document.getElementById("Chat");
        element.style.display = 'none';
        var element = document.getElementById("Msg");
        element.style.display = 'none';
    }
    function closeIt(elementname) {
        var element = document.getElementById(elementname);
        element.style.display = 'none';
    }
    function zoomIt(elementname) {
        var element = document.getElementById(elementname);
        element.style.height = '0';
    }
    function largeIt(elementname) {
        var element = document.getElementById(elementname);
        element.style.height = '250';
    }

    
    function switchTopBar() {

        if (parent.document.all("topFrame").style.display == "none") {
            parent.topf.rows = "60,*";
            parent.document.all("topFrame").style.display = ""
        }
        else {
            parent.topf.rows = "0,*";
            parent.document.all("topFrame").style.display = "none"
        }
    } 
</script>
</head>
<body>
    <form id="form1" runat="server">
    
    <div id="top">
<%----%> 	     <div  id="logo" onclick="switchTopBar()">
<asp:Image ID="Image1" runat="server"  ImageUrl="../Icon/ip/top.png" />
</div>
	  	<div id="user">
              <asp:Label ID="lblwelcometop" runat="server" Text="Label"></asp:Label> 
          <asp:Label ID="UserID" runat="server" Text="Label"></asp:Label>
           </div>	 
		  <div id="msg">
		  <TABLE  width=99%>
<TR>
	<TD width=50% height=100%>
	
	<div id="Chat" style="display:none" >
  <TABLE width=100% >
<%--  <TR>
	<TD>讨论</TD><TD width=20%  align=right>
	<A HREF="#" onclick="closeIt('Chat')">--</A>
	<A HREF="#" onclick="largeIt('Chat')">□</A>
	<A HREF="#" onclick="zoomIt('Chat')">×</A></TD>
  </TR>--%>
  <TR >
	<TD colspan=2>
	<div id="ChatBody" class=newStyle2 ></div>
	</TD>
  </TR>
  </TABLE>
</div>

       
</TD>
	<TD>
	
	<div id="SMS" style="display:none">
  <TABLE width=100% >
 <%-- <TR >
	<TD>消息</TD><TD width=20%  align=right>
	<A HREF="#" onclick="closeIt('SMS')">--</A>
	<A HREF="#" onclick="largeIt('SMS')">□</A>
	<A HREF="#" onclick="zoomIt('SMS')">×</A></TD>
  </TR>--%>
  <TR >
	<TD colspan=2>
	<div id="MsgBody" class=newStyle2 > 
	
</div>
	</TD>
  </TR>
  </TABLE>
</div>
<div>          
</div>
</TD>
</TR>
</TABLE>
		  


		  
		  </div>	 
	 </div>
   <asp:Label ID="Dept" runat="server"  Text=""></asp:Label>
          <asp:Label ID="Branch" runat="server" Text=""></asp:Label> </form>
</body>
</html>
