<%--
 * ***** BEGIN LICENSE BLOCK *****
 * Zimbra Collaboration Suite Web Client
 * Copyright (C) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016 Synacor, Inc.
 *
 * This program is free software: you can redistribute it and/or modify it under
 * the terms of the GNU General Public License as published by the Free Software Foundation,
 * version 2 of the License.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU General Public License for more details.
 * You should have received a copy of the GNU General Public License along with this program.
 * If not, see <https://www.gnu.org/licenses/>.
 * ***** END LICENSE BLOCK *****
--%>
<%@ page import="com.zimbra.common.mime.MimeCompoundHeader" %>
<%@ page import="com.zimbra.cs.httpclient.URLUtil" %>
<%@ page import="java.util.regex.*" %>
<%@ page buffer="8kb" autoFlush="true" %>
<%@ page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8" %>
<%@ taglib prefix="zm" uri="com.zimbra.zm" %>
<%@ taglib prefix="mo" uri="com.zimbra.mobileclient" %>
<%@ 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" %>
<%@ taglib prefix="app" uri="com.zimbra.htmlclient" %>

<c:set var="F_LIMIT" value="${not empty sessionScope.F_LIMIT ? sessionScope.F_LIMIT : 100}" scope="session"/>
<c:if test="${empty param.ajax}"><?xml version="1.0" encoding="UTF-8"?>
<!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" xml:lang="en" lang="en">
<c:if test="${(!empty param.debug || !empty param.dev)}"><c:set var="dbg" value="${true}"/></c:if>
<c:remove var="prevUrl" scope="session"/><c:remove var="currentUrl" scope="session"/></c:if>
<c:url var="baseURL" scope="request" value="${requestScope.baseURL!=null?requestScope.baseURL:'zmain'}"/>
<c:set var="context_url" value="${requestScope.baseURL}"/>
<c:if test="${param.loginOp=='logout'}"><c:remove var="mapp" scope="session"/><c:redirect url="/"><c:param name="loginOp" value="logout"/><c:param name="client" value="mobile"/></c:redirect></c:if>
<%--<c:if test="${not empty param.ajax}">--%>
    <c:url var="prevUrl" scope="session" value="${zm:cook(sessionScope.currentUrl)}"/>
    <c:url var="currentUrl" scope="session" value="zmain">
        <c:forEach items="${param}" var="p"><c:param name="${p.key}" value="${p.value}"/></c:forEach>
    </c:url>
