<%@ 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="context_url" value="${requestScope.baseURL!=null?requestScope.baseURL:'mainx'}"/>
<c:set var="caction" value="${prevUrl}"/>
<c:choose>
<c:when test="${not empty prevUrl}">
    <c:set var="bt" value="${fn:replace(fn:substringAfter(prevUrl,'?'),'&','|')}"/>
    <c:url var="caction" value='${prevUrl}'/>
</c:when>
<c:when test="${not empty param.bt}">
    <c:set var="bt" value="${zm:cook(param.bt)}"/>
    <c:url var="caction" value='${context_url}?${fn:replace(param.bt,"|","&")}'/>
</c:when>
<c:when test="${empty prevUrl  && empty param.bt && not empty header['referer']}">
    <c:set var="caction" value='${header["referer"]}'/>
    <c:set var="bt"
           value="${fn:replace(fn:replace(fn:substringAfter(header['referer'],'?'),'appmsg=messageSent',''),'&','|')}"/>
</c:when>
</c:choose>
<c:if test="${!fn:containsIgnoreCase(caction, '_back=1')}">
<c:url value="${caction}" var="caction">
    <c:param name="_back" value="1"/>
</c:url>
</c:if>
<mo:handleError>
    <c:set var="context_url" value="${requestScope.baseURL!=null?requestScope.baseURL:'zmain'}"/>
    <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"/>
    <fmt:setBundle basename='/messages/AjxMsg' var='AjxMsg' scope='request' />

    <%--<fmt:message var="title" key="newAppointment"/>--%>                          
    <fmt:message var="hourFmt" key="CAL_APPT_EDIT_HOUR_FORMAT"/>
    <zm:clearApptSummaryCache/>
    <zm:composeUploader var="uploader"/>
    <c:set var="compose" value="${uploader.compose}"/>
    <c:choose>
        <c:when test="${param.useInstance eq '1' and not empty param.exInvId}">
            <c:set var="id" value="${param.exInvId}"/>
            <c:set var="compNum" value="${empty param.exCompNum ? 0 : param.exCompNum}"/>
            <zm:getMessage var="message" id="${id}" markread="true" neuterimages="${empty param.xim}" wanthtml="false"/>
        </c:when>
        <c:when test="${not empty param.invId}">
            <c:set var="id" value="${param.invId}"/>
            <c:set var="compNum" value="${empty param.invCompNum ? 0 : param.invCompNum}"/>
            <zm:getMessage var="message" id="${id}" markread="true" neuterimages="${empty param.xim}" wanthtml="false"/>
        </c:when>
        <c:when test="${not empty param.id}">
            <c:set var="id" value="${param.id}"/>
            <c:set var="compNum" value="${empty param.invCompNum ? 0 : param.invCompNum}"/>
            <zm:getMessage var="message" id="${id}" markread="true" neuterimages="${empty param.xim}" wanthtml="false"/>
        </c:when>
        <c:otherwise>
            <c:set var="message" value="${null}"/>
        </c:otherwise>
    </c:choose>

    <c:set var="appt" value="${empty message ? null : message.invite.component}"/>
    <c:set var="canEditRecurrence" value="${(empty appt or not appt.exception) and not compose.useInstance}"/>
    <c:set var="canDelete" value="${not empty appt}"/>
    <c:set var="hasAttendees" value="${not empty appt and not empty appt.attendees}"/>

    <c:choose>
        <c:when test="${empty compose}">
            <c:if test="${!empty param.date}">
                <fmt:parseDate pattern="yyyyMMdd" timeZone="${mailbox.prefs.timeZone}" var="parsedDate" value="${param.date}"/>
            </c:if>
            <zm:messageCompose var="compose" message="${message}" action="${empty message ? 'apptnew' : 'apptedit'}"
                               date="${empty parsedDate ? requestScope.dateContext : zm:getCalendarMidnight(parsedDate.time, mailbox.prefs.timeZone)}"
                               inviteId="${empty param.invId? param.id : param.invId}"
                               istask="${param.st eq 'newtask'}"
                               exceptionInviteId="${empty param.exInvId? null : param.exInvId}"
                               useInstance="${param.useInstance eq '1'}"
                               instanceStartTime="${zm:nonNull(param.instStartTime)}"
                               instanceDuration="${zm:nonNull(param.instDuration)}"/>
        </c:when>
        <c:when test="${uploader.isUpload and not empty message}">
            <zm:fixupMessageCompose message="${message}" compose="${compose}"
                                    newattachments="${uploader.compose.hasFileItems}"/>
        </c:when>
    </c:choose>

    <c:choose>
        <c:when test="${empty compose.inviteId}">
            <c:set var="apptImage" value="calendar/ImgNewAppointment.png"/>
            <c:set var="apptImageAlt" value="ALT_NEW_APPOINTMENT"/>
            <fmt:message var="apptSubject" key="${param.st eq 'newtask' ? 'newTask' : 'newAppointment'}"/>
            <c:set var="isNewAppt" value="${true}"/>
        </c:when>
        <c:otherwise>
            <c:set var="apptImage" value="startup/ImgAppointment.png"/>
            <c:set var="apptImageAlt" value="ALT_EDIT_APPOINTMENT"/>
            <c:set var="apptSubject" value="${compose.subject}"/>
            <c:set var="closeImage" value="common/ImgClose.png"/>
            <c:set var="isNewAppt" value="${false}"/>
        </c:otherwise>
    </c:choose>
    <c:set var="isInstance"
           value="${not empty appt and (appt.exception or not empty appt.recurrence) and compose.useInstance}"/>

