<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Driver/transfer/Transfer.master" CodeBehind="SafetyHistory.aspx.vb" Inherits="Web.SafetyHistory1" %>
<%@ MasterType VirtualPath="Transfer.Master" %>
<%@ Register TagPrefix="ctrl" Namespace="Web" Assembly="Web" %>
<%@ Register Src="~/_include/controls/StatePicker.ascx" TagPrefix="ctrl" TagName="StatePicker" %>
<%@ Register Src="~/_include/controls/Signature.ascx" TagPrefix="ctrl" TagName="Signature" %>
<%@ Register Src="~/_include/controls/YesNoPicker.ascx" TagPrefix="ctrl" TagName="YesNoPicker" %>
<asp:Content ID="Content1" ContentPlaceHolderID="phContent" runat="server">

    <h1>Safety Performance History Investigation &mdash; Previous USDOT Regulated Employers</h1>
    <h2>Please complete one form for each previous USDOT regulated employer within the previous three (3) years.</h2>
    
    <ctrl:FormList ID="rptHistory" runat="server" AddText="Add History"><ItemTemplate>
        <asp:HiddenField ID="hidId" runat="server" Value="0" />
        <section id="history<%# Container.ItemIndex + 1 %>">
            <div style="float: right; display: inline-block;">
                <asp:Button ID="btnRemove" runat="server" 
                    CausesValidation="false" OnClick="btnRemove_Click" 
                    Text="Remove" />
            </div>
            <h1>Driver Applicant Release #<%# Container.ItemIndex + 1 %></h1>

            <p>I hereby specifically authorize you to release the following information to 
    <span id="company_name_<%# Container.ItemIndex + 1 %>" style="text-decoration: underline;">the specified company</span> 
    and their agents for the purposes of investigation as required by §391.23 and §40.321(b) of the Federal Motor Carrier Safety
    Regulations. You are hereby released from any and all liability which may result from furnishing such information.</p>
            <ctrl:Signature ID="signature" runat="server" ContextId="history<%# Container.ItemIndex + 1 %>" />

            <ul class="formFields">
                <li class="big left">
                    <asp:Label runat="server" AssociatedControlID="txtName"
                        Text="Applicant Name" />
                    <asp:TextBox ID="txtName" runat="server"
                        MaxLength="128" Enabled="false" />
                </li>
                <li class="right">
                    <asp:Label runat="server" AssociatedControlID="txtSocial"
                        Text="SSN" />
                    <asp:TextBox ID="txtSocial" runat="server"
                        MaxLength="50" Enabled="false" />
                </li>
            </ul>

            <ul class="formFields">
                <li class="big">
                    <asp:Label runat="server" AssociatedControlID="txtCompany"
                        Text="Previous Employer/Company Name" />
                    <asp:TextBox ID="txtCompany" runat="server" MaxLength="128" />
                    <script type="text/javascript">
                        $('#<%# Container.FindControl("txtCompany").ClientID %>').on('change input', function() {
                            var entered = $(this).val();
                            $('#company_name_<%# Container.ItemIndex + 1 %>').text(entered.length? entered : 'the specified company');
                        });
                        $(function () {
                            var txtCompany = $('#<%# Container.FindControl("txtCompany").ClientID %>');
                            var entered = txtCompany.val();
                            $('#company_name_<%# Container.ItemIndex + 1 %>').text(entered.length? entered : 'the specified company');
                        });
                    </script>
                </li>
            </ul>

            <ul class="formFields">
                <li class="big">
                    <asp:Label runat="server" AssociatedControlID="txtAddress"
                        Text="Address" />
                    <asp:TextBox ID="txtAddress" runat="server"
                        MaxLength="128" />
                </li>
                <li class="left">
                    <asp:Label runat="server" AssociatedControlID="txtCity"
                        Text="City" />
                    <asp:TextBox ID="txtCity" runat="server"
                        MaxLength="50" />
                </li>
                <li class="left">
                    <asp:Label runat="server" AssociatedControlID="ddlState"
                        Text="State" />
                    <ctrl:StatePicker ID="ddlState" runat="server" />
                </li>
                <li class="right">
                    <asp:Label runat="server" AssociatedControlID="txtZip"
                        Text="Zip" />
                    <asp:TextBox ID="txtZip" runat="server" TextMode="Number" />
                </li>
            </ul>

            <ul class="formFields">
                <li>
                    <asp:Label runat="server" AssociatedControlID="txtPhone"
                        Text="Phone" />
                    <asp:TextBox ID="txtPhone" runat="server"
                        MaxLength="50" TextMode="Phone" />
                </li>
                <li>
                    <asp:Label runat="server" AssociatedControlID="txtFax"
                        Text="Fax" />
                    <asp:TextBox ID="txtFax" runat="server"
                        MaxLength="50" TextMode="Phone" />
                </li>
            </ul>

            <ul class="formFields">
                <li>
                    <asp:Label runat="server" AssociatedControlID="txtEmploymentStart"
                        Text="Employment Dates" />
                    <asp:TextBox ID="txtEmploymentStart" runat="server"
                        MaxLength="50" TextMode="Date" />
                    <asp:Label runat="server" AssociatedControlID="txtEmploymentEnd"
                        Text="To" />
                    <asp:TextBox ID="txtEmploymentEnd" runat="server"
                        MaxLength="50" TextMode="Date" />
                </li>
            </ul>

        </section>
    </ItemTemplate></ctrl:FormList>

</asp:Content>
