<%@ page language="C#" validaterequest="false" masterpagefile="~/MasterFile/TimeCheck.master" autoeventwireup="true" inherits="Masters_TA_UI_Master_ShiftAdd, App_Web_oqeancrh" enableeventvalidation="false" %>

<%--<%@ Register Src="~/UserControls/TA_uc_OrgLevelFilter_Updated.ascx" TagName="orglevel" TagPrefix="UC" %>--%>
<asp:Content ID="Content1" ContentPlaceHolderID="BodyContentPH" runat="Server">
    <!--[if gt IE 5.5]>
	<link rel="stylesheet" type="text/css" href="../css/anytimeIE.css" />
 <![endif]-->

    <script src="../js/maxLength.js" type="text/javascript"></script>

    <script src="../js/DateTimeValidation.js" type="text/javascript"></script>

    <script src="../js/ShiftAjax.js" type="text/javascript"></script>

    <script src="../plugins/datepicker/jquery-1.11.1.min.js"></script>

    <script language="javascript" src="../js/jquery.autocomplete.js" type="text/javascript"></script>

    <script src="../plugins/datepicker/bootstrap-datepicker.js"></script>

    <script language="javascript" type="text/javascript">
        $(function () {
            $('#ctl00_BodyContentPH_txt_ShiftInTime').datetimepicker({ format: document.getElementById('ctl00_BodyContentPH_Hidden1').value });
            $('#ctl00_BodyContentPH_txt_ShiftOuttime').datetimepicker({ format: document.getElementById('ctl00_BodyContentPH_Hidden1').value });
            $('#ctl00_BodyContentPH_txt_GraceShiftIn').datetimepicker({ format: 'HH:mm' });
            $('#ctl00_BodyContentPH_txt_GraceShiftOut').datetimepicker({ format: 'HH:mm' });
            $('#ctl00_BodyContentPH_txt_MinimumHrs').datetimepicker({ format: 'HH:mm' });
            $('#ctl00_BodyContentPH_txt_FirstHalfStartTime').datetimepicker({ format: document.getElementById('ctl00_BodyContentPH_Hidden1').value });
            $('#ctl00_BodyContentPH_txt_FirstHalfEndTime').datetimepicker({ format: document.getElementById('ctl00_BodyContentPH_Hidden1').value });
            $('#ctl00_BodyContentPH_txt_SecondHalfStartTime').datetimepicker({ format: document.getElementById('ctl00_BodyContentPH_Hidden1').value });
            $('#ctl00_BodyContentPH_txt_SecondHalfEndTime').datetimepicker({ format: document.getElementById('ctl00_BodyContentPH_Hidden1').value });
            $('#ctl00_BodyContentPH_txt_BreakStratTime1').datetimepicker({ format: document.getElementById('ctl00_BodyContentPH_Hidden1').value });
            $('#ctl00_BodyContentPH_txt_BreakEndTime1').datetimepicker({ format: document.getElementById('ctl00_BodyContentPH_Hidden1').value });
            $('#ctl00_BodyContentPH_txt_BreakStartTime2').datetimepicker({ format: document.getElementById('ctl00_BodyContentPH_Hidden1').value });
            $('#ctl00_BodyContentPH_txt_BreakEndTime2').datetimepicker({ format: document.getElementById('ctl00_BodyContentPH_Hidden1').value });
            $('#ctl00_BodyContentPH_txt_BreakStartTime3').datetimepicker({ format: document.getElementById('ctl00_BodyContentPH_Hidden1').value });
            $('#ctl00_BodyContentPH_txt_BreakEndTime3').datetimepicker({ format: document.getElementById('ctl00_BodyContentPH_Hidden1').value });
            $('#ctl00_BodyContentPH_txt_MinOTtmie').datetimepicker({ format: 'HH:mm' });
            $('#ctl00_BodyContentPH_txt_MaxOTtime').datetimepicker({ format: 'HH:mm' });
            $('#ctl00_BodyContentPH_txtboxBreak').datetimepicker({ format: 'HH:mm' });
            $('#ctl00_BodyContentPH_txtFirstHalfWorkHrs').datetimepicker({ format: 'HH:mm' });
            $('#ctl00_BodyContentPH_txtSecondHalfWorkHrs').datetimepicker({ format: 'HH:mm' });
            $('#ctl00_BodyContentPH_txtMaxShiftWorkHours').datetimepicker({ format: 'HH:mm' });
        });

        var SelectCompany = "Select Company";
        var EnterShiftName = "Enter Shift Name";
        var EnterShiftShortName = "Enter Shift Short Name";
        var EnterMinimumHrstomarkPresentforStraightShift = "Enter Minimum Hours required for a day";
        var EnterShiftIntime = "Enter Shift Intime";
        var EnterShiftOuttime = "Enter Shift Outtime";
        var Selectfirsthalfstarttime = "Select first half start time";
        var Selectfirsthalfendtime = "Select first half end time";
        var Selectsecondhalfstarttime = "Select second half start time";
        var Selectsecondhalfendtime = "Select second half end time";
        var SelectBreakEndTime1 = "Select BreakEndTime1";
        var SelectBreakStartTime1 = "Select BreakStartTime1";
        var SelectBreakEndTime2 = "Select BreakEndTime2";
        var SelectBreakStartTime2 = "Select BreakStartTime2";
        var SelectBreakEndTime3 = "Select BreakEndTime3";
        var SelectBreakStartTime3 = "Select BreakStartTime3";
        var ClickCalculateHours = "Click Calculate Hours";
        var ConfirmSave = "Are you sure, to Save?";
        var MaxLength = "Maximum length is ";
        var ChckMaxLength = "Maximum length is 250";
        var Invalidtimeformat = 'Invalid time format:';
        var Permission = "Enter in hh:mm format";
        var InvalidBreakTime = "InvalidBreakTime";
        var EnterGraceShiftin = "Enter valid Grace ShiftIn time";
        var EnterGraceShiftOut = "Enter valid Grace ShiftOut time";
        var EnterMinOT = "Enter valid Minimum OT time";
        var EnterMaxOT = "Enter valid Maximum OT time";
        var EntervalidGraceShiftIn = "Enter valid Grace Shift In";
        var EntervalidGraceShiftOut = "Enter valid Grace Shift Out";
        var MaximumWorkedHrs = "Minimum Hours required for a day should not be greater than Total Working Hours (hh:mm)";
        var EntervalidMinimumExtraTimeForOT = "Enter valid Minimum Extra Time For OT (hh:mm)";
        var EnterMaximumExtraTimeForOT = "Enter Maximum Extra Time For OT(hh:mm)";
        var MaximumExtraTimeForOTMinimum = "Maximum Extra Time For OT (hh:mm) should be greater than Minimum Extra Time For OT (hh:mm)";
        var EnterOverTimeOnWorkingDays = "Enter Over Time On Working Days";
        var EntervaliddatainOverTimeOnWorkingDays = "Enter valid data in Over Time On Working Days";
        var EnterMinimumExtraTimeForOT = "Enter Minimum Extra Time For OT(hh:mm)";
        var MaximumExtraTimeForOT = "Maximum Extra Time For OT (hh:mm) should be greater than Minimum Extra Time For OT (hh:mm)";
        //vaighai Part
        var MaxworkhrsAftershiftEndtime = "Maximum Hours required for a day (hh:mm) should be greater than 12 hours";
        var EnterMaxWorkHours = "Enter Maximum Hours required for a day";

        function InvalidFun(invalidBreakTime) {
            InvalidBreakTime = invalidBreakTime;
        }
        function chkPermission(permission) {
            Permission = permission;
        }
        function ChMaxLengthh(chckMaxLength) {
            ChckMaxLength = chckMaxLength;
        }
        function MaxLengthh(maxLength) {
            MaxLength = maxLength;
        }
        function ShowMinimumWorked() {
            if (document.aspnetForm.ctl00_BodyContentPH_ckbStaightShift.checked == true) {
                document.getElementById('ctl00_BodyContentPH_txt_MinimumHrs').disabled = false;
                document.getElementById('ctl00_BodyContentPH_divFirstAndSecondSession').style.display = "none";
                document.getElementById('ctl00_BodyContentPH_Div_Break').style.display = "none";
                document.getElementById('ctl00_BodyContentPH_straightShiftParameters').style.display = "";
                document.getElementById('ctl00_BodyContentPH_txtboxBreak').value = "";
                document.getElementById('ctl00_BodyContentPH_rb24HrsShiftNo').checked = true;
                document.getElementById('ctl00_BodyContentPH_rb24HrsShiftYes').disabled = true;
                document.getElementById('ctl00_BodyContentPH_rb24HrsShiftNo').disabled = true;
            }
            else {
                document.getElementById('ctl00_BodyContentPH_txt_MinimumHrs').disabled = true;
                document.getElementById('ctl00_BodyContentPH_txt_MinimumHrs').value = "";
                document.getElementById('ctl00_BodyContentPH_divFirstAndSecondSession').disabled = true;
                document.getElementById('ctl00_BodyContentPH_divFirstAndSecondSession').style.display = "";
                document.getElementById('ctl00_BodyContentPH_Div_Break').style.display = "";
                document.getElementById('ctl00_BodyContentPH_straightShiftParameters').style.display = "none";
                document.getElementById('ctl00_BodyContentPH_rb24HrsShiftYes').disabled = false;
                document.getElementById('ctl00_BodyContentPH_rb24HrsShiftNo').disabled = false;
            }
        }
        function SetAlertMessages
            (selectCompany, enterShiftName, enterShiftShortName, enterShiftIntime, enterShiftOuttime, selectfirsthalfstarttime,
            selectfirsthalfendtime, selectsecondhalfstarttime, selectsecondhalfendtime, selectBreakEndTime1, selectBreakStartTime1,
            selectBreakEndTime2, selectBreakStartTime2, selectBreakEndTime3, selectBreakStartTime3, clickCalculateHours, confirmSave,
            invalidtimeformat, EntergraceShiftin, EntergraceShiftOut, EnterminOT, EntermaxOT, entervalidGraceShiftIn, entervalidGraceShiftOut,
            entervalidMinimumExtraTimeForOT, enterMaximumExtraTimeForOT, maximumExtraTimeForOTMinimum, enterOverTimeOnWorkingDays,
            entervaliddatainOverTimeOnWorkingDays, enterMinimumExtraTimeForOT, maximumExtraTimeForOT, enterMinimumHrstomarkPresentforStraightShift, MaxworkhrsAftershiftEndtime, EnterMaxWorkHours
            ) {
            SelectCompany = selectCompany;
            EnterShiftName = enterShiftName;
            EnterShiftShortName = enterShiftShortName;
            EnterShiftIntime = enterShiftIntime;
            EnterShiftOuttime = enterShiftOuttime;
            Selectfirsthalfstarttime = selectfirsthalfstarttime;
            Selectfirsthalfendtime = selectfirsthalfendtime;
            Selectsecondhalfstarttime = selectsecondhalfstarttime;
            Selectsecondhalfendtime = selectsecondhalfendtime;
            SelectBreakEndTime1 = selectBreakEndTime1;
            SelectBreakStartTime1 = selectBreakStartTime1;
            SelectBreakEndTime2 = selectBreakEndTime2;
            SelectBreakStartTime2 = selectBreakStartTime2;
            SelectBreakEndTime3 = selectBreakEndTime3;
            SelectBreakStartTime3 = selectBreakStartTime3;
            ClickCalculateHours = clickCalculateHours;
            ConfirmSave = confirmSave;
            Invalidtimeformat = invalidtimeformat;
            EnterGraceShiftin = EntergraceShiftin;
            EnterGraceShiftOut = EntergraceShiftOut;
            EnterMinOT = EnterminOT;
            EnterMaxOT = EntermaxOT;
            EntervalidGraceShiftIn = entervalidGraceShiftIn;
            EntervalidGraceShiftOut = entervalidGraceShiftOut;
            EntervalidMinimumExtraTimeForOT = EntervalidMinimumExtraTimeForOT;
            EnterMaximumExtraTimeForOT = enterMaximumExtraTimeForOT;
            MaximumExtraTimeForOTMinimum = maximumExtraTimeForOTMinimum;
            EnterOverTimeOnWorkingDays = enterOverTimeOnWorkingDays;
            EntervaliddatainOverTimeOnWorkingDays = entervaliddatainOverTimeOnWorkingDays;
            EnterMinimumExtraTimeForOT = enterMinimumExtraTimeForOT;
            MaximumExtraTimeForOT = maximumExtraTimeForOT;
            EnterMinimumHrstomarkPresentforStraightShift = enterMinimumHrstomarkPresentforStraightShift;
            MaxworkhrsAftershiftEndtime = MaxworkhrsAftershiftEndtime;
            EnterMaxWorkHours = EnterMaxWorkHours;
        }
        function Validation() {
            var ShiftIn, ShiftOut, shiftBreakIn1, shiftBreakIn2, shiftBreakIn3, shiftBreakOut1, shiftBreakOut2, shiftBreakOut3, firstHalfShiftIn, firstHalfShiftOut, secondHalfShiftIn, secondHalfShiftOut;
            var index = document.aspnetForm.ctl00_BodyContentPH_ddlCompany.selectedIndex;
            var company = document.aspnetForm.ctl00_BodyContentPH_ddlCompany.options[index].value;
            shiftBreakIn1 = document.aspnetForm.ctl00_BodyContentPH_txt_BreakStratTime1.value;
            shiftBreakIn2 = document.aspnetForm.ctl00_BodyContentPH_txt_BreakStartTime2.value
            shiftBreakIn3 = document.aspnetForm.ctl00_BodyContentPH_txt_BreakStartTime3.value
            shiftBreakOut1 = document.aspnetForm.ctl00_BodyContentPH_txt_BreakEndTime1.value;
            shiftBreakOut2 = document.aspnetForm.ctl00_BodyContentPH_txt_BreakEndTime2.value;
            shiftBreakOut3 = document.aspnetForm.ctl00_BodyContentPH_txt_BreakEndTime3.value;
            ShiftIn = document.aspnetForm.ctl00_BodyContentPH_txt_ShiftInTime.value;
            ShiftOut = document.aspnetForm.ctl00_BodyContentPH_txt_ShiftOuttime.value;

            firstHalfShiftIn = document.aspnetForm.ctl00_BodyContentPH_txt_FirstHalfStartTime.value;
            firstHalfShiftOut = document.aspnetForm.ctl00_BodyContentPH_txt_FirstHalfEndTime.value;
            secondHalfShiftIn = document.aspnetForm.ctl00_BodyContentPH_txt_SecondHalfStartTime.value;
            secondHalfShiftOut = document.aspnetForm.ctl00_BodyContentPH_txt_SecondHalfEndTime.value;
            //debugger;
            var empCat_index = document.aspnetForm.ctl00_BodyContentPH_ddlEmpCatagory.selectedIndex;
            var empCat_value = document.aspnetForm.ctl00_BodyContentPH_ddlEmpCatagory.options[empCat_index].value;
            if (document.getElementById('ctl00_BodyContentPH_divEastmanShifts').style.display == "none") {
                empCat_value = "-1";
            }
            if (company == "0") {
                alert(SelectCompany);
                document.aspnetForm.ctl00_BodyContentPH_ddlCompany.focus();
                return false;
            }
            if (trim(document.aspnetForm.ctl00_BodyContentPH_txt_ShiftName.value) == "") {
                alert(EnterShiftName);
                document.aspnetForm.ctl00_BodyContentPH_txt_ShiftName.focus();
                return false;
            }
            if (trim(document.aspnetForm.ctl00_BodyContentPH_txtShiftShortName.value) == "") {
                alert(EnterShiftShortName);
                document.aspnetForm.ctl00_BodyContentPH_txtShiftShortName.focus();
                return false;
            }
            if (document.aspnetForm.ctl00_BodyContentPH_ckbStaightShift.checked == true) {
                if (document.aspnetForm.ctl00_BodyContentPH_txt_MinimumHrs.value == "") {
                    alert(EnterMinimumHrstomarkPresentforStraightShift);
                    document.aspnetForm.ctl00_BodyContentPH_txt_MinimumHrs.focus();
                    return false;
                }
            }
            if (empCat_value == "0") {
                alert("Select employee category");
                return false;
            }
            if (document.aspnetForm.ctl00_BodyContentPH_txt_ShiftInTime.value == "") {
                alert(EnterShiftIntime);
                document.aspnetForm.ctl00_BodyContentPH_txt_ShiftInTime.focus();
                return false;
            }
            if (document.aspnetForm.ctl00_BodyContentPH_txt_ShiftInTime.value == "") {
                alert(EnterShiftIntime);
                document.aspnetForm.ctl00_BodyContentPH_txt_ShiftInTime.focus();
                return false;
            }
            if (document.aspnetForm.ctl00_BodyContentPH_txt_ShiftOuttime.value == "") {
                alert(EnterShiftOuttime);
                document.aspnetForm.ctl00_BodyContentPH_txt_ShiftOuttime.focus();
                return false;
            }
            if (document.aspnetForm.ctl00_BodyContentPH_ckbStaightShift.checked == false) {
                if (firstHalfShiftIn == "") {
                    alert(Selectfirsthalfstarttime);
                    return false;
                }
                if (firstHalfShiftOut == "") {
                    alert(Selectfirsthalfendtime);
                    return false;
                }
                if (secondHalfShiftIn == "") {
                    alert(Selectsecondhalfstarttime);
                    return false;
                }
                if (secondHalfShiftOut == "") {
                    alert(Selectsecondhalfendtime);
                    return false;
                }
            }

            if (document.aspnetForm.ctl00_BodyContentPH_txt_GraceShiftIn.value != "") {
                var splittedValue = document.aspnetForm.ctl00_BodyContentPH_txt_GraceShiftIn.value.split(":");
                if (splittedValue.length < 2) {
                    alert(EntervalidGraceShiftIn);
                    document.aspnetForm.ctl00_BodyContentPH_txt_GraceShiftIn.focus();
                    return false;
                }
                else if (splittedValue[0].length < 2) {
                    alert(EntervalidGraceShiftIn);
                    document.aspnetForm.ctl00_BodyContentPH_txt_GraceShiftIn.focus();
                    return false;
                }
                else if (splittedValue[1].length < 2) {
                    alert(EntervalidGraceShiftIn);
                    document.aspnetForm.ctl00_BodyContentPH_txt_GraceShiftIn.focus();
                    return false;
                }
                var HoursToMinutes = splittedValue[0] * 60;
                HoursToMinutes = parseInt(HoursToMinutes) + parseInt(splittedValue[1]);
                //Grace Should be allowed to enter more than 1 hours max 3 hours. if required change it here.
                //As per info tech partner requisition changed the value from 1 hour to 3 hours maximum.
                if (HoursToMinutes > 180) {
                    alert(EnterGraceShiftin);
                    document.aspnetForm.ctl00_BodyContentPH_txt_GraceShiftIn.focus();
                    return false;
                }
            }
            if (document.aspnetForm.ctl00_BodyContentPH_txt_GraceShiftOut.value != "") {
                var splittedValue = document.aspnetForm.ctl00_BodyContentPH_txt_GraceShiftOut.value.split(":");
                if (splittedValue.length < 2) {
                    alert(EntervalidGraceShiftOut);
                    document.aspnetForm.ctl00_BodyContentPH_txt_GraceShiftOut.focus();
                    return false;
                }
                else if (splittedValue[0].length < 2) {
                    alert(EntervalidGraceShiftOut);
                    document.aspnetForm.ctl00_BodyContentPH_txt_GraceShiftOut.focus();
                    return false;
                }
                else if (splittedValue[1].length < 2) {
                    alert(EntervalidGraceShiftOut);
                    document.aspnetForm.ctl00_BodyContentPH_txt_GraceShiftOut.focus();
                    return false;
                }
                var HoursToMinutes = splittedValue[0] * 60;
                HoursToMinutes = parseInt(HoursToMinutes) + parseInt(splittedValue[1]);
                //Grace Should be allowed to enter more than 1 hours max 3 hours. if required change it here.
                //As per info tech partner requisition changed the value from 1 hour to 3 hours maximum.
                if (HoursToMinutes > 180) {
                    alert(EnterGraceShiftOut);
                    document.aspnetForm.ctl00_BodyContentPH_txt_GraceShiftOut.focus();
                    return false;
                }
            }
            if (document.aspnetForm.ctl00_BodyContentPH_ckbStaightShift.checked == false) {
                if (shiftBreakIn1 != "" && shiftBreakOut1 == "") {
                    alert(SelectBreakEndTime1);
                    return false;
                }
                if (shiftBreakIn1 == "" && shiftBreakOut1 != "") {
                    alert(SelectBreakStartTime1);
                    return false;
                }
                if (shiftBreakIn2 != "" && shiftBreakOut2 == "") {
                    alert(SelectBreakEndTime2);
                    return false;
                }
                if (shiftBreakIn2 == "" && shiftBreakOut2 != "") {
                    alert(SelectBreakStartTime2);
                    return false;
                }
                if (shiftBreakIn3 != "" && shiftBreakOut3 == "") {
                    alert(SelectBreakEndTime3);
                    return false;
                }
                if (shiftBreakIn3 == "" && shiftBreakOut3 != "") {
                    alert(SelectBreakStartTime3);
                    return false;
                }
            }
            else {
                if (document.aspnetForm.ctl00_BodyContentPH_txt_MinimumHrs.value != "") {
                    var Min_splittedValue = document.aspnetForm.ctl00_BodyContentPH_txt_MinimumHrs.value.split(":");
                    var Min_HoursToMinutes = Min_splittedValue[0] * 60;
                    Min_HoursToMinutes = parseInt(Min_HoursToMinutes) + parseInt(Min_splittedValue[1]);
                    var splittedValue = document.aspnetForm.ctl00_BodyContentPH_txt_TotalWorkingHourrs.value.split(":");
                    var HoursToMinutes = splittedValue[0] * 60;
                    HoursToMinutes = parseInt(HoursToMinutes) + parseInt(splittedValue[1]);
                    //alert(Min_HoursToMinutes);
                    //alert(HoursToMinutes);
                    if (Min_HoursToMinutes > HoursToMinutes) {
                        alert(MaximumWorkedHrs);
                        return false;
                    }
                }
            }
            if (document.aspnetForm.ctl00_BodyContentPH_txt_TotalWorkingHourrs.value == "" || document.aspnetForm.ctl00_BodyContentPH_txt_TotalWorkingHourrs.value == "0:0") {
                alert(ClickCalculateHours);
                document.aspnetForm.ctl00_BodyContentPH_txt_TotalWorkingHourrs.focus();
                return false;
            }
            if (document.aspnetForm.ctl00_BodyContentPH_txtspecialOTstart1.value == "" && document.aspnetForm.ctl00_BodyContentPH_txtspecialOTstart2.value != "") {
                alert("Enter the value of special Overtime 1");
                document.aspnetForm.ctl00_BodyContentPH_txt_TotalWorkingHourrs.focus();
                return false;
            }
            if (document.aspnetForm.ctl00_BodyContentPH_txt_MinOTtmie.value != "") {
                var Min_splittedValue = document.aspnetForm.ctl00_BodyContentPH_txt_MinOTtmie.value.split(":");
                var Min_HoursToMinutes = Min_splittedValue[0] * 60;
                Min_HoursToMinutes = parseInt(Min_HoursToMinutes) + parseInt(Min_splittedValue[1]);
                if (Min_HoursToMinutes <= 0) {
                    alert(EntervalidMinimumExtraTimeForOT);
                    return false;
                }
                else if (Min_HoursToMinutes > 1439) {
                    alert(EnterminOT);
                    return false;
                }
                else {
                    if (document.aspnetForm.ctl00_BodyContentPH_txt_MaxOTtime.value == "") {
                        alert(EnterMaximumExtraTimeForOT);
                        return false;
                    }
                    else {
                        var splittedValue = document.aspnetForm.ctl00_BodyContentPH_txt_MaxOTtime.value.split(":");
                        var HoursToMinutes = splittedValue[0] * 60;
                        HoursToMinutes = parseInt(HoursToMinutes) + parseInt(splittedValue[1]);
                        if (HoursToMinutes > 1439) {
                            alert(EntermaxOT);
                            return false;
                        }
                        else {
                            if (Min_HoursToMinutes > HoursToMinutes) {
                                alert(MaximumExtraTimeForOTMinimum);
                                return false;
                            }
                            else if (document.aspnetForm.ctl00_BodyContentPH_txt_OverTimeWorkingDays.value == "") {
                                alert(EnterOverTimeOnWorkingDays);
                                return false;
                            }
                            else if (Min_HoursToMinutes != 0 && HoursToMinutes != 0) {
                                if (document.aspnetForm.ctl00_BodyContentPH_txt_OverTimeWorkingDays.value == "0" || document.aspnetForm.ctl00_BodyContentPH_txt_OverTimeWorkingDays.value == "00" || document.aspnetForm.ctl00_BodyContentPH_txt_OverTimeWorkingDays.value == "000") {
                                    alert(EntervaliddatainOverTimeOnWorkingDays);
                                    return false;
                                }
                            }
                        }
                    }
                }
            }
            if (document.aspnetForm.ctl00_BodyContentPH_txt_MaxOTtime.value != "") {
                var Max_splittedValue = document.aspnetForm.ctl00_BodyContentPH_txt_MaxOTtime.value.split(":");
                var Max_HoursToMinutes = Max_splittedValue[0] * 60;
                Max_HoursToMinutes = parseInt(Max_HoursToMinutes) + parseInt(splittedValue[1]);
                if (Max_HoursToMinutes > 1439) {
                    alert(EntermaxOT);
                    return false;
                }
                else {
                    if (document.aspnetForm.ctl00_BodyContentPH_txt_MinOTtmie.value == "") {
                        alert(EnterMinimumExtraTimeForOT);
                        return false;
                    }
                    else {
                        var splittedValue = document.aspnetForm.ctl00_BodyContentPH_txt_MinOTtmie.value.split(":");
                        var HoursToMinutes = splittedValue[0] * 60;
                        HoursToMinutes = parseInt(HoursToMinutes) + parseInt(splittedValue[1]);
                        if (HoursToMinutes > 1439) {
                            alert(EntermaxOT);
                            return false;
                        }
                        else {
                            if (HoursToMinutes > Max_HoursToMinutes) {
                                alert(MaximumExtraTimeForOTMinimum);
                                return false;
                            }
                            else if (document.aspnetForm.ctl00_BodyContentPH_txt_OverTimeWorkingDays.value == "") {
                                alert(EnterOverTimeOnWorkingDays);
                                return false;
                            }
                            else if (Max_HoursToMinutes != 0 && HoursToMinutes != 0) {
                                if (document.aspnetForm.ctl00_BodyContentPH_txt_OverTimeWorkingDays.value == "0" || document.aspnetForm.ctl00_BodyContentPH_txt_OverTimeWorkingDays.value == "00" || document.aspnetForm.ctl00_BodyContentPH_txt_OverTimeWorkingDays.value == "000") {
                                    alert(EntervaliddatainOverTimeOnWorkingDays);
                                    return false;
                                }
                            }
                        }
                    }
                }
            }
            if (document.aspnetForm.ctl00_BodyContentPH_DefaultShiftCount.value == "") {
                return confirm(ConfirmSave);
            }

        }
        function ValidationHours(BreakTime) {
            InvalidBreakTime = BreakTime;
            var shiftBreakIn1, shiftBreakIn2, shiftBreakIn3, shiftBreakOut1, shiftBreakOut2, shiftBreakOut3, firstHalfShiftIn, firstHalfShiftOut, secondHalfShiftIn, secondHalfShiftOut;
            var index = document.aspnetForm.ctl00_BodyContentPH_ddlCompany.selectedIndex;
            var company = document.aspnetForm.ctl00_BodyContentPH_ddlCompany.options[index].value;
            shiftBreakIn1 = document.aspnetForm.ctl00_BodyContentPH_txt_BreakStratTime1.value;
            shiftBreakIn2 = document.aspnetForm.ctl00_BodyContentPH_txt_BreakStartTime2.value;
            shiftBreakIn3 = document.aspnetForm.ctl00_BodyContentPH_txt_BreakStartTime3.value;
            shiftBreakOut1 = document.aspnetForm.ctl00_BodyContentPH_txt_BreakEndTime1.value;
            shiftBreakOut2 = document.aspnetForm.ctl00_BodyContentPH_txt_BreakEndTime2.value;
            shiftBreakOut3 = document.aspnetForm.ctl00_BodyContentPH_txt_BreakEndTime3.value;
            ShiftIn = document.aspnetForm.ctl00_BodyContentPH_txt_ShiftInTime.value;
            ShiftOut = document.aspnetForm.ctl00_BodyContentPH_txt_ShiftOuttime.value;
            firstHalfShiftIn = document.aspnetForm.ctl00_BodyContentPH_txt_FirstHalfStartTime.value;
            firstHalfShiftOut = document.aspnetForm.ctl00_BodyContentPH_txt_FirstHalfEndTime.value;
            secondHalfShiftIn = document.aspnetForm.ctl00_BodyContentPH_txt_SecondHalfStartTime.value;
            secondHalfShiftOut = document.aspnetForm.ctl00_BodyContentPH_txt_SecondHalfEndTime.value;
            if (company == "0") {
                alert(SelectCompany);
                return false;
            }
            if (trim(document.aspnetForm.ctl00_BodyContentPH_txt_ShiftName.value) == "") {
                alert(EnterShiftName);
                document.aspnetForm.ctl00_BodyContentPH_txt_ShiftName.focus();
                return false;
            }
            else if (trim(document.aspnetForm.ctl00_BodyContentPH_txtShiftShortName.value) == "") {
                alert(EnterShiftShortName);
                document.aspnetForm.ctl00_BodyContentPH_txtShiftShortName.focus();
                return false;
            }
            else if (document.aspnetForm.ctl00_BodyContentPH_txt_ShiftInTime.value == "") {
                alert(EnterShiftIntime);
                document.aspnetForm.ctl00_BodyContentPH_txt_ShiftInTime.focus();
                return false;
            }
            else if (document.aspnetForm.ctl00_BodyContentPH_txt_ShiftInTime.value == "") {
                alert(EnterShiftIntime);
                document.aspnetForm.ctl00_BodyContentPH_txt_ShiftInTime.focus();
                return false;
            }
            else if (document.aspnetForm.ctl00_BodyContentPH_txt_ShiftOuttime.value == "") {
                alert(EnterShiftOuttime);
                document.aspnetForm.ctl00_BodyContentPH_txt_ShiftOuttime.focus();
                return false;
            }
            if (document.aspnetForm.ctl00_BodyContentPH_ckbStaightShift.checked == false) {
                if (firstHalfShiftIn == "") {
                    alert(Selectfirsthalfstarttime);
                    return false;
                }
                else if (firstHalfShiftOut == "") {
                    alert(Selectfirsthalfendtime);
                    return false;
                }
                else if (secondHalfShiftIn == "") {
                    alert(Selectsecondhalfstarttime);
                    return false;
                }
                else if (secondHalfShiftOut == "") {
                    alert(Selectsecondhalfendtime);
                    return false;
                }
                else if (shiftBreakIn1 != "" && shiftBreakOut1 == "") {
                    alert(SelectBreakEndTime1);
                    return false;
                }
                else if (shiftBreakIn1 == "" && shiftBreakOut1 != "") {
                    alert(SelectBreakStartTime1);
                    return false;
                }
                else if (shiftBreakIn2 != "" && shiftBreakOut2 == "") {
                    alert(SelectBreakEndTime2);
                    return false;
                }
                else if (shiftBreakIn2 == "" && shiftBreakOut2 != "") {
                    alert(SelectBreakStartTime2);
                    return false;
                }
                else if (shiftBreakIn3 != "" && shiftBreakOut3 == "") {
                    alert(SelectBreakEndTime3);
                    return false;
                }
                else if (shiftBreakIn3 == "" && shiftBreakOut3 != "") {
                    alert(SelectBreakStartTime3);
                    return false;
                }
            }
            //tIME fORMAT VAlIDATION    
            var blnValidTime = true;
            if (trim(document.aspnetForm.ctl00_BodyContentPH_txt_ShiftInTime.value) != "") {
                blnValidTime = checkTimeValueOfShift(document.aspnetForm.ctl00_BodyContentPH_txt_ShiftInTime, document.getElementById('ctl00_BodyContentPH_Hidden1').value, Invalidtimeformat);
                if (blnValidTime == false) {
                    return false;
                }
            }
            if (trim(document.aspnetForm.ctl00_BodyContentPH_txt_ShiftOuttime.value) != "") {
                blnValidTime = checkTimeValueOfShift(document.aspnetForm.ctl00_BodyContentPH_txt_ShiftOuttime, document.getElementById('ctl00_BodyContentPH_Hidden1').value, Invalidtimeformat);
                if (blnValidTime == false) {
                    return false;
                }
            }
            if (document.aspnetForm.ctl00_BodyContentPH_ckbStaightShift.checked == false) {
                if (trim(document.aspnetForm.ctl00_BodyContentPH_txt_FirstHalfStartTime.value) != "") {
                    blnValidTime = checkTimeValueOfShift(document.aspnetForm.ctl00_BodyContentPH_txt_FirstHalfStartTime, document.getElementById('ctl00_BodyContentPH_Hidden1').value, Invalidtimeformat);
                    if (blnValidTime == false) {
                        return false;
                    }
                }
                if (document.aspnetForm.ctl00_BodyContentPH_txt_FirstHalfEndTime.value != "") {
                    blnValidTime = checkTimeValueOfShift(document.aspnetForm.ctl00_BodyContentPH_txt_FirstHalfEndTime, document.getElementById('ctl00_BodyContentPH_Hidden1').value, Invalidtimeformat);
                    if (blnValidTime == false) {
                        return false;
                    }
                }
                if (trim(document.aspnetForm.ctl00_BodyContentPH_txt_SecondHalfStartTime.value) != "") {
                    blnValidTime = checkTimeValueOfShift(document.aspnetForm.ctl00_BodyContentPH_txt_SecondHalfStartTime, document.getElementById('ctl00_BodyContentPH_Hidden1').value, Invalidtimeformat);
                    if (blnValidTime == false) {
                        return false;
                    }
                }
                if (document.aspnetForm.ctl00_BodyContentPH_txt_SecondHalfEndTime.value != "") {
                    blnValidTime = checkTimeValueOfShift(document.aspnetForm.ctl00_BodyContentPH_txt_SecondHalfEndTime, document.getElementById('ctl00_BodyContentPH_Hidden1').value, Invalidtimeformat);
                    if (blnValidTime == false) {
                        return false;
                    }
                }
                if (document.aspnetForm.ctl00_BodyContentPH_txt_BreakStratTime1.value != "") {
                    blnValidTime = checkTimeValueOfShift(document.aspnetForm.ctl00_BodyContentPH_txt_BreakStratTime1, document.getElementById('ctl00_BodyContentPH_Hidden1').value, Invalidtimeformat);
                    if (blnValidTime == false) {
                        return false;
                    }
                }
                if (trim(document.aspnetForm.ctl00_BodyContentPH_txt_BreakEndTime1.value) != "") {
                    blnValidTime = checkTimeValueOfShift(document.aspnetForm.ctl00_BodyContentPH_txt_BreakEndTime1, document.getElementById('ctl00_BodyContentPH_Hidden1').value, Invalidtimeformat);
                    if (blnValidTime == false) {
                        return false;
                    }
                }
                if (document.aspnetForm.ctl00_BodyContentPH_txt_BreakStartTime2.value != "") {
                    blnValidTime = checkTimeValueOfShift(document.aspnetForm.ctl00_BodyContentPH_txt_BreakStartTime2, document.getElementById('ctl00_BodyContentPH_Hidden1').value, Invalidtimeformat);
                    if (blnValidTime == false) {
                        return false;
                    }
                }
                if (document.aspnetForm.ctl00_BodyContentPH_txt_BreakEndTime2.value != "") {
                    blnValidTime = checkTimeValueOfShift(document.aspnetForm.ctl00_BodyContentPH_txt_BreakEndTime2, document.getElementById('ctl00_BodyContentPH_Hidden1').value, Invalidtimeformat);
                    if (blnValidTime == false) {
                        return false;
                    }
                }
                if (trim(document.aspnetForm.ctl00_BodyContentPH_txt_BreakStartTime3.value) != "") {
                    blnValidTime = checkTimeValueOfShift(document.aspnetForm.ctl00_BodyContentPH_txt_BreakStartTime3, document.getElementById('ctl00_BodyContentPH_Hidden1').value, Invalidtimeformat);
                    if (blnValidTime == false) {
                        return false;
                    }
                }
                if (document.aspnetForm.ctl00_BodyContentPH_txt_BreakEndTime3.value != "") {
                    blnValidTime = checkTimeValueOfShift(document.aspnetForm.ctl00_BodyContentPH_txt_BreakEndTime3, document.getElementById('ctl00_BodyContentPH_Hidden1').value, Invalidtimeformat);
                    if (blnValidTime == false) {
                        return false;
                    }
                }
            }
            ShiftTime(InvalidBreakTime);
            return false;
        }
        function ClearBreakTime1() {
            document.aspnetForm.ctl00_BodyContentPH_txt_BreakStratTime1.value = "";
            document.aspnetForm.ctl00_BodyContentPH_txt_BreakEndTime1.value = "";
            document.aspnetForm.ctl00_BodyContentPH_txtFirstHalfWorkHrs.value = "";
            document.aspnetForm.ctl00_BodyContentPH_txtSecondHalfWorkHrs.value = "";
            document.aspnetForm.ctl00_BodyContentPH_txt_TotalWorkingHourrs.value = "";
            return false;
        }
        function ClearBreakTime2() {
            document.aspnetForm.ctl00_BodyContentPH_txt_BreakStartTime2.value = "";
            document.aspnetForm.ctl00_BodyContentPH_txt_BreakEndTime2.value = "";
            document.aspnetForm.ctl00_BodyContentPH_txtFirstHalfWorkHrs.value = "";
            document.aspnetForm.ctl00_BodyContentPH_txtSecondHalfWorkHrs.value = "";
            document.aspnetForm.ctl00_BodyContentPH_txt_TotalWorkingHourrs.value = "";
            return false;
        }
        function ClearBreakTime3() {
            document.aspnetForm.ctl00_BodyContentPH_txt_BreakStartTime3.value = "";
            document.aspnetForm.ctl00_BodyContentPH_txt_BreakEndTime3.value = "";
            document.aspnetForm.ctl00_BodyContentPH_txtFirstHalfWorkHrs.value = "";
            document.aspnetForm.ctl00_BodyContentPH_txtSecondHalfWorkHrs.value = "";
            document.aspnetForm.ctl00_BodyContentPH_txt_TotalWorkingHourrs.value = "";
            return false;
        }
        function ClearHours() {
            document.aspnetForm.ctl00_BodyContentPH_txtFirstHalfWorkHrs.value = "";
            document.aspnetForm.ctl00_BodyContentPH_txtSecondHalfWorkHrs.value = "";
            document.aspnetForm.ctl00_BodyContentPH_txt_TotalWorkingHourrs.value = "";
            return false;
        }
    </script>

    <div class="content-header">
        <h1 style="background-image: url('../dist/img/shifticon.png'); background-repeat: no-repeat; padding-left: 35px">
            <asp:Label ID="lbl_ShiftTiming" runat="server"></asp:Label>
        </h1>
        <asp:SiteMapPath ID="site" runat="server" CssClass="breadcrumb">
            <NodeStyle CssClass="active" />
        </asp:SiteMapPath>
    </div>
    <div class="content">
        <div class="exda-table">
            <h6>
                <span style="color: Red">|</span>
                <asp:Label ID="lbl_IndicatesMandatoryFields" runat="server"></asp:Label>
                (9 No.)</h6>
            <asp:HiddenField ID="Hidden1" runat="server" />
            <asp:HiddenField ID="DefaultShiftCount" runat="server" />
        </div>
        <!--FILTERS-->
        <div class="emp-filter" style="padding-top: 0px">
            <div class="row">
                <div class="form-horizontal">
                    <div>
                        <div class="row">
                            <div class="lve-polhdr2" style="padding: 7px 10px 3px 10px;">
                                <h3 style="font-size: 15px; padding-bottom: 2px;">
                                    <asp:Label ID="lbl_General" runat="server"></asp:Label>
                                </h3>
                            </div>
                        </div>
                        <div class="row lve-polhdr4" style="margin: 0px -5px; padding: 20px 0 0 10px;">
                            <div>
                                <div class="col-md-12">
                                    <div class="form-group">
                                        <div class="col-md-2">
                                            <asp:Label ID="lblCompany" runat="server"></asp:Label>
                                        </div>
                                        <div class="col-md-3">
                                            <asp:DropDownList ID="ddlCompany" runat="server" AppendDataBoundItems="true" CssClass="form-control select2 Man-dat">
                                                <asp:ListItem Value="0" Text="-Select-"></asp:ListItem>
                                            </asp:DropDownList>
                                        </div>
                                        <div class="col-md-1">
                                        </div>
                                        <div class="col-md-2">
                                            <asp:Label ID="lblDefaultShift" runat="server"></asp:Label>
                                        </div>
                                        <div class="col-md-4 Pad-left-7px">
                                            <div class="col-md-6">
                                                <asp:RadioButton ID="rbtnYes" runat="server" GroupName="DefaultShift"
                                                    CssClass="radioLeave radioLeave-primary" />
                                            </div>
                                            <div class="col-md-6">
                                                <asp:RadioButton ID="rbtnNo" runat="server" GroupName="DefaultShift" Checked="true"
                                                    CssClass="radioLeave radioLeave-primary" />
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="col-md-12">
                                    <div class="form-group">
                                        <div class="col-md-2">
                                            <asp:Label ID="lbl_StraightShiftReq" runat="server"></asp:Label>
                                        </div>
                                        <div class="col-md-3">
                                            <asp:CheckBox ID="ckbStaightShift" runat="server" CssClass="checkbox checkbox-primary" onclick="ShowMinimumWorked();" />
                                        </div>
                                        <div class="col-md-1">
                                        </div>
                                        <div class="col-md-2">
                                            <asp:Label ID="lbl24HrsShift" runat="server"></asp:Label>
                                        </div>
                                        <div class="col-md-4 Pad-left-7px">
                                            <div class="col-md-6">
                                                <asp:RadioButton ID="rb24HrsShiftYes" runat="server" GroupName="24Hrs"
                                                    CssClass="radioLeave radioLeave-primary" />
                                            </div>
                                            <div class="col-md-6">
                                                <asp:RadioButton ID="rb24HrsShiftNo" runat="server" Checked="true" GroupName="24Hrs"
                                                    CssClass="radioLeave radioLeave-primary" />
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="col-md-12">
                                    <div class="form-group">
                                        <div class="col-md-2">
                                            <asp:Label ID="lbl_ShiftName" runat="server"></asp:Label>
                                        </div>
                                        <div class="col-md-3">
                                            <asp:TextBox onpaste="return true" ID="txt_ShiftName" runat="server" CssClass="form-control mandatory"
                                                MaxLength="30" onkeypress="return chkMaxLen(event,this,30,MaxLength);"></asp:TextBox>
                                        </div>
                                        <div class="col-md-1">
                                        </div>
                                        <div class="col-md-2">
                                            <asp:Label ID="lbl_ShiftShortName" runat="server"></asp:Label>
                                        </div>
                                        <div class="col-md-3">
                                            <asp:TextBox onpaste="return true" ID="txtShiftShortName" runat="server" CssClass="form-control mandatory"
                                                MaxLength="3" onkeypress="return chkMaxLen(event,this,3,MaxLength);"></asp:TextBox>
                                        </div>
                                    </div>
                                </div>
                                <div class="col-md-12">
                                    <div class="form-group">
                                        <div class="col-md-2">
                                            <asp:Label ID="lbl_ShiftDescription" runat="server"></asp:Label>
                                        </div>
                                        <div class="col-md-3">
                                            <asp:TextBox onpaste="return true" ID="txt_ShiftDescription" runat="server" CssClass="form-control"
                                                onkeypress="return chkMaxLen(event,this,255,MaxLength);"
                                                MaxLength="255" Style="resize: none">
                                            </asp:TextBox>
                                        </div>
                                        <div class="col-md-1">
                                        </div>
                                        <div class="col-md-2" id="lblshiftType" runat="server">
                                            <asp:Label ID="lblService" runat="server"></asp:Label>
                                        </div>
                                        <div class="col-md-4 Pad-left-7px" id="lblshiftType1" runat="server">
                                            <div class="col-md-6">
                                                <asp:RadioButton ID="rbFreeScan" runat="server" GroupName="Service"
                                                    CssClass="radioLeave radioLeave-primary" />
                                            </div>
                                            <div class="col-md-6">
                                                <asp:RadioButton ID="rbFunctionKey" runat="server" GroupName="Service"
                                                    Checked="true" CssClass="radioLeave radioLeave-primary" />
                                            </div>
                                        </div>
                                    </div>
                                </div>

                                <div class="col-md-12" id="straightShiftParameters" runat="server" style="display: none">
                                    <div class="form-group">
                                        <div class="col-md-2">
                                            <asp:Label ID="lbl_AttendancePresentMinHrs" runat="server"></asp:Label>
                                        </div>
                                        <div class="col-md-3">
                                            <asp:TextBox ID="txt_MinimumHrs" runat="server" CssClass="form-control mandatory"></asp:TextBox>
                                        </div>
                                        <div class="col-md-1">
                                        </div>
                                        <div class="col-md-2">
                                            <asp:Label ID="lblBreakHours" runat="server"></asp:Label>
                                        </div>
                                        <div class="col-md-3">
                                            <asp:TextBox ID="txtboxBreak" runat="server" CssClass="form-control"></asp:TextBox>
                                        </div>
                                    </div>
                                </div>
                                <div class="col-md-12" id="divEastmanShifts" runat="server">
                                    <div class="form-group">
                                        <div class="col-md-2">
                                            <asp:Label ID="lblEmpCategory" runat="server"></asp:Label>
                                        </div>
                                        <div class="col-md-3">
                                            <asp:DropDownList ID="ddlEmpCatagory" runat="server" CssClass="form-control select2 Man-dat"
                                                AppendDataBoundItems="true">
                                                <asp:ListItem Value="0" Selected="True"></asp:ListItem>
                                            </asp:DropDownList>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div>
                        <div class="row">
                            <div class="lve-polhdr2" style="padding: 7px 10px 3px 10px;">
                                <h3 style="font-size: 15px; padding-bottom: 2px;">
                                    <asp:Label ID="lbl_ShiftTimings" runat="server"></asp:Label>
                                </h3>
                            </div>
                        </div>
                        <div class="row lve-polhdr4" style="margin: 0px -5px; padding: 20px 0 0 10px;">
                            <div class="col-md-12">
                                <div class="form-group">
                                    <div class="col-md-2">
                                        <asp:Label ID="lbl_ShiftIn" runat="server"></asp:Label>
                                    </div>
                                    <div class="col-md-3">
                                        <asp:TextBox onpaste="return true" ID="txt_ShiftInTime" runat="server" CssClass="form-control mandatory"
                                            MaxLength="8" onDrop="return false;" onCut="return false;" onkeypress="return number_colon_Space_AM_PM(event,this);"
                                            onchange="return ClearHours();"></asp:TextBox>
                                    </div>
                                    <div class="col-md-1">
                                    </div>
                                    <div class="col-md-2">
                                        <asp:Label ID="lbl_ShiftOut" runat="server"></asp:Label>
                                    </div>
                                    <div class="col-md-3">
                                        <asp:TextBox ID="txt_ShiftOuttime" runat="server" CssClass="form-control mandatory"
                                            MaxLength="8" onDrop="return false;" onCut="return false;" onpaste="return false;"
                                            onkeypress="return number_colon_Space_AM_PM(event,this);" onchange="return ClearHours();"></asp:TextBox>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <div class="col-md-2">
                                        <asp:Label ID="lbl_GraceShiftIn" runat="server"></asp:Label>
                                    </div>
                                    <div class="col-md-3">
                                        <asp:TextBox ID="txt_GraceShiftIn" runat="server" CssClass="form-control" MaxLength="5"
                                            onDrop="return false;" onpaste="return false;" onkeypress="return number_colon(event,this);"></asp:TextBox>
                                    </div>
                                    <div class="col-md-1">
                                    </div>
                                    <div class="col-md-2">
                                        <asp:Label ID="lbl_GraceShiftOut" runat="server"></asp:Label>
                                    </div>
                                    <div class="col-md-3">
                                        <asp:TextBox ID="txt_GraceShiftOut" runat="server" CssClass="form-control" MaxLength="5"
                                            onDrop="return false;" onpaste="return false;" onkeypress="return number_colon(event,this);"></asp:TextBox>
                                    </div>
                                </div>
                                <div id="divFirstAndSecondSession" runat="server">
                                    <div class="form-group">
                                        <div class="col-md-2">
                                            <asp:Label ID="lbl_FirstHalfStartTime" runat="server"></asp:Label>
                                        </div>
                                        <div class="col-md-3">
                                            <asp:TextBox ID="txt_FirstHalfStartTime" runat="server" CssClass="form-control mandatory"
                                                MaxLength="8" oncut="return false;" ondrop="return false;" onpaste="return false;"
                                                onkeypress="return number_colon_Space_AM_PM(event,this);" onchange="return ClearHours();"></asp:TextBox>
                                        </div>
                                        <div class="col-md-1">
                                        </div>
                                        <div class="col-md-2">
                                            <asp:Label ID="lbl_FirstHalfEndTime" runat="server"></asp:Label>
                                        </div>
                                        <div class="col-md-3">
                                            <asp:TextBox onpaste="return true" ID="txt_FirstHalfEndTime" runat="server" CssClass="form-control mandatory"
                                                MaxLength="8" oncut="return false;" ondrop="return false;" onkeypress="return number_colon_Space_AM_PM(event,this);"
                                                onchange="return ClearHours();"></asp:TextBox>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <div class="col-md-2">
                                            <asp:Label ID="lbl_SecondHalfStartTime" runat="server"></asp:Label>
                                        </div>
                                        <div class="col-md-3">
                                            <asp:TextBox onpaste="return true" ID="txt_SecondHalfStartTime" runat="server" CssClass="form-control mandatory"
                                                MaxLength="8" oncut="return false;" ondrop="return false;" onkeypress="return number_colon_Space_AM_PM(event,this);"
                                                onchange="return ClearHours();"></asp:TextBox>
                                        </div>
                                        <div class="col-md-1">
                                        </div>
                                        <div class="col-md-2">
                                            <asp:Label ID="lbl_SecondHalfEndTime" runat="server"></asp:Label>
                                        </div>
                                        <div class="col-md-3">
                                            <asp:TextBox onpaste="return true" ID="txt_SecondHalfEndTime" runat="server" CssClass="form-control mandatory"
                                                MaxLength="8" oncut="return false;" ondrop="return false;" onkeypress="return number_colon_Space_AM_PM(event,this);"
                                                onchange="return ClearHours();"></asp:TextBox>
                                        </div>
                                    </div>

                                    <div class="form-group">
                                        <div class="col-md-2">
                                            <asp:Label ID="lblFirstHalfWorkHrs" runat="server"></asp:Label>
                                        </div>
                                        <div class="col-md-3">
                                            <div class="input-group">
                                                <asp:TextBox onpaste="return true" ID="txtFirstHalfWorkHrs" runat="server" CssClass="form-control"
                                                    MaxLength="5" onCut="return false;" onDrop="return false;" onkeydown="return key_press_nokey(event)"
                                                    onkeypress="return key_press_nokey(event)"></asp:TextBox>
                                                <span class="input-group-addon">
                                                    <asp:Label ID="Label1" runat="server"></asp:Label></span>
                                            </div>
                                        </div>
                                        <div class="col-md-1">
                                        </div>
                                        <div class="col-md-2">
                                            <asp:Label ID="lblSecondHalfWorkHrs" runat="server"></asp:Label>
                                        </div>
                                        <div class="col-md-3">
                                            <div class="input-group">
                                                <asp:TextBox onpaste="return true" ID="txtSecondHalfWorkHrs" runat="server" CssClass="form-control"
                                                    MaxLength="5" onCut="return false;" onDrop="return false;" onkeydown="return key_press_nokey(event)"
                                                    onkeypress="return key_press_nokey(event)"></asp:TextBox>
                                                <span class="input-group-addon">
                                                    <asp:Label ID="Label2" runat="server"></asp:Label></span>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <div class="col-md-2">
                                            <asp:Label ID="lbl_MaxShiftWorkHours" runat="server"></asp:Label>
                                        </div>
                                        <div class="col-md-3">
                                            <asp:TextBox onpaste="return true" ID="txtMaxShiftWorkHours" runat="server" CssClass="form-control"
                                                MaxLength="8" oncut="return false;" ondrop="return false;" onkeypress="return number_colon_Space_AM_PM(event,this);"
                                                onchange="return ClearHours();"></asp:TextBox>
                                        </div>
                                        <div class="col-md-7">
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div id="Div_Break" runat="server">
                        <div class="row">
                            <div class="lve-polhdr2" style="padding: 7px 10px 3px 10px;">
                                <h3 style="font-size: 15px; padding-bottom: 2px;">
                                    <asp:Label ID="lbl_BreakTimings" runat="server"></asp:Label>
                                </h3>
                            </div>
                        </div>
                        <div class="row lve-polhdr4" style="margin: 0px -5px; padding: 20px 0 0 10px;">
                            <div class="col-md-12">
                                <div class="form-group">
                                    <div class="col-md-2">
                                        <asp:Label ID="lbl_StartTime1" runat="server"></asp:Label>
                                    </div>
                                    <div class="col-md-3">
                                        <asp:TextBox onpaste="return true" ID="txt_BreakStratTime1" runat="server" CssClass="form-control"
                                            EnableTheming="True" MaxLength="8" onDrop="return false;" onCut="return false;"
                                            onkeypress="return number_colon_Space_AM_PM(event,this);" onchange="return ClearHours();"></asp:TextBox>
                                    </div>
                                    <div class="col-md-1">
                                    </div>
                                    <div class="col-md-2">
                                        <asp:Label ID="lbl_EndTime1" runat="server"></asp:Label>
                                    </div>
                                    <div class="col-md-3">
                                        <asp:TextBox onpaste="return true" ID="txt_BreakEndTime1" runat="server" CssClass="form-control"
                                            EnableTheming="True" MaxLength="8" onDrop="return false;" onCut="return false;"
                                            onkeypress="return number_colon_Space_AM_PM(event,this);" onchange="return ClearHours();"></asp:TextBox>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <div class="col-md-2">
                                        <asp:Label ID="lbl_StartTime2" runat="server"></asp:Label>
                                    </div>
                                    <div class="col-md-3">
                                        <asp:TextBox onpaste="return true" ID="txt_BreakStartTime2" runat="server" CssClass="form-control"
                                            EnableTheming="True" MaxLength="8" onDrop="return false;" onCut="return false;"
                                            onkeypress="return number_colon_Space_AM_PM(event,this);" onchange="return ClearHours();"></asp:TextBox>
                                    </div>
                                    <div class="col-md-1">
                                    </div>
                                    <div class="col-md-2">
                                        <asp:Label ID="lbl_EndTime2" runat="server"></asp:Label>
                                    </div>
                                    <div class="col-md-3">
                                        <asp:TextBox onpaste="return true" ID="txt_BreakEndTime2" runat="server" CssClass="form-control"
                                            EnableTheming="True" MaxLength="8" onDrop="return false;" onCut="return false;"
                                            onchange="return ClearHours();" onkeypress="return number_colon_Space_AM_PM(event,this);"></asp:TextBox>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <div class="col-md-2">
                                        <asp:Label ID="lbl_StartTime3" runat="server"></asp:Label>
                                    </div>
                                    <div class="col-md-3">
                                        <asp:TextBox onpaste="return true" ID="txt_BreakStartTime3" runat="server" CssClass="form-control"
                                            EnableTheming="True" MaxLength="8" onDrop="return false;" onCut="return false;"
                                            onchange="return ClearHours();" onkeypress="return number_colon_Space_AM_PM(event,this);"></asp:TextBox>
                                    </div>
                                    <div class="col-md-1">
                                    </div>
                                    <div class="col-md-2">
                                        <asp:Label ID="lbl_EndTime3" runat="server"></asp:Label>
                                    </div>
                                    <div class="col-md-3">
                                        <asp:TextBox onpaste="return true" ID="txt_BreakEndTime3" runat="server" CssClass="form-control"
                                            EnableTheming="True" MaxLength="8" onDrop="return false;" onCut="return false;"
                                            onchange="return ClearHours();" onkeypress="return number_colon_Space_AM_PM(event,this);"></asp:TextBox>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div>
                        <div class="row">
                            <div class="lve-polhdr2" style="padding: 7px 10px 3px 10px;">
                                <h3 style="font-size: 15px; padding-bottom: 2px;">
                                    <asp:Label ID="lbl_OverTime" runat="server"></asp:Label>
                                </h3>
                            </div>
                        </div>
                        <div class="row lve-polhdr4" style="margin: 0px -5px; padding: 20px 0 0 10px;">
                            <div class="col-md-12">
                                <div class="form-group" id="divspOT1" runat="server" style="display: none">
                                    <div class="col-md-2">
                                        <asp:Label ID="lblSpecialOvertime" runat="server" Text="After"></asp:Label>
                                    </div>
                                    <div class="col-md-3">
                                        <asp:TextBox onpaste="return true" ID="txtspecialOTstart1" runat="server" CssClass="form-control"
                                            MaxLength="5" onDrop="return false;" onkeypress="return number_dotShift(event,this);"></asp:TextBox>
                                    </div>
                                    <div class="col-md-7">
                                        <asp:Label ID="Label4" runat="server" Text="minute(s) of <B>[ OT ]</B> apply <B>Special overtime 1</B>"></asp:Label>
                                    </div>
                                </div>
                                <div class="form-group" id="divspOT2" runat="server" style="display: none">
                                    <div class="col-md-2">
                                        <asp:Label ID="Label3" runat="server" Text="After"></asp:Label>
                                    </div>
                                    <div class="col-md-3">
                                        <asp:TextBox onpaste="return true" ID="txtspecialOTstart2" runat="server" CssClass="form-control"
                                            MaxLength="5" onDrop="return false;" onkeypress="return number_dotShift(event,this);"></asp:TextBox>
                                    </div>
                                    <div class="col-md-7">
                                        <asp:Label ID="Label5" runat="server" Text="minute(s) of <B>[ Special overtime 1 ]</B> apply <B>Special overtime 2</B>"></asp:Label>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <div class="col-md-2">
                                        <asp:Label ID="lbl_MinimumExtraTimeforOT" runat="server"></asp:Label>
                                    </div>
                                    <div class="col-md-3">
                                        <asp:TextBox onpaste="return true" ID="txt_MinOTtmie" runat="server" CssClass="form-control"
                                            MaxLength="5" onDrop="return false;" onkeypress="return number_colon(event,this);"></asp:TextBox>
                                    </div>
                                    <div class="col-md-1">
                                    </div>
                                    <div class="col-md-2">
                                        <asp:Label ID="lbl_MaximumExtraTimeforOT" runat="server"></asp:Label>
                                    </div>
                                    <div class="col-md-3">
                                        <asp:TextBox onpaste="return true" ID="txt_MaxOTtime" runat="server" CssClass="form-control"
                                            MaxLength="5" onblur="return chkPermission(this,Permission);" onDrop="return false;"
                                            onkeypress="return number_colon(event,this);"></asp:TextBox>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <div class="col-md-2">
                                        <asp:Label ID="lbl_OvertimeOnWorkingDays" runat="server"></asp:Label>
                                    </div>
                                    <div class="col-md-3">
                                        <asp:TextBox onpaste="return true" ID="txt_OverTimeWorkingDays" runat="server" CssClass="form-control"
                                            MaxLength="4" onDrop="return false;" onkeypress="return number_dotShift(event,this);"></asp:TextBox>
                                        <asp:RangeValidator ID="RngOverTimeWorkingDays" runat="server" ControlToValidate="txt_OverTimeWorkingDays"
                                            ErrorMessage="Enter Value Between 0 and 365" MaximumValue="365" MinimumValue="0"
                                            Type="Double"></asp:RangeValidator>
                                    </div>
                                    <div class="col-md-1">
                                    </div>
                                    <div class="col-md-2">
                                        <asp:Label ID="lbl_TotalWorkingHours" runat="server"></asp:Label>
                                    </div>
                                    <div class="col-md-3 ">
                                        <div class="input-group">
                                            <asp:TextBox onpaste="return true" ID="txt_TotalWorkingHourrs" runat="server" CssClass="form-control"
                                                MaxLength="5" onCut="return false;" onDrop="return false;" onkeydown="return key_press_nokey(event)"
                                                onkeypress="return key_press_nokey(event)"></asp:TextBox>
                                            <span class="input-group-addon">
                                                <asp:Label ID="lbl_hrs3" runat="server"></asp:Label></span>
                                        </div>

                                    </div>
                                </div>
                                <div class="form-group">
                                    <div class="col-md-2">
                                    </div>
                                    <div class="col-md-3">
                                    </div>
                                    <div class="col-md-1">
                                    </div>
                                    <div class="col-md-3">
                                    </div>
                                    <div class="col-md-2">
                                        <asp:LinkButton ID="btnCalculateHrs" CssClass="btn save-btn fa-calculator pull-right"
                                            runat="server" ToolTip="Calculate Hours"
                                            OnClientClick="return ValidationHours(InvalidBreakTime);" />
                                    </div>
                                    <div class="col-md-1">
                                    </div>
                                </div>
                                <%--             only for vaighai--%>
                            </div>
                        </div>
                    </div>
                    <div class="row form-group" style="margin: 0px -5px; padding: 20px 0 0 10px;">
                        <div class="col-md-6">
                        </div>
                        <div class="col-md-5">
                            <div class="pull-right-button">
                                <asp:LinkButton ID="btn_Add" runat="server" CssClass="btn save-btn fa-floppy-o" OnClick="btn_Add_Click"
                                    OnClientClick="if(Page_ClientValidate()) return Validation();return false;" />
                                <asp:LinkButton ID="btn_Cancel" CssClass="btn save-btn fa-angle-left" runat="server"
                                    OnClick="btn_Cancel_Click" CausesValidation="False" />
                            </div>
                        </div>
                    </div>
                    <div style="margin: 0px -5px; padding: 20px 0 0 10px;">
                        <div class="col-md-12">
                            <div class="callout callout-info" style="margin-bottom: 0!important;">
                                <asp:Label ID="lblImportNote" runat="server"></asp:Label>
                            </div>
                            <br />
                            <ul>
                                <li>
                                    <asp:Label ID="lblnotes1" runat="server" Text="If you are not using any keys in device before marking the punch, select <B>Shift Type</B> as <B>Free scan</B> here."></asp:Label>
                                </li>
                            </ul>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</asp:Content>