</mo:handleError>
<fmt:message var="title" key="ALT_MSG_STATUS_APPT"/>
<fmt:message var="addedit" key="${empty message ? 'add' : 'edit'}"/>
<c:set var="title" value="${title} : ${addedit}" scope="request"/>
<form action="?st=${zm:cook(param.st)}&more=true&bt=${zm:cook(bt)}" method="post" enctype="multipart/form-data" accept-charset="utf-8" onsubmit="return submitForm(this,'aniframe1');">
<input type="hidden" name="crumb" value="${fn:escapeXml(mailbox.accountInfo.crumb)}"/>
<c:choose>
    <c:when test="${ua.isiPad eq true}">
        <div class="composeToolbar">
            <div class="compose button"><span><input class="zo_button" name="actionSave" type="submit" value="<fmt:message key="save"/>"></span></div>
            <div class="buttonRight button" onclick="return toggleCompose('compose-pop','veil');"><span><fmt:message key="cancel"/></span></div>
        </div>
    </c:when>
    <c:otherwise>
        <div class="tbl tb"><div class="tr"><div class="td">
            <span class="zo_tb_submit"><a href="${zm:cook(caction)}" class="zo_button"><fmt:message key="cancel"/></a></span>
            <span class='zo_tb_submit'><input class="zo_button" name="actionSave" type="submit" value="<fmt:message key="save"/>"></span>
        </div>
        </div></div>
    </c:otherwise>
</c:choose>
<div class="Stripes cmp_appt_container ${ua.isiPad eq true ? 'composeFields' : ''}">
<c:if test="${ua.isiPad == true}">
        <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>
</c:if>
<fmt:message key="newTask" var="newTaskSub"/>
<div class="sectionLbl"><b>${fn:escapeXml(zm:truncate(apptSubject, 24, true))}</b></div>
<c:if test="${zm:boolean(isInstance)}"><div class="View"><div class="tbl"><div class="tr">
                <span class="td ZhApptRecurrInfo"><app:img src="dwt/ImgInformation.png"/></span>
                <span class="td">
                    <c:url value="${context_url}?st=newappt&bt=${bt}&useInstance=0&invId=${id}" var="apptUrl"/><fmt:message key="apptInstNote"/>
                    <hr size="1"><a href="${zm:cook(apptUrl)}"><fmt:message key="apptInstEditSeries"/></a>
                </span>
</div></div></div></c:if>
<div class="View"><div class="tbl">
    <div class="tr cmp_to_row">
        <span class="label td"><fmt:message key="subjectLabel"/></span>
        <span class="td value" style="padding:0px; text-align:left;"><input type="text" class="Textarea" value="${fn:escapeXml(compose.subject)}" name="subject"></span>
    </div><div class="tr nr">
        <span class="label td"><fmt:message key="locationLabel"/></span>
        <span class="td value" style="padding:0px; text-align:left;"><input class="Textarea" type="text" value="${fn:escapeXml(compose.location)}" name="location"></span>
    </div>
