<inp2:adm_SetPopupSize width="700" height="585"/>
<inp2:m_include t="incs/header"/>

<inp2:m_RenderElement name="combined_header" section="in-portal:promo_block_groups"  prefix="promo-block-group" title_preset="promo_block_group_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();
				a_toolbar.AddButton( new ToolBarButton('select', '<inp2:m_phrase label="la_ToolTip_Save" escape="1"/>', function() {
							submit_event('promo-block-group', '<inp2:promo-block-group_SaveEvent/>');
						}
					) );
				a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
							cancel_edit('promo-block-group', 'OnCancelEdit','<inp2:promo-block-group_SaveEvent/>','<inp2:m_Phrase label="la_FormCancelConfirmation" escape="1"/>');
						}
				 ) );

			 	a_toolbar.AddButton( new ToolBarButton('reset_edit', '<inp2:m_phrase label="la_ToolTip_Reset" escape="1"/>', function() {
						reset_form('promo-block-group', 'OnReset', '<inp2:m_Phrase label="la_FormResetConfirmation" escape="1"/>');
					}
			 	) );

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

				a_toolbar.Render();

				<inp2:m_if check="promo-block-group_IsSingle" >
					a_toolbar.HideButton('prev');
					a_toolbar.HideButton('next');
					a_toolbar.HideButton('sep1');
				<inp2:m_else/>
					<inp2:m_if check="promo-block-group_IsLast" >
						a_toolbar.DisableButton('next');
					</inp2:m_if>
					<inp2:m_if check="promo-block-group_IsFirst" >
						a_toolbar.DisableButton('prev');
					</inp2:m_if>
				</inp2:m_if>
			</script>
		</td>
	</tr>
</tbody>
</table>

<inp2:promo-block-group_SaveWarning name="grid_save_warning"/>
<inp2:promo-block-group_ErrorWarning name="form_error_warning"/>

<inp2:m_DefineElement name="category_caption">
	<inp2:m_ifnot check="m_Param" name="is_first">
		<inp2:m_param name="separator"/>
	</inp2:m_ifnot>
	<inp2:m_param name="cat_name"/>
</inp2:m_DefineElement>

<inp2:m_DefineElement name="category_path">
	<inp2:c_CategoryPath cat_id="$cat_id" render_as="category_caption" separator="&gt;"/><br/>
</inp2:m_DefineElement>

<div id="scroll_container">
	<table class="edit-form">
		<inp2:m_RenderElement name="subsection" prefix="promo-block-group" fields="PromoBlockGroupId,Title,CreatedOn,Status,AssignedToSections" title="la_section_General"/>

		<inp2:m_RenderElement name="inp_id_label" prefix="promo-block-group" field="PromoBlockGroupId" title="la_fld_Id"/>
		<inp2:m_RenderElement name="inp_edit_box" prefix="promo-block-group" field="Title" maxlength="50"/>
		<inp2:m_RenderElement name="inp_label" prefix="promo-block-group" field="CreatedOn"/>
		<inp2:m_RenderElement name="inp_edit_radio" prefix="promo-block-group" field="Status"/>

		<inp2:m_RenderElement design="form_row" prefix="promo-block-group" field="AssignedToSections">
			<td class="control-cell" valign="top">
				<inp2:$prefix_PrintCategories field="$field" render_as="category_path"/>
			</td>
		</inp2:m_RenderElement>

		<inp2:m_RenderElement name="subsection" prefix="promo-block-group" fields="RotationDelay,TransitionTime,TransitionControls,TransitionEffect" title="la_section_Settings"/>
		<inp2:m_RenderElement name="inp_edit_box" prefix="promo-block-group" field="RotationDelay"/>
		<inp2:m_RenderElement name="inp_edit_box" prefix="promo-block-group" field="TransitionTime"/>
		<inp2:m_RenderElement name="inp_edit_radio" prefix="promo-block-group" field="TransitionControls"/>

		<inp2:m_RenderElement design="form_row" prefix="promo-block-group" field="TransitionEffect" format="" empty_value="" has_empty="1">
			<td class="control-cell">
				<select tabindex="<inp2:m_Get name='tab_index'/>" name="<inp2:{$prefix}_InputName field='$field'/>" id="<inp2:{$prefix}_InputName field='$field'/>">
					<inp2:$prefix_PredefinedOptions field="$field" block="inp_option_phrase" selected="selected" has_empty="$has_empty" empty_value="$empty_value"/>
				</select>

				<input style="width: 120px;<inp2:m_ifnot check="{$prefix}_Field" name="$field" equals_to="-1" db="db"> display: none;</inp2:m_ifnot>" type="text" name="<inp2:{$prefix}_InputName field='{$field}Custom'/>" id="<inp2:{$prefix}_InputName field='{$field}Custom'/>" value="<inp2:{$prefix}_Field field='{$field}Custom' format='$format'/>" tabindex="<inp2:m_Get name='tab_index'/>"/>
			</td>
		</inp2:m_RenderElement>

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

<script type="text/javascript">
	$(document).ready(
		function () {
			var $field_mask = '<inp2:promo-block-group_InputName name="#FIELD_NAME#" js_escape="1"/>';

			$( get_control($field_mask, 'TransitionEffect') ).change(
				function ($e) {
					$( get_control($field_mask, 'TransitionEffectCustom') ).toggle( $(this).val() == '-1' );
				}
			);
		}
	);
</script>
<inp2:m_include t="incs/footer"/>
