
<%@ page buffer="8kb" autoFlush="true" %>
<%@ page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8" %>
<%@ taglib prefix="zm" uri="com.zimbra.zm" %>
<%@ taglib prefix="app" uri="com.zimbra.htmlclient" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="fmt" uri="com.zimbra.i18n" %>

<app:handleError>
    <zm:getMailbox var="mailbox"/>
    <c:choose>
    <c:when test="${not empty mailbox.prefs.locale}">
        <fmt:setLocale value='${mailbox.prefs.locale}' scope='request' />
    </c:when>
    <c:otherwise>
        <fmt:setLocale value='${pageContext.request.locale}' scope='request' />
    </c:otherwise>
    </c:choose>
    <fmt:setBundle basename="/messages/ZhMsg" scope="request"/>
    
    <zm:getMessage var="msg" id="${param.id}" markread="true" neuterimages="${empty param.xim}"/>
    <c:set var="print" value="${param.print}" />
</app:handleError>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<app:head title="${msg.subject}" mailbox="${mailbox}"/>
<body>
    <zm:currentResultUrl var="currentUrl" value="" action="view" context="${null}"/>
    <table width=100% cellpadding="0" cellspacing="0">
        <tr>
            <td class='ZhAppContent'>
                <c:if test="${zm:boolean(print)}">
                <table  border=0 width=100% cellpadding="7">
                    <tr>
                        <td style="font-size:20px;font-weight:bold;" ><fmt:message key="zimbraTitle"/></td>
                        <td style="font-size:14px;font-weight:bold;" align=right> <c:out  value="${mailbox.defaultIdentity.fromAddress}"/></td>
                    </tr>
                </table>
                <hr>
                <div style='padding:10px;font-size:20px;font-weight:bold;"' >
                    <c:out value="${msg.subject}" />
                </div>
                <hr>
                </c:if>
                <c:set var="extImageUrl" value=""/>
                <c:if test="${empty param.xim}">
                    <zm:currentResultUrl var="extImageUrl" value="message" action="view" context="${null}" xim="1" id="${param.id}"/>
                </c:if>

                <zm:currentResultUrl var="composeUrl" value="search" context="${null}"
                                     action="compose" paction="view" id="${msg.id}"/>
                <c:choose>
                    <c:when test="${zm:boolean(print)}">
                        <app:messagePrintView mailbox="${mailbox}" message="${msg}" />
                    </c:when>
                    <c:otherwise>
                        <app:displayMessage mailbox="${mailbox}" hideops="true" message="${msg}" externalImageUrl="${extImageUrl}" showconvlink="true" composeUrl="${composeUrl}"/>
                    </c:otherwise>
                </c:choose>
            </td>
        </tr>
    </table>
<c:if test="${zm:boolean(print)}">
<script type="text/javascript">
    <!--
    window.print();
    // -->
</script>
</c:if>
</body>
</html>