</div></div>
<div class="View"><div class="tbl">
    <div class="tr cmp_to_row">
        <span class="label td"><fmt:message key="startLabel"/></span>
        <span class="td value1" style="padding:0px; text-align:left;"><input class="Textarea" id="start" type=text size="12" maxlength="20" name="startDate" value="${fn:escapeXml(compose.startDate)}">
            <c:if test="${param.st ne 'newtask'}">
            <fmt:message key="at"/>
            <select name="startHour"><c:set var="h" value="${compose.startHour}"/>
            <c:forEach var="hi" begin="0" end="23"><option value="${hi}" <c:if test="${h eq hi}"> selected</c:if>><fmt:formatDate value="${zm:getTodayHour(hi, tz).time}" pattern="${hourFmt}"/></option></c:forEach>
            </select>
            <select name="startMinute"><c:set var="m" value="${compose.startMinute}"/>
                <option <c:if test="${m eq 0}">selected </c:if> value="0">:00</option>
                <option <c:if test="${m eq 5}">selected </c:if> value="5">:05</option>
                <option <c:if test="${m eq 10}">selected </c:if> value="10">:10</option>
                <option <c:if test="${m eq 15}">selected </c:if> value="15">:15</option>
                <option <c:if test="${m eq 20}">selected </c:if> value="20">:20</option>
                <option <c:if test="${m eq 25}">selected </c:if> value="25">:25</option>
                <option <c:if test="${m eq 30}">selected </c:if> value="30">:30</option>
                <option <c:if test="${m eq 35}">selected </c:if> value="35">:35</option>
                <option <c:if test="${m eq 40}">selected </c:if> value="40">:40</option>
                <option <c:if test="${m eq 45}">selected </c:if> value="45">:45</option>
                <option <c:if test="${m eq 50}">selected </c:if> value="50">:50</option>
                <option <c:if test="${m eq 55}">selected </c:if> value="55">:55</option>
            </select>
            </c:if>
        </span>
    </div><div class="tr nr cmp_to_row">
        <span class="label td"><fmt:message key="endLabel"/></span>
        <span class="td value1" style="padding:0px; text-align:left;"><input class="Textarea" id="end" type=text size="12" maxlength="20" name="endDate" value="${fn:escapeXml(compose.endDate)}">
            <c:if test="${param.st ne 'newtask'}">
            <fmt:message key="at"/>
            <select name="endHour"><c:set var="h" value="${compose.endHour}"/>
            <c:forEach var="hi" begin="0" end="23"><option value="${hi}" <c:if test="${h eq hi}"> selected</c:if>><fmt:formatDate value="${zm:getTodayHour(hi, null).time}" pattern="${hourFmt}"/></option></c:forEach>
            </select>
            <select name="endMinute"><c:set var="m" value="${compose.endMinute}"/>
                <option <c:if test="${m eq 0}">selected </c:if> value="0">:00</option>
                <option <c:if test="${m eq 5}">selected </c:if> value="5">:05</option>
                <option <c:if test="${m eq 10}">selected </c:if> value="10">:10</option>
                <option <c:if test="${m eq 15}">selected </c:if> value="15">:15</option>
                <option <c:if test="${m eq 20}">selected </c:if> value="20">:20</option>
                <option <c:if test="${m eq 25}">selected </c:if> value="25">:25</option>
                <option <c:if test="${m eq 30}">selected </c:if> value="30">:30</option>
                <option <c:if test="${m eq 35}">selected </c:if> value="35">:35</option>
                <option <c:if test="${m eq 40}">selected </c:if> value="40">:40</option>
                <option <c:if test="${m eq 45}">selected </c:if> value="45">:45</option>
                <option <c:if test="${m eq 50}">selected </c:if> value="50">:50</option>
                <option <c:if test="${m eq 55}">selected </c:if> value="55">:55</option>
            </select>
            </c:if>
     </span>
    </div>
