<inp2:adm_SetPopupSize width="865" height="640"/>

<inp2:m_include t="incs/header"/>
<inp2:m_RenderElement name="combined_header" section="in-portal:mailing_lists" prefix="mailing-list" title_preset="mailing_list_edit"/>

<!-- ToolBar -->
<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
<tbody>
	<tr>
  	<td>
  		<script type="text/javascript">
				a_toolbar = new ToolBar();

				<inp2:m_if check="mailing-list_IsNewItem">
					a_toolbar.AddButton(
						new ToolBarButton(
							'select',
							'<inp2:m_phrase label="la_ToolTip_Send" escape="1"/>',
							function() {
								submit_event('mailing-list', '<inp2:mailing-list_SaveEvent/>');
							}
						)
					);
				</inp2:m_if>

				a_toolbar.AddButton(
					new ToolBarButton(
						'cancel',
						'<inp2:m_phrase label="la_ToolTip_Close" escape="1"/>',
						function() {
							submit_event('mailing-list', 'OnGoBack');
						}
				 	)
				);

				a_toolbar.AddButton( new ToolBarSeparator('sep1') );

				a_toolbar.AddButton(
					new ToolBarButton(
						'prev',
						'<inp2:m_phrase label="la_ToolTip_Prev" escape="1"/>',
						function() {
							go_to_id('mailing-list', '<inp2:mailing-list_PrevId/>');
						}
				 	)
				);

				a_toolbar.AddButton(
					new ToolBarButton(
						'next',
						'<inp2:m_phrase label="la_ToolTip_Next" escape="1"/>',
						function() {
							go_to_id('mailing-list', '<inp2:mailing-list_NextId/>');
						}
				 	)
				);

				a_toolbar.Render();

				<inp2:m_if check="mailing-list_IsSingle">
					a_toolbar.HideButton('prev');
					a_toolbar.HideButton('next');
					a_toolbar.HideButton('sep1');
				<inp2:m_else/>
					<inp2:m_if check="mailing-list_IsLast">
						a_toolbar.DisableButton('next');
					</inp2:m_if>
					<inp2:m_if check="mailing-list_IsFirst">
						a_toolbar.DisableButton('prev');
					</inp2:m_if>
				</inp2:m_if>
			</script>

			<script type="text/javascript" src="js/swfobject.js"></script>
			<script type="text/javascript" src="js/uploader.js"></script>
		</td>
	</tr>
</tbody>
</table>

<inp2:mailing-list_SaveWarning name="grid_save_warning"/>
<inp2:mailing-list_ErrorWarning name="form_error_warning"/>

<inp2:m_DefineElement name="recipient_element">
	&lt;<inp2:m_Param name="recipient_name"/>&gt;
	<inp2:m_if check="m_Param" name="not_last">; </inp2:m_if>
</inp2:m_DefineElement>

<inp2:m_DefineElement name="inp_recipient_box" class="" format="" is_last="" maxlength="" onblur="" onchange="" size="" onkeyup="" hint_label="" style="width: 100%">
	<inp2:m_if check="{$prefix}_FieldVisible" field="$field">
		<tr class="<inp2:m_odd_even odd='edit-form-odd' even='edit-form-even'/>">
			<inp2:m_RenderElement name="inp_edit_field_caption" prefix="$prefix" field="$field" title="$title" hint_label="$hint_label" is_last="$is_last"/>
			<td class="control-cell">
				<inp2:m_if check="{$prefix}_IsManualRecipient">
					<input style="<inp2:m_Param name="style"/>" type="text" name="<inp2:{$prefix}_InputName field="$field"/>" id="<inp2:{$prefix}_InputName field="$field"/>" value="<inp2:{$prefix}_Field field="$field" format="$format"/>" tabindex="<inp2:m_get param="tab_index"/>" size="<inp2:m_param name="size"/>" maxlength="<inp2:m_param name="maxlength"/>">
				<inp2:m_else/>
					<inp2:$prefix_PrintRecipients render_as="recipient_element" strip_nl="2"/>
					<inp2:m_RenderElement name="inp_edit_hidden" prefix="$prefix" field="$field"/>
				</inp2:m_if>
			</td>
			<inp2:m_RenderElement name="inp_edit_error" pass_params="1"/>
		</tr>
	</inp2:m_if>
</inp2:m_DefineElement>

<div id="scroll_container">
	<table class="edit-form">

		<inp2:m_RenderElement name="subsection" title="la_section_General"/>
			<inp2:m_RenderElement name="inp_id_label" prefix="mailing-list" field="MailingId" title="la_fld_Id"/>
			<inp2:m_RenderElement name="inp_recipient_box" prefix="mailing-list" field="To" title="la_fld_To" size="60"/>

			<inp2:m_if check="mailing-list_IsNewItem">
				<inp2:m_RenderElement name="inp_edit_box" prefix="mailing-list" field="Subject" title="la_fld_Subject" size="60"/>
				<inp2:m_RenderElement name="inp_edit_swf_upload" prefix="mailing-list" field="Attachments" title="la_fld_Attachment"/>
				<inp2:m_RenderElement name="inp_label" prefix="mailing-list" field="Status" title="la_fld_Status"/>

			<inp2:m_else/>
				<inp2:m_RenderElement name="inp_label" prefix="mailing-list" field="Subject" title="la_fld_Subject"/>
				<inp2:m_RenderElement name="inp_label" prefix="mailing-list" field="Attachments" title="la_fld_Attachment"/>
				<inp2:m_RenderElement name="inp_label" prefix="mailing-list" field="Status" title="la_fld_Status"/>
				<inp2:m_RenderElement name="inp_label" prefix="mailing-list" field="EmailsQueued" title="la_fld_EmailsQueued"/>
				<inp2:m_RenderElement name="inp_label" prefix="mailing-list" field="EmailsSent" title="la_fld_EmailsSent"/>
				<inp2:m_RenderElement name="inp_label" prefix="mailing-list" field="EmailsTotal" title="la_fld_EmailsTotal"/>
			</inp2:m_if>

		<inp2:m_RenderElement name="subsection" title="la_section_Message"/>

			<inp2:m_if check="mailing-list_IsNewItem">
				<inp2:m_RenderElement name="inp_edit_textarea" prefix="mailing-list" field="MessageHtml" title="la_fld_HtmlVersion" control_options="{min_height: 140}" rows="10" cols="75"/>
				<inp2:m_RenderElement name="inp_edit_textarea" prefix="mailing-list" field="MessageText" allow_html="0" title="la_fld_TextVersion" control_options="{min_height: 140}" rows="10" cols="75"/>
			<inp2:m_else/>
				<inp2:m_RenderElement name="inp_label" prefix="mailing-list" field="MessageHtml" title="la_fld_HtmlVersion"/>
				<inp2:m_RenderElement name="inp_label" prefix="mailing-list" field="MessageText" title="la_fld_TextVersion" nl2br="1"/>
			</inp2:m_if>

		<inp2:m_RenderElement name="inp_edit_filler"/>
	</table>

	<input type="hidden" name="mailing_recipient_type" value="<inp2:m_Get name='mailing_recipient_type'/>"/>
</div>

<inp2:m_include t="incs/footer"/>