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

<%@ Register TagPrefix="dxGridview" Namespace="DevExpress.Web" Assembly="DevExpress.Web.v14.2" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="BodyContentPH" runat="Server">
    <script src="../js/Map_GoogleV3.js"></script>
    <%--<script src="../js/Map_GoogleV3.1.js"></script>--%>

    <link href="../dist/css/bootstrap-responsive-tabs.css" rel="stylesheet" type="text/css">
    <script src="../dist/js/jquery.bootstrap-responsive-tabs.min.js"></script>
    <script src="../plugins/datepicker/bootstrap-datepicker.js"></script>
    <link href="../dist/css/bootstrap-responsive-tabs.css" rel="stylesheet" type="text/css">
    <link href="../dist/css/login.css" rel="stylesheet" type="text/css">
    <%--<script src="../dist/js/jquery.bootstrap-responsive-tabs.min.js"></script>--%>

    <script type="text/javascript">
        var MaxLength = "Maximum length is ";
        function MaxLengthh(maxLength) {
            MaxLength = maxLength;
        }

        function navi(loc) {
            document.getElementById('ctl00_BodyContentPH_iframePopup').src = loc;
            return false;
        }
    </script>

    <script type="text/javascript">

        $(function () {
            debugger;
            document.getElementById('ctl00_BodyContentPH_PH_Landmark').style.display = "block";
            document.getElementById('ctl00_BodyContentPH_PH_Fencing').style.display = "none";
        //    if (document.getElementById('ctl00_BodyContentPH_PH_Fencing').style.display=="block")
        //    {
        //        document.getElementById('ctl00_BodyContentPH_PH_Fencing').style.display = "none";
        //    }
        //    else
        //    {
        //        document.getElementById('ctl00_BodyContentPH_PH_Fencing').style.display = "block";
        //    }
        //    if (document.getElementById('ctl00_BodyContentPH_PH_Landmark').style.display == "none")
        //    {
        //        document.getElementById('ctl00_BodyContentPH_PH_Landmark').style.display = "block";
        //    }
            
        });

        function Tabchange() {

            debugger;
            document.getElementById('ctl00_BodyContentPH_landamarkDiv').Visibile = false;

        }

        function div_FencingTabShow() {
            //loadPartialView();

            document.getElementById('ctl00_BodyContentPH_PH_Landmark').style.display = "none";
            document.getElementById('ctl00_BodyContentPH_PH_Fencing').style.display = "block";

            //debugger;
            //if (document.getElementById('ctl00_BodyContentPH_PH_Fencing').style.display == "block")
            //{
            //    document.getElementById('ctl00_BodyContentPH_PH_Landmark').style.display = "none";
            //    document.getElementById('ctl00_BodyContentPH_PH_Fencing').style.display = "block";
            //}
            //else
            //{
            //    document.getElementById('ctl00_BodyContentPH_PH_Landmark').style.display = "block";
            //    document.getElementById('ctl00_BodyContentPH_PH_Fencing').style.display = "none";
            //}
            
            $('#tablist a[href="#Fencing"]').tab('show');
            $('#ctl00_BodyContentPH_lblMandat').text("2 No.");
            $('html, body').animate({ scrollTop: 0 }, 'slow');
            return false;

        }

        function div_LandmarkTabShow() {
            debugger;

                document.getElementById('ctl00_BodyContentPH_PH_Landmark').style.display = "block";
                document.getElementById('ctl00_BodyContentPH_PH_Fencing').style.display = "none";
            //if (document.getElementById('ctl00_BodyContentPH_PH_Landmark').style.display == "block") {
            //    document.getElementById('ctl00_BodyContentPH_PH_Landmark').style.display = "none";
            //    document.getElementById('ctl00_BodyContentPH_PH_Fencing').style.display = "block";
            //}
            //else {
            //    document.getElementById('ctl00_BodyContentPH_PH_Landmark').style.display = "block";
            //    document.getElementById('ctl00_BodyContentPH_PH_Fencing').style.display = "none";
            //}
            $('#ctl00_BodyContentPH_grvLandmarks').trigger('reloadGrid');
            $('#tablist a[href="#Landmark"]').tab('show');
            $('#ctl00_BodyContentPH_lblMandat').text("2 No.");
            $('html, body').animate({ scrollTop: 0 }, 'slow');
            return false;
        }

        function getLocation() {

            if (navigator.geolocation) {
                navigator.geolocation.getCurrentPosition(showPosition);
            } else {
                console.log("Geolocation is not supported by this browser.");
            }
        }

        function showPosition(position) {
            var latitude = position.coords.latitude;
            var longitude = position.coords.longitude;

            // Display the location on the page
            //$("#locationResult").text("Latitude: " + latitude + ", Longitude: " + longitude);

            // Send the location to the server-side code using an AJAX request

            document.getElementById('ctl00_BodyContentPH_hdnLatitude').value = latitude;
            document.getElementById('ctl00_BodyContentPH_hdnLongitude').value = longitude;
            //alert('Lattitude' + latitude + 'longituted' + longitude);
            //showControls(2);
            getAttendanceLocation(latitude, longitude);
        }

        function getValue() {
            debugger;
            var Confirm = window.confirm("Are you sure, to Save?");
            if (Confirm)
            {
                var index = document.aspnetForm.ctl00_BodyContentPH_ddlCompany.selectedIndex;
                var company = document.aspnetForm.ctl00_BodyContentPH_ddlCompany.options[index].value;
                //ctl00_BodyContentPH_txtstreet
                var FencingName = document.getElementById('ctl00_BodyContentPH_txtFencName').value;

                if (company == 0) {
                    alert('Select Company');
                    return false;
                }
                if (FencingName == '' || FencingName == 'undefined') {
                    alert('Enter the Fencing Name');
                    return false;
                }
                var checkboxCHk = document.getElementById('ctl00_BodyContentPH_hdnChkBoxValue').value;

                var gvChkbox = document.getElementById("ct100_BodycontentPH_hdnSelectLandamrkIdsRow").value;
                return true;

            }
            else
            {
                document.getElementById('ctl00_BodyContentPH_txtFencName').focus();
                //alert("Data not saved.");
                return false;
            }
            
            //var array = checkboxCHk.split(',');
            //var count = 0;
            //for (var i = 0; i < (array.length - 1) ; i++) {
            //    var chk = document.getElementById('ctl00_BodyContentPH_' + array[i]);
            //    if (chk.checked) {
            //        count = count + 1;
            //    }
            //}
            //if (count == 0) {
            //    alert('Choose Fencing Landmark');
            //    return false;
            //}
            //else
            //{

            //    FencingPolygon();
            //}

           

        }
    </script>



    <div class="content-header">
        <h1 style="background-image: url('../dist/img/city.png'); background-repeat: no-repeat; padding-left: 35px">
            <asp:Label ID="lbllandMarkHeader" Text="Landmark Details" runat="server"></asp:Label>
        </h1>
        <asp:SiteMapPath ID="site" runat="server" CssClass="breadcrumb">
            <NodeStyle CssClass="active" />
        </asp:SiteMapPath>
    </div>
    <div class="content">



        <div class="emp-filter">
            <div class="form-horizontal">
                <asp:UpdatePanel id="upMap" runat="server" UpdateMode="Conditional" >
                    <ContentTemplate>
                          <div class="row form-group">
                    <div class="content">

                        <div id="map-dsply" style="height: 400px; direction: ltr; width: 100%;">
                        </div>
                        <style type="text/css">
                            .nm_buttonPair {
                                right: 96%;
                            }

                            @media screen and (-webkit-min-device-pixel-ratio:0) {
                                .nm_zoomWrap {
                                    margin-right: 96%;
                                }
                            }
                        </style>
                    </div>
                </div>
                    </ContentTemplate>
                </asp:UpdatePanel>
              
                <div class="row form-group">
                    <div class="content">
                        <div class="respos-tab">

                            <div id="DIv" role="tabpanel">
                                <ul class="nav nav-tabs responsive-tabs tab-header" id="tablist">
                                    <li class="active" id="DivLandmark"><a href="#Landmark" role="tab" onclick="return div_LandmarkTabShow();" runat="server" OnClientClick="">
                                        <span>
                                            <img src="../dist/img/Landmark_icon.png"></span>
                                        <asp:Label ID="lblLandmark" runat="server" Text="LandMark" Style="padding: 0"></asp:Label></a></li>
                                    <li id="DivFencing"><a href="#Fencing" role="tab" onclick="return div_FencingTabShow();"><span>
                                        <img src="../dist/img/Fencing_icon.png"></span><asp:Label ID="lbl_Official" runat="server" Text="Geofencing" Style="padding: 0"></asp:Label></a></li>
                                    <%--<li class="pull-right empadd-man">
                                        <h6>
                                            <span style="color: Red">|</span><asp:Label ID="lbl_Mandatory" runat="server" Text="Mandatory" Style="padding: 0"></asp:Label>
                                            (<asp:Label ID="lblMandat" runat="server"
                                                Text="2 No." Style="padding: 0px"></asp:Label>)</h6>
                                    </li>--%>
                                </ul>
                            </div>

                            <div class="tab-content">

                                <%-- Landamrk Tab --%>
                                <div class="tab-pane active" id="Landmark">
                                    <div id="PH_Landmark" runat="server" enableviewstate="true" style="padding: 16px">
                                        <div class="form-horizontal">
                                            <div class="panel-body">
                                                <div class="row" style="display: none">
                                                    <div class="col-md-12">
                                                        <div class="box">
                                                            <div>
                                                                <div class="row">
                                                                    <div class="col-md-3">
                                                                        <asp:Button ID="btn_Landmark_main" runat="server" CssClass="btn btn-block btn-primary"
                                                                            Enabled="false" OnClientClick="return div_Landmark();" OnClick="btn_Landmark_blur_Click" />
                                                                    </div>
                                                                    <div class="col-md-3">
                                                                        <asp:Button ID="btn_Fencing_blur" runat="server" CCausesValidation="true" CssClass="btn btn-block btn-success"
                                                                            OnClientClick="return div_FencingTabShow();" />
                                                                    </div>

                                                                </div>

                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>


                                                <div class="col-md-12">
                                                    <asp:UpdatePanel ID="updPanel" runat="server" UpdateMode="Conditional">
                                                        <ContentTemplate>

                                                            <div id="search-tbl" style="vertical-align: top;">
                                                                <asp:HiddenField ID="hdnSelectRow" runat="server" />
                                                                <asp:Panel runat="server" ID="landamarkDiv" Visible="false">

                                                                    <div style="top: 6px" class="col-md-12">
                                                                        <div class="row form-group">
                                                                            <div class="col-md-3">
                                                                                <asp:Label runat="server" ID="lblfenchType" Text="Mode of fetching"></asp:Label>
                                                                            </div>
                                                                            <div class="col-md-8">
                                                                                <div id="tdStreetAddr" runat="server" class="LandmarkPaddingStyle">
                                                                                    <asp:DropDownList ID="ddlType" runat="server" CssClass="form-control select2" onchange="showControls(this.selectedIndex);">
                                                                                    </asp:DropDownList>
                                                                                </div>
                                                                            </div>
                                                                        </div>
                                                                        <div class="row form-group">
                                                                            <div class="col-md-3">
                                                                                <asp:Label ID="lblLocat" runat="server" Text="Location Name & Radius"></asp:Label>
                                                                            </div>
                                                                            <div class="col-md-3">
                                                                                <asp:TextBox ID="txtLocationName" Width="100px" CssClass="form-control mandatory" runat="server" MaxLength="100" onpaste="return false"
                                                                                    onkeypress="return acceptChars_MaxLength(event,this,100,MaxLength);" ondrop="return false"></asp:TextBox>

                                                                            </div>
                                                                            <div class="col-md-3 nullpadding" style="margin-left: -24px;">
                                                                                <asp:TextBox ID="txtRadius" Width="100px" runat="server" CssClass="form-control" onpaste="return true" ondrop="return false"
                                                                                    MaxLength="4" onkeypress="return number_only(event,this);"></asp:TextBox>
                                                                            </div>

                                                                            <div class="col-xs-2">
                                                                                <asp:Label ID="lblinmetres" runat="server" Text="in metres"></asp:Label>
                                                                            </div>
                                                                        </div>
                                                                        <div class="row form-group">
                                                                            <div class="col-md-3">
                                                                                <asp:Label ID="lblDescript" runat="server" Text="Description"></asp:Label>
                                                                            </div>
                                                                            <div class="col-md-8">
                                                                                <asp:TextBox ID="txtLocationDesc" runat="server" CssClass="form-control" Height="50px" MaxLength="250"
                                                                                    onkeypress="return acceptChars_MaxLength(event,this,250,MaxLength);" TextMode="MultiLine" Style="resize: none"></asp:TextBox>

                                                                            </div>
                                                                        </div>
                                                                        <div class="row form-group">
                                                                            <div id="spAddr" name="spAddr" runat="server">
                                                                                <div class="col-md-3">
                                                                                    <asp:Label ID="lblAddress" runat="server" valign="top" Text="Address"></asp:Label>
                                                                                </div>
                                                                                <div class="col-md-3">
                                                                                    <asp:TextBox ID="txtstreet" CssClass="form-control mandatory" runat="server"
                                                                                        Style="resize: none" TextMode="MultiLine" MaxLength="250" onkeypress="return acceptCharsNum_MaxLength(event,this,250,MaxLength);"></asp:TextBox>

                                                                                </div>
                                                                                <div class="col-md-5 nullpadding">

                                                                                    <div class="col-md-2">
                                                                                        <asp:Label ID="Label1" runat="server" valign="top" Text="City"></asp:Label>
                                                                                    </div>
                                                                                    <div class="col-md-10">
                                                                                        <asp:TextBox ID="txtcity" runat="server" CssClass="form-control" onpaste="return false" ondrop="return false"
                                                                                            onkeypress="return acceptChars_MaxLength(event,this,50,MaxLength);" MaxLength="50"></asp:TextBox>
                                                                                    </div>


                                                                                    <div class="col-md-2">
                                                                                        <asp:Label ID="Label2" runat="server" valign="top" Text="State"></asp:Label>
                                                                                    </div>
                                                                                    <div class="col-md-10">
                                                                                        <asp:TextBox ID="txtstate" runat="server" CssClass="form-control" onpaste="return false" ondrop="return false"
                                                                                            onkeypress="return acceptChars_MaxLength(event,this,50,MaxLength);" MaxLength="50"></asp:TextBox>
                                                                                    </div>

                                                                                    <div class="col-md-2">
                                                                                        <asp:Label ID="Label3" runat="server" valign="top" Text="Country"></asp:Label>
                                                                                    </div>
                                                                                    <div class="col-md-10">
                                                                                        <asp:TextBox ID="txtCountry" onpaste="return false" CssClass="form-control" ondrop="return false" runat="server"
                                                                                            onkeypress="return acceptChars_MaxLength(event,this,50,MaxLength);" MaxLength="50"></asp:TextBox>
                                                                                    </div>
                                                                                </div>
                                                                            </div>
                                                                        </div>
                                                                        <div class="row form-group" id="spLatlng" name="spLatlng" runat="server" style="display: none;">
                                                                            <div class="col-md-3">
                                                                                <asp:Label ID="lbllatelng" runat="server"></asp:Label>
                                                                            </div>
                                                                            <div class="col-md-4 col-Landmark nullpadding">
                                                                                <asp:TextBox ID="txtlat" CssClass="form-control" runat="server" MaxLength="17"></asp:TextBox>

                                                                            </div>
                                                                            <div class="col-md-4 nullpadding">
                                                                                <asp:TextBox ID="txtlong" CssClass="form-control" runat="server" MaxLength="17"></asp:TextBox>

                                                                            </div>
                                                                        </div>
                                                                        <div class="row form-group">
                                                                        </div>
                                                                        <div class="row form-group">
                                                                            <div class="col-md-3">
                                                                            </div>
                                                                            <div class="col-md-8">
                                                                                <div class="pull-right-button">
                                                                                    <asp:LinkButton ID="btnAddress" runat="server" CssClass="btn save-btn fa-floppy-oo"
                                                                                        OnClick="btnAddress_Click" Text="&nbsp;Map View" OnClientClick="return ViewLocationvalidate();">
                                                                                    </asp:LinkButton>
                                                                                    <asp:LinkButton ID="lnkbtnSave" runat="server" CssClass="btn save-btn fa-floppy-o" OnClientClick="return ValidateControls();"
                                                                                        OnClick="lnkbtnSave_Click" Text="&nbsp;Save">
                                                                                    </asp:LinkButton>
                                                                                    <asp:LinkButton ID="btnCancel" runat="server" CssClass="btn save-btn fa-floppy-oo" OnClientClick="showControls(0);" Text="&nbsp;&nbsp;Cancel"
                                                                                        OnClick="btnCancel_Click">
                                                                                    </asp:LinkButton>


                                                                                    <asp:HiddenField ID="hdnGetAllid" runat="server" />
                                                                                </div>
                                                                            </div>
                                                                        </div>
                                                                    </div>

                                                                    <%-- <div class="row form-group" >
                                                                    <div class="center-block">
                                                                        <div class="Panel-group" id="accordion" role="tablist" aria-multiselectable="true">
                                                                            <div class="panel panel-default">
                                                                                <div class="panel-heading " role="tab" id="headingOne">
                                                                                    <h4 class="panel-title">
                                                                                        <a role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseOne" aria-expanded="true" aria-controls="collapseOne">Add Landmark
                                                                                        </a>
                                                                                    </h4>
                                                                                </div>
                                                                                <div id="collapseOne" class="panel-collapse collapse " role="tabpanel" aria-labelledby="headingOne">
                                                                                    <div class="panel-body">
                                                                                        
                                                                                    </div>
                                                                                </div>
                                                                            </div>
                                                                        </div>

                                                                    </div>
                                                                </div>--%>
                                                                </asp:Panel>

                                                                <asp:Panel ID="landmarkGrid" runat="server">
                                                                    <div class="row form-group">
                                                                        <asp:UpdatePanel ID="UpdPanel1" runat="server" UpdateMode="Conditional">
                                                                            <ContentTemplate>
                                                                                <dxGridview:ASPxGridView ID="grvLandmarks" EnableCallBacks="false" runat="server" EnableTheming="True"
                                                                                    ClientInstanceName="grvLandmarks" KeyFieldName="id" AutoPostBack="true"
                                                                                    AutoGenerateColumns="false" Width="100%" OnHtmlRowCreated="grvLandmarks_HtmlRowCreated">
                                                                                    
                                                                                    <Columns>
                                                                                        <dxGridview:GridViewDataColumn VisibleIndex="0" HeaderStyle-VerticalAlign="Middle"
                                                                                            Width="30px" HeaderStyle-HorizontalAlign="Center" CellStyle-VerticalAlign="Middle"
                                                                                            CellStyle-HorizontalAlign="Center">
                                                                                            <Settings AllowAutoFilter="false" />
                                                                                            <HeaderTemplate>
                                                                                                <input id="chkSelectAll" runat="server" type="checkbox" onclick="SelectAllOnThisPage(this)" />
                                                                                            </HeaderTemplate>
                                                                                            <DataItemTemplate>
                                                                                                <input id="chkSelect" runat="server" type="checkbox" onclick="SelectOnRow(this)"
                                                                                                    accesskey='<%# Eval("id") %>' />
                                                                                            </DataItemTemplate>
                                                                                            <HeaderStyle HorizontalAlign="center" Wrap="true" />
                                                                                        </dxGridview:GridViewDataColumn>
                                                                                        <dxGridview:GridViewDataTextColumn FieldName="Mode of Locating" VisibleIndex="3" Width="150px">
                                                                                            <DataItemTemplate>
                                                                                                <asp:Label ID="lblOptions" Text='<%# Eval("Options") %>' runat="server" Style="overflow-y: auto; overflow-x: auto; word-break: break-all; word-wrap: break-word; display: inline-block;"></asp:Label>
                                                                                            </DataItemTemplate>
                                                                                            <HeaderStyle HorizontalAlign="center" Wrap="true" />
                                                                                            <Settings ShowInFilterControl="False" />
                                                                                        </dxGridview:GridViewDataTextColumn>
                                                                                        <dxGridview:GridViewDataTextColumn FieldName="LocationName" VisibleIndex="4" Width="200px">
                                                                                            <DataItemTemplate>
                                                                                                <asp:Label ID="lblLocationName" Text='<%# Eval("LocationName") %>' runat="server" Style="overflow-y: auto; overflow-x: auto; word-break: break-all; word-wrap: break-word; display: inline-block;"></asp:Label>
                                                                                            </DataItemTemplate>
                                                                                            <HeaderStyle HorizontalAlign="center" Wrap="true" />
                                                                                            <Settings ShowInFilterControl="False" />
                                                                                        </dxGridview:GridViewDataTextColumn>
                                                                                        <dxGridview:GridViewDataTextColumn FieldName="Radius" VisibleIndex="5" Width="100px">
                                                                                            <DataItemTemplate>
                                                                                                <asp:Label ID="lblRadius" Text='<%# Eval("Radius") %>' runat="server" Style="overflow-y: auto; overflow-x: auto; word-break: break-all; word-wrap: break-word; display: inline-block;"></asp:Label>
                                                                                            </DataItemTemplate>
                                                                                            <HeaderStyle HorizontalAlign="center" Wrap="true" />
                                                                                            <Settings ShowInFilterControl="False" />
                                                                                        </dxGridview:GridViewDataTextColumn>
                                                                                        <dxGridview:GridViewDataTextColumn FieldName="Description" VisibleIndex="6" Width="150px">
                                                                                            <DataItemTemplate>
                                                                                                <asp:Label ID="lblDescription" Text='<%# Eval("Description") %>' runat="server" Style="overflow-y: auto; overflow-x: auto; word-break: break-all; word-wrap: break-word; display: inline-block;"></asp:Label>
                                                                                            </DataItemTemplate>
                                                                                            <HeaderStyle HorizontalAlign="center" Wrap="true" />
                                                                                            <Settings ShowInFilterControl="False" />
                                                                                        </dxGridview:GridViewDataTextColumn>
                                                                                        <dxGridview:GridViewDataTextColumn FieldName="Address" VisibleIndex="7" Width="150px">
                                                                                            <DataItemTemplate>
                                                                                                <asp:Label ID="lblAddress" Text='<%# Eval("Address") %>' runat="server" Style="overflow-y: auto; overflow-x: auto; word-break: break-all; word-wrap: break-word; display: inline-block;"></asp:Label>
                                                                                            </DataItemTemplate>
                                                                                            <HeaderStyle HorizontalAlign="center" Wrap="true" />
                                                                                            <Settings ShowInFilterControl="False" />
                                                                                        </dxGridview:GridViewDataTextColumn>
                                                                                        <dxGridview:GridViewDataTextColumn FieldName="City" VisibleIndex="8" Width="150px">
                                                                                            <DataItemTemplate>
                                                                                                <asp:Label ID="lblCity" Text='<%# Eval("City") %>' runat="server" Style="overflow-y: auto; overflow-x: auto; word-break: break-all; word-wrap: break-word; display: inline-block;"></asp:Label>
                                                                                            </DataItemTemplate>
                                                                                            <HeaderStyle HorizontalAlign="center" Wrap="true" />
                                                                                            <Settings ShowInFilterControl="False" />
                                                                                        </dxGridview:GridViewDataTextColumn>
                                                                                        <dxGridview:GridViewDataTextColumn FieldName="State" VisibleIndex="9" Width="150px">
                                                                                            <DataItemTemplate>
                                                                                                <asp:Label ID="lblState" Text='<%# Eval("State") %>' runat="server" Style="overflow-y: auto; overflow-x: auto; word-break: break-all; word-wrap: break-word; display: inline-block;"></asp:Label>
                                                                                            </DataItemTemplate>
                                                                                            <HeaderStyle HorizontalAlign="center" Wrap="true" />
                                                                                            <Settings ShowInFilterControl="False" />
                                                                                        </dxGridview:GridViewDataTextColumn>
                                                                                        <dxGridview:GridViewDataTextColumn FieldName="Country" VisibleIndex="10" Width="150px">
                                                                                            <DataItemTemplate>
                                                                                                <asp:Label ID="lblCountry" Text='<%# Eval("Country") %>' runat="server" Style="overflow-y: auto; overflow-x: auto; word-break: break-all; word-wrap: break-word; display: inline-block;"></asp:Label>
                                                                                            </DataItemTemplate>
                                                                                            <HeaderStyle HorizontalAlign="center" Wrap="true" />
                                                                                            <Settings ShowInFilterControl="False" />
                                                                                        </dxGridview:GridViewDataTextColumn>

                                                                                        <dxGridview:GridViewDataTextColumn FieldName="Latitude" VisibleIndex="11" Width="150px">
                                                                                            <DataItemTemplate>
                                                                                                <asp:Label ID="lbllatitude" Text='<%# Eval("latitude") %>' runat="server" Style="overflow-y: auto; overflow-x: auto; word-break: break-all; word-wrap: break-word; display: inline-block;"></asp:Label>
                                                                                            </DataItemTemplate>
                                                                                            <HeaderStyle HorizontalAlign="center" Wrap="true" />
                                                                                            <Settings ShowInFilterControl="False" />
                                                                                        </dxGridview:GridViewDataTextColumn>
                                                                                        <dxGridview:GridViewDataTextColumn FieldName="Longitude" VisibleIndex="12" Width="150px">
                                                                                            <DataItemTemplate>
                                                                                                <asp:Label ID="lbllongitude" Text='<%# Eval("longitude") %>' runat="server" Style="overflow-y: auto; overflow-x: auto; word-break: break-all; word-wrap: break-word; display: inline-block;"></asp:Label>
                                                                                            </DataItemTemplate>
                                                                                            <HeaderStyle HorizontalAlign="center" Wrap="true" />
                                                                                            <Settings ShowInFilterControl="False" />
                                                                                        </dxGridview:GridViewDataTextColumn>

                                                                                        <dxGridview:GridViewDataTextColumn FieldName="ID" VisibleIndex="12" Width="150px" Visible="false">
                                                                                            <DataItemTemplate>
                                                                                                <asp:Label ID="lbllongitude" Text='<%# Eval("id") %>' runat="server" Style="overflow-y: auto; overflow-x: auto; word-break: break-all; word-wrap: break-word; display: inline-block;"></asp:Label>
                                                                                            </DataItemTemplate>
                                                                                            <HeaderStyle HorizontalAlign="center" Wrap="true" />
                                                                                            <Settings ShowInFilterControl="False" />
                                                                                        </dxGridview:GridViewDataTextColumn>

                                                                                        <dxGridview:GridViewDataTextColumn CellStyle-HorizontalAlign="Center" VisibleIndex="1" Name="Edit" Width="50px">
                                                                                            <DataItemTemplate>
                                                                                                <asp:LinkButton ID="btnEdit" runat="server" CommandArgument='<%# Eval("id") %>' data-toggle="tooltip"
                                                                                                    data-placement="top" CssClass="btn btn-defalut edit-icons" Style="color: #3C8DBC; text-decoration: none;"
                                                                                                    OnClick="ibEdit_Click" CommandName="Edit"></asp:LinkButton>
                                                                                            </DataItemTemplate>
                                                                                        </dxGridview:GridViewDataTextColumn>

                                                                                        <dxGridview:GridViewDataTextColumn CellStyle-HorizontalAlign="Center" VisibleIndex="2"
                                                                                            Name="Delete" Width="50px">
                                                                                            <Settings AllowAutoFilter="false" />
                                                                                            <DataItemTemplate>
                                                                                                <asp:LinkButton ID="ibDelete" runat="server" CommandArgument='<%# Eval("id") %>' data-toggle="tooltip"
                                                                                                    data-placement="top" CssClass="btn btn-defalut del-icons" Style="color: Red"
                                                                                                    CommandName='Delete' OnClick="ibDelete_Click" OnClientClick="return confirm('Are you sure to Delete ?');"></asp:LinkButton>
                                                                                            </DataItemTemplate>
                                                                                            <HeaderStyle HorizontalAlign="center" Wrap="true" />
                                                                                        </dxGridview:GridViewDataTextColumn>
                                                                                    </Columns>
                                                                                    <SettingsPager PageSize="15">
                                                                                        <PageSizeItemSettings Visible="true" ShowAllItem="true" Items="10,20,50,100,200,500" />
                                                                                    </SettingsPager>
                                                                                    <Settings ShowFilterRow="true" ShowFilterRowMenu="true" HorizontalScrollBarMode="Auto" 
                                                                                        VerticalScrollBarMode="Hidden" VerticalScrollableHeight="400" />
                                                                                    <SettingsText EmptyDataRow="No Records Found" />
                                                                                    <SettingsBehavior AutoExpandAllGroups="True" ColumnResizeMode="Control" />
                                                                                    <SettingsBehavior AllowDragDrop="true" />
                                                                                    <ClientSideEvents EndCallback="function(s, e) { grid.PerformCallback('refresh'); }" />
                                                                                </dxGridview:ASPxGridView>
                                                                                <dxGridview:ASPxGridViewExporter ID="ASPxGridViewExporter1" runat="server" GridViewID="grvLandmarks">
                                                                                    <PageFooter Right="[Page # of Pages #]">
                                                                                    </PageFooter>
                                                                                </dxGridview:ASPxGridViewExporter>
                                                                            </ContentTemplate>
                                                                        </asp:UpdatePanel>
                                                                    </div>
                                                                </asp:Panel>


                                                                <div class="row form-group">
                                                                    <div class="pull-right-button">
                                                                        <%--   <a id="btn_add" class="btn add-btn fa-plus" onclick="LandmarkShow();">&nbsp;&nbsp;Add</a>--%>

                                                                        <asp:LinkButton ID="btn_Add" runat="server" CssClass="btn add-btn fa-plus" Text="&nbsp;&nbsp;Add"
                                                                            OnClick="btn_Add_Click">
                                                                        </asp:LinkButton>

                                                                        <asp:LinkButton ID="lnkbtnDelete" runat="server" CssClass="btn del-btn fa-trash-o" Text="&nbsp;&nbsp;Delete"
                                                                            OnClick="lnkbtnDelete_Click" OnClientClick="return confirmdelete(this.form);">
                                                                        </asp:LinkButton>

                                                                        <%--  <asp:LinkButton ID="btn_Back" runat="server" CssClass="btn save-btn fa-angle-left" Text="&nbsp;&nbsp;Back"
                                                                            OnClick="btn_Back_Click" Visible="false">
                                                                        </asp:LinkButton>--%>
                                                                    </div>
                                                                </div>

                                                            </div>

                                                        </ContentTemplate>
                                                    </asp:UpdatePanel>
                                                </div>


                                            </div>
                                        </div>
                                    </div>
                                </div>

                                <%-- Fencing Tab --%>
                                <div class="tab-pane active" id="Fencing">
                                    <div id="PH_Fencing" runat="server" enableviewstate="true" style="padding: 16px">
                                        <div class="form-horizontal">
                                            <div class="panel-body">
                                                <div class="row" style="display: none">
                                                    <div class="col-md-12">
                                                        <div class="box">
                                                            <div>
                                                                <div class="row">
                                                                    <div class="col-md-3">
                                                                        <asp:Button ID="btn_Landmark_blur" runat="server" CssClass="btn btn-block btn-primary"
                                                                            OnClientClick="return div_Landmark();" OnClick="btn_Landmark_blur_Click" />
                                                                    </div>
                                                                    <div class="col-md-3">
                                                                        <asp:Button ID="btn_Fencing_main" runat="server" CCausesValidation="true" CssClass="btn btn-block btn-success"
                                                                            Enabled="false" OnClientClick="return div_FencingTabShow();" />
                                                                    </div>

                                                                </div>

                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>

                                                <div class="col-md-12">
                                                    <asp:UpdatePanel ID="UpdPanel2" runat="server" UpdateMode="Conditional">
                                                        <ContentTemplate>

                                                            <div class="search-tbl" style="vertical-align: top;">


                                                                <asp:Panel ID="FencingDiv" runat="server" Visible="false">

                                                                    <div class="row form-group">
                                                                        <div class="Col-md-12">
                                                                            <div class="col-md-2">
                                                                                <asp:Label runat="server" ID="lblcompany" Text="Company"></asp:Label>
                                                                            </div>
                                                                            <div class="col-md-3">

                                                                                <asp:DropDownList ID="ddlCompany" runat="server" AppendDataBoundItems="true"
                                                                                    CssClass="form-control select2 Man-dat">
                                                                                    <asp:ListItem Text="-Select-" Value="0"></asp:ListItem>

                                                                                </asp:DropDownList>
                                                                            </div>
                                                                            <div class="col-md-2">
                                                                                <asp:Label ID="lblFencingname" runat="server" Text="Fencing Name"></asp:Label>
                                                                            </div>
                                                                            <div class="col-md-3">
                                                                                <asp:TextBox ID="txtFencName" Width="100px" CssClass="form-control mandatory" runat="server" MaxLength="100" onpaste="return false"
                                                                                    onkeypress="return acceptChars_MaxLength(event,this,100,MaxLength);"></asp:TextBox>
                                                                            </div>


                                                                        </div>

                                                                    </div>

                                                                    <div class="row form-group">

                                                                      <%--  <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                                                                            <ContentTemplate>--%>

                                                                        <asp:GridView ID="grvLandmarkIds" Width="100%" runat="server" DataKeyNames="id"
                                                                            AllowPaging="true" AllowSorting="false" AutoGenerateColumns="false" PageSize="10"
                                                                            CssClass="table das-table1"
                                                                            BorderWidth="1px">
                                                                            <Columns>
                                                                                <asp:TemplateField HeaderStyle-CssClass="empheader">
                                                                                    <HeaderTemplate>
                                                                                        <%--<asp:CheckBox ID="checkallIds" runat="server" AutoPostBack="true" OnCheckedChanged="NewCheck_CheckedChanged"
                                                                                            TextAlign="Right"/>--%>
                                                                                      <%--  <input ID="checkallIds" runat="server" AutoPostBack="true" OnCheckedChanged="NewCheck_CheckedChanged"
                                                                                            TextAlign="Right"/>--%>
                                                                                        <input id="chkSelectAlls" runat="server" type="checkbox" onclick="SelectAllOnThisPages(this)" />
                                                                                                

                                                                                        <%--<asp:CheckBox ID="NewCheck" runat="server" AutoPostBack="true" OnCheckedChanged="NewCheck_CheckedChanged"></asp:CheckBox>--%>
                                                                                        
                                                                                    </HeaderTemplate>
                                                                                    <ItemTemplate>
                                                                                        <asp:Label ID="lblLandID" Visible="false" runat="server" Text='<%#Eval("id") %>'></asp:Label>
                                                                                         <input id="chkSelects" runat="server" type="checkbox" onclick="SelectOnRows(this)"
                                                                                                    accesskey='<%# Eval("id") %>' />


                                                                                        <%--<asp:CheckBox ID="chkSelectLandamrkIds" runat="server" AutoPostBack="true" OnCheckedChanged="checkallLandmarkIds_CheckedChanged" value='<%# Eval("id") %>' />--%>


                                                                                       <%-- <asp:CheckBox ID="chkSelectLandamrkIds" runat="server" AutoPostBack="true" value='<%# Eval("id") %>'
                                                                                            ></asp:CheckBox>--%>

                                                                                    </ItemTemplate>
                                                                                    <ItemStyle HorizontalAlign="Center" Width="6%" BorderColor="White" BorderStyle="Solid"
                                                                                        BorderWidth="1px" />
                                                                                    <HeaderStyle HorizontalAlign="Center" BorderColor="White" BorderStyle="Solid" BorderWidth="1px" />
                                                                                </asp:TemplateField>


                                                                                <asp:TemplateField HeaderText="Mode of Locating" Visible="False" HeaderStyle-CssClass="empheader">
                                                                                    <ItemTemplate>
                                                                                        <asp:Label ID="lblModeofLocating" runat="server" Text='<%#Eval("Options") %>'></asp:Label>
                                                                                    </ItemTemplate>
                                                                                    <HeaderStyle BorderColor="White" BorderStyle="Solid" BorderWidth="1px" />
                                                                                    <ItemStyle BorderColor="White" BorderStyle="Solid" BorderWidth="1px" />
                                                                                </asp:TemplateField>

                                                                                <asp:TemplateField HeaderText="Location Name" HeaderStyle-CssClass="empheader">
                                                                                    <ItemTemplate>
                                                                                        <asp:Label ID="lblLocationName" Text='<%# Eval("LocationName") %>' runat="server"></asp:Label>
                                                                                    </ItemTemplate>
                                                                                    <HeaderStyle BorderColor="White" BorderStyle="Solid" BorderWidth="1px" />
                                                                                    <ItemStyle BorderColor="White" BorderStyle="Solid" BorderWidth="1px" />
                                                                                </asp:TemplateField>


                                                                                <asp:TemplateField HeaderText="Address" HeaderStyle-CssClass="empheader">
                                                                                    <ItemTemplate>
                                                                                        <asp:Label ID="lblAddress" Text='<%# Eval("Address") %>' runat="server"></asp:Label>
                                                                                    </ItemTemplate>
                                                                                    <HeaderStyle BorderColor="White" BorderStyle="Solid" BorderWidth="1px" />
                                                                                    <ItemStyle BorderColor="White" BorderStyle="Solid" BorderWidth="1px" />
                                                                                </asp:TemplateField>


                                                                                <asp:TemplateField HeaderText="City" HeaderStyle-CssClass="empheader">
                                                                                    <ItemTemplate>
                                                                                        <asp:Label ID="lblCity" Text='<%# Eval("City") %>' runat="server"></asp:Label>
                                                                                    </ItemTemplate>
                                                                                    <HeaderStyle BorderColor="White" BorderStyle="Solid" BorderWidth="1px" />
                                                                                    <ItemStyle BorderColor="White" BorderStyle="Solid" BorderWidth="1px" />
                                                                                </asp:TemplateField>

                                                                                <asp:TemplateField HeaderText="State" HeaderStyle-CssClass="empheader">
                                                                                    <ItemTemplate>
                                                                                        <asp:Label ID="lblState" Text='<%# Eval("State") %>' runat="server"></asp:Label>
                                                                                    </ItemTemplate>
                                                                                    <HeaderStyle BorderColor="White" BorderStyle="Solid" BorderWidth="1px" />
                                                                                    <ItemStyle BorderColor="White" BorderStyle="Solid" BorderWidth="1px" />
                                                                                </asp:TemplateField>

                                                                                <asp:TemplateField HeaderText="Country" HeaderStyle-CssClass="empheader">
                                                                                    <ItemTemplate>
                                                                                        <asp:Label ID="lblCountry" Text='<%# Eval("Country") %>' runat="server"></asp:Label>
                                                                                    </ItemTemplate>
                                                                                    <HeaderStyle BorderColor="White" BorderStyle="Solid" BorderWidth="1px" />
                                                                                    <ItemStyle BorderColor="White" BorderStyle="Solid" BorderWidth="1px" />
                                                                                </asp:TemplateField>

                                                                                <asp:TemplateField HeaderText="latitude" HeaderStyle-CssClass="empheader">
                                                                                    <ItemTemplate>
                                                                                        <asp:Label ID="lbllatitude" Text='<%# Eval("latitude") %>' runat="server"></asp:Label>
                                                                                    </ItemTemplate>
                                                                                    <HeaderStyle BorderColor="White" BorderStyle="Solid" BorderWidth="1px" />
                                                                                    <ItemStyle BorderColor="White" BorderStyle="Solid" BorderWidth="1px" />
                                                                                </asp:TemplateField>

                                                                                <asp:TemplateField HeaderText="longitude" HeaderStyle-CssClass="empheader">
                                                                                    <ItemTemplate>
                                                                                        <asp:Label ID="lbllongitude" Text='<%# Eval("longitude") %>' runat="server"></asp:Label>
                                                                                    </ItemTemplate>
                                                                                    <HeaderStyle BorderColor="White" BorderStyle="Solid" BorderWidth="1px" />
                                                                                    <ItemStyle BorderColor="White" BorderStyle="Solid" BorderWidth="1px" />
                                                                                </asp:TemplateField>

                                                                            </Columns>
                                                                            <HeaderStyle CssClass="td" />
                                                                            <EmptyDataTemplate>
                                                                                <asp:Label ID="lblNoRecords" runat="server" OnLoad="GetEmptyText"></asp:Label>
                                                                            </EmptyDataTemplate>
                                                                            <RowStyle Height="10px" />
                                                                            <RowStyle Height="30px" CssClass="table-bg" BorderColor="#C5DFFC" />
                                                                            <PagerStyle BorderColor="White" BorderStyle="Solid" BorderWidth="1px" VerticalAlign="Bottom"
                                                                                Font-Overline="False" HorizontalAlign="Right" CssClass="GridPager" Font-Size="Smaller" />
                                                                            <PagerSettings Mode="NumericFirstLast" FirstPageText="First" LastPageText="Last"
                                                                                NextPageText="Next" PreviousPageText="&lt;" />
                                                                            <AlternatingRowStyle BackColor="white" />

                                                                        </asp:GridView>

                                                                       
                                                        <%--</ContentTemplate>
                                                    </asp:UpdatePanel>--%>
                                                                                 <%--<dxGridview:ASPxGridView ID="grvLandmarkIds" EnableCallBacks="false" runat="server"
                                                                                    ClientInstanceName="grvLandmarkIds" KeyFieldName="id" AutoPostBack="true"
                                                                                    AutoGenerateColumns="false" Width="100%">
                                                                                    <Columns>
                                                                                        <dxGridview:GridViewDataColumn VisibleIndex="0" HeaderStyle-VerticalAlign="Middle"
                                                                                            Width="30px" HeaderStyle-HorizontalAlign="Center" CellStyle-VerticalAlign="Middle"
                                                                                            CellStyle-HorizontalAlign="Center">
                                                                                            <Settings AllowAutoFilter="false" />
                                                                                            <HeaderTemplate>
                                                                                                <input id="chkSelectAllLandmarkIds" runat="server" type="checkbox" onclick="SelectLandmarkIdsAllOnThisPage(this)" />
                                                                                            </HeaderTemplate>
                                                                                            <DataItemTemplate>
                                                                                                <input id="chkSelectLandamrkIds" runat="server" type="checkbox" onclick="SelectLandmarkIdsOnRow(this)"
                                                                                                    accesskey='<%# Eval("id") %>' />
                                                                                            </DataItemTemplate>
                                                                                            <HeaderStyle HorizontalAlign="center" Wrap="true" />
                                                                                        </dxGridview:GridViewDataColumn>
                                                                                        <dxGridview:GridViewDataTextColumn FieldName="Mode of Locating" VisibleIndex="3" Width="150px" Visible="false">
                                                                                            <DataItemTemplate>
                                                                                                <asp:Label ID="lblOptions" Text='<%# Eval("Options") %>' runat="server" Style="overflow-y: auto; overflow-x: auto; word-break: break-all; word-wrap: break-word; display: inline-block;"></asp:Label>
                                                                                            </DataItemTemplate>
                                                                                            <HeaderStyle HorizontalAlign="center" Wrap="true" />
                                                                                            <Settings ShowInFilterControl="False" />
                                                                                        </dxGridview:GridViewDataTextColumn>
                                                                                        <dxGridview:GridViewDataTextColumn FieldName="LocationName" VisibleIndex="4" Width="250px">
                                                                                            <DataItemTemplate>
                                                                                                <asp:Label ID="lblLocationName" Text='<%# Eval("LocationName") %>' runat="server" Style="overflow-y: auto; overflow-x: auto; word-break: break-all; word-wrap: break-word; display: inline-block;"></asp:Label>
                                                                                            </DataItemTemplate>
                                                                                            <HeaderStyle HorizontalAlign="center" Wrap="true" />
                                                                                            <Settings ShowInFilterControl="False" />
                                                                                        </dxGridview:GridViewDataTextColumn>
                                                                                        <dxGridview:GridViewDataTextColumn FieldName="Radius" VisibleIndex="5" Width="100px" Visible="false">
                                                                                            <DataItemTemplate>
                                                                                                <asp:Label ID="lblRadius" Text='<%# Eval("Radius") %>' runat="server" Style="overflow-y: auto; overflow-x: auto; word-break: break-all; word-wrap: break-word; display: inline-block;"></asp:Label>
                                                                                            </DataItemTemplate>
                                                                                            <HeaderStyle HorizontalAlign="center" Wrap="true" />
                                                                                            <Settings ShowInFilterControl="False" />
                                                                                        </dxGridview:GridViewDataTextColumn>
                                                                                        <dxGridview:GridViewDataTextColumn FieldName="Description" VisibleIndex="6" Width="150px" Visible="false">
                                                                                            <DataItemTemplate>
                                                                                                <asp:Label ID="lblDescription" Text='<%# Eval("Description") %>' runat="server" Style="overflow-y: auto; overflow-x: auto; word-break: break-all; word-wrap: break-word; display: inline-block;"></asp:Label>
                                                                                            </DataItemTemplate>
                                                                                            <HeaderStyle HorizontalAlign="center" Wrap="true" />
                                                                                            <Settings ShowInFilterControl="False" />
                                                                                        </dxGridview:GridViewDataTextColumn>
                                                                                        <dxGridview:GridViewDataTextColumn FieldName="Address" VisibleIndex="7" Width="250px">
                                                                                            <DataItemTemplate>
                                                                                                <asp:Label ID="lblAddress" Text='<%# Eval("Address") %>' runat="server" Style="overflow-y: auto; overflow-x: auto; word-break: break-all; word-wrap: break-word; display: inline-block;"></asp:Label>
                                                                                            </DataItemTemplate>
                                                                                            <HeaderStyle HorizontalAlign="center" Wrap="true" />
                                                                                            <Settings ShowInFilterControl="False" />
                                                                                        </dxGridview:GridViewDataTextColumn>
                                                                                        <dxGridview:GridViewDataTextColumn FieldName="City" VisibleIndex="8" Width="150px" Visible="false">
                                                                                            <DataItemTemplate>
                                                                                                <asp:Label ID="lblCity" Text='<%# Eval("City") %>' runat="server" Style="overflow-y: auto; overflow-x: auto; word-break: break-all; word-wrap: break-word; display: inline-block;"></asp:Label>
                                                                                            </DataItemTemplate>
                                                                                            <HeaderStyle HorizontalAlign="center" Wrap="true" />
                                                                                            <Settings ShowInFilterControl="False" />
                                                                                        </dxGridview:GridViewDataTextColumn>
                                                                                        <dxGridview:GridViewDataTextColumn FieldName="State" VisibleIndex="9" Width="150px" Visible="false">
                                                                                            <DataItemTemplate>
                                                                                                <asp:Label ID="lblState" Text='<%# Eval("State") %>' runat="server" Style="overflow-y: auto; overflow-x: auto; word-break: break-all; word-wrap: break-word; display: inline-block;"></asp:Label>
                                                                                            </DataItemTemplate>
                                                                                            <HeaderStyle HorizontalAlign="center" Wrap="true" />
                                                                                            <Settings ShowInFilterControl="False" />
                                                                                        </dxGridview:GridViewDataTextColumn>
                                                                                        <dxGridview:GridViewDataTextColumn FieldName="Country" VisibleIndex="10" Width="150px" Visible="false">
                                                                                            <DataItemTemplate>
                                                                                                <asp:Label ID="lblCountry" Text='<%# Eval("Country") %>' runat="server" Style="overflow-y: auto; overflow-x: auto; word-break: break-all; word-wrap: break-word; display: inline-block;"></asp:Label>
                                                                                            </DataItemTemplate>
                                                                                            <HeaderStyle HorizontalAlign="center" Wrap="true" />
                                                                                            <Settings ShowInFilterControl="False" />
                                                                                        </dxGridview:GridViewDataTextColumn>

                                                                                        <dxGridview:GridViewDataTextColumn FieldName="Latitude" VisibleIndex="11" Width="230px" >
                                                                                            <DataItemTemplate>
                                                                                                <asp:Label ID="lbllatitude" Text='<%# Eval("latitude") %>' runat="server" Style="overflow-y: auto; overflow-x: auto; word-break: break-all; word-wrap: break-word; display: inline-block;"></asp:Label>
                                                                                            </DataItemTemplate>
                                                                                            <HeaderStyle HorizontalAlign="center" Wrap="true" />
                                                                                            <Settings ShowInFilterControl="False" />
                                                                                        </dxGridview:GridViewDataTextColumn>
                                                                                        <dxGridview:GridViewDataTextColumn FieldName="Longitude" VisibleIndex="12" Width="230px">
                                                                                            <DataItemTemplate>
                                                                                                <asp:Label ID="lbllongitude" Text='<%# Eval("longitude") %>' runat="server" Style="overflow-y: auto; overflow-x: auto; word-break: break-all; word-wrap: break-word; display: inline-block;"></asp:Label>
                                                                                            </DataItemTemplate>
                                                                                            <HeaderStyle HorizontalAlign="center" Wrap="true" />
                                                                                            <Settings ShowInFilterControl="False" />
                                                                                        </dxGridview:GridViewDataTextColumn>

                                                                                        <dxGridview:GridViewDataTextColumn FieldName="ID" VisibleIndex="12" Width="150px" Visible="false">
                                                                                            <DataItemTemplate>
                                                                                                <asp:Label ID="lbllongitude" Text='<%# Eval("id") %>' runat="server" Style="overflow-y: auto; overflow-x: auto; word-break: break-all; word-wrap: break-word; display: inline-block;"></asp:Label>
                                                                                            </DataItemTemplate>
                                                                                            <HeaderStyle HorizontalAlign="center" Wrap="true" />
                                                                                            <Settings ShowInFilterControl="False" />
                                                                                        </dxGridview:GridViewDataTextColumn>

                                                                                        <dxGridview:GridViewDataTextColumn CellStyle-HorizontalAlign="Center" VisibleIndex="1" Name="Edit" Width="50px" Visible="false">
                                                                                            <DataItemTemplate>
                                                                                                <asp:LinkButton ID="btnEdit" runat="server" CommandArgument='<%# Eval("id") %>' data-toggle="tooltip"
                                                                                                    data-placement="top" CssClass="btn btn-defalut edit-icons" Style="color: #3C8DBC; text-decoration: none;"
                                                                                                    OnClick="ibEdit_Click" CommandName="Edit"></asp:LinkButton>
                                                                                            </DataItemTemplate>
                                                                                        </dxGridview:GridViewDataTextColumn>

                                                                                        <dxGridview:GridViewDataTextColumn CellStyle-HorizontalAlign="Center" VisibleIndex="2" Visible="false"
                                                                                            Name="Delete" Width="50px">
                                                                                            <Settings AllowAutoFilter="false" />
                                                                                            <DataItemTemplate>
                                                                                                <asp:LinkButton ID="ibDelete" runat="server" CommandArgument='<%# Eval("id") %>' data-toggle="tooltip"
                                                                                                    data-placement="top" CssClass="btn btn-defalut del-icons" Style="color: Red"
                                                                                                    CommandName='Delete' OnClick="ibDelete_Click" OnClientClick="return confirm('Are you sure to Delete ?');"></asp:LinkButton>
                                                                                            </DataItemTemplate>
                                                                                            <HeaderStyle HorizontalAlign="center" Wrap="true" />
                                                                                        </dxGridview:GridViewDataTextColumn>
                                                                                    </Columns>
                                                                                    <SettingsPager PageSize="15">
                                                                                        <PageSizeItemSettings Visible="true" ShowAllItem="true" Items="10,20,50,100,200,500" />
                                                                                    </SettingsPager>
                                                                                    <Settings ShowFilterRow="true" ShowFilterRowMenu="true" HorizontalScrollBarMode="Auto" VerticalScrollBarMode="Hidden" VerticalScrollableHeight="400" />
                                                                                    <SettingsText EmptyDataRow="No Records Found" />
                                                                                    <SettingsBehavior AutoExpandAllGroups="True" ColumnResizeMode="Control" />
                                                                                    <SettingsBehavior AllowDragDrop="true" />
                                                                                </dxGridview:ASPxGridView>
                                                                                <dxGridview:ASPxGridViewExporter ID="ASPxGridViewExporter3" runat="server" GridViewID="grvLandmarkIds">
                                                                                    <PageFooter Right="[Page # of Pages #]">
                                                                                    </PageFooter>
                                                                                </dxGridview:ASPxGridViewExporter>--%>

                                                </div>

                                                <div class="row form-group">
                                                    <div class="col-md-3">
                                                    </div>
                                                    <div class="col-md-8">
                                                        <div class="pull-right-button">
                                                            <asp:LinkButton ID="lbtnAddFencing" runat="server" CssClass="btn save-btn fa-floppy-o"
                                                                OnClientClick="return getValue();" OnClick="lbtnAddFencing_Click" Text="&nbsp;Add Fencing">
                                                            </asp:LinkButton>



                                                            <asp:LinkButton ID="lbtnFencingCancel" runat="server" CssClass="btn save-btn fa-floppy-oo" Text="&nbsp;&nbsp;Cancel"
                                                                OnClick="lbtnFencingCancel_Click">
                                                            </asp:LinkButton>

                                                        </div>
                                                    </div>
                                                </div>

                                                <asp:HiddenField ID="hdnSelectedLandmarkValue" runat="server" />
                                                <asp:HiddenField ID="hdnChkBoxValue" runat="server" />
                                                <asp:HiddenField ID="hdnSelectFencingRow" runat="server" />
                                                <asp:HiddenField ID="hdnSelectLandamrkIdsRow" runat="server" />
                                                <asp:HiddenField ID="hdnSelectLandamrkIdsGrid" runat="server" />
                                                <asp:HiddenField ID="hdnSelectFencingGrid" runat="server" />
                                                <asp:HiddenField ID="hdnSelectedLat" runat="server" />
                                                <asp:HiddenField ID="hdnSelectedLong" runat="server" />
                                                <asp:HiddenField ID="hdnLatitude" runat="server" />
                                                <asp:HiddenField ID="hdnLongitude" runat="server" />

                                                </asp:Panel>

                                                                <asp:Panel ID="FencingGrid" runat="server" Visible="true">

                                                                    <div class="row form-group" id="partialViewContainer">

                                                                        <asp:UpdatePanel ID="UpdPanel4" runat="server" UpdateMode="Conditional">
                                                                            <ContentTemplate>
                                                                                <dxGridview:ASPxGridView ID="grvFencing" EnableCallBacks="false" runat="server"
                                                                                    ClientInstanceName="grvFencing" KeyFieldName="FencingId" AutoPostBack="true"
                                                                                    AutoGenerateColumns="false" Width="100%" OnHtmlRowCreated="grvLandmarkFencing_HtmlRowCreated" TabIndex="0">
                                                                                    <Columns>
                                                                                        <dxGridview:GridViewDataColumn VisibleIndex="0" HeaderStyle-VerticalAlign="Middle"
                                                                                            Width="30px" HeaderStyle-HorizontalAlign="Center" CellStyle-VerticalAlign="Middle"
                                                                                            CellStyle-HorizontalAlign="Center">
                                                                                            <Settings AllowAutoFilter="false" />
                                                                                            <HeaderTemplate>
                                                                                                <input id="chkSelectAll" runat="server" type="checkbox" onclick="SelectFencingAllOnThisPage(this)" />
                                                                                            </HeaderTemplate>
                                                                                            <DataItemTemplate>
                                                                                                <input id="chkSelect" runat="server" type="checkbox" onclick="SelectFencingOnRow(this)"
                                                                                                    accesskey='<%# Eval("FencingId") %>' />
                                                                                            </DataItemTemplate>
                                                                                            <HeaderStyle HorizontalAlign="center" Wrap="true" />
                                                                                        </dxGridview:GridViewDataColumn>
                                                                                        <dxGridview:GridViewDataTextColumn FieldName="Fencing Name" VisibleIndex="1" Width="800px">
                                                                                            <DataItemTemplate>
                                                                                                <asp:Label ID="lblOptions" Text='<%# Eval("Fencing_Name") %>' runat="server" Style="overflow-y: auto; overflow-x: auto; word-break: break-all; word-wrap: break-word; display: inline-block;"></asp:Label>
                                                                                            </DataItemTemplate>
                                                                                            <HeaderStyle HorizontalAlign="center" Wrap="true" />
                                                                                            <Settings ShowInFilterControl="False" />
                                                                                        </dxGridview:GridViewDataTextColumn>
                                                                                        <dxGridview:GridViewDataTextColumn FieldName="LocationName" VisibleIndex="2" Width="200px" Visible="false">
                                                                                            <DataItemTemplate>
                                                                                                <asp:Label ID="lblLocationName" Text='<%# Eval("LandmarkId") %>' runat="server" Style="overflow-y: auto; overflow-x: auto; word-break: break-all; word-wrap: break-word; display: inline-block;"></asp:Label>
                                                                                            </DataItemTemplate>
                                                                                            <HeaderStyle HorizontalAlign="center" Wrap="true" />
                                                                                            <Settings ShowInFilterControl="False" />
                                                                                        </dxGridview:GridViewDataTextColumn>
                                                                                        <dxGridview:GridViewDataTextColumn FieldName="Radius" VisibleIndex="3" Width="50px" Visible="false">
                                                                                            <DataItemTemplate>
                                                                                                <asp:Label ID="lblRadius" Text='<%# Eval("CompanyId") %>' runat="server" Style="overflow-y: auto; overflow-x: auto; word-break: break-all; word-wrap: break-word; display: inline-block;"></asp:Label>
                                                                                            </DataItemTemplate>
                                                                                            <HeaderStyle HorizontalAlign="center" Wrap="true" />
                                                                                            <Settings ShowInFilterControl="False" />
                                                                                        </dxGridview:GridViewDataTextColumn>

                                                                                        <dxGridview:GridViewDataTextColumn CellStyle-HorizontalAlign="Center" VisibleIndex="4" Name="Edit" Width="50px">
                                                                                            <DataItemTemplate>
                                                                                                <asp:LinkButton ID="ibtnFencingEdit" runat="server" CommandArgument='<%# Eval("FencingId") %>' data-toggle="tooltip"
                                                                                                    data-placement="top" CssClass="btn btn-defalut edit-icons" Style="color: #3C8DBC; text-decoration: none;"
                                                                                                    OnClick="ibtnFencingEdit_Click" CommandName="Edit"></asp:LinkButton>
                                                                                            </DataItemTemplate>
                                                                                        </dxGridview:GridViewDataTextColumn>

                                                                                        <dxGridview:GridViewDataTextColumn CellStyle-HorizontalAlign="Center" VisibleIndex="5" Name="Delete" Width="50px">
                                                                                            <Settings AllowAutoFilter="false" />
                                                                                            <DataItemTemplate>
                                                                                                <asp:LinkButton ID="ibFencingDelete" runat="server" CommandArgument='<%# Eval("FencingId") %>' data-toggle="tooltip"
                                                                                                    data-placement="top" CssClass="btn btn-defalut del-icons" Style="color: Red"
                                                                                                    CommandName='Delete' OnClick="ibFencingDelete_Click" OnClientClick="return confirm('Are you sure to Delete ?');"></asp:LinkButton>
                                                                                            </DataItemTemplate>
                                                                                            <HeaderStyle HorizontalAlign="center" Wrap="true" />
                                                                                        </dxGridview:GridViewDataTextColumn>
                                                                                    </Columns>
                                                                                    <SettingsPager PageSize="15">
                                                                                        <PageSizeItemSettings Visible="true" ShowAllItem="true" Items="10,20,50,100,200,500" />
                                                                                    </SettingsPager>
                                                                                    <Settings ShowFilterRow="true" ShowFilterRowMenu="true" HorizontalScrollBarMode="Auto" VerticalScrollBarMode="Hidden" VerticalScrollableHeight="400" />
                                                                                    <SettingsText EmptyDataRow="No Records Found" />
                                                                                    <SettingsBehavior AutoExpandAllGroups="True" ColumnResizeMode="Control" />
                                                                                    <SettingsBehavior AllowDragDrop="true" />
                                                                                </dxGridview:ASPxGridView>
                                                                                <dxGridview:ASPxGridViewExporter ID="ASPxGridViewExporter2" runat="server" GridViewID="grvFencing">
                                                                                    <PageFooter Right="[Page # of Pages #]">
                                                                                    </PageFooter>
                                                                                </dxGridview:ASPxGridViewExporter>
                                                                            </ContentTemplate>
                                                                        </asp:UpdatePanel>

                                                                    </div>

                                                                </asp:Panel>

                                                <div class="row form-group">
                                                    <div class="pull-right-button">
                                                        <%--   <a id="btn_add" class="btn add-btn fa-plus" onclick="LandmarkShow();">&nbsp;&nbsp;Add</a>--%>

                                                        <asp:LinkButton ID="lbtnFecingAdd" runat="server" CssClass="btn add-btn fa-plus" Text="&nbsp;&nbsp;Add"
                                                            OnClick="lbtnFecingAdd_Click">
                                                        </asp:LinkButton>

                                                        <asp:LinkButton ID="lbtnFencingDelete" runat="server" CssClass="btn del-btn fa-trash-o" Text="&nbsp;&nbsp;Delete"
                                                            OnClick="lbtnFencingDelete_Click" OnClientClick="return confirmdelete(this.form);">
                                                        </asp:LinkButton>

                                                        <%--  <asp:LinkButton ID="btn_Back" runat="server" CssClass="btn save-btn fa-angle-left" Text="&nbsp;&nbsp;Back"
                                                                            OnClick="btn_Back_Click" Visible="false">
                                                                        </asp:LinkButton>--%>
                                                    </div>
                                                </div>

                                            </div>

                                            <div class="row form-group">
                                                <asp:UpdatePanel ID="UpdPanel3" runat="server" UpdateMode="Conditional">
                                                    <ContentTemplate>
                                                        <%--<div class="center-none">
                                                                            <div class="Panel-group" id="fencingLocation" role="tablist" aria-multiselectable="true">
                                                                                <div class="panel panel-default">
                                                                                    <div class="panel-heading " role="tab" id="heading">
                                                                                        <h4 class="panel-title" style="width: 100%">
                                                                                            <label runat="server" id="lbl_FencingLocation">Fencing Landmark</label>
                                                                                            <%-- <a  role="button" data-toggle="collapse" data-parent="#fencingLocation" href="#collapse" aria-expanded="true" aria-controls="collapse">Add Landmark
                                                                                    </a>
                                                                                        </h4>
                                                                                    </div>
                                                                                    <div id="collapsetwo" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="heading">
                                                                                        <div class="panel-body">
                                                                                            <div class="col-md-12 config-table">
                                                                                                <div class="lvepol-table">
                                                                                                    <div class="row">
                                                                                                        <div class="table-responsive">

                                                                                                            <asp:Panel ID="PH_DynmCtrl" runat="server" EnableViewState="true">
                                                                                                            </asp:Panel>
                                                                                                            
                                                                                                        </div>
                                                                                                    </div>
                                                                                                    <div class="clearfix">
                                                                                                    </div>

                                                                                                </div>

                                                                                                <div class="row form-group">
                                                                                                    <div class="col-md-3">
                                                                                                    </div>
                                                                                                    <div class="col-md-8">
                                                                                                        <div class="pull-right-button">
                                                                                                            <asp:LinkButton ID="lbtnAddFencing" runat="server" CssClass="btn save-btn fa-floppy-o"
                                                                                                                OnClientClick="return getValue();return confirm('Are you sure to save fencing');" OnClick="lbtnAddFencing_Click" Text="&nbsp;Add Fencing">
                                                                                                            </asp:LinkButton>

                                                                                                            <asp:LinkButton ID="lbtnFencingDelete" runat="server" CssClass="btn del-btn fa-trash-o"
                                                                                                                OnClientClick="return confirmdelete(this.form);return getValue();" OnClick="lbtnFencingDelete_Click" Text="&nbsp;Delete Fencing">
                                                                                                            </asp:LinkButton>

                                                                                                            <asp:LinkButton ID="lbtnCancel" runat="server" CssClass="btn save-btn fa-floppy-oo" Text="&nbsp;&nbsp;Cancel"
                                                                                                                OnClick="lbtnCancel_Click">
                                                                                                            </asp:LinkButton>

                                                                                                           

                                                                                                        </div>
                                                                                                    </div>
                                                                                                </div>

                                                                                            </div>
                                                                                        </div>
                                                                                    </div>
                                                                                </div>
                                                                            </div>
                                                                        </div>--%>
                                                    </ContentTemplate>
                                                </asp:UpdatePanel>
                                            </div>


                                            </ContentTemplate>
                                                    </asp:UpdatePanel>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                            </div>

                </div>
            </div>
        </div>
    </div>
    </div>

    </div>
    <script type="text/javascript">



        function ValidateControls() {
            collapeshow();
            var TypeofFencing = document.getElementById('ctl00_BodyContentPH_ddlType').selectedIndex;
            var Location_Name = document.getElementById('ctl00_BodyContentPH_txtLocationName').value;
            var StreetAddress = document.getElementById('ctl00_BodyContentPH_txtstreet').value;
            var MapCodinatelat = document.getElementById('ctl00_BodyContentPH_txtlat').value;
            var MapCodinatelong = document.getElementById('ctl00_BodyContentPH_txtlong').value;
            if (TypeofFencing == 0) {
                alert('Select the Type of Fencing');
                return false;
            }
            if (Location_Name == "") {
                alert('Enter the Location Name');
                return false;
            }
            if (StreetAddress == "" && TypeofFencing == 1) {
                alert('Enter the Address');
                return false;
            }
            if (MapCodinatelat == "" && TypeofFencing == 2) {
                alert('Enter the Latitude');
                return false;
            }
            if (MapCodinatelong == "" && TypeofFencing == 2) {
                alert('Enter the Longitude');
                return false;
            }

            return confirm('Are you sure to save location');
        }
        function collapeshow() {
            debugger;
            document.getElementById('collapseOne').className = "panel-collapse collapse in";
        }

        function ViewLocationvalidate() {


            collapeshow();

            var TypeofFencing = document.getElementById('ctl00_BodyContentPH_ddlType').selectedIndex;
            var Location_Name = document.getElementById('ctl00_BodyContentPH_txtLocationName').value;
            var StreetAddress = document.getElementById('ctl00_BodyContentPH_txtstreet').value;
            var MapCodinatelat = document.getElementById('ctl00_BodyContentPH_txtlat').value;
            var MapCodinatelong = document.getElementById('ctl00_BodyContentPH_txtlong').value;
            if (TypeofFencing == 0) {
                alert('Select the Type of Fencing');
                return false;
            }
            if (Location_Name == "") {
                alert('Enter the Location Name');
                return false;
            }
            if (StreetAddress == "" && TypeofFencing == 1) {
                alert('Enter the Address');
                return false;
            }
            if (MapCodinatelat == "" && TypeofFencing == 2) {
                alert('Enter the Latitude');
                return false;
            }
            if (MapCodinatelong == "" && TypeofFencing == 2) {
                alert('Enter the Longitude');
                return false;

            }
            return true;
        }


        function showControls(ddlvalue) {
            //alert(ddlvalue);
            if (ddlvalue == 2) {
                document.getElementById('ctl00_BodyContentPH_spLatlng').style.display = "block";
                document.getElementById('ctl00_BodyContentPH_spAddr').style.display = "none";
            }
            else if (ddlvalue == 1) {
                document.getElementById('ctl00_BodyContentPH_spLatlng').style.display = "none";
                document.getElementById('ctl00_BodyContentPH_spAddr').style.display = "block";
            }
            return true;
        }
        function SelectAllOnThisPage(chkSelectAll) {
           
            debugger;
            var hdnSelectRow = document.getElementById('<%= hdnSelectRow.ClientID %>');
            var hdnSelectAll = document.getElementById('<%= hdnGetAllid.ClientID %>');
            if (chkSelectAll.checked == true) {
                for (var i = 0; i < grvLandmarks.pageRowCount; i++) {
                    if (document.getElementById('ctl00_BodyContentPH_grvLandmarks_cell' + (i + grvLandmarks.visibleStartIndex) + '_0_chkSelect').disabled == false) {
                        document.getElementById('ctl00_BodyContentPH_grvLandmarks_cell' + (i + grvLandmarks.visibleStartIndex) + '_0_chkSelect').checked = true;
                        var hdnUserId = document.getElementById('ctl00_BodyContentPH_grvLandmarks_cell' + (i + grvLandmarks.visibleStartIndex) + '_0_chkSelect').accessKey;
                        var hdnSelectRow = document.getElementById('<%= hdnSelectRow.ClientID %>');
                        //if (hdnSelectRow && hdnSelectRow!="") {
                        //    var removeId = hdnSelectRow.values.split(",");
                        //}
                        //else {

                        //}
                        //if (hdnUserId != "" && !Array.contains(removeId, hdnUserId)) {
                        //    if (hdnSelectRow.value != "")
                        //        hdnSelectRow.value += ",";
                        //    hdnSelectRow.value += hdnUserId;
                        //}
                    }
                }
            }
            else {
                for (var i = 0; i < grvLandmarks.pageRowCount; i++) {
                    document.getElementById('ctl00_BodyContentPH_grvLandmarks_cell' + (i + grvLandmarks.visibleStartIndex) + '_0_chkSelect').checked = false;
                }
                hdnSelectRow.value = '';
            }
        }

        function SelectAllOnThisPages(chkSelectAlls) {
           
            debugger;
            var hdnSelectRow = document.getElementById('<%= hdnSelectRow.ClientID %>');
            var hdnSelectAll = document.getElementById('<%= hdnGetAllid.ClientID %>');
            if (chkSelectAlls.checked == true) {

                var grvLandmarkIds = document.getElementById('<%= grvLandmarkIds.ClientID %>');
                var rows = grvLandmarkIds.getElementsByTagName("tr");
                var rowCount = rows.length - 1;
                //for (var i = 0; i < rowCount; i++) {
  
                    var $checkBoxes = $('[id*="chkSelectAlls"]:not(:disabled)', '#<%= grvLandmarkIds.ClientID %>');

                    if (chkSelectAlls.checked == true) {
                        $('[id*="chkSelect"]:not(:disabled)').prop('checked', true);
                       
                    } else {
                         $checkBoxes.prop('checked', false);
                    }

                        
                   // }
                
            }
            else {
                var grvLandmarkIds = document.getElementById('<%= grvLandmarkIds.ClientID %>');
                var rows = grvLandmarkIds.getElementsByTagName("tr");
                var rowCount = rows.length - 1;
                //for (var i = 0; i < rowCount; i++) {
  
                    var $checkBoxes = $('[id*="chkSelectAlls"]:not(:disabled)', '#<%= grvLandmarkIds.ClientID %>');

                    if (chkSelectAlls.checked == true) {
                        $('[id*="chkSelect"]:not(:disabled)').prop('checked', true);
                       
                    } else {
                        $('[id*="chkSelect"]:not(:disabled)').prop('checked', false);
                    }
                }
               
            }
       
        function SelectOnRows(chkOnSelects) {
            debugger;
            var hdnUserId = chkOnSelects.accessKey;
            var hdnSelectRow = document.getElementById('<%= hdnSelectRow.ClientID %>');
            var LatLog;

            var removeId = hdnSelectRow.value.split(",");
            if (chkOnSelects.checked) {

                var checkbox = $(this).find('[id*="chkSelects"]');

                // Toggle the checkbox's checked state
                checkbox.prop('checked', !checkbox.prop('checked'));

                if (hdnUserId != "" && !Array.contains(removeId, hdnUserId)) {
                    if (hdnSelectRow.value != "")
                        hdnSelectRow.value += ",";
                    hdnSelectRow.value += hdnUserId;
                    //LatLog = LatLog + "," + hdnUserId
                    

                }
                //hdnSelectedLandmarkValue.value = hdnSelectRow.value; hdnSelectedLandmarkValue.value = hdnSelectedLandmarkValue.value + LatLog;
                //var varTotalCheckedCount = 0;
                //var varTotalEnabled = 0;
                //for (var i = 0; i < grvLandmarks.pageRowCount; i++) {
                //    if (document.getElementById('ctl00_BodyContentPH_grvLandmarks_cell' + (i + grvLandmarks.visibleStartIndex) + '_0_chkSelect').disabled == false) {
                //        varTotalEnabled = varTotalEnabled + 1;
                //    }
                //    if (document.getElementById('ctl00_BodyContentPH_grvLandmarks_cell' + (i + grvLandmarks.visibleStartIndex) + '_0_chkSelect').checked)
                //        varTotalCheckedCount = varTotalCheckedCount + 1;
                //}
                //if (varTotalCheckedCount == varTotalEnabled)
                //    document.getElementById('ctl00_BodyContentPH_grvLandmarks_header0_chkSelectAll').checked = true;
                //else
                //    document.getElementById('ctl00_BodyContentPH_grvLandmarks_header0_chkSelectAll').checked = false;
            }
            else {
                if (Array.contains(removeId, hdnUserId)) {
                    Array.remove(removeId, hdnUserId);
                }
                hdnSelectRow.value = removeId;
                document.getElementById('ctl00_BodyContentPH_grvLandmarks_header0_chkSelectAll').checked = false;
            }
        }

        function SelectOnRow(chkOnSelect) {
            debugger;
            var hdnUserId = chkOnSelect.accessKey;
            var hdnSelectRow = document.getElementById('<%= hdnSelectRow.ClientID %>');
            var removeId = hdnSelectRow.value.split(",");
            if (chkOnSelect.checked) {
                if (hdnUserId != "" && !Array.contains(removeId, hdnUserId)) {
                    if (hdnSelectRow.value != "")
                        hdnSelectRow.value += ",";
                    hdnSelectRow.value += hdnUserId;
                }
                var varTotalCheckedCount = 0;
                var varTotalEnabled = 0;
                for (var i = 0; i < grvLandmarks.pageRowCount; i++) {
                    if (document.getElementById('ctl00_BodyContentPH_grvLandmarks_cell' + (i + grvLandmarks.visibleStartIndex) + '_0_chkSelect').disabled == false) {
                        varTotalEnabled = varTotalEnabled + 1;
                    }
                    if (document.getElementById('ctl00_BodyContentPH_grvLandmarks_cell' + (i + grvLandmarks.visibleStartIndex) + '_0_chkSelect').checked)
                        varTotalCheckedCount = varTotalCheckedCount + 1;
                }
                if (varTotalCheckedCount == varTotalEnabled)
                    document.getElementById('ctl00_BodyContentPH_grvLandmarks_header0_chkSelectAll').checked = true;
                else
                    document.getElementById('ctl00_BodyContentPH_grvLandmarks_header0_chkSelectAll').checked = false;
            }
            else {
                if (Array.contains(removeId, hdnUserId)) {
                    Array.remove(removeId, hdnUserId);
                }
                hdnSelectRow.value = removeId;
                document.getElementById('ctl00_BodyContentPH_grvLandmarks_header0_chkSelectAll').checked = false;
            }
        }


        function SelectLandmarkIdsAllOnThisPage(chkSelectAll) {
            var hdnSelectRow = document.getElementById('<%= hdnSelectLandamrkIdsRow.ClientID %>');
            var hdnSelectAll = document.getElementById('<%= hdnSelectLandamrkIdsGrid.ClientID %>');
            if (chkSelectAll.checked == true) {
                for (var i = 0; i < grvLandmarkIds.pageRowCount; i++) {
                    if (document.getElementById('ctl00_BodyContentPH_grvLandmarkIds_cell' + (i + grvLandmarkIds.visibleStartIndex) + '_0_chkSelectLandamrkIds').disabled == false) {
                        document.getElementById('ctl00_BodyContentPH_grvLandmarkIds_cell' + (i + grvLandmarkIds.visibleStartIndex) + '_0_chkSelectLandamrkIds').checked = true;
                        var hdnUserId = document.getElementById('ctl00_BodyContentPH_grvLandmarkIds_cell' + (i + grvLandmarkIds.visibleStartIndex) + '_0_chkSelectLandamrkIds').accessKey;
                        var hdnSelectRow = document.getElementById('<%= hdnSelectLandamrkIdsRow.ClientID %>');
                           var removeId = hdnSelectRow.value.split(",");
                           if (hdnUserId != "" && !Array.contains(removeId, hdnUserId)) {
                               if (hdnSelectRow.value != "")
                                   hdnSelectRow.value += ",";
                               hdnSelectRow.value += hdnUserId;
                           }
                       }
                   }
               }
               else {
                   for (var i = 0; i < grvLandmarkIds.pageRowCount; i++) {
                       document.getElementById('ctl00_BodyContentPH_grvLandmarkIds_cell' + (i + grvLandmarkIds.visibleStartIndex) + '_0_chkSelectLandamrkIds').checked = false;
                   }
                   hdnSelectRow.value = '';
               }
           }
           function SelectLandmarkIdsOnRow(chkOnSelect) {
               debugger;
               var hdnUserId = chkOnSelect.accessKey;
               var hdnSelectRow = document.getElementById('<%= hdnSelectLandamrkIdsRow.ClientID %>');
            var removeId = hdnSelectRow.value.split(",");
            if (chkOnSelect.checked) {
                if (hdnUserId != "" && !Array.contains(removeId, hdnUserId)) {
                    if (hdnSelectRow.value != "")
                        hdnSelectRow.value += ",";
                    hdnSelectRow.value += hdnUserId;
                }
                var varTotalCheckedCount = 0;
                var varTotalEnabled = 0;
                for (var i = 0; i < grvLandmarkIds.pageRowCount; i++) {
                    if (document.getElementById('ctl00_BodyContentPH_grvLandmarkIds_cell' + (i + grvLandmarkIds.visibleStartIndex) + '_0_chkSelectLandamrkIds').disabled == false) {
                        varTotalEnabled = varTotalEnabled + 1;
                    }
                    if (document.getElementById('ctl00_BodyContentPH_grvLandmarkIds_cell' + (i + grvLandmarkIds.visibleStartIndex) + '_0_chkSelectLandamrkIds').checked)
                        varTotalCheckedCount = varTotalCheckedCount + 1;
                }
                if (varTotalCheckedCount == varTotalEnabled)
                    document.getElementById('ctl00_BodyContentPH_grvLandmarkIds_header0_chkSelectAllLandmarkIds').checked = true;
                else
                    document.getElementById('ctl00_BodyContentPH_grvLandmarkIds_header0_chkSelectAllLandmarkIds').checked = false;
            }
            else {
                if (Array.contains(removeId, hdnUserId)) {
                    Array.remove(removeId, hdnUserId);
                }
                hdnSelectRow.value = removeId;
                document.getElementById('ctl00_BodyContentPH_grvLandmarkIds_header0_chkSelectAllLandmarkIds').checked = false;
            }
        }



        function SelectFencingAllOnThisPage(chkSelectAll) {
            var hdnSelectFencingRow = document.getElementById('<%= hdnSelectFencingRow.ClientID %>');
            var hdnSelectAll = document.getElementById('<%= hdnSelectFencingGrid.ClientID %>');
            if (chkSelectAll.checked == true) {
                for (var i = 0; i < grvLandmarks.pageRowCount; i++) {
                    if (document.getElementById('ctl00_BodyContentPH_grvFencing_cell' + (i + grvFencing.visibleStartIndex) + '_0_chkSelect').disabled == false) {
                        document.getElementById('ctl00_BodyContentPH_grvFencing_cell' + (i + grvFencing.visibleStartIndex) + '_0_chkSelect').checked = true;
                        var hdnUserId = document.getElementById('ctl00_BodyContentPH_grvFencing_cell' + (i + grvFencing.visibleStartIndex) + '_0_chkSelect').accessKey;
                        var hdnSelectFencingRow = document.getElementById('<%= hdnSelectFencingRow.ClientID %>');
                        var removeId = hdnSelectFencingRow.value.split(",");
                        if (hdnUserId != "" && !Array.contains(removeId, hdnUserId)) {
                            if (hdnSelectFencingRow.value != "")
                                hdnSelectFencingRow.value += ",";
                            hdnSelectFencingRow.value += hdnUserId;
                        }
                    }
                }
            }
            else {
                for (var i = 0; i < grvFencing.pageRowCount; i++) {
                    document.getElementById('ctl00_BodyContentPH_grvFencing_cell' + (i + grvFencing.visibleStartIndex) + '_0_chkSelect').checked = false;
                }
                hdnSelectFencingRow.value = '';
            }
        }
        function SelectFencingOnRow(chkOnSelect) {
            debugger;
            var hdnUserId = chkOnSelect.accessKey;
            var hdnSelectFencingRow = document.getElementById('<%= hdnSelectFencingRow.ClientID %>');
            var removeId = hdnSelectFencingRow.value.split(",");
            if (chkOnSelect.checked) {
                if (hdnUserId != "" && !Array.contains(removeId, hdnUserId)) {
                    if (hdnSelectFencingRow.value != "")
                        hdnSelectFencingRow.value += ",";
                    hdnSelectFencingRow.value += hdnUserId;
                }
                var varTotalCheckedCount = 0;
                var varTotalEnabled = 0;
                for (var i = 0; i < grvFencing.pageRowCount; i++) {
                    if (document.getElementById('ctl00_BodyContentPH_grvFencing_cell' + (i + grvFencing.visibleStartIndex) + '_0_chkSelect').disabled == false) {
                        varTotalEnabled = varTotalEnabled + 1;
                    }
                    if (document.getElementById('ctl00_BodyContentPH_grvFencing_cell' + (i + grvFencing.visibleStartIndex) + '_0_chkSelect').checked)
                        varTotalCheckedCount = varTotalCheckedCount + 1;
                }
                if (varTotalCheckedCount == varTotalEnabled)
                    document.getElementById('ctl00_BodyContentPH_grvFencing_header0_chkSelectAll').checked = true;
                else
                    document.getElementById('ctl00_BodyContentPH_grvFencing_header0_chkSelectAll').checked = false;
            }
            else {
                if (Array.contains(removeId, hdnUserId)) {
                    Array.remove(removeId, hdnUserId);
                }
                hdnSelectFencingRow.value = removeId;
                document.getElementById('ctl00_BodyContentPH_grvFencing_header0_chkSelectAll').checked = false;
            }
        }


    </script>
    <!-- OnSelect CheckBox in Grid -->


</asp:Content>