<%--</c:if>--%>
<c:if test="${not empty param.djs}"><c:set var="djs" value="${fn:escapeXml(param.djs)}" scope="session" /></c:if>
<c:set var="version" value="${initParam.zimbraCacheBusterVersion}"/>
<c:set var="uiv" value="1" scope="session"/>
<mo:handleError>
    <zm:getMailbox var="mailbox"/>
    <zm:getUserAgent var="ua" session="true"/>
    <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"/>
    <mo:apptComposeCheck/>
    <mo:composeCheck/>
    <c:choose>
        <c:when test="${not empty param.doPrefsAction}">
            <zm:modifyPrefs var="updated">
                <zm:pref name="zimbraPrefTimeZoneId" value="${param.zimbraPrefTimeZoneId}"/>
                <c:if test="${mailbox.features.conversations}">
                    <zm:pref name="zimbraPrefGroupMailBy" value="${param.zimbraPrefGroupMailBy}"/>
                </c:if>
                <c:if test="${mailbox.features.initialSearchPreference}">
                    <zm:pref name="zimbraPrefMailInitialSearch" value="${param.zimbraPrefMailInitialSearch}"/>
                </c:if>
                <zm:pref name="zimbraPrefAutoAddAddressEnabled" value="${param.zimbraPrefAutoAddAddressEnabled eq 'TRUE' ? 'TRUE' : 'FALSE'}"/>
                <zm:pref name="zimbraPrefContactsPerPage" value="${param.zimbraPrefContactsPerPage}"/>
                <zm:pref name="zimbraPrefMailItemsPerPage" value="${param.zimbraPrefMailItemsPerPage}"/>
                <zm:pref name="zimbraPrefCalendarFirstdayOfWeek" value="${param.zimbraPrefCalendarFirstdayOfWeek}"/>
                <zm:pref name="zimbraPrefUseTimeZoneListInCalendar" value="${param.zimbraPrefUseTimeZoneListInCalendar eq 'TRUE' ? 'TRUE' : 'FALSE'}"/>
            </zm:modifyPrefs>
            <c:set var="flimit" value="${zm:cook(param.F_LIMIT)}"/>
            <c:choose>
                <c:when test="${flimit gt 0 and flimit le 1000}">
                    <c:set var="F_LIMIT" scope="session" value="${flimit}"/>
                </c:when>
                <c:otherwise>
                    <c:redirect url="zmview?st=prefs&emsg=MO_MaxFoldersInvalidValueMsg"/>                    
                </c:otherwise>
            </c:choose>
            <c:if test="${updated}">
                <zm:getMailbox var="mailbox" refreshaccount="${true}"/>
                <c:set var="limit" value="${mailbox.prefs.mailItemsPerPage}" scope="session"/>
                <zm:clearSearchCache />
                <app:status><fmt:message key="optionsSaved"/></app:status>
            </c:if>
        </c:when>
        <c:when test="${not empty param.doMessageAction}">
            <mo:messageAction/>
        </c:when>
        <c:when test="${not empty param.doBriefcaseAction}">
            <mo:briefcaseAction/>
        </c:when>
        <c:when test="${not empty param.doTaskAction}">
            <mo:taskAction/>
        </c:when>
        <c:when test="${not empty param.doContactAction}">
            <mo:contactAction/>
        </c:when>
        <c:when test="${not empty param.doFolderAction}">
            <mo:folderAction/>
        </c:when>
        <c:when test="${not empty param.doApptAction}">
            <mo:apptAction/>
        </c:when>
    </c:choose>
    <c:set var="action" value="${zm:cook(empty param.paction ? param.action : param.paction)}" scope="request"/>
</mo:handleError>
<c:set value="${ua.isiPhone || ua.isiPod || ua.isOsAndroid ? 'iphone' : ( ua.isIE ? 'wm6' : 'iphone')}" var="zms" scope="session"/>
<c:if test="${not empty param.zms}">
<c:if test="${not fn:contains(param.zms, '/')}">
    <c:set value="${fn:escapeXml(param.zms)}" var="zms" scope="session"/>
</c:if>
</c:if>
<c:if test="${sessionScope.limit == null}">
    <c:set var="limit" value="${sessionScope.zms eq 'xlite' ? '5' : mailbox.prefs.mailItemsPerPage}" scope="session"/>
</c:if>
<c:if test="${(sessionScope.limit != param.limit && param.limit != null && param.limit != '')  }">
    <c:set var="limit" value="${zm:cook(param.limit)}" scope="session"/>