</div></div>
<div class="View">
    <c:if test="${param.st eq 'newtask'}"><div class="tbl"><div class="tr">
        <span class="label td"><fmt:message key="priority"/></span>
        <span class="value td" style="padding:0px; text-align:left;">
            <select name="taskPriority" id="priority">
                <option <c:if test="${compose.taskPriority eq '9'}">selected </c:if>value="9"><fmt:message key="taskPrioLow"/></option>
                <option <c:if test="${compose.taskPriority eq '5'}">selected </c:if>value="5"><fmt:message key="taskPrioNormal"/></option>
                <option <c:if test="${compose.taskPriority eq '1'}">selected </c:if>value="1"><fmt:message key="taskPrioHigh"/></option>
            </select>
        </span>
    </div><div class="tr nr">
        <span class="label td"><fmt:message key="status"/></span>
        <span class="td value1" style="padding:0px; text-align:left;">
            <select name="taskStatus" id="status">
                <option id="NEED" <c:if test="${compose.taskStatus eq 'NEED'}">selected </c:if>value="NEED"><fmt:message key="TASK_NEED"/></option>
                <option id="COMP" <c:if test="${compose.taskStatus eq 'COMP'}">selected </c:if>value="COMP"><fmt:message key="TASK_COMP"/></option>
                <option id="INPR" <c:if test="${compose.taskStatus eq 'INPR'}">selected </c:if>value="INPR"><fmt:message key="TASK_INPR"/></option>
                <option <c:if test="${compose.taskStatus eq 'WAITING'}">selected </c:if>value="WAITING"><fmt:message key="TASK_WAITING"/></option>
                <option <c:if test="${compose.taskStatus eq 'DEFERRED'}">selected </c:if>value="DEFERRED"><fmt:message key="TASK_DEFERRED"/></option>
            </select>
            <select name="taskPercentComplete" id="percent">
                <option id="percent0" <c:if test="${compose.taskPercentComplete eq '0'}">selected </c:if>value="0">0%</option>
                <option <c:if test="${compose.taskPercentComplete eq '10'}">selected </c:if>value="10">10%</option>
                <option <c:if test="${compose.taskPercentComplete eq '20'}">selected </c:if>value="20">20%</option>
                <option <c:if test="${compose.taskPercentComplete eq '30'}">selected </c:if>value="30">30%</option>
                <option <c:if test="${compose.taskPercentComplete eq '40'}">selected </c:if>value="40">40%</option>
                <option <c:if test="${compose.taskPercentComplete eq '50'}">selected </c:if>value="50">50%</option>
                <option <c:if test="${compose.taskPercentComplete eq '60'}">selected </c:if>value="60">60%</option>
                <option <c:if test="${compose.taskPercentComplete eq '70'}">selected </c:if>value="70">70%</option>
                <option <c:if test="${compose.taskPercentComplete eq '80'}">selected </c:if>value="80">80%</option>
                <option <c:if test="${compose.taskPercentComplete eq '90'}">selected </c:if>value="90">90%</option>
                <option id="percent100" <c:if test="${compose.taskPercentComplete eq '100'}">selected </c:if>value="100">100%</option>
            </select>
        </span>
    </div></div></c:if>
    <c:if test="${param.st ne 'newtask'}"><div class="tbl"><div class="tr">
        <span class="td label"><fmt:message key="showAsLabel"/></span>
        <span class="td value" style="padding:0px; text-align:left;"><select name="freeBusyStatus" id="showAs">
            <option <c:if test="${compose.freeBusyStatus eq 'F'}">selected </c:if>value="F"><fmt:message key="free"/></option>
            <option <c:if test="${compose.freeBusyStatus eq 'T'}">selected </c:if> value="T"><fmt:message key="tentative"/></option>
            <option <c:if test="${compose.freeBusyStatus eq 'B'}">selected </c:if> value="B"><fmt:message key="busy"/></option>
            <option <c:if test="${compose.freeBusyStatus eq 'O'}">selected </c:if> value="O"><fmt:message key="outOfOffice"/></option>
        </select></span>
    </div><div class="tr nr">
    <span class="td label"><fmt:message key="markAsLabel"/></span>
        <span class="td value" style="padding:0px; text-align:left;"><select name="classProp" id="markAs">
            <option <c:if test="${compose.classProp eq 'PUB'}">selected </c:if> value="PUB"><fmt:message key="public"/></option>
            <option <c:if test="${compose.classProp eq 'PRI'}">selected </c:if> value="PRI"><fmt:message key="private"/></option>
        </select></span>
        </div></div>
    </c:if>
