<inp2:adm_SetPopupSize width="780" height="580"/>

<inp2:m_include t="incs/header"/>
<inp2:m_RenderElement name="combined_header" prefix="sqe" section="in-commerce:shipping_quote_engines" title_preset="engine_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('sqe','<inp2:sqe_SaveEvent/>');
						}
					) );
				a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
						submit_event('sqe','OnCancelEdit');
						}
				 ) );

				a_toolbar.Render();
			</script>
		</td>
	</tr>
</tbody>
</table>

<inp2:m_DefineElement name="carrier">
	<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">
			<input type="hidden" id="<inp2:sqe_InputName field="{$carrier}Enabled"/>" name="<inp2:sqe_InputName field="{$carrier}Enabled"/>" value="<inp2:sqe_Field field="{$carrier}Enabled" db="db"/>">
			<input tabindex="<inp2:m_get param="tab_index"/>" type="checkbox" id="_cb_<inp2:sqe_InputName field="{$carrier}Enabled"/>" name="_cb_<inp2:sqe_InputName field="{$carrier}Enabled"/>" <inp2:sqe_Field field="{$carrier}Enabled" checked="checked" db="db"/> onclick="update_checkbox(this, document.getElementById('<inp2:sqe_InputName field="{$carrier}Enabled"/>'))" onchange="check_carrier('_cb_<inp2:sqe_InputName field="{$carrier}Enabled"/>', '<inp2:sqe_InputName field="{$carrier}Account" />', '_cb_<inp2:sqe_InputName field="{$carrier}Invoiced"/>')">

			<inp2:m_param name="title" />
		</td>
		<td class="control-mid">&nbsp;</td>
		<td class="control-cell">
			<inp2:m_phrase label="la_AccountLogin" />:
			<input type="text" name="<inp2:sqe_InputName field="{$carrier}Account" />" id="<inp2:sqe_InputName field="{$carrier}Account" />" value="<inp2:sqe_Field field="{$carrier}Account" />" tabindex="<inp2:m_get param="tab_index"/>">

			<inp2:m_phrase label="la_Invoiced" />:
			<input type="hidden" id="<inp2:sqe_InputName field="{$carrier}Invoiced"/>" name="<inp2:sqe_InputName field="{$carrier}Invoiced"/>" value="<inp2:sqe_Field field="{$carrier}Invoiced" db="db"/>">
			<input tabindex="<inp2:m_get param="tab_index"/>" type="checkbox" id="_cb_<inp2:sqe_InputName field="{$carrier}Invoiced"/>" name="_cb_<inp2:sqe_InputName field="{$carrier}Invoiced"/>" <inp2:sqe_Field field="{$carrier}Invoiced" checked="checked" db="db"/> onclick="update_checkbox(this, document.getElementById('<inp2:sqe_InputName field="{$carrier}Invoiced"/>'))">
		</td>
	</tr>
	<script type="text/javascript">
		check_carrier('_cb_<inp2:sqe_InputName field="{$carrier}Enabled"/>', '<inp2:sqe_InputName field="{$carrier}Account" />', '_cb_<inp2:sqe_InputName field="{$carrier}Invoiced"/>');
	</script>
</inp2:m_DefineElement>

<script type="text/javascript">

function check_carrier(carrier_checkbox, account_field, invoiced_checkbox)
{
	if(document.getElementById(carrier_checkbox).checked)
	{
		document.getElementById(account_field).disabled = false;
		document.getElementById(invoiced_checkbox).disabled = false;
	}
	else
	{
		document.getElementById(account_field).disabled = true;
		document.getElementById(invoiced_checkbox).disabled = true;
	}
}

</script>

<inp2:sqe_SaveWarning name="grid_save_warning"/>
<inp2:sqe_ErrorWarning name="form_error_warning"/>

<div id="scroll_container">
	<table class="edit-form">
		<inp2:m_RenderElement name="subsection" title="la_Text_General"/>
			<inp2:m_RenderElement name="inp_label" prefix="sqe" field="EngineId" title="la_fld_Id"/>
			<inp2:m_RenderElement name="inp_label" prefix="sqe" field="Name" title="la_fld_ShippingQuoteEngineName"/>
			<inp2:m_RenderElement name="inp_edit_checkbox" prefix="sqe" field="Status" title="la_fld_Enabled"/>
			<inp2:m_RenderElement name="inp_edit_box" prefix="sqe" field="AccountLogin" title="la_fld_Login" />

			<inp2:m_RenderElement design="form_row" prefix="sqe" field="AccountPassword" title="la_fld_Password">
				<td class="control-cell">
					<input type="password" name="<inp2:sqe_InputName field="AccountPassword" />" id="<inp2:sqe_InputName field="AccountPassword" />" value="">
				</td>
			</inp2:m_RenderElement>

	<inp2:m_if check="sqe_Field" field="ClassName" equals_to="Intershipper" db="db">
		<inp2:m_RenderElement name="subsection" title="la_Text_Carriers"/>
			<inp2:m_RenderElement name="carrier" carrier="UPS" title="UPS" />
			<inp2:m_RenderElement name="carrier" carrier="FDX" title="FedEx" />
			<inp2:m_RenderElement name="carrier" carrier="DHL" title="DHL" />
			<inp2:m_RenderElement name="carrier" carrier="USP" title="USPS" />
			<inp2:m_RenderElement name="carrier" carrier="ARB" title="Airborne" />

		<inp2:m_RenderElement name="subsection" title="la_Text_Delivery"/>
			<inp2:m_RenderElement name="inp_edit_checkbox" prefix="sqe" field="1DYEnabled" title="la_fld_FirstDayDelivery"/>
			<inp2:m_RenderElement name="inp_edit_checkbox" prefix="sqe" field="2DYEnabled" title="la_fld_SecondDayDelivery"/>
			<inp2:m_RenderElement name="inp_edit_checkbox" prefix="sqe" field="3DYEnabled" title="la_fld_ThirdDayDelivery"/>
			<inp2:m_RenderElement name="inp_edit_checkbox" prefix="sqe" field="GNDEnabled" title="la_fld_GroundDelivery"/>

		<inp2:m_RenderElement name="subsection" title="la_Text_Other"/>
			<inp2:m_RenderElement name="inp_edit_options" prefix="sqe" field="ShipMethod" title="la_fld_ShipMethod"/>

			<inp2:m_RenderElement name="inp_edit_box" prefix="sqe" field="FlatSurcharge" title="la_fld_FlatSurcharge" size="10"/>
			<inp2:m_RenderElement name="inp_edit_box" prefix="sqe" field="PercentSurcharge" title="la_fld_PercentSurcharge" size="10"/>
	</inp2:m_if>
		<inp2:m_RenderElement name="inp_edit_filler"/>
	</table>
</div>

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