</c:if>
<c:set var="aurl" value="${context_url}"/>
<%-- Access keys --%>
<c:set var="mailapp_accesskey" value="1" scope="request"/>
<c:set var="contactapp_accesskey" value="2" scope="request"/>
<c:set var="calapp_accesskey" value="3" scope="request"/>
<c:set var="fldrapp_accesskey" value="4" scope="request"/>
<c:set var="search_accesskey" value="5" scope="request"/>
<c:set var="navlink_accesskey" value="6" scope="request"/>
<c:set var="prev_accesskey" value="7" scope="request"/>
<c:set var="next_accesskey" value="8" scope="request"/>
<c:set var="mainaction_accesskey" value="0" scope="request"/>
<c:if test="${empty param.ajax}"><head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />    
<title><fmt:message key="zimbraTitle"/></title>
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0;"/>
<script type="text/javascript">window.onerror=function(m,u,l){if(window.console){window.console.log("An error occured in: "+u+"\n{\n\tmsg: "+m+",\n\tline: "+l+"\n}");}return false;};</script>
<c:if test="${empty djs or not djs}"><script type="text/javascript">window.currentUrl='<c:url value="${zm:cook(currentUrl)}"><c:param name="ajax" value="true"/></c:url>';
<mo:handleError><c:import url="/m/mojs${dbg ? '?dev=1':''}"/></mo:handleError></script></c:if>
<c:set var="calcss" value=",${sessionScope.zms}-cal"/>
<link href="<c:url value='/css/${sessionScope.zms}${calcss},images.css${not empty param.dev ? "?debug=1" : ""}'/>" type="text/css" rel="stylesheet"/>
</head>
<body onorientationchange="updateOrientation()"><c:if test="${zm:boolean(dbg)}"><!--${ua.userAgent}--></c:if>
<div class="container tbl" id="appbar" align="center"><c:set var="appcount" value="1"/>
    <c:if test="${zm:boolean(mailbox.features.mail)}"><c:set var="appcount" value="${appcount+1}"/></c:if>
    <c:if test="${zm:boolean(mailbox.features.contacts)}"><c:set var="appcount" value="${appcount+1}"/></c:if>
    <c:if test="${zm:boolean(mailbox.features.calendar)}"><c:set var="appcount" value="${appcount+1}"/></c:if>
    <c:if test="${mailbox.features.briefcases || mailbox.features.notebook || mailbox.features.tasks}"><c:set var="appcount" value="${appcount+1}"/></c:if>
    <c:set var="active" value="${empty param.st || param.st eq 'message' || param.st eq 'conversation' || param.st eq 'folders' ? '-active' : ''}"
    /><div class="tr"><c:if test="${zm:boolean(mailbox.features.mail)}"><a style='width: ${95/appcount}%;'  accesskey="${requestScope.mailapp_accesskey}" id="mail" class="mail${active} appTab${active} td" href="${aurl}?st=${mailbox.prefs.groupMailBy}">
            <span onclick="return zClickLink('mail')" class="nstd"><fmt:message key="mail"/></span>
            <span onclick="return zClickLink('mail')" style="display:none;" class="apunread nstd" id="inboxUnread">${mailbox.inbox.unreadCount > 0 ? mailbox.inbox.unreadCount : ''}</span>
        </a></c:if><c:if test="${zm:boolean(mailbox.features.contacts)}"><c:set var="active" value="${param.st eq 'contact' || param.st eq 'ab' ? '-active' : ''}"/>
        <a style='width: ${95/appcount}%;'  accesskey="${requestScope.contactapp_accesskey}" id="contact" class="contact${active} appTab${active} td" href="${aurl}?st=contact">
            <span onclick="return zClickLink('contact')" class="nstd"><fmt:message key="contacts"/></span>
        </a></c:if><c:if test="${zm:boolean(mailbox.features.calendar)}"><c:set var="active" value="${param.st eq 'cal' || param.st eq 'cals' ? '-active' : ''}"/>
        <a style='width: ${95/appcount}%;'  accesskey="${requestScope.calapp_accesskey}" id="cal" class="cal${active} appTab${active} td" href="${aurl}?st=cal">
            <span class="nstd" onclick="return zClickLink('cal')"><fmt:message key="calendar"/></span><fmt:formatDate value="${zm:getToday(mailbox.prefs.timeZone).time}" timeZone="${mailbox.prefs.timeZone}" pattern="EEE|d|MMM" var="today"/><c:set var="darr" value="${fn:split(today,'|')}"/>
            <span onclick="return zClickLink('cal')" style="display:none;" class="aptoday nstd">
                <div class="_day">${darr[0]}</div><div class="_date">${darr[1]}</div><div class="_month">${darr[2]}</div>
            </span>
        </a></c:if><c:if test="${mailbox.features.briefcases || mailbox.features.notebook || mailbox.features.tasks}">
            <c:if test="${not empty param.l_view}"><c:set var="l_view" value="${fn:escapeXml(param.l_view)}" scope="session"/></c:if>
            <c:if test="${empty sessionScope.l_view}"><c:set var="l_view" value="list" scope="session"/></c:if>
            <c:set var="active" value="${param.st eq 'tasks' || param.st eq 'task'|| param.st eq 'briefcase' || param.st eq 'wiki' || param.st eq 'briefcases' || param.st eq 'notebooks' ? '-active' : ''}"/>
        <a style='width: ${98/appcount}%;'  accesskey="${requestScope.fldrapp_accesskey}" id="docs" class="folders${active} docs${active} appTab${active} td" href="${aurl}?st=${mailbox.features.briefcases ? 'briefcases' : (mailbox.features.notebook ? 'notebooks' : 'tasks')}">
            <span class="nstd" onclick="return zClickLink('docs')"><fmt:message key="folders"/></span>
        </a></c:if>
        <c:set var="active" value="${param.search eq '1' ? '' : ''}"/><c:set var="spara" value="search=${param.search eq '1' ? '0' : '1'}"/>
        <a style='width: ${95/appcount}%;'  accesskey="${requestScope.search_accesskey}" id="search" class="search${active} appTab${active} td" href="${aurl}?${spara}" onclick='toggleElem("searchbar",this) ; $("sq").focus(); return false;'>
            <span class="nstd"><fmt:message key="search"/></span>
        </a></div></div>