</div>
<c:if test="${param.st ne 'newtask'}">
<div class="View"><div class="tbl"><div class="tr">
    <span class="td left"><input id="allday" type=checkbox name="allDay" <c:if test="${zm:boolean(compose.allDay)}">checked="checked"</c:if> value="1"> <fmt:message key="allDayEvent"/></span>
    <span class="td right"><span style="display:none;" id="showHide">
        <a id="showHideLink" href="?more=1&${zm:cook(pageContext.request.queryString)}" onclick="return toggleElem('apt_dtls_div',this,'<fmt:message key="hide"/>','<fmt:message key="more"/>')"><fmt:message key="more"/> </a>
    </span></span>
</div></div></div>
</c:if><c:if test="${param.st eq 'newtask'}"><div class="View value cmp_body">
    <textarea class='Textarea' id="bodyField" cols="39" name="body">${fn:escapeXml(empty compose.content ? compose.description : compose.content)}</textarea>
</div></c:if>
<c:set var="numCalendars" value="0"/>
    <zm:forEachFolder var="folder">
        <c:choose>
            <c:when test="${param.st eq 'newtask' and folder.isTaskView and folder.isTaskMoveTarget}">
                <c:set var="numCalendars" value="${numCalendars+1}"/>
            </c:when>
            <c:when test="${param.st ne 'newtask' and folder.isAppointmentView and folder.isAppointmentMoveTarget}">
                <c:set var="numCalendars" value="${numCalendars+1}"/>
            </c:when>
        </c:choose>
    </zm:forEachFolder>
<c:if test="${numCalendars gt 1}">
    <div class="View"><div class="tbl"><div class="tr">
        <span class="td label"><c:if test="${param.st eq 'newtask'}"><fmt:message key="taskList"/></c:if><c:if test="${param.st ne 'newtask'}"><fmt:message key="calendarLabel"/></c:if></span>
         <span class="td value" style="padding:0px; text-align:left;"><select name='apptFolderId' id="apptFolderId"><c:set var="count" value="${0}"/>
             <zm:forEachFolder var="folder">
                 <c:set var="folderName" value="${zm:getFolderName(pageContext, folder.id)}"/>
                 <c:if test="${count lt sessionScope.F_LIMIT and param.st ne 'newtask' and folder.isAppointmentView and folder.isAppointmentMoveTarget }">
                     <c:choose>
                        <c:when test="${not empty param.invId && (compose.apptFolderId eq folder.canonicalId)}">
                            <option value="${folder.id}" selected='selected'>${folderName}</option>
                        </c:when>
                        <c:when test="${empty param.invId && not empty sessionScope.calendar && (sessionScope.calendar.id eq folder.canonicalId)}">
                            <option value="${folder.id}" selected='selected'>${folderName}</option>
                        </c:when>
                        <c:otherwise>
                            <option value="${folder.id}">${folderName}</option>
                        </c:otherwise>
                     </c:choose>
                     <c:set var="count" value="${count+1}"/>
                 </c:if>
                 <c:if test="${count lt sessionScope.F_LIMIT and param.st eq 'newtask' and folder.isTaskView and folder.isTaskMoveTarget }">
                     <option value="${folder.id}" <c:if test="${compose.apptFolderId eq folder.canonicalId}">selected='selected'</c:if>>${folderName}</option>
                     <c:set var="count" value="${count+1}"/>
                 </c:if>
             </zm:forEachFolder>
         </select></span>
    </div>
    </div>
    </div>
