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

    <h1>Accidents</h1>

    
    <h3>Accident Record for the Past (3) years Prior to Application Date</h3>

    <section>
        <ul class="formFields">
            <li>
                <asp:RequiredFieldValidator runat="server" ControlToValidate="ynThreeYearsAccidents"
                    Text="required" Display="Dynamic" CssClass="required" />
                <asp:Label runat="server" AssociatedControlID="ynThreeYearsAccidents"
                    Text="Have you had any accidents in the past three (3) years?" />
                <ctrl:YesNoPicker ID="ynThreeYearsAccidents" runat="server" />
            </li>
        </ul>
    </section>

    <ctrl:FormList ID="rptAccidents" runat="server" AddText="Add Accident" TargetCount="0"><ItemTemplate>
        <asp:HiddenField ID="hidAccidentId" runat="server" Value="0" />
        <section>
            <div style="float: right; display: inline-block;">
                <asp:Button ID="btnRemoveAccident" runat="server" 
                    CausesValidation="false" OnClick="btnRemoveAccident_Click" 
                    Text="Remove" />
            </div>
            <h1><%# If(Container.ItemIndex = 0,
                            "Most Recent",
                            "Accident " & CStr(Container.ItemIndex + 1)) %></h1>

            <ul class="formFields">
                <li>
                    <asp:RequiredFieldValidator runat="server" ControlToValidate="txtAccidentDate"
                        Text="required" Display="Dynamic" CssClass="required" />
                    <asp:Label runat="server" AssociatedControlID="txtAccidentDate"
                        Text="Accident Date" />
                    <asp:TextBox ID="txtAccidentDate" runat="server" MaxLength="50" TextMode="Date" />
                </li>
                <li>
                    <asp:RequiredFieldValidator runat="server" ControlToValidate="txtAccidentNature"
                        Text="required" Display="Dynamic" CssClass="required" />
                    <asp:Label runat="server" AssociatedControlID="txtAccidentNature"
                        Text="Nature of Accident" />
                    <asp:TextBox ID="txtAccidentNature" runat="server" MaxLength="50" />
                    <span class="hint">passenger vehicle, head-on, rear-end, etc.</span>
                </li>
                <li>
                    <asp:RequiredFieldValidator runat="server" ControlToValidate="txtAccidentConsequences"
                        Text="required" Display="Dynamic" CssClass="required" />
                    <asp:Label runat="server" AssociatedControlID="txtAccidentConsequences"
                        Text="Injuries/Fatalities" />
                    <asp:TextBox ID="txtAccidentConsequences" runat="server" MaxLength="50" />
                </li>
                <li>
                    <asp:Label runat="server" AssociatedControlID="txtAccidentComments"
                        Text="Comments" />
                    <asp:TextBox ID="txtAccidentComments" runat="server" TextMode="MultiLine" MaxLength="256" />
                </li>
            </ul>
        </section>
    </ItemTemplate></ctrl:FormList>

    

</asp:Content>
