<%@ page language="C#" masterpagefile="~/Pages/Common/MasterPages/MainMasterPage_new.master" autoeventwireup="true" inherits="Pages_FrontOffice_AppointmentScheduling_VisitorLog, App_Web_qgbsguup" title="Visitor Log" enableEventValidation="false" viewStateEncryptionMode="Never" %>

<%@ Register Src="~/UserControls/DatePicker/DatePickerControl.ascx" TagName="DatePickerControl"
    TagPrefix="Date" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%@ Register Src="~/UserControls/GridViewPager/GridViewPager.ascx" TagName="GridViewPager"
    TagPrefix="uc1" %>
    
<%@ Register Src="~/UserControls/Common/ScreenGroup/ScreenGroup.ascx" TagName="ScreenGroupControl"
    TagPrefix="ScreenGroup" %>
     <%@ Register Src="~/UserControls/AutoComplete/AutoCompleteControl.ascx" TagName="AutoCompleteControl"
    TagPrefix="acc" %>
    <%@ Register Src="~/UserControls/Common/EmployeeSearch/EmployeeSearch.ascx" TagName="EmployeeSearchControl" TagPrefix="hims" %> 
     <%@ Register Assembly="TimePicker" Namespace="MKB.TimePicker" TagPrefix="timePicker" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
    <asp:UpdatePanel ID="ResonMasterUpdatePanel" runat="server" UpdateMode="Always">
        <ContentTemplate>
          <HIMS:EmployeeSearchControl ID="EmployeeSearch" Visible="false" runat="server" />  
        
            <div id="divContentPage">
                <!-- ContentPlaceHolder Box Starts -->
                <div style="width: 100%;padding:2px;margin:2px">
                    <table width="100%" border="0" style="vertical-align: top; margin-top: -1px;border-collapse:collapse;background-color:White" cellpadding="0"
                        cellspacing="0">
                        <tr>
                            <td class="dashBoardLeftCont" valign="top">
                                <div class="himssuHeader3WireBox">
                                    <div class="himsBoxHeader">
                                        <div class="leftdiv">
                                        </div>
                                        <div class="himsBoxTitle">
                                            <div class="headerText">
                                                <asp:Label runat="server" ID="ScreenGroupNameLabel"></asp:Label>    
                                            </div>
                                        </div>
                                    </div>
                                    <table width="200px" cellpadding="0" cellspacing="0">
                                        <tr>
                                            <td>
                                                <div class="himsBoxContent">
                                                    <div class="leftUlMenu">
                                                        <ScreenGroup:ScreenGroupControl EnableViewState="true" ID="ScreenGroupControl" ScreenGroupId="168"
                                                            Visible="true" runat="server" />
                                                    </div>
                                                </div>
                                            </td>
                                        </tr>
                                    </table>
                                </div>
                            </td>
                            <td style="vertical-align: top;padding-left:10px" width="99%">
                                <!-- Sub Container2 Box Start -->
                                <div class="himssuHeader5WireBox" id="SearchDiv" runat="server" visible="true">
                                    <div class="himsBoxHeader">
                                        <asp:Panel ID="Panel1" runat="server">
                                            <div class="leftdiv">
                                            </div>
                                            <div class="himsBoxTitle">
                                             <%--   <asp:Image ID="Image2" runat="server" class="fLeft" />--%>
                                                <div class="headerText">
                                                    <asp:Label ID="Label3" runat="server" Text="Search"></asp:Label>
                                                   <%-- <cc1:CollapsiblePanelExtender ID="CollapsiblePanelExtender1" runat="Server" TargetControlID="DetailPanel"
                                                        ExpandControlID="Image2" CollapseControlID="Image2" TextLabelID="Label3" Collapsed="true"
                                                        ImageControlID="Image2" ExpandedImage="~/images/buttonCollapse.gif" CollapsedImage="~/images/buttonExpand.gif"
                                                        ExpandDirection="Vertical" />--%>
                                                </div> 
                                                 <div class="fRight" style="margin-top: -20px">
                                                  <asp:Button ID="AddNewButtonID" runat="server"  onclick="AddNewButton_Click" SkinID="0" CssClass="AddButton" Text="Add"  />
                                                  </div>
                                            </div> 
                                        </asp:Panel>
                                    </div>
                                    <div class="himsBoxContent">
                                        <asp:Panel ID="DetailPanel" runat="Server">
                                            <div class="contentHolder">
                                                <asp:Panel ID="SearchCriteriaPanel" runat="Server">

                                                  <div class="outerBox pTop5">
                                                <div class="controlLabelWidth">
                                                    <asp:Label ID="SearchOrgLabel" runat="server" Text="Organization" ></asp:Label>
                                                </div>
                                                <div class="fLeft pRight5">
                                                    <asp:DropDownList runat="server" ID="SearchOrgDropDownList" SkinID="CustomWidthDropDownList"
                                                        Width="154px"  onmouseleave="showHideTooltip()" onmouseenter="showHideTooltip()">
                                                    </asp:DropDownList>
                                                </div>
                                            </div>

                                            <div class="outerBox pTop5">
                                                <div class="controlLabelWidth">
                                                    <asp:Label ID="SearchWhomToMeetLabel" runat="server" Text="Whom To Meet" ></asp:Label>
                                                </div>
                                                <div class="fLeft pRight5">
                                            <asp:TextBox ID="SearchWhomToMeetTextBox" onmouseleave="showHideTooltip()" onmouseenter="showHideTooltip()"
                                                        SkinID="CustomWidthTextBox"  Width="150px" runat="server" MaxLength="200"  > </asp:TextBox> 
                                                        </div></div>
                                                         <timePicker:TimeSelector ID="TimeSelector1" runat="server" DisplaySeconds="False"
                                                    SelectedTimeFormat="Twelve" AmPm="AM" Date="" Hour="0" Minute="0" Enabled="false"
                                                    Second="0" meta:resourcekey="ActivityStartTimeSelectorResource1"/>
                                            <div class="cBoth">
                                                    </div>
                                                    <div class="outerBox pTop5">
                                                <div class="controlLabelWidth">
                
                                                    <asp:Label ID="FromDateLabel" runat="server" Text="From Date" Visible="true"></asp:Label>
                                                </div>
                                                <div class="fLeft pRight5">
                                                    <Date:DatePickerControl DisplayDatePicker="true" ID="FromDatePickerControl"  Visible="true"
                                                        runat="server" />
                                                </div>
                                            </div>

                                     <div class="outerBox pTop5">
                                                <div class="controlLabelWidth">
                
                                                    <asp:Label ID="ToDateLabel" runat="server" Text="To Date" Visible="true"></asp:Label>
                                                </div>
                                                <div class="fLeft pRight5">
                                                    <Date:DatePickerControl DisplayDatePicker="true"  ID="ToDatePickerControl" Visible="true"  runat="server" />
                                                </div>
                                           </div>                 
                                                     

                                            

                                                 
                                                    <div class="cBoth">
                                                    </div>
                                                    <div class="alignCenter pTop5">
                                                        <asp:Button ID="SearchButton" Text="Search" runat="Server" OnClick="SearchButton_Click" SkinID="0" CssClass="PrimaryButton"/>
                                                        <asp:Button ID="ResetButton" runat="server" Text="Clear" OnClick="ResetButton_Click" />
                                                        <asp:Button ID="PrintButton" runat="server" Visible="false" Text="Print" OnClick="PrintButton_Click" />
                                                            
                                                    </div>
                                                    <div class="cBoth">
                                                    </div>
                                                </asp:Panel>
                                                <div id="Div1" class="himssuHeader7WireBox" runat="server" >
                                                    <div id="ReasonMasterDetailDiv" visible="false" runat="server">
                                                        <div class="spacer">
                                                            <asp:Image ID="Image3" runat="server" ImageUrl="~/Images/spacer.gif" />
                                                        </div>
                                                                 <div class="himsBoxHeader">
                                                                        <div class="leftdiv">
                                                                        </div>
                                                                        <div class="himsBoxTitle">
                                                                            <div class="headerText">
                                                                                <asp:Label ID="Label1" runat="server" Text=""></asp:Label>
                                                                            </div>
                                                                        </div>
                                     

                                                                                               
                                                                   </div>
                                                        <div class="himsBoxContent">
                                                            <asp:UpdatePanel ID="MenuPlanDetailUpdatePanel" runat="server" UpdateMode="Always">
                                                                <ContentTemplate>
                                                                    <div id="Div5" runat="server" visible="false">
                                                                       <%-- <div id="DivHeader" style="vertical-align: top; width: 100%;">
                                                                            <asp:Table ID="PeriodicPaySetupGridViewTable" runat="server" CellPadding="0" CellSpacing="0"
                                                                                BackColor="#E8E8E8" ForeColor="#000000" Width="100%" GridLines="Both">
                                                                                <asp:TableRow Height="20px">
                                                                                    <asp:TableCell Text="" Width="5%" Font-Bold="true"> </asp:TableCell>
                                                                                  
                                                                                    <asp:TableCell Text="Name" Width="15%" Font-Bold="true" HorizontalAlign="Left"> </asp:TableCell>
                                                                                    <asp:TableCell Text="Ledger Group" Width="15%" Font-Bold="true" HorizontalAlign="Left"> </asp:TableCell>
                                                                                      <asp:TableCell Text="Ledger Type" Width="15%" Font-Bold="true" HorizontalAlign="Left"> </asp:TableCell>
                                                                                         <asp:TableCell Text="Opening Balance" Width="15%" Font-Bold="true" HorizontalAlign="Left"> </asp:TableCell>
                                                                                     <asp:TableCell Text="InActive" Width="15%" Font-Bold="true" HorizontalAlign="Left"> </asp:TableCell>
                                                                                    </asp:TableRow>
                                                                            </asp:Table>
                                                                        </div>--%>
                                                                       <%-- <div id="Div2" visible="true" runat="server" class="Container" style="vertical-align: top;
                                                                            height: 109px;">--%>
                                                                            <asp:GridView ID="VisitorLogGridView" runat="server" Width="100%" AutoGenerateColumns="False"
                                                                                OnRowDataBound="VisitorLogGridView_RowDataBound" OnPageIndexChanging="VisitorLogGridView_PageIndexChanging"
                                                                                AllowPaging="false"  SkinID="" ShowHeader="True" PagerSettings-Visible="false"
                                                                                DataKeyNames="VisitorId,OrgId"  EmptyDataText="No records Found !!!">
                                                                                <Columns>
                                                                                    <asp:TemplateField ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Center" ItemStyle-Wrap="true">
                                                                                        <ItemTemplate>
                                                                                            <asp:LinkButton ID="EditLinkButton" runat="server" CommandName="Select" OnClick="LinkButton_Click"
                                                                                                Text="Select" CausesValidation="false"></asp:LinkButton>
                                                                                        </ItemTemplate>
                                                                                    </asp:TemplateField>

                                                                                     <asp:TemplateField HeaderText="Organization" ItemStyle-Width="10%" SortExpression="Title" HeaderStyle-HorizontalAlign="Left"
                                                                                        ItemStyle-Wrap="true">
                                                                                        <ItemTemplate>
                                                                                            <asp:Label ID="OrgLabel" runat="server" Text='<%# Bind("Organization") %>'></asp:Label>
                                                                                        </ItemTemplate>
                                                                                    </asp:TemplateField>
                                                                                    
                                                                                    <asp:TemplateField HeaderText="Visitor" ItemStyle-Width="10%" SortExpression="Title" HeaderStyle-HorizontalAlign="Left"
                                                                                        ItemStyle-Wrap="true">
                                                                                        <ItemTemplate>
                                                                                            <asp:Label ID="VisitorLabel" runat="server" Text='<%# Bind("VisitorName") %>'></asp:Label>
                                                                                        </ItemTemplate>
                                                                                    </asp:TemplateField>
                                                                                      <asp:TemplateField HeaderText="No. Of Visitor(s)" ItemStyle-Width="10%" SortExpression="Title" HeaderStyle-HorizontalAlign="Left"
                                                                                        ItemStyle-Wrap="true">
                                                                                        <ItemTemplate>
                                                                                            <asp:Label ID="NoOfVisitorLabel" runat="server" Text='<%# Bind("NoOfVisitor") %>'></asp:Label>
                                                                                        </ItemTemplate>
                                                                                    </asp:TemplateField>
                                                                                       <asp:TemplateField HeaderText="Purpose" ItemStyle-Width="10%" SortExpression="Title" HeaderStyle-HorizontalAlign="Left"
                                                                                        ItemStyle-Wrap="true">
                                                                                        <ItemTemplate>
                                                                                            <asp:Label ID="PurposeOfVisitLabel" runat="server" Text='<%# Bind("PurposeOfVisit") %>'></asp:Label>
                                                                                        </ItemTemplate>
                                                                                    </asp:TemplateField>
                                                                                  
                                                                                   <asp:TemplateField HeaderText="Whom To Meet" ItemStyle-Width="10%" SortExpression="Title" HeaderStyle-HorizontalAlign="Left"
                                                                                        ItemStyle-Wrap="true">
                                                                                        <ItemTemplate>
                                                                                            <asp:Label ID="WhomToMeetNameLabel" runat="server" Text='<%# Bind("WhomToMeetName") %>'></asp:Label>
                                                                                        </ItemTemplate>
                                                                                    </asp:TemplateField>
                                                                                     <asp:TemplateField HeaderText="Visit Date" ItemStyle-Width="10%" SortExpression="Title" HeaderStyle-HorizontalAlign="Left"
                                                                                        ItemStyle-Wrap="true">
                                                                                        <ItemTemplate>
                                                                                            <asp:Label ID="VisitDateLabel" runat="server" Text='<%# Bind("VisitDate","{0:MM/dd/yyyy}") %>'></asp:Label>
                                                                                        </ItemTemplate>
                                                                                    </asp:TemplateField>
                                                                                     <asp:TemplateField HeaderText="In Time" ItemStyle-Width="10%" SortExpression="Title" HeaderStyle-HorizontalAlign="Right"
                                                                                        ItemStyle-Wrap="true" ItemStyle-HorizontalAlign="Right">
                                                                                        <ItemTemplate>
                                                                                            <asp:Label ID="InTimeLabel" runat="server" Text='<%# Bind("InTime","{0:HH:MM:ss}") %>'></asp:Label>
                                                                                            
                                                                                        </ItemTemplate>
                                                                                    </asp:TemplateField>
                                                                                    <asp:TemplateField HeaderText="Out Time" ItemStyle-Width="15%" SortExpression="Title" HeaderStyle-HorizontalAlign="Right"
                                                                                        ItemStyle-Wrap="true" ItemStyle-HorizontalAlign="Right">
                                                                                        <ItemTemplate>
                                                                                            <asp:Label ID="OutTimeLabel" runat="server" Visible="false"  Text='<%# Bind("OutTime","{0:HH:MM:ss}") %>'></asp:Label>
                                                                                             <asp:Button ID="OutTimeButton" runat="server" Text="Out" OnClick="OutTimeButton_Click"  Width="40px" SkinID="CustomWidthButton" ForeColor="White" BackColor="Black" />
                                                                                        </ItemTemplate>
                                                                                    </asp:TemplateField>
                                                                                     <asp:TemplateField HeaderText="Photo" ItemStyle-Width="190px" HeaderStyle-HorizontalAlign="Center" Visible="false"
                                                                            ItemStyle-HorizontalAlign="Center" ItemStyle-Wrap="true">
                                                                            <ItemTemplate>
                                                                                <asp:Image ID="VisitorPhoto" Height="60px" Width="60px" runat="server" ImageUrl='<%# Eval("VisitorPhoto")%>' />
                                                                            </ItemTemplate>
                                                                        </asp:TemplateField>
                                                                                </Columns>
                                                                            </asp:GridView>
                                                                      <%--  </div>--%>
                                                                    </div>
                                                                </ContentTemplate>
                                                            </asp:UpdatePanel>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </asp:Panel>
                                    </div>
                                </div>
                                <!-- Sub Container2 Box Ends -->
                               
                                <!-- Sub Container1 Box Start -->
                                <div class="himssuHeader1WireBox" id="DetailDiv" runat="server" visible="false">
                                    <div class="himsBoxHeader">
                                        <div class="leftdiv">
                                        </div>
                                        <div class="himsBoxTitle">
                                            <div class="headerText">
                                                <asp:Label ID="VisitorLogDetailLabel" runat="server" Text="Visitor Log"></asp:Label>
                                            </div>
                                        </div> 
                                                          
                                        <div class="fRight" style="margin-top: -20px">
                                            
                                            <table>
                                             <tr>
                                             
                                             
                                                 <td class="formLabel">
                                                    <div id="NumberOfRecordDiv" class="display-flex" runat="server" visible="true">
                                                    <asp:ImageButton AlternateText="First page" ToolTip="First page" ID="FirstRecordImageButton"
                                                        runat="server" ImageUrl="~/Images/arrowLlast.gif" CommandName="Page" CommandArgument="First"
                                                        OnClick="FirstRecordImageButton_Click" />
                                                    <asp:ImageButton AlternateText="Previous page" ToolTip="Previous page" ID="PreviousImageButton"
                                                        runat="server" ImageUrl="~/Images/arrowLeft.gif" CommandName="Page" CommandArgument="Prev"
                                                        OnClick="PreviousImageButton_Click" />
                                                    <asp:Label    ID="LabelPage" runat="server" Text="Record " AssociatedControlID="ReCordNumber" />
                                                  <%--  <asp:TextBox  ID="ReCordNumber" runat="server"   Enabled="false"
                                                        SkinID="Dummy" CssClass="pageTextbox" />--%>
                                                    <asp:Label ID="ReCordNumber" Font-Bold="true"   SkinID="Dummy"    runat="server" ></asp:Label>
                                                    <asp:Label ID="ofLabel" Text="of" runat="server" />
                                                    <asp:Label ID="TotalRecord" runat="server" />
                                                    <asp:ImageButton AlternateText="Next page" ToolTip="Next page" ID="NextImageButtom"
                                                        runat="server" ImageUrl="~/Images/arrowRight.gif" CommandName="Page" CommandArgument="Next"
                                                        OnClick="NextImageButton_Click" />
                                                    <asp:ImageButton AlternateText="Last page" ToolTip="Last page" ID="LastRecordImageButton"
                                                        runat="server" ImageUrl="~/Images/arrowRLast.gif" CommandName="Page" CommandArgument="Last"
                                                        OnClick="LastRecordImageButton_Click" />

                                                   </div>
                                                </td>

                                                 <td>
                                                    <asp:Button ID="BackButton" runat="Server" OnClick="BackButton_Click" SkinID="0" CssClass="BackButton" Text="Back"/>
                                               </td>


                                              
                                            </tr>
                                            </table>
                                        </div>
                                    </div>
                                   
                                    <div class="himsBoxContent">
                                      
                                                      <div class="contentHolder">
                                                     <table >
                                                   
                                            <tr>
                                            <td align="left" >

                                              <div class="outerBox pTop5">
                                                <div class="controlLabelWidth">
                                                    <asp:Label ID="OrgLabel" runat="server" Text="Organization" SkinID="MandatoryLabel"></asp:Label>
                                                </div>
                                                <div class="fLeft pRight5">
                                                    <asp:DropDownList runat="server" ID="OrgDropDownList" SkinID="CustomWidthDropDownList"
                                                        Width="154px"  onmouseleave="showHideTooltip()" onmouseenter="showHideTooltip()">
                                                    </asp:DropDownList>
                                                </div>
                                            </div>
                                            <div class="cBoth">
                                                </div>

                                             <div class="outerBox pTop5">
                                                <div class="controlLabelWidth">
                                                    <asp:Label ID="TitleLabel" runat="server" Text="Visitor Name" SkinID="MandatoryLabel"></asp:Label>
                                                </div>
                                                <div class="fLeft pRight5">
                                                    <asp:TextBox ID="TitleTextBox" onmouseleave="showHideTooltip()" onmouseenter="showHideTooltip()"
                                                        Width="150px" runat="server" MaxLength="100" AutoPostBack="false" SkinID="CustomWidthTextbox"></asp:TextBox>
                                                    <asp:HiddenField ID="IdHiddenField" runat="server" />
                                                </div>
                                            </div>
                                         
                                    
                                            
                                            <div class="cBoth">
                                                </div>
                                           

                                             <div class="outerBox pTop5">
                                                        <div class="controlLabelWidth">
                                                            <asp:Label ID="NoOfVisitorLabel" Text="No. of Visitors" runat="server" SkinID="MandatoryLabel"></asp:Label>
                                                        </div>
                                                        <div class="fLeft pRight5">
                                                             <asp:TextBox ID="NoOfVisitorTextBox" onmouseleave="showHideTooltip()" onmouseenter="showHideTooltip()"
                                                             SkinID="CustomWidthTextBox" Width="150px" runat="Server" MaxLength="100" onKeypress="javascript:return isNumber()"></asp:TextBox>
                                                        </div>
                                                    </div>

                                                     <div class="cBoth">
                                                </div>

                                           

                                             <div class="outerBox pTop5">
                                                        <div class="controlLabelWidth">
                                                            <asp:Label ID="PurposeOfVisitLabel" Text="Purpose Of Visit" runat="server"></asp:Label>
                                                        </div>
                                                        <div class="fLeft pRight5">
                                                             <asp:TextBox ID="PurposeOfVisitTextBox" onmouseleave="showHideTooltip()" onmouseenter="showHideTooltip()"
                                                             SkinID="CustomWidthTextBox" Width="150px" runat="Server" MaxLength="100"></asp:TextBox>
                                                        </div>
                                                    </div>
                                                    <div class="cBoth">
                                                </div>
                                                     <div class="outerBox pTop5">
                                                <div class="controlLabelWidth">
                                                    <asp:Label ID="TestDateLabel" runat="server" Text="Visit Date" Visible="True"  ></asp:Label>
                                                </div>
                                                <div class="fLeft pRight5">
                                                    <Date:DatePickerControl DisplayDatePicker="true" ID="VisitDateFromDatePickerControl" Visible="True"
                                                        runat="server" />
                                                </div>
                                            </div>
                                               <div class="outerBox pTop5">
                                                <div class="controlLabelWidth">
                                                    <asp:Label ID="InTimeLabel" runat="server" Text="In Time"></asp:Label>
                                                </div>
                                                <div class="fLeft pRight5">
                                                    <timePicker:TimeSelector ID="InTimeSelector" runat="server" DisplaySeconds="False"
                                                    SelectedTimeFormat="Twelve" AmPm="AM" Date="" Hour="0" Minute="0" Visible="true"
                                                    Second="0" meta:resourcekey="ActivityStartTimeSelectorResource1"/>
                                                  
                                                </div>
                                            </div>
                                               <div class="outerBox pTop5">
                                                <div class="controlLabelWidth">
                                                    <asp:Label ID="OutTimeLabel" runat="server" Text="Out Time"></asp:Label>
                                                </div>
                                                <div class="fLeft pRight5">
                                                    <timePicker:TimeSelector ID="OutTimeSelector" runat="server" DisplaySeconds="False"
                                                    SelectedTimeFormat="Twelve" AmPm="AM" Date="" Hour="0" Minute="0" Visible="true"
                                                    Second="0" meta:resourcekey="ActivityStartTimeSelectorResource1"/>
                                                  
                                                </div>
                                                  
                                            </div>
                                                      <div class="cBoth">
                                                </div>

                                            <div class="outerBox pTop5">
                                                <div class="controlLabelWidth">
                                                    <asp:Label ID="SourceNameLabel" runat="server" Text="Whom to Meet" ></asp:Label>
                                                </div>
                                                <div class="fLeft pRight5">
                                                    <asp:TextBox ID="SourceNameTextBox" AutoPostBack="true" onmouseleave="showHideTooltip()" Enabled="false" onmouseenter="showHideTooltip()"
                                                        SkinID="CustomWidthTextBox" Width="150px" runat="server" MaxLength="200" OnTextChanged="SourceNameTextBox_OnTextChanged"> </asp:TextBox>    
                                                         <asp:ImageButton SkinID="FindImage"  ID="SourceCodeImageButton"
                                                        runat="server"/>
                                                    <asp:HiddenField ID="SourceIdHiddenField" runat="server" />                           
                                                </div>
                                            </div>
                                            

                                         
                                             
                                            
                                                        
                                                           <div class="cBoth">
                                                </div>
                                                       
                                          
                                             <div class="outerBox pTop5">
                                                        <div class="controlLabelWidth">
                                                            <asp:Label ID="WhomToMeetLabel" Text="Meet Others" runat="server" ></asp:Label>
                                                        </div>
                                                        <div class="fLeft pRight5">
                                                            
                                                            <asp:TextBox ID="WhomToMeetTextBox" onmouseleave="showHideTooltip()" onmouseenter="showHideTooltip()"
                                                        SkinID="CustomWidthTextBox"  Width="150px" runat="server" MaxLength="200"  OnTextChanged="WhomToMeetTextBox_OnTextChanged"> </asp:TextBox>    
                                                            <%-- <acc:AutoCompleteControl ID="WhomToMeetTextBox" runat="server" MinimumPrefixLength="2"
                                                                                MaxLength="50" ContextKey="sHrm.EmployeeMaster" AutoPostBack="true"  DisplayLoadingStatus="true"
                                                                                SkinID="CustomWidthTextBox"  OnTextChanged="WhomToMeetTextBox_OnTextChanged" Width="154px" ValidateOnTextChanged="false" />--%>
                                                                               
                                                        </div>
                                                         </div>

                                                          
                                                         <%-- <div class="outerBox pTop5">
                                                <div class="controlLabelWidth">
                                                    <asp:Label ID="InTimeLabel" runat="server" Text="In Time" ></asp:Label>
                                                </div>
                                                <div class="fLeft pRight5">
                                                    <asp:TextBox ID="InTimeTextBox" onmouseleave="showHideTooltip()" Enabled="false" onmouseenter="showHideTooltip()"
                                                        SkinID="CustomWidthTextBox"  Width="150px" runat="server" MaxLength="200"> </asp:TextBox>    
                                                         
                                                                    
                                                </div>
                                            </div>

                                             <div class="outerBox pTop5">
                                                <div class="controlLabelWidth">
                                                    <asp:Label ID="OutTimeLabel" runat="server" Text="Out Time" ></asp:Label>
                                                </div>
                                                <div class="fLeft pRight5">
                                                    <asp:TextBox ID="OutTimeTextBox"  onmouseleave="showHideTooltip()" Enabled="false" onmouseenter="showHideTooltip()"
                                                        SkinID="CustomWidthTextBox" Width="150px" runat="server" MaxLength="200"> </asp:TextBox>    
                                                         
                                                                    
                                                </div>
                                            </div>--%>
                                        
                                            </td>
                                                <td align="center" valign="top">
                                             <asp:Image ID="VisitorPhoto" Visible="false" runat="server" Height="80px" Width="80px"
                                                    AlternateText="Upload Photo" /><br />
                                               
                                                 
                                            </td>
                                            </tr>
                                           
                                                    </div>
                                         
                                                 </div>
                                                 </div>
                                      
                                            </td>
                                         
                                               
                                      
                                        
                                           
                                          
                                          </tr>
                                            </table>
                                                  
                                        
                                          
                                            <div class="cBoth">
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <!-- Sub Container1 Box Ends -->
                            </td>
                        </tr>
                    </table>
                </div>
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
    <script data-main='<%=ResolveUrl("~/JavaScript/rjs/assign-organization")%>' src='<%=ResolveUrl("~/JavaScript/rjs/require.js")%>'></script>
   <script language="javascript" type="text/javascript">

       function fnValidateVisitorLog() {
           //debugger;
           var himsValidator = [

                               new hims_ctl_val('<%=TitleTextBox.ClientID %>', "Visitor Name", "T", "", "", "", 20),
                               new hims_ctl_val('<%=NoOfVisitorTextBox.ClientID %>', "No. Of Visitor", "T", "", "", "", 20)

                                ];


           if (fnDoValidate(himsValidator))
               return true;
           else
               return false;
       }
               function isNumber(evt) {
                   evt = (evt) ? evt : window.event;
                   var charCode = (evt.which) ? evt.which : evt.keyCode;
                   if (charCode > 31 && (charCode < 48 || charCode > 57)) {
                       return false;
                   }
                   return true;
               }


       function NumberOnly() {
           var AsciiValue = event.keyCode
           if ((AsciiValue >= 48 && AsciiValue <= 57) || (AsciiValue == 8 || AsciiValue == 127))
               event.returnValue = true;
           else
               event.returnValue = false;
       }
       function showHideSwitch(theid) {

           if (document.getElementById) {
               var switch_id = document.getElementById(theid);
               var imgid = theid + 'Button';
               var button_id = document.getElementById(imgid);
               if (menus_status_array[theid] != 'show') {
                   button_id.setAttribute('ImageUrl', img_close);
                   switch_id.className = 'showSwitch';
                   menus_status_array[theid] = 'show';
                   document.cookie = theid + '=show';
                   if (theid == "ddSETTINGS") {
                       menus_status_array[ddSETTINGS] = 'hide';
                       var theid2 = "ddSETTINGS";
                       document.cookie = theid2 + '=hide';
                   }
                   //Added for reseting after setting cookie
                   resetMenu();



               } else {
                   button_id.setAttribute('ImageUrl', img_open);
                   switch_id.className = 'hideSwitch';
                   menus_status_array[theid] = 'hide';
                   document.cookie = theid + '=hide';
               }
           }
       }
       function resetMenu() { // read cookies and set menus to last visited state
           if (document.getElementById) {
               for (var i = 0; i < menus_array.length; i++) {
                   var idname = menus_array[i];
                   var switch_id = document.getElementById(idname);
                   var imgid = idname + 'Button';
                   var button_id = document.getElementById(imgid);
                   if (getCookie(idname) == 'show') {
                       button_id.setAttribute('ImageUrl', img_open);

                       // switch_id.className = 'showSwitch';
                       //menus_status_array[idname] = 'show';
                   } else {
                       button_id.setAttribute('ImageUrl', img_close);
                       //switch_id.className = 'hideSwitch';
                       //menus_status_array[idname] = 'hide';
                   }
               }
           }
       }

       /****************************************************************************************
       Function/Procedure  Name            :- fnDbtNonModalWin
       functionality                       :- Function to open Search Window.
       ****************************************************************************************/

       var childPopupArray = new Array(30)

       function fnDbtNonModalWin(strFullWindowName, strWindowTitle, dialogSize) {
           var targetWin = null;
           var CurrentPopUpIndex = 0;
           for (var PopUpCount = 0; PopUpCount < childPopupArray.length - 1; PopUpCount++) {
               if (childPopupArray[PopUpCount] != undefined)
                   if (childPopupArray[PopUpCount][0] == strWindowTitle) {
                       targetWin = childPopupArray[PopUpCount][1];
                       if (targetWin.closed)
                           childPopupArray[PopUpCount] = undefined;
                       break;
                   }
           }
           if (targetWin != null && targetWin.closed)
               targetWin = null;
           if (targetWin == null) {
               targetWin = window.open(strFullWindowName, '', 'height=1000,width=1200,toolbar=no,directories=no,status=no, menubar=no,scrollbars=no,resizable=yes');

           }

           else {
               targetWin.location = strFullWindowName;
               targetWin.focus();
           }
           for (var ExistingPopUpCount = 0; ExistingPopUpCount < childPopupArray.length - 1; ExistingPopUpCount++) {
               if (childPopupArray[ExistingPopUpCount] != undefined)
                   if (childPopupArray[ExistingPopUpCount][0] == strWindowTitle) {
                       childPopupArray[ExistingPopUpCount][1] = targetWin;
                       CurrentPopUpIndex = ExistingPopUpCount;
                       break;
                   }
           }
           if (CurrentPopUpIndex == 0) {
               for (var EmptyPopUpCount = 0; EmptyPopUpCount < childPopupArray.length - 1; EmptyPopUpCount++) {
                   if (childPopupArray[EmptyPopUpCount] == undefined) {
                       childPopupArray[EmptyPopUpCount] = new Array(2);
                       childPopupArray[EmptyPopUpCount][0] = strWindowTitle;
                       childPopupArray[EmptyPopUpCount][1] = targetWin;
                       break;
                   }
               }
           }

       }
       function setScroll(val, posId) {
           posId.value = val.scrollTop;
       }


       //only required for w/o ajax page ScrollWOAjax.
       function scrollTo(what, posId) {
           if (what != "0")
               document.getElementById(what).scrollTop = document.getElementById(posId).value;
       }

       function getCookie(name) {
           var dc = document.cookie;
           var prefix = name + "=";
           var begin = dc.indexOf("; " + prefix);
           if (begin == -1) {
               begin = dc.indexOf(prefix);
               if (begin != 0) return null;
           } else
               begin += 2;
           var end = document.cookie.indexOf(";", begin);
           if (end == -1)
               end = dc.length;
           return unescape(dc.substring(begin + prefix.length, end));
       }
       // LIST ALL SHOW/HIDE ELEMENT IDS HERE
       menus_array = new Array('ddSETTINGS');
       menus_status_array = new Array(); // remembers state of switches
       img_close = '../../Images/buttonExpand.gif';
       img_open = '../../Images/buttonCollapse.gif';



       popwindow = null;
       function popUp(pageURL, title, w, h) {

           var left = (screen.width / 2) - (w / 2);
           var top = (screen.height / 2) - (h / 2);
           var targetWin = window.open(pageURL, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, copyhistory=no, width=' + w + ', height=' + h + ', top=' + top + ', left=' + left);
       }

       function popUpReportViewer(pageURL, title, w, h) {

           var left = (screen.width / 2) - (w / 2);
           var top = (screen.height / 2) - (h / 2);

           var targetWin = window.open(pageURL, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=yes, copyhistory=no, width=' + w + ', height=' + h + ', top=' + top + ', left=' + left);
           targetWin.moveTo(0, 0);
           targetWin.resizeTo(screen.availWidth, screen.availHeight);

       }
    </script>
    <script type="text/javascript" language="javascript">
        function showHideSwitch(theid) {

            if (document.getElementById) {
                var switch_id = document.getElementById(theid);
                var imgid = theid + 'Button';
                var button_id = document.getElementById(imgid);
                if (menus_status_array[theid] != 'show') {
                    button_id.setAttribute('ImageUrl', img_close);
                    switch_id.className = 'showSwitch';
                    menus_status_array[theid] = 'show';
                    document.cookie = theid + '=show';
                    if (theid == "ddSETTINGS") {
                        menus_status_array[ddSETTINGS] = 'hide';
                        var theid2 = "ddSETTINGS";
                        document.cookie = theid2 + '=hide';
                    }
                    //Added for reseting after setting cookie
                    resetMenu();



                } else {
                    button_id.setAttribute('ImageUrl', img_open);
                    switch_id.className = 'hideSwitch';
                    menus_status_array[theid] = 'hide';
                    document.cookie = theid + '=hide';
                }
            }
        }
        function resetMenu() { // read cookies and set menus to last visited state
            if (document.getElementById) {
                for (var i = 0; i < menus_array.length; i++) {
                    var idname = menus_array[i];
                    var switch_id = document.getElementById(idname);
                    var imgid = idname + 'Button';
                    var button_id = document.getElementById(imgid);
                    if (getCookie(idname) == 'show') {
                        button_id.setAttribute('ImageUrl', img_open);

                        // switch_id.className = 'showSwitch';
                        //menus_status_array[idname] = 'show';
                    } else {
                        button_id.setAttribute('ImageUrl', img_close);
                        //switch_id.className = 'hideSwitch';
                        //menus_status_array[idname] = 'hide';
                    }
                }
            }
        }
    </script>
    <script language="JavaScript" type="text/javascript">
        /****************************************************************************************
        Function/Procedure  Name            :- fnDbtNonModalWin
        functionality                       :- Function to open Search Window.
        ****************************************************************************************/

        var childPopupArray = new Array(30)

        function fnDbtNonModalWin(strFullWindowName, strWindowTitle, dialogSize) {
            var targetWin = null;
            var CurrentPopUpIndex = 0;
            for (var PopUpCount = 0; PopUpCount < childPopupArray.length - 1; PopUpCount++) {
                if (childPopupArray[PopUpCount] != undefined)
                    if (childPopupArray[PopUpCount][0] == strWindowTitle) {
                        targetWin = childPopupArray[PopUpCount][1];
                        if (targetWin.closed)
                            childPopupArray[PopUpCount] = undefined;
                        break;
                    }
            }
            if (targetWin != null && targetWin.closed)
                targetWin = null;
            if (targetWin == null) {
                targetWin = window.open(strFullWindowName, '', 'height=1000,width=1200,toolbar=no,directories=no,status=no, menubar=no,scrollbars=no,resizable=yes');

            }

            else {
                targetWin.location = strFullWindowName;
                targetWin.focus();
            }
            for (var ExistingPopUpCount = 0; ExistingPopUpCount < childPopupArray.length - 1; ExistingPopUpCount++) {
                if (childPopupArray[ExistingPopUpCount] != undefined)
                    if (childPopupArray[ExistingPopUpCount][0] == strWindowTitle) {
                        childPopupArray[ExistingPopUpCount][1] = targetWin;
                        CurrentPopUpIndex = ExistingPopUpCount;
                        break;
                    }
            }
            if (CurrentPopUpIndex == 0) {
                for (var EmptyPopUpCount = 0; EmptyPopUpCount < childPopupArray.length - 1; EmptyPopUpCount++) {
                    if (childPopupArray[EmptyPopUpCount] == undefined) {
                        childPopupArray[EmptyPopUpCount] = new Array(2);
                        childPopupArray[EmptyPopUpCount][0] = strWindowTitle;
                        childPopupArray[EmptyPopUpCount][1] = targetWin;
                        break;
                    }
                }
            }

        }
        function setScroll(val, posId) {
            posId.value = val.scrollTop;
        }


        //only required for w/o ajax page ScrollWOAjax.
        function scrollTo(what, posId) {
            if (what != "0")
                document.getElementById(what).scrollTop = document.getElementById(posId).value;
        }

        function getCookie(name) {
            var dc = document.cookie;
            var prefix = name + "=";
            var begin = dc.indexOf("; " + prefix);
            if (begin == -1) {
                begin = dc.indexOf(prefix);
                if (begin != 0) return null;
            } else
                begin += 2;
            var end = document.cookie.indexOf(";", begin);
            if (end == -1)
                end = dc.length;
            return unescape(dc.substring(begin + prefix.length, end));
        }
        // LIST ALL SHOW/HIDE ELEMENT IDS HERE
        menus_array = new Array('ddSETTINGS');
        menus_status_array = new Array(); // remembers state of switches
        img_close = '../../Images/buttonExpand.gif';
        img_open = '../../Images/buttonCollapse.gif';



        popwindow = null;
        function popUp(pageURL, title, w, h) {

            var left = (screen.width / 2) - (w / 2);
            var top = (screen.height / 2) - (h / 2);
            var targetWin = window.open(pageURL, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, copyhistory=no, width=' + w + ', height=' + h + ', top=' + top + ', left=' + left);
        }

        function popUpReportViewer(pageURL, title, w, h) {

            var left = (screen.width / 2) - (w / 2);
            var top = (screen.height / 2) - (h / 2);

            var targetWin = window.open(pageURL, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=yes, copyhistory=no, width=' + w + ', height=' + h + ', top=' + top + ', left=' + left);
            targetWin.moveTo(0, 0);
            targetWin.resizeTo(screen.availWidth, screen.availHeight);

        }

    </script>
</asp:Content>
