<%@ page contentType="text/html; charset=GBK" %>
<%@ page import = "zr.zrpower.common.util.SysPreperty"%>
<%@ page import = "zr.zrpower.entity.sys.SessionUser"%>
<%@ page import = "zr.zrpower.ejb.sys.UserService" %>
<%@ page import = "zr.zrpower.entity.sys.BPIP_USER"%>
<%@ page import = "zr.zrpower.common.util.DateWork"%>
<%@ page import = "java.lang.Object"%>
<%@ page import = "java.util.*" %>
<%@ page import = "java.text.*" %>

<HTML>
<%
SessionUser user = (SessionUser)session.getAttribute("userinfo");
UserService userMgr = new UserService();
DateWork dateBean = new DateWork();
String MSGCONTENT = "0";
String MailMessage = "0";
String flow = "0";

//更新当前用户的在线时间
userMgr.UpUserOnlineDate(user.getUserID());

int Intnumber =userMgr.GetSysSaverPNumber();


String strImage2 = "flowrun4.gif";
String strWav = "";

//待办工作
if (strWav.length()==0)
{
  if (!flow.equals("0")){
     strWav = "security.wav";
  }
}


String userID = user.getUserID();
BPIP_USER mUser=userMgr.GetUserInfo(userID);
//
%>
<%
Calendar cal = Calendar.getInstance();
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String mDateTime = formatter.format(cal.getTime());
Date date = new Date();
cal.setTime(date);
int week = cal.get(Calendar.DAY_OF_WEEK)-1;
String messageIco = "messageshow1.gif";
if (week==1){messageIco = "messageshow1.gif";}
if (week==2){messageIco = "messageshow2.gif";}
if (week==3){messageIco = "messageshow3.gif";}
if (week==4){messageIco = "messageshow4.gif";}
if (week==5){messageIco = "messageshow5.gif";}
if (week==6){messageIco = "messageshow6.gif";}
if (week==0){messageIco = "messageshow7.gif";}
String FAQUnit = SysPreperty.getProperty().FAQUnit;//技术支持单位
String FAQUnitLink = SysPreperty.getProperty().FAQUnitLink;//技术支持单位网址
String strFAQUnits = "";
if (FAQUnit.length()>2)
{
    strFAQUnits = "<a target='_blank' href='"+FAQUnitLink+"' title='技术支持'>&nbsp;技术支持:"+FAQUnit+"</a>";
}


%>
<HEAD>
<TITLE></TITLE>
<meta http-equiv="refresh" content="60">
<%if (strWav.length()>0){%>
   <bgsound src='<%=SysPreperty.getProperty().AppUrl%>zrsysmanage/images/<%=strWav%>' loop='1'>
<%}%>




<link REL="stylesheet" type="text/css" href="zrsysmanage/css/<%=user.getUserCSS()%>">
<Script Language="JavaScript" Src="zrsysmanage/script/Public.js"></Script>
</head>
<body  background="<%=SysPreperty.getProperty().AppUrl%>zrsysmanage/images/<%=user.getUserImage()%>/footerBg.gif">

<table  width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td  height="23">
      <a href="javascript:OpenUrl('zrsysmanage/online.jsp','0')" title="在线用户"><font class="titlefont">&nbsp;您登录的是<%=SysPreperty.getProperty().ServerName%>，当前在线人数：<%=Intnumber%>人</font></a>
    </td>
    <td  height="23"><font class="titlefont">
      <%=strFAQUnits%></font>
    </td>
    <td>

    </td>
    <td align="right">

        <%
        //有待提示的信息
        if (strWav.length()>0){%>
          <a href="#" onclick="popTop=50;popshow();" title="有新的消息，请注意查收！">
            <img src="<%=SysPreperty.getProperty().AppUrl%>zrsysmanage/images/<%=user.getUserImage()%>/<%=messageIco%>" border="0"  width="25" height="25" align="absmiddle">
          </a>
        <%}%>
        &nbsp;
    </td>
  </tr>
</table>
</body>
</html>
<script language="Javascript">
var oPopup = window.createPopup();
var popTop=50;
var publictime="";
var cnum=0;

function popmsg(){
  var strMessage="";



  if (cnum<3 && strMessage.length>0)
  {
       strMessage = "<table border='0' cellspacing='0' cellpadding='0' width='100%' height='100%'><tr><td>"+strMessage+"</td></tr><tr><td height='70' align='right'>";
       strMessage = strMessage + "<img src='<%=SysPreperty.getProperty().AppUrl%>zrsysmanage/images/<%=user.getUserImage()%>/<%=messageIco%>' border='0' width='70' height='70' align='absmiddle'>";
       strMessage = strMessage + "</td></tr></table>"
  }

  if (strMessage.length==0){
    return;
  }
var winstr="";

winstr+="<table border='0' width='256' id='table1' cellspacing='0' cellpadding='0' height='159' background='<%=SysPreperty.getProperty().AppUrl%>zrsysmanage/images/<%=user.getUserImage()%>/messageback.jpg'>";
winstr+="<tr>";
winstr+="<td width='9' height='30' colspan='2'></td>";
winstr+="<td height='30' width='255'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;系统提示</td>";
winstr+="<td width='20' height='30' style='cursor: hand;' onclick='parent.popclose();'></td>";
winstr+="</tr>";
winstr+="<tr>";
winstr+="<td width='11'></td>";
winstr+="<td width='255' colspan='2' rowspan='3'>"+strMessage+"</td>";
winstr+="<td width='20'></td>";
winstr+="</tr>";
winstr+="<tr>";
winstr+="<td width='11'></td>";
winstr+="<td width='20'></td>";
winstr+="</tr>";
winstr+="<tr>";
winstr+="<td width='11' height='49'></td>";
winstr+="<td width='20' height='49'></td>";
winstr+="</tr>";
winstr+="<tr>";
winstr+="<td width='9' height='10' colspan='2'></td>";
winstr+="<td height='10' width='255'></td>";
winstr+="<td width='20' height='10'></td>";
winstr+="</tr>";
winstr+="</table>";

oPopup.document.createStyleSheet("zrsysmanage/css/<%=user.getUserCSS()%>");
oPopup.document.body.innerHTML = winstr;

popshow();
}
function popshow(){
if(popTop>1720){
clearTimeout(mytime);
oPopup.hide();
return;
}else if(popTop>1520&&popTop<1720){
oPopup.show(screen.width-256,screen.height,256,1720-popTop);
}else if(popTop>1500&&popTop<1520){
oPopup.show(screen.width-256,screen.height+(popTop-1720),256,159);
}else if(popTop<180){
oPopup.show(screen.width-256,screen.height,256,popTop);
}else if(popTop<220){
oPopup.show(screen.width-256,screen.height-popTop,256,159);
}
popTop+=10;
var mytime=setTimeout("popshow();",50);
publictime = mytime;
}

function popclose(){
   clearTimeout(publictime);
   oPopup.hide();
}

popmsg();


</script>
<%
//清空相关对象
user = null;
mUser = null;
%>