</c:if>                            
<div id="apt_dtls_div">
<c:if test="${param.st ne 'newtask'}">
<div class="View" style="overflow:visible"><div class="tbl"><div class="tr">
    <span class="label td"><fmt:message key="repeatLabel"/></span>
    <span class="value td" style="padding:0px; text-align:left;">
        <input type=radio name='repeatType' <c:if test="${compose.repeatType eq 'NONE'}">checked="checked"</c:if> value="NONE"><fmt:message key="recurNone"/>
        <input type=radio id="rpttypeid" name='repeatType' value="BASIC" <c:if test="${compose.repeatType eq 'BASIC'}">checked="checked"</c:if>>
        <select name="repeatBasicType" onchange="document.getElementById('rpttypeid').checked='checked';">
            <option value="DAILY" <c:if test="${compose.repeatBasicType eq 'DAILY'}">selected </c:if>><fmt:message key="recurBasicSelectDaily"/></option>
            <option value="WEEKLY" <c:if test="${compose.repeatBasicType eq 'WEEKLY'}">selected </c:if>><fmt:message key="recurBasicSelectWeekly"/></option>
            <option value="MONTHLY" <c:if test="${compose.repeatBasicType eq 'MONTHLY'}">selected </c:if>><fmt:message key="recurBasicSelectMonthly"/></option>
            <option value="YEARLY" <c:if test="${compose.repeatBasicType eq 'YEARLY'}">selected </c:if>><fmt:message key="recurBasicSelectYearly"/></option>
        </select>
    </span></div>
    <c:if test="${mailbox.prefs.useTimeZoneListInCalendar or not zm:isSameTimeZone(compose.timeZone, mailbox.prefs.timeZoneCanonicalId)}">
    <c:set var="addedTimeZone" value="true"/>
    <div class="tr nr"><span class="label td"><fmt:message key="timeZonePrefLabel"/></span>
            <span class="value td" style="padding:0px; text-align:left;"><select name="timeZone" id="timeZone">
                <zm:forEachTimeZone var="tz"><fmt:message var="displayName" bundle='${AjxMsg}' key="${tz.id}"/>
                    <option <c:if test="${compose.timeZone eq tz.id}">selected</c:if> value="${fn:escapeXml(tz.id)}">${fn:escapeXml(displayName)}</option>
                </zm:forEachTimeZone>
            </select></span></div>
    </c:if></div>
<c:if test="${mailbox.features.groupcalendarEnabled}">
    <div class="tbl"><div class="tr nr"><span class="td label"><fmt:message key="attendeesLabel"/></span>
        <span class="td value" style="padding:0px; text-align:left;"><div class="ZhAC ZhACTo">
        <input class="Textarea" id="attField" rows="1" type="text" name="attendees" autocorrect="off" autocomplete="off" value="${fn:escapeXml(compose.attendees)}"/><br/><div class='ZhACCont' id="attContainer" style='width:99%;top:1.5em;'></div>
</div></span></div></div></c:if>
</div><div class="View value cmp_body" style="height:200px;">
    <textarea class='Textarea' id="bodyField" cols="39" rows="20" name="body" style="height:200px;">${fn:escapeXml(empty compose.content ? compose.description : compose.content)}</textarea>
</div></c:if>
</div>
</div>
<c:if test="${ua.isiPad eq false}">
<div class="tbl tb"><div class="tr"><div class="td">
    <span class="zo_tb_submit">
        <a href="${zm:cook(caction)}" class="zo_button"><fmt:message key="cancel"/></a>
    </span>
    <span class='zo_tb_submit'>
        <input class="zo_button" name="actionSave" type="submit" value="<fmt:message key="save"/>">
</span></div></div></div>
</c:if>    
<input type="hidden" name="apptFolderId" value="${fn:escapeXml(compose.apptFolderId)}"/>
<input type="hidden" name="invId" value="${fn:escapeXml(compose.inviteId)}"/>
<input type="hidden" name="exInvId" value="${fn:escapeXml(compose.exceptionInviteId)}"/>
<input type="hidden" name="useInstance" value="${fn:escapeXml(compose.useInstance ? '1' : '0') }"/>
<input type="hidden" name="instStartTime" value="${fn:escapeXml(compose.instanceStartTime)}"/>
<input type="hidden" name="instDuration" value="${fn:escapeXml(compose.instanceDuration)}"/>
<c:if test="${not addedTimeZone}">
    <input type="hidden" name="timeZone" value="${fn:escapeXml(compose.timeZone)}"/>