<div class="loadingDiv hidden" id="loadingDiv" onclick="function(){return requestTimeout(false,'Aborted by user.');}"></div></c:if>
<div class="container" id="maincontainer"><div id="card"><div class="front face cShow" id="front"><c:choose><c:when
        test="${not empty param.appmsg}"><c:set var="statusMessage" value="${fn:escapeXml(param.appmsg)}"/>
            <c:set var="statusClass" value="Info"/>
            <div class="container tbl" id="msgDiv" onclick="return toggleElem(this);"><div id='statusdiv' class="tbl StatusInfo"><span  class='td aleft'><fmt:message key="${fn:escapeXml(param.appmsg)}"/></span><span class='SmlIcnHldr aright right Cancel'></span></div></div>
        </c:when><c:when test="${not empty requestScope.statusMessage}">
            <c:set var="statusMessage" value="${fn:escapeXml(requestScope.statusMessage)}"/>
            <c:set var="statusClass" value="${requestScope.statusClass}"/>
            <div class="container tbl" id="msgDiv" onclick="return toggleElem(this);"><div id='statusdiv' class="tbl ${requestScope.statusClass}"><span class="td aleft">${fn:escapeXml(requestScope.statusMessage)}</span><span class='SmlIcnHldr aright Cancel'></span></div></div>
        </c:when></c:choose>
    <script type="text/javascript">if(window.location.hash&&window.location.hash!=currHash&&XHR!==undefined&&XHR(true)){GC().style.visibility='hidden';}</script>
    <div class="container" id="searchbar" style="${param.search eq '1' ? '' : 'display:none;'}">
        <form method="post" accept-charset="UTF-8" action="${context_url}" onsubmit="if(!this.sq.value){showLoadingMsg('<fmt:message key="actionNoSearchQuerySpecified"/>',true,'Warning',1000);return false;}else{return submitForm(this);}">
            <c:if test="${not empty param.invId}"><input type="hidden" name="invId" value="${zm:cook(param.invId)}"/></c:if><input type="hidden" name="search" value="1"/><c:set var="st" value="${fn:escapeXml(param.st)}"/>
            <c:choose>
                <c:when test="${param.st eq 'folders'}">
                    <c:set var="st" value="${mailbox.prefs.groupMailBy}"/>
                </c:when>
                 <c:when test="${param.st eq 'ab'}">
                     <c:set var="st" value="contact"/>
                </c:when>
                <c:when test="${param.st eq 'cals'}">
                     <c:set var="st" value="cal"/>
                </c:when>
                <c:when test="${param.st eq 'tasks'}">
                     <c:set var="st" value="task"/>
                </c:when>
                <c:when test="${param.st eq 'briefcases'}">
                    <c:set var="st" value="briefcase"/>
                </c:when>
                <c:when test="${param.st eq 'notebooks'}">
                   <c:set var="st" value="wiki"/>
                </c:when>
            </c:choose><input type="hidden" name="crumb" value="${fn:escapeXml(mailbox.accountInfo.crumb)}"/> 
                <div class="tbl">
                    <div class="tr">
                          <span class="td sih aleft"><input type="text" class="searchInput" id="sq" name="sq" value="${zm:cook(param.sq)}"/></span>
                          <span class="td aright" style="white-space:nowrap;"><input type="submit" class="searchButton zo_button" name="actionSearch" value="<fmt:message key="search"/>"/></span>
                    </div>
                </div>
                <div class="tbl avs"><div class="tr">
                    <span class="td aleft">
                        <select name="st" style="border:1px solid gray;">
                                <c:if test="${zm:boolean(mailbox.features.mail)}"><option value="${mailbox.prefs.groupMailBy}" ${empty st or st eq  mailbox.prefs.groupMailBy ? 'selected="selected"' : ''}><fmt:message key="mail"/></option></c:if>
                                <c:if test="${zm:boolean(mailbox.features.contacts)}"><option value="contact" ${st eq 'contact' ? 'selected=selected' : ''}><fmt:message key="contacts"/></option></c:if>
                                <c:if test="${zm:boolean(mailbox.features.gal)}"><option value="gal" ${st eq 'gal' ? 'selected=selected' : ''}><fmt:message key="GAL"/></option></c:if>
                                <c:if test="${zm:boolean(mailbox.features.calendar)}"><option value="cal" ${st eq 'cal' ? 'selected=selected' : ''}><fmt:message key="appointments"/></option></c:if>
                                <c:if test="${zm:boolean(mailbox.features.tasks)}"><option value="task" ${st eq 'task' ? 'selected=selected' : ''}><fmt:message key="tasks"/></option></c:if>
                                <c:if test="${zm:boolean(mailbox.features.notebook)}"><option value="wiki" ${st eq 'wiki' ? 'selected=selected' : ''}><fmt:message key="pages"/></option></c:if>
                                <c:if test="${zm:boolean(mailbox.features.briefcases)}"><option value="briefcase" ${st eq 'briefcase' ? 'selected=selected' : ''}><fmt:message key="files"/></option></c:if>
                            </select>
                     </span>
                    <c:if test="${mailbox.features.advancedSearch}">
                        <span class="td aright"><a href="<c:url value="${context_url}?st=query"><c:param name="s" value="${st}"/></c:url>"><fmt:message key="advancedSearch"/></a></span>
                    </c:if>
                </div></div>
            </form>
    </div>
    <div class="container stb tbl" id="savesearchbar" style="${param.saveSearch eq '1' ? '' : 'display:none;'}">
        <form method="post" accept-charset="UTF-8" action="${context_url}" onsubmit="if(!this.sname.value){showLoadingMsg('<fmt:message key="actionNoNameSpecified"/>',true,'Warning',1000);return false;}else{return submitForm(this);}">
            <input type="hidden" name="query" value="${zm:cook(param.sq)}"/><input type="hidden" name="st" value="${empty param.st? mailbox.prefs.groupMailBy : (param.st eq 'cal' ? 'appointment' : zm:cook(param.st))}"/>
            <input type="hidden" name="doFolderAction" value="1"/>
            <input type="hidden" name="parentid" value="${mailbox.inbox.parentId}"/>
            <input type="hidden" name="crumb" value="${fn:escapeXml(mailbox.accountInfo.crumb)}"/>
            <span style="white-space:nowrap;" class="label td"><fmt:message key="searchNameLabel"/></span>
            <span class="td" style="width:40%"><input type="text" class="searchInput" name="sname" value="${zm:cook(param.sname)}"/></span>
            <span class="td"><input type="submit" class="searchButton zo_button" name="actionSaveSearch" value="<fmt:message key="save"/>"/></span>
        </form>
    </div><mo:handleError>
        <c:import url="/m/zmview" var="response" scope="page"/></mo:handleError><div class="container" id="body">${response}</div>
