<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="<inp2:m_Compress files='js/uploader/upload_manager.js|js/uploader/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>

<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 design="form_row" prefix="mailing-list" field="To" title="la_fld_To" size="60">
				<td class="control-cell">
					<inp2:m_if check="{$prefix}_IsManualRecipient">
						<input style="width: 100%;" type="text" name="<inp2:{$prefix}_InputName field="$field"/>" id="<inp2:{$prefix}_InputName field="$field"/>" value="<inp2:{$prefix}_Field field="$field"/>" tabindex="<inp2:m_get param="tab_index"/>" size="<inp2:m_param name="size"/>">
					<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>

			<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}" allow_html="1" rows="10" cols="75"/>
				<inp2:m_RenderElement name="inp_edit_textarea" prefix="mailing-list" field="MessageText" title="la_fld_TextVersion" control_options="{min_height: 140}" rows="10" cols="75"/>
			<inp2:m_else/>

				<inp2:m_RenderElement design="form_row" prefix="mailing-list" field="MessageHtml" title="la_fld_HtmlVersion">
					<td class="control-cell" valign="top">
						<iframe src="<inp2:m_Link {$prefix}_event='OnGetHtmlBody' pass='m,$prefix'/>" style="border: 1px solid black;" width="640" height="250" align="left">
							You browser doesn't support frames!
						</iframe>
					</td>
				</inp2:m_RenderElement>

				<inp2:m_RenderElement design="form_row" prefix="mailing-list" field="MessageText" title="la_fld_TextVersion">
					<td class="control-cell" valign="top">
						<div style="border: 1px solid black; width: 624px; height: 234px; padding: 8px; font-family: serif; font-size: 16px; overflow: auto;">
							<inp2:$prefix_Field name="$field" nl2br="1"/>
						</div>
					</td>
				</inp2:m_RenderElement>
			</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"/>