</c:if>
<input type="hidden" name="repeatType" value="${fn:escapeXml(compose.repeatType)}"/>
<input type="hidden" name="repeatDailyInterval" value="${fn:escapeXml(compose.repeatDailyInterval)}"/>
<input type="hidden" name="repeatWeeklyByDay" value="${fn:escapeXml(compose.repeatWeeklyByDay)}"/>
<input type="hidden" name="repeatWeeklyInterval" value="${fn:escapeXml(compose.repeatWeeklyInterval)}"/>
<input type="hidden" name="repeatWeeklySun" value="${fn:escapeXml(compose.repeatWeeklySun) ? '1' : '0'}"/>
<input type="hidden" name="repeatWeeklyMon" value="${fn:escapeXml(compose.repeatWeeklyMon) ? '1' : '0'}"/>
<input type="hidden" name="repeatWeeklyTue" value="${fn:escapeXml(compose.repeatWeeklyTue) ? '1' : '0'}"/>
<input type="hidden" name="repeatWeeklyWed" value="${fn:escapeXml(compose.repeatWeeklyWed) ? '1' : '0'}"/>
<input type="hidden" name="repeatWeeklyThu" value="${fn:escapeXml(compose.repeatWeeklyThu) ? '1' : '0'}"/>
<input type="hidden" name="repeatWeeklyFri" value="${fn:escapeXml(compose.repeatWeeklyFri) ? '1' : '0'}"/>
<input type="hidden" name="repeatWeeklySat" value="${fn:escapeXml(compose.repeatWeeklySat) ? '1' : '0'}"/>
<input type="hidden" name="repeatMonthlyInterval" value="${fn:escapeXml(compose.repeatMonthlyInterval)}"/>
<input type="hidden" name="repeatMonthlyMonthDay" value="${fn:escapeXml(compose.repeatMonthlyMonthDay)}"/>
<input type="hidden" name="repeatMonthlyRelativeInterval" value="${fn:escapeXml(compose.repeatMonthlyRelativeInterval)}"/>
<input type="hidden" name="repeatMonthlyRelativeOrd" value="${fn:escapeXml(compose.repeatMonthlyRelativeOrd)}"/>
<input type="hidden" name="repeatMonthlyRelativeDay" value="${fn:escapeXml(compose.repeatMonthlyRelativeDay)}"/>
<input type="hidden" name="repeatYearlyMonthDay" value="${fn:escapeXml(compose.repeatYearlyMonthDay)}"/>
<input type="hidden" name="repeatYearlyMonth" value="${fn:escapeXml(compose.repeatYearlyMonth)}"/>
<input type="hidden" name="repeatYearlyRelativeOrd" value="${fn:escapeXml(compose.repeatYearlyRelativeOrd)}"/>
<input type="hidden" name="repeatYearlyRelativeDay" value="${fn:escapeXml(compose.repeatYearlyRelativeDay)}"/>
<input type="hidden" name="repeatYearlyRelativeMonth" value="${fn:escapeXml(compose.repeatYearlyRelativeMonth)}"/>
<input type="hidden" name="repeatEndType" value="${fn:escapeXml(compose.repeatEndType)}"/>
<input type="hidden" name="repeatEndCount" value="${fn:escapeXml(compose.repeatEndCount)}"/>
<input type="hidden" name="repeatEndDate" value="${fn:escapeXml(compose.repeatEndDate)}"/>
</form>

<c:if test="${not empty requestScope.compAction and ua.isiPad eq true}">
<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.ZmiPadCal.processPostComposeAction(document.getElementById('msgDiv').innerHTML, "${requestScope.compAction}",document.getElementById('pAjax').innerHTML, self.frameElement.id);nojs = true;
        }else{
            nojs = true;
        }
    }
}
</c:set>${dbg ? js : zm:yuiCompress(js, 'js')}</script>
</c:if>

<script type="text/javascript"><c:set var="js">
<c:if test="${empty param.more and param.st ne 'newtask'}">
document.getElementById('apt_dtls_div').style.display = 'none';
document.getElementById('showHide').style.display = '';
</c:if>
<c:if test="${empty param.isinframe and empty requestScope.compAction}">
	<c:if test="${param.st ne 'newtask'}">
	AC("attField","attContainer");
	</c:if>
</c:if>
</c:set>${zm:yuiCompress(js,'js')}</script>