</div></div></div>
<script type="text/javascript"><c:set var="js">
//This code runs from the ajax response
var nojs = false;
if(window != parent){
    var d = document.getElementById('statusdiv');
    var msg = (d) ? d.innerHTML : null;
    if (msg != null) {
        parent.showLoadingMsg(null, false);
        if(d.className && d.className.indexOf("Status") > -1){
            parent.lfr(self.GC().innerHTML,self.frameElement.id);nojs = true;
        }else{
            nojs = true;
        }
    }
}
<c:if test="${not empty requestScope.title}">
document.title = "<fmt:message key="zimbraTitleLabel"/>"+" "+"${fn:escapeXml(requestScope.title)}";</c:if>
<c:if test="${not empty requestScope.curId}">window.currentDate = '${requestScope.curId}';</c:if>
<c:if test="${not empty requestScope._today}">window._today = '${requestScope._today}';</c:if>
<c:if test="${ua.isiPhone or ua.isiPod or ua.isOsAndroid}">if(dId && dV[dId]){hideDelete(dId);}</c:if>
</c:set>${dbg ? js : zm:yuiCompress(js, 'js')}</script>
<c:if test="${param.st eq 'folders' or param.st eq 'cals' or param.st eq 'tasks' or param.st eq 'ab' or param.st eq 'notebooks' or param.st eq 'briefcases'}">
<div class="tbl"><div class="tr"><div class="td YellowBg small-gray-text"><fmt:message key="MO_MaxFoldersNote"><fmt:param value="${sessionScope.F_LIMIT}"/></fmt:message></div></div></div>
</c:if>
<c:if test="${empty param.ajax}">
    <div class="tbl"><div class="tr">
        <div class="container td" id="userinfo"><c:url var="logoutUrl" value="${context_url}"><c:param name="loginOp" value="logout"/><c:param name="client" value="mobile"/></c:url>
            <span class="logout-span"><a href="${logoutUrl}" id="_logout" noajax='true'><fmt:message key="logOut"/> </a> (${mailbox.accountInfo.attrs["uid"][0]}) </span>
            <span class="quota-span"><fmt:message key="MO_quotaLabel"/>&nbsp;<c:set var="max" value="${mailbox.attrs.zimbraMailQuota[0]}"/><fmt:message var="unlimited" key="unlimited"/><fmt:message key="MO_quotaUsage"><fmt:param value="${zm:displaySizeFractions(pageContext, mailbox.size,2)}"/><fmt:param value="${max==0 ? unlimited : zm:displaySizeFractions(pageContext, max,2)}"/></fmt:message></span>
        </div>
    </div></div>
    <c:if test="${zm:boolean(mailbox.features.options)}">
        <div class="tbl container" style="height:32px;"><div class="tr"><div class="td fw list-row"><a href="?st=prefs"><fmt:message key="options"/></a></div></div></div>
    </c:if>
    <div class="tbl container" style="height:30px;"><div class="tr">
            <div class="td fw list-row"><c:set var="v" value="${ua.isiPhone || ua.isiPod || ua.isOsAndroid? 'iphone' : ( ua.isIE ? 'wm6' : 'xlite')}"/>
                <fmt:message key="lowBandwidth" var="lbw"/>
                <fmt:message key="default" var="def"/>
                <fmt:message key="viewLabel"/>&nbsp;
                <c:if test="${fn:endsWith(sessionScope.zms,'xlite')}"><c:set var="def" value="<a noajax='true' href='?zms=${v}&amp;limit=10'>${def}</a>"/>${def}</c:if>
                <c:if test="${!fn:endsWith(sessionScope.zms,'xlite')}"><c:set var="lbw" value="<a noajax='true' href='?zms=xlite&amp;limit=5'>${lbw}</a>"/>${lbw}</c:if> | <a href="?st=versions"><fmt:message key="more"/>...</a>
            </div>
    </div></div>
    <div class="tbl"><div class="tr"><div class="container td fw" id="copyright_notice">
        <a noajax='true' target="_blank" href="<fmt:message key="logoURL"/>"><fmt:message key="footerCopyright"/></a>
    </div></div></div><c:if test="${empty param.noframe || empty param.isiniframe}">
    <script type="text/javascript"><c:set var="js">
    if (XHR !==undefined && XHR(true)) {if(!nojs && (window == parent)){registerOnclickHook();
        <c:if test="${ua.isiPhone or ua.isiPod or ua.isOsAndroid}">setInterval(function() {checkHash(null,'get');}, 400);</c:if>
        <c:if test="${param.st ne 'newmail' && param.st ne 'compose' && mailbox.features.mail && (empty param.st || param.st eq mailbox.prefs.groupMailBy)}">if(window.location.hash.indexOf('newmail') < 0 && window.location.hash.indexOf('compose') < 0 ){
            setTimeout(function() {ajxReq('<c:url value="/m/zmain?st=newmail"/>',null,null,'get',true);},300);}</c:if>
    }}</c:set>
    ${dbg ? js : zm:yuiCompress(js, 'js')}</script></c:if>
</body></html></c:if>
