<%@ page title="" language="C#" masterpagefile="~/Pages/Common/MasterPages/MainMasterPage_new.master" autoeventwireup="true" inherits="Pages_Recruitment_CandidateHistory, App_Web_vo04ddbt" uiculture="auto" meta:resourcekey="PageResource1" enableEventValidation="false" viewStateEncryptionMode="Never" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
<%@ Register Src="~/UserControls/AutoComplete/AutoCompleteControl.ascx" TagName="AutoCompleteControl" TagPrefix="acc" %>
<%@ Register Src="~/UserControls/DatePicker/DatePickerAutoPostBackControl.ascx" TagName="DatePickerControl" TagPrefix="DPC" %>
<%@ Register Src="~/UserControls/Common/CommonSearch/CommonSearch.ascx" TagName="CommonSearchUserControl" TagPrefix="Common" %>
<%@ Register Src="~/UserControls/Common/ScreenGroup/ScreenGroup.ascx" TagName="ScreenGroupControl" TagPrefix="ScreenGroup" %>
<%@ Register Src="~/UserControls/Common/Recruitment/VacancyDetailBoxControl.ascx" TagName="VacancyControl" TagPrefix="Vacancy" %>

<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
    <asp:UpdatePanel ID="HREmployeeMasterSearchUpdatePanel" runat="server">
        <ContentTemplate>
            <Common:CommonSearchUserControl ID="CommonSearchControl" runat="server" Visible="false" />
            <div id="divContentPage" class="divcontentpagemargin">
                <div class="dashBoardLeftCont">
                    <div class="himssuHeader3WireBox">
                        <table>
                            <tr>
                                <td>
                                    <div class="himsBoxContent">
                                        <div class="leftUlMenu">
                                            <ScreenGroup:ScreenGroupControl EnableViewState="true" ID="ScreenGroupControl" ScreenGroupId="229"
                                                Visible="true" runat="server" />
                                        </div>
                                    </div>
                                </td>
                            </tr>
                        </table>
                    </div>
                </div>
                <div class="whiteboxpaddingleft row">
                    <Vacancy:VacancyControl ID="VacancyUserControl" runat="server" Visible="true" />
                    <div class="himssuHeader1WireBox card card-box">
                        <div class="himsBoxHeader card-head" id="Div4" runat="server" visible="True">
                            <div class="leftdiv">
                            </div>
                            <div class="himsBoxTitle">
                                <div class="headerText fLeft">
                                    <header>
                                        <asp:Label ID="Label4" Text="Candidate Detail" runat="server" />
                                    </header>
                                </div>
                            </div>
                            <div class="fRight mt-27 pagination display-flex">
                               
                                            <div id="NumberOfRecordDiv" class="display-flex" runat="server" visible="true">
                                                <asp:LinkButton AlternateText="First page" ToolTip="First page" ID="FirstRecordImageButton"
                                                    runat="server" CommandName="Page" CommandArgument="First"
                                                    OnClick="FirstRecordImageButton_Click" CssClass="btn btn-default gridviewpagerbuttonpadding">
					<i class="fa fa-fast-backward"></i>
                                                </asp:LinkButton>
                                                <asp:LinkButton AlternateText="Previous page" ToolTip="Previous page" ID="PreviousImageButton"
                                                    runat="server" CommandName="Page" CommandArgument="Prev"
                                                    OnClick="PreviousImageButton_Click" CssClass="btn btn-default gridviewpagerbuttonpadding">
					<i class="fa fa-play fa-rotate-180"></i>
                                                </asp:LinkButton>
                                               
				<asp:Label ID="LabelPage" runat="server" Text="Record " AssociatedControlID="ReCordNumber" />
                                                &nbsp; <asp:Label ID="ReCordNumber" Font-Bold="true" SkinID="Dummy" runat="server"></asp:Label>
                                               &nbsp;  <asp:Label ID="ofLabel" Text="of" runat="server" />
                                               &nbsp;  <asp:Label ID="TotalRecord" runat="server" />
                                                &nbsp;
				<asp:LinkButton AlternateText="Next page" ToolTip="Next page" ID="NextImageButtom"
                    runat="server" CssClass="btn btn-default gridviewpagerbuttonpadding" CommandName="Page" CommandArgument="Next"
                    OnClick="NextImageButton_Click">
					 <i class="fa fa-play"></i>
                </asp:LinkButton>

                                                <asp:LinkButton AlternateText="Last page" ToolTip="Last page" ID="LastRecordImageButton"
                                                    runat="server" CssClass="btn btn-default gridviewpagerbuttonpadding" CommandName="Page" CommandArgument="Last"
                                                    OnClick="LastRecordImageButton_Click">
					  <i class="fa fa-fast-forward"></i>
                                                </asp:LinkButton>
                                                &nbsp;  &nbsp; &nbsp;
                                            </div>
                                     
                            </div>
                        </div>
                        <div class="himsBoxContent card-body">
                            <asp:Panel ID="DetailPanel" runat="Server">
                                <div class="contentHolder">
                                    <div class="topdisplayContainer" style="width: 100%">
                                    
                                                    <div class="himsDisplayBox">
                                                        <div style="margin-top: 0px">
                                                        </div>
                                                        <div class="himsBoxContent messageMessage">
                                                            <div class="topdisplayContainer">
                                                                <table class="fLeft">
                                                                    <tr>
                                                                        <td>
                                                                            <asp:Label ID="CodeLabelL" runat="server" Text="Code :" Font-Bold="true"></asp:Label>
                                                                       <%-- </td>
                                                                        <td>--%>
                                                                            <asp:Label ID="CodeLabelT" runat="server" Text=""></asp:Label>
                                                                        </td>
                                                                        <td>&nbsp;
                                                                        </td>
                                                                        <td>&nbsp;
                                                                        </td>
                                                                        <td>&nbsp;
                                                                        </td>
                                                                        <td>&nbsp;
                                                                        </td>
                                                                        <td>
                                                                            <asp:Label ID="NameLabelL" runat="server" Text="Name :" Font-Bold="true"></asp:Label>
                                                                      <%--  </td>
                                                                        <td>--%>
                                                                            <asp:Label ID="NameLabelT" runat="server" Text=""></asp:Label>
                                                                        </td>
                                                                        <td>&nbsp;
                                                                        </td>
                                                                        <td>&nbsp;
                                                                        </td>
                                                                        <td>&nbsp;
                                                                        </td>
                                                                        <td>&nbsp;
                                                                        </td>
                                                                    </tr>
                                                                </table>
                                                                <div class="cBoth">
                                                                </div>
                                                            </div>
                                                        </div>
                                                        <div class="himsBoxFooter">
                                                            <div>
                                                            </div>
                                                        </div>
                                                    </div>
                                              
                                    </div>
                                    <div class="navgraybackground">
                                        <ul class="nav nav-tabs">
                                            <li>
                                                <a href="#tab_1">
                                                    <asp:Button Text="&#xf044; General" ID="EmployeeMendatoryButton" CssClass="transparenttab fas" OnClick="EmployeeMendatoryButton_Click"
                                                        SkinID="0" runat="server" />
                                                </a>
                                            </li>
                                            <li>
                                                <a href="#tab_1">
                                                    <asp:Button Text="&#xf095; Communication" ID="CommunicationButton" CssClass="transparenttab fas" OnClick="Communication_Click"
                                                        SkinID="0" runat="server" />
                                                </a>
                                            </li>
                                            <li class="active">
                                                <a href="#tab_1">
                                                    <asp:Button Text="&#xf0c0; Employment" ID="EmploymentButton" CssClass="transparenttab fas" OnClick="Employment_Click"
                                                        SkinID="0" runat="server" />
                                                </a>
                                            </li>
                                            <li>
                                                <a href="#tab_1">
                                                    <asp:Button Text="&#xf19d; Qualification" ID="QualificationButton" CssClass="transparenttab fas" OnClick="Qualification_Click"
                                                        SkinID="0" runat="server" />
                                                </a>
                                            </li>
                                            <li>
                                                <a href="#tab_1">
                                                    <asp:Button Text="&#xf0c0; Family" ID="FamilyButton" CssClass="transparenttab fas" OnClick="FamilyButton_Click"
                                                        SkinID="0" runat="server" />
                                                </a>
                                            </li>
                                            <li>
                                                <a href="#tab_1">
                                                    <asp:Button Text="&#xf0c0; Document" ID="DocumentButton" CssClass="transparenttab fas" OnClick="DocumentButton_Click"
                                                        SkinID="0" runat="server" />
                                                </a>
                                            </li>
                                        </ul>
                                    </div>
                                    <table>
                                        <div class="contentHolder">
                                            <tr>
                                                <td style="vertical-align: top; border-top: 0px solid gray !important">
                                                    <asp:Panel ID="PanEnable" runat="server" meta:resourcekey="PanEnableResource1">
                                                        <asp:PlaceHolder ID="UserControlContainer" runat="server"></asp:PlaceHolder>
                                                        <div class="himssuHeader1WireBox">
                                                            <div class="himsBoxContent">
                                                                <div class="contentHolder">
                                                                    <asp:Panel ID="pnlForGrid" runat="server" meta:resourcekey="pnlForGridResource1">
                                                                        <div class="himssuHeader6WireBox col-md-12">
                                                                            <div id="EmploymentHistoryGridDiv" runat="server">
                                                                            </div>
                                                                            <div class="himsBoxContent table-responsive">
                                                                                <asp:GridView runat="server" ID="EmploymentHistoryGridView" Width="100%" AutoGenerateColumns="False"
                                                                                    EmptyDataText="No Family Details Found!" DataKeyNames="Id,CandidateId,CompanyName,Duration,Designation,Remark,IsDelete,Lastsalary,ReasonForLeaving,JobDescription,IsCurrentlyWorking,FromDate,ToDate"
                                                                                    OnSelectedIndexChanged="EmploymentHistoryGridView_SelectedIndexChanged" meta:resourcekey="EmploymentHistoryGridViewResource1" OnRowDataBound="EmploymentHistoryGridView_RowDataBound"
                                                                                    CssClass="table table-striped table-bordered table-hover">
                                                                                    <Columns>
                                                                                        <asp:CommandField ShowSelectButton="True" />
                                                                                        <asp:BoundField DataField="CompanyName" HeaderText="Institute Name" HeaderStyle-HorizontalAlign="Left"></asp:BoundField>
                                                                                        <asp:TemplateField HeaderText="From Date" 
                                                                                            HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" ItemStyle-Wrap="true">
                                                                                            <ItemTemplate>
                                                                                                    <asp:Label ID="FromDateLabel" runat="server" Text='<%#Eval("FromDate","{0:dd/MM/yyyy}") %>'></asp:Label>
                                                                                            </ItemTemplate>
                                                                                        </asp:TemplateField>
                                                                                        <asp:TemplateField HeaderText="To Date" 
                                                                                            HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" ItemStyle-Wrap="true">
                                                                                            <ItemTemplate>
                                                                                                    <asp:Label ID="ToDateLabel" runat="server" Text='<%# Bind("Todate" , "{0:dd/MM/yyyy}") %>'>'></asp:Label>
                                                                                            </ItemTemplate>
                                                                                        </asp:TemplateField>
                                                                                        <asp:BoundField DataField="Duration" HeaderText="Duration" HeaderStyle-HorizontalAlign="Left"></asp:BoundField>
                                                                                        <asp:BoundField DataField="Designation" HeaderText="Designation" HeaderStyle-HorizontalAlign="Left"></asp:BoundField>
                                                                                        <asp:BoundField DataField="LastSalary" HeaderText="Last Salary" HeaderStyle-HorizontalAlign="Left"></asp:BoundField>
                                                                                        <asp:BoundField DataField="ReasonForLeaving" HeaderText="Reason For Leaving" HeaderStyle-HorizontalAlign="Left"></asp:BoundField>
                                                                                        <asp:BoundField DataField="JobDescription" HeaderText="Job Description" HeaderStyle-HorizontalAlign="Left"></asp:BoundField>
                                                                                        <asp:BoundField DataField="Remark" HeaderText="Remark" HeaderStyle-HorizontalAlign="Left"></asp:BoundField>
                                                                                  <%--      <asp:BoundField DataField="IsCurrentlyWorking" HeaderText="Curently Working" HeaderStyle-HorizontalAlign="Left"></asp:BoundField>--%>
                                                                                        <asp:TemplateField HeaderText="Currently Working" ItemStyle-Width="5%"
                                                                                                HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" ItemStyle-Wrap="true">
                                                                                                <ItemTemplate>
                                                                                                      <asp:Label ID="IsCurrentlyWorkingLabel" runat="server" Text='<%#Eval("IsCurrentlyWorking") %>'></asp:Label>
                                                                                                </ItemTemplate>
                                                                                        </asp:TemplateField>
                                                                                    </Columns>
                                                                                    <PagerSettings Visible="False" />
                                                                                </asp:GridView>
                                                                            </div>
                                                                        </div>
                                                                    </asp:Panel>
                                                                    <div class="spacer">
                                                                        <img src="../../../Images/spacer.gif" />
                                                                    </div>
                                                                    <div class="outerBox pTop5 col-md-3">
                                                                        <div class="controlLabelWidth">
                                                                            <asp:Label ID="CompanyNameLabel" runat="server" Text="Institute Name" SkinID="MandatoryLabel"
                                                                                meta:resourcekey="CompanyNameLabelResource1"></asp:Label>
                                                                        </div>
                                                                        <div class="fLeft pRight5">
                                                                            <asp:TextBox ID="CompanyNameTextBox" MaxLength="100" SkinID="CustomWidthTextBox"
                                                                                runat="server" onmouseleave="showHideTooltip()" onmouseenter="showHideTooltip()"
                                                                                meta:resourcekey="CompanyNameTextBoxResource1"></asp:TextBox>
                                                                        </div>
                                                                        <asp:HiddenField runat="server" ID="HiddenFieldID" Value="0" />
                                                                    </div>
                                                                    <div class="outerBox pTop5 col-md-3">
                                                                        <div class="controlLabelWidth">
                                                                            <asp:Label ID="FromDateLabel" runat="server" Text="From Date" meta:resourcekey="FromDateLabelResource1"></asp:Label>
                                                                        </div>
                                                                        <div class="fLeft pRight5">
                                                                            <DPC:DatePickerControl ID="FromDateTextBox" runat="server" DisplayDatePicker="true" OnTextChanged="FromDateTextBox_TextChanged" />
                                                                        </div>
                                                                    </div>
                                                                    
                                                                    <div class="outerBox pTop5 col-md-3">
                                                                        <div class="controlLabelWidth">
                                                                            <asp:Label ID="ToDateLabel" runat="server" Text="To Date" meta:resourcekey="ToDateLabelResource1"></asp:Label>
                                                                        </div>
                                                                        <div class="fLeft pRight5">
                                                                            <DPC:DatePickerControl ID="ToDateTextBox" runat="server" DisplayDatePicker="true" OnTextChanged="ToDateTextBox_OnTextChanged"/>
                                                                        </div>
                                                                    </div>
                                                                    <div class="outerBox pTop5 col-md-3">
                                                                        <div class="controlLabelWidth">
                                                                            <asp:Label ID="DurationLabel" runat="server" Text="Duration" SkinID="MandatoryLabel"></asp:Label>
                                                                        </div>
                                                                        <div class="fLeft pRight5">
                                                                            <asp:TextBox ID="DurationTextBox" MaxLength="300" runat="server" SkinID="CustomWidthTextBox"
                                                                                onmouseleave="showHideTooltip()" onmouseenter="showHideTooltip()">
                                                                            </asp:TextBox>
                                                                        </div>
                                                                    </div>

                                                                    <div class="outerBox pTop5 col-md-3">
                                                                        <div class="controlLabelWidth">
                                                                            <asp:Label ID="DesignationLabel1" runat="server" Text="Designation" SkinID="MandatoryLabel"></asp:Label>
                                                                        </div>
                                                                        <div class="fLeft pRight5">
                                                                            <asp:TextBox ID="DesignationTextBox" MaxLength="300" runat="server" SkinID="CustomWidthTextBox"
                                                                                onKeyDown="textCounter(this,100);" onKeyUp="textCounter(this,100);"
                                                                                onmouseleave="showHideTooltip()" onmouseenter="showHideTooltip()">
                                                                            </asp:TextBox>
                                                                        </div>
                                                                    </div>
                                                                    <div id="LastSalaryDiv" runat="server" visible="false">
                                                                        <div class="outerBox pTop5 col-md-3">
                                                                            <div class="controlLabelWidth">
                                                                                  <asp:Label ID="LastSalaryLabel" runat="server" Text="Last Salary" meta:resourcekey="MiddleNameLabelResource1" Visible="false"></asp:Label>
                                                                                  <asp:Label ID="LastSalarylbl" runat="server" Text="Last Salary" class="mandatory" Visible="false"></asp:Label>
                                                                                <%--<asp:Label ID="LastSalaryLabel" runat="server" Text="Last Salary"></asp:Label>--%>
                                                                            </div>
                                                                            <div class="fLeft pRight5">
                                                                                <asp:TextBox ID="LastSalaryTextBox" MaxLength="300" onkeypress="return isNumberKey(event);"
                                                                                    runat="server" SkinID="CustomWidthTextBox" onmouseleave="showHideTooltip()"
                                                                                    onmouseenter="showHideTooltip()">
                                                                                </asp:TextBox>
                                                                            </div>
                                                                        </div>
                                                                    </div>
                                                                    <div id="ReasonForLeaveDiv" runat="server" visible="false">
                                                                        <div class="outerBox pTop5 col-md-3">
                                                                            <div class="controlLabelWidth">
                                                                                <asp:Label ID="ReasonForLeaveLabel" runat="server" Text="Reason For Leave" meta:resourcekey="MiddleNameLabelResource1" Visible="false"></asp:Label>
                                                                                <asp:Label ID="ReasonForLeavelbl" runat="server" Text="Reason For Leave" class="mandatory" Visible="false"></asp:Label>
                                                                                <%--<asp:Label ID="ReasonForLeaveLabel" runat="server" Text="Reason For Leave"></asp:Label>--%>
                                                                            </div>
                                                                            <div class="fLeft">
                                                                                <asp:TextBox ID="ReasonForLeaveTextBox" TextMode="MultiLine" onKeyDown="textCounter(this,200);"
                                                                                    onKeyUp="textCounter(this,200);" runat="server" SkinID="MultilineTextBox" Height="30px"
                                                                                    onmouseleave="showHideTooltip()" onmouseenter="showHideTooltip()"
                                                                                    meta:resourcekey="RemarkTextBoxResource1"></asp:TextBox>
                                                                            </div>
                                                                        </div>
                                                                    </div>
                                                                    <div id="JobDescriptionDiv" runat="server" visible="false">
                                                                        <div class="outerBox pTop5 col-md-3">
                                                                            <div class="controlLabelWidth">
                                                                                <asp:Label ID="JobDescriptionLabel" runat="server" Text="Job Description" meta:resourcekey="MiddleNameLabelResource1" Visible="false"></asp:Label>
                                                                                <asp:Label ID="JobDescriptionlbl" runat="server" Text="Job Description" class="mandatory" Visible="false"></asp:Label>
                                                                                <%--<asp:Label ID="JobDescriptionLabel" runat="server" Text="Job Description"></asp:Label>--%>
                                                                            </div>
                                                                            <div class="fLeft " style="margin-left: 10px">
                                                                                <asp:TextBox ID="JobDescriptionTextBox" TextMode="MultiLine" onKeyDown="textCounter(this,200);"
                                                                                    onKeyUp="textCounter(this,200);" runat="server" SkinID="MultilineTextBox" Height="30px"
                                                                                    onmouseleave="showHideTooltip()" onmouseenter="showHideTooltip()"
                                                                                    meta:resourcekey="RemarkTextBoxResource1"></asp:TextBox>
                                                                            </div>
                                                                        </div>
                                                                    </div>
                                                                    <div id="RemarkDiv" runat="server" visible="false">
                                                                            <div class="outerBox pTop5 col-md-3">
                                                                                <div class="controlLabelWidth">
                                                                                    <asp:Label ID="RemarkLabel" runat="server" Text="Remark" meta:resourcekey="MiddleNameLabelResource1" Visible="false"></asp:Label>
                                                                                    <asp:Label ID="Remarklbl" runat="server" Text="Remark" class="mandatory" Visible="false"></asp:Label>
                                                                                    <%--<asp:Label ID="RemarkLabel" runat="server" Text="Remark"></asp:Label>--%>
                                                                                </div>
                                                                                <div class="fLeft">
                                                                                    <asp:TextBox ID="RemarkTextBox" TextMode="MultiLine" onKeyDown="textCounter(this,200);"
                                                                                        onKeyUp="textCounter(this,200);" runat="server" SkinID="MultilineTextBox" Height="30px"
                                                                                        onmouseleave="showHideTooltip()" onmouseenter="showHideTooltip()"
                                                                                        meta:resourcekey="RemarkTextBoxResource1"></asp:TextBox>
                                                                                </div>
                                                                            </div>
                                                                    </div>
                                                               
