<% @ LANGUAGE=VBSCRIPT CODEPAGE = 1252 %>
<!--#include file="constant.inc"-->
<!--#include file="lib/session.inc"-->
<%SendHeader 0, 1%>
<!--#include file="lib/getrend.inc"-->
<%
'<!-- Microsoft Outlook Web Access-->
'<!-- Item.asp : This file processes next/prev requests. -->
'<!-- Copyright (c) Microsoft Corporation 1993-1997. All rights reserved.-->
On Error Resume Next
if SessionIsValid() then
bstrAction = Request.QueryString("action")
nItem = Session(CURRENT_INDEX)
bFoundMsg = false
Set objMessages = Session(CURRENT_CONTENTS)
If objMessages Is Nothing Or Err.Number <> 0 Then
ReportError1 L_errCannotGetMessageObj_ErrorMessage
End If
Do
If bstrAction = "next" Then
nItem = nItem + 1
Else
nItem = nItem - 1
End If
Set objOneMsg = objMessages.Item(nItem+1)
If objOneMsg Is Nothing or Err.Number <> 0 Then
Err.Clear ' Cleanup the error
Exit Do
End If
If TypeName(objOneMsg)<>"GroupHeader" Then
nLen = Len(objOneMsg.ID)
If nLen > 0 Then
bFoundMsg = true
Exit Do
End If
End If
Loop
Session(CURRENT_INDEX) = nItem
If bFoundMsg Then
Set objRender = GetMessageRenderer
objRender.DataSource = objOneMsg
bstrLink = objRender.RenderLink
If Err.Number <> 0 then
ReportErrorClose L_errRenderLink_ErrorMessage
Else
Set Session(CURRENT_MSG) = objOneMsg
Response.Redirect(bstrLink)
End If
Else
%>
<html>
<body bgcolor="#c0c0c0">
<center>
<% If bstrAction = "next" Then %>
<A href="item.asp?action=previous">
<IMG SRC="<%=bstrVirtRoot%>/forms/prevmsg.gif" Alt="<%=L_PrevMsg_ToolTip%>" align="middle" border=0 width=24 height=24></a>
<% Else %>
<A href="item.asp?action=next">
<IMG SRC="<%=bstrVirtRoot%>/forms/nextmsg.gif" Alt='<%=L_NextMsg_ToolTip%>' align="middle" border=0 width=24 height=24></a>
<% End If %>
<br><hr><br>
<font size=3>
<%= L_errNoMoreMessages_ErrorMessage %>
</font>
</center>
</body>
</html>
<%
End If
Else 'invalid session (timedout)
%>
<html>
<body bgcolor="#c0c0c0">
<center>
<font size=4>
Your Outlook Web Access session has expired.<br><br>
</font><font size=3>
Your current item will need to be re-opened.
You will be asked to re-logon before you are able to perform this and any other action in your Outlook session.
<br><hr><br>
</font>
<form>
<input type="button" value="OK" onClick="window.close();">
</form>
</center>
</body>
</html>
<%
End If
%>