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

<inp2:m_Get var="form_id" result_to_var="form_id"/>
<inp2:m_RenderElement name="combined_header" section="in-portal:submissions:$form_id" prefix="formsubs" title_preset="formsubs_view"/>

<!-- 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();

				a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
							submit_event('formsubs','OnCancelEdit');
						}
				 ) );

				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('formsubs', '<inp2:formsubs_PrevId/>');
						}
				 ) );
				a_toolbar.AddButton( new ToolBarButton('next', '<inp2:m_phrase label="la_ToolTip_Next" escape="1"/>', function() {
							go_to_id('formsubs', '<inp2:formsubs_NextId/>');
						}
				 ) );

				//a_toolbar.AddButton( new ToolBarSeparator('sep2') );

				a_toolbar.Render();

				<inp2:m_if check="formsubs_IsSingle" >
					a_toolbar.HideButton('prev');
					a_toolbar.HideButton('next');
					a_toolbar.HideButton('sep1');
					//a_toolbar.HideButton('sep2');
				<inp2:m_else/>
					<inp2:m_if check="formsubs_IsLast" >
						a_toolbar.DisableButton('next');
					</inp2:m_if>
					<inp2:m_if check="formsubs_IsFirst" >
						a_toolbar.DisableButton('prev');
					</inp2:m_if>
				</inp2:m_if>
			</script>
		</td>
	</tr>
</tbody>
</table>

<inp2:m_DefineElement name="form_field_text">
	<inp2:m_if check="FieldEquals" field="Validation" value="1">
		<a href="mailto:<inp2:SubmissionTag tag="Field"/>"><inp2:SubmissionTag tag="Field"/></a>
	<inp2:m_else/>
		<inp2:SubmissionTag tag="Field"/>
	</inp2:m_if>
</inp2:m_DefineElement>

<inp2:m_DefineElement name="form_field_password">
	<inp2:SubmissionTag tag="Field"/>
</inp2:m_DefineElement>

<inp2:m_DefineElement name="form_field_option">
		<option value="<inp2:m_param name="key"/>"<inp2:m_param name="selected"/>><inp2:m_param name="option"/></option>
</inp2:m_DefineElement>

<inp2:m_DefineElement name="form_field_select">
	<inp2:SubmissionTag tag="Field"/>
</inp2:m_DefineElement>

<inp2:m_DefineElement name="form_field_checkbox">
	<input type="hidden" id="<inp2:CustomInputName/>" name="<inp2:CustomInputName/>" value="<inp2:SubmissionTag tag="Field" field="$field" db="db"/>">
	<input disabled="disabled" tabindex="<inp2:m_get param="tab_index"/>" type="checkbox" id="_cb_<inp2:m_param name="field"/>" name="_cb_<inp2:m_param name="field"/>" <inp2:SubmissionTag tag="Field" checked="checked" db="db"/> class="<inp2:m_param name="field_class"/>" onclick="document.getElementById('<inp2:CustomInputName/>').value = this.checked ? 1:0">
</inp2:m_DefineElement>

<inp2:m_DefineElement name="form_field_textarea">
	<inp2:SubmissionTag tag="Field" nl2br="1" no_special="1"/>
</inp2:m_DefineElement>

<inp2:m_DefineElement name="form_radio_item">
	<input disabled="disabled" type="radio" <inp2:m_param name="checked"/> name="<inp2:m_param name="field_name"/>" id="<inp2:m_param name="field_name"/>_<inp2:m_param name="key"/>" value="<inp2:m_param name="key"/>"><label for="<inp2:m_param name="field_name"/>_<inp2:m_param name="key"/>"><inp2:m_param name="option"/></label>&nbsp;
</inp2:m_DefineElement>

<inp2:m_DefineElement name="form_field_radio">
	<inp2:SubmissionTag tag="PredefinedOptions" field="$field" tabindex="$pass_tabindex" block="form_radio_item" selected="checked"/>
</inp2:m_DefineElement>


<inp2:formsubs_SaveWarning name="grid_save_warning"/>
<inp2:formsubs_ErrorWarning name="form_error_warning"/>

<div id="scroll_container">
	<table class="edit-form">
		<inp2:m_RenderElement name="subsection" prefix="formsubs" fields="FormSubmissionId,SubmissionTime" title="!la_section_General!"/>
			<inp2:m_RenderElement name="inp_id_label" prefix="formsubs" field="FormSubmissionId" title="!la_fld_Id!"/>
			<inp2:m_RenderElement name="inp_edit_date_time" prefix="formsubs" field="SubmissionTime" title="!la_fld_SubmissionTime!" />
		<inp2:m_RenderElement name="subsection" title="!la_section_Data!"/>

			<inp2:m_DefineElement name="form_field">
				<tr class="<inp2:m_odd_even odd='edit-form-odd' even='edit-form-even'/>">
					<inp2:m_inc param="tab_index" by="1"/>
					<td class="label-cell">
						<inp2:Field field="Prompt" plus_or_as_label="1" no_special="no_special"/>:
					</td>
					<td class="control-mid">&nbsp;</td>
					<td class="control-cell">
						<inp2:ConfigFormElement field="Value" blocks_prefix="form_field_" element_type_field="ElementType" value_list_field="ValueList" /><br/>
					</td>
				</tr>
			</inp2:m_DefineElement>

		<inp2:formflds_PrintList render_as="form_field" SourcePrefix="formsubs" per_page="-1"/>
		<inp2:m_RenderElement name="inp_edit_filler"/>
	</table>
</div>

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