<%--                                                                    <div class="outerBox pTop5 col-md-6">
                                                                            <asp:CheckBox ID="CurrentlyWorkingCheckBox" runat="server"/>
                                                                            <div class="cBoth"></div>
                                                                            <asp:Label ID="CurrentlyWorkingLabel" runat="server" Text="Currently Working"></asp:Label>
                                                                    </div>--%>
                                                                    <div id="CurrentlyWorkingDiv" runat="server" visible="false">
                                                                        <div class="outerBox pTop5 col-md-3">
                                                                            <div class="fLeft pTop5">
                                                                                <asp:CheckBox ID="CurrentlyWorkingCheckBox" runat="server" Text="Currently Working" />
                                                                               <%--  <asp:Label ID="Label1" runat="server" Text="Currently Working"></asp:Label>--%>
                                                                            </div>
                                                                        </div>                              
                                                                        <div class="alignCenter col-md-12 pTop15 pb5">
                                                                            <asp:Button ID="AddButton" runat="server" Text="&#xf067;  Add" OnClick="AddButton_OnClick" SkinID="0" CssClass="btn btn-add fas" />
                                                                            <asp:Button ID="ResetButton" runat="server" Text="&#xf0e2; Clear" OnClick="ClearButton_OnClick"
                                                                                SkinID="0" CssClass="btn btn-clear fas" />
                                                                        </div>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                        </div>
                                                    </asp:Panel>
                                                </td>
                                            </tr>
                                        </div>
                                    </table>
                                </div>
                            </asp:Panel>
                        </div>
                    </div>
                </div>
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
    <%--<script data-main="../../../JavaScript/rjs/builtjs/candidate-master-built" src="../../../JavaScript/rjs/require.js"></script>--%>
    <script data-main='<%=ResolveUrl("~/JavaScript/rjs/candidate-master")%>' src='<%=ResolveUrl("~/JavaScript/rjs/require.js")%>'></script>   
    <script type="text/javascript" >
        
        function DateDiff() {
            var months;
            var FromDate = document.getElementById("ctl00_CP_FromDateTextBox_DateTextbox").value;
            var ToDate = document.getElementById("ctl00_CP_ToDateTextBox_DateTextbox").value;

            var d = new Date(FromDate.split("/").reverse().join("-"));
            var dd = d.getDate();
            var mm = d.getMonth() + 1;
            var yy = d.getFullYear();
            var newdate = yy + "/" + mm + "/" + dd;

            var d3 = new Date(ToDate.split("/").reverse().join("-"));
            var dd1 = d3.getDate();
            var mm1 = d3.getMonth() + 1;
            var yy1 = d3.getFullYear();
            var newdate1 = yy1 + "/" + mm1 + "/" + dd1;

            //var d1 = new Date(newdate);
            //var d2 = new Date(newdate1);

            //months = (d2.getFullYear() - d1.getFullYear()) * 12;
            //months -= d1.getMonth();
            //months += d2.getMonth();
            //document.getElementById("ctl00_CP_DurationTextBox").value = months;
            //return months <= 0 ? 0 : months + 1;

            var startDate = new Date(new Date(newdate).toISOString().substr(0, 10));
            //if (!ToDate) {
            //    ToDate = new Date().toISOString().substr(0, 10);    // need date in YYYY-MM-DD format
            //}
            var endDate = new Date(newdate1);
            if (startDate > endDate) {
                var swap = startDate;
                startDate = endDate;
                endDate = swap;
            }
            var startYear = startDate.getFullYear();
            var february = (startYear % 4 === 0 && startYear % 100 !== 0) || startYear % 400 === 0 ? 29 : 28;
            var daysInMonth = [31, february, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];

            var yearDiff = endDate.getFullYear() - startYear;
            var monthDiff = endDate.getMonth() - startDate.getMonth();
            if (monthDiff < 0) {
                yearDiff--;
                monthDiff += 12;
            }
            document.getElementById("ctl00_CP_DurationTextBox").value = yearDiff + ' ' + 'Year' + ' ' + monthDiff + ' ' + 'Month';
            //return yearDiff +' ' + ' Year ' + monthDiff + ' '+ ' Month ';
        }
    </script>
</asp:Content>
