private void ShowRecordDetails(bool show, int rec_id)
        {
            EmployeeRecord rec        = null;
            string         javaScript = "";

            try
            {
                rec = (show) ? (_tableEmployees.GetRecordByID(_connectionDb, rec_id)) : (null);
            }
            catch (Exception ex)
            {
                ShowErrorMessage("The error was occured while open connection to the database:<br/>" +
                                 ex.Message);
            }

            if (show && rec == null)
            {
                show = false;
            }

            panelMrPBookRecordDetails.Visible = show;
            ViewState["_bShowDetailsDiv"]     = _bShowDetailsDiv = show;
            string encodedDefPhotoUrl      = Server.UrlEncode(_siteUrl + _sNoProfileImageFile);
            string encodedConnectionString = Server.UrlEncode(EncryptString(_sConnectionStringPhoto, _sEncodeParams));
            string sPictureHandler         = String.Format("{0}/_layouts/MriyaStaffWebparts/ShowPhoto.ashx?id={1}&npi={2}&cs={3}",
                                                           _siteUrl, rec_id, encodedDefPhotoUrl, encodedConnectionString);

            if (show)
            {
                StringBuilder sb    = new StringBuilder();
                string        sName = "";

                if (rec.MiddleName.Length > 0)
                {
                    sName += rec.LastName;
                    if (sName.Length > 0)
                    {
                        sName += " ";
                    }
                    sName += rec.FirstName;
                    if (sName.Length > 0)
                    {
                        sName += " ";
                    }
                    sName += rec.MiddleName;
                }
                else
                {
                    sName += rec.FirstName;
                    if (sName.Length > 0)
                    {
                        sName += " ";
                    }
                    sName += rec.LastName;
                }

                int    line           = 0;
                string cssRowStyle    = "styleMrPBookDetailsRow";
                string cssRowStyleAlt = "styleMrPBookDetailsRowAlt";
                sb.AppendLine("<table class=\"styleMrPBookDetailsTable\" padding=\"0\" cellspacing=\"0\" border=\"0\" style=\"width:100%;\">");
                if (_bShowDetailsName && sName.Trim().Length > 0)
                {
                    sb.AppendFormat("<tr class=\"{0}\"><td colspan=\"2\"><div class=\"stylrMrPBookName\">{1}</div></td></tr>\n",
                                    ((line++ % 2) != 0) ? (cssRowStyleAlt) : (cssRowStyle), sName);
                }
                if (_bShowDetailsJobTitle && rec.JobTitle.Trim().Length > 0)
                {
                    sb.AppendFormat("<tr class=\"{0}\"><td style=\"width:100px;\"><div class=\"stylrMrPBookPosition\"><span class=\"styleMrPBookDetailsLabel\">{1}: </span></div></td>",
                                    ((line++ % 2) != 0) ? (cssRowStyleAlt) : (cssRowStyle), Properties.Resources.textHeaderJobTitle);
                    sb.AppendFormat("<td valign=\"top\"><div class=\"stylrMrPBookPosition\">{0}</div></td></tr>\n",
                                    rec.JobTitle);
                }
                if (_bShowDetailsDepartment && rec.Department.Trim().Length > 0)
                {
                    sb.AppendFormat("<tr class=\"{0}\"><td valign=\"top\"><div class=\"stylrMrPBookDeparment\"><span class=\"styleMrPBookDetailsLabel\">{1}: </span></div></td>",
                                    ((line++ % 2) != 0) ? (cssRowStyleAlt) : (cssRowStyle), Properties.Resources.textHeaderDepartment);
                    sb.AppendFormat("<td valign=\"top\"><div class=\"stylrMrPBookDeparment\">{0}</div></td></tr>\n",
                                    rec.Department);
                }
                if (_bShowDetailsDob && rec.DOB != null)
                {
                    sb.AppendFormat("<tr class=\"{0}\"><td valign=\"top\"><div class=\"stylrMrPBookDob\"><span class=\"styleMrPBookDetailsLabel\">{1}: </span></div></td>",
                                    ((line++ % 2) != 0) ? (cssRowStyleAlt) : (cssRowStyle), Properties.Resources.textHeaderDob);
                    sb.AppendFormat("<td valign=\"top\"><div class=\"stylrMrPBookDob\">{0}</div></td></tr>\n",
                                    rec.dtDOB.ToString("m"));
                }
                if (_bShowDetailsWPhone && rec.PhoneWork.Trim().Length > 0)
                {
                    sb.AppendFormat("<tr class=\"{0}\"><td valign=\"top\"><div class=\"stylrMrPBookWPhone\"><span class=\"styleMrPBookDetailsLabel\">{1}: </span></div></td>",
                                    ((line++ % 2) != 0) ? (cssRowStyleAlt) : (cssRowStyle), Properties.Resources.textHeaderPhoneWork1);
                    sb.AppendFormat("<td valign=\"top\"><div class=\"stylrMrPBookWPhone\">{0}</div></td></tr>\n",
                                    rec.PhoneWork);
                }
                if (_bShowDetailsMhone && rec.PhoneMobile.Trim().Length > 0)
                {
                    sb.AppendFormat("<tr class=\"{0}\"><td valign=\"top\"><div class=\"stylrMrPBookMPhone\"><span class=\"styleMrPBookDetailsLabel\">{1}: </span></div></td>",
                                    ((line++ % 2) != 0) ? (cssRowStyleAlt) : (cssRowStyle), Properties.Resources.textHeaderPhoneMobile);
                    sb.AppendFormat("<td valign=\"top\"><div class=\"stylrMrPBookMPhone\">{0}</div></td></tr>\n",
                                    rec.PhoneMobile);
                }
                if (_bShowDetailsEmail && rec.Email.Trim().Length > 0)
                {
                    sb.AppendFormat("<tr class=\"{0}\"><td valign=\"top\"><div class=\"stylrMrPBookEmail\"><span class=\"styleMrPBookDetailsLabel\">{1}: </span></div></td>",
                                    ((line++ % 2) != 0) ? (cssRowStyleAlt) : (cssRowStyle), Properties.Resources.textHeaderEmail);
                    sb.AppendFormat("<td valign=\"top\"><div class=\"stylrMrPBookEmail\"><a href=\"mailto:{0}\">{0}</a></div></td></tr>\n",
                                    rec.Email);
                }
                if (_bShowDetailsCity && (rec.City.Trim().Length > 0 || rec.OrgCity.Trim().Length > 0))
                {
                    sb.AppendFormat("<tr class=\"{0}\"><td valign=\"top\"><div class=\"stylrMrPBookCity\"><span class=\"styleMrPBookDetailsLabel\">{1}: </span></div></td>",
                                    ((line++ % 2) != 0) ? (cssRowStyleAlt) : (cssRowStyle), Properties.Resources.textHeaderCity);
                    sb.AppendFormat("<td valign=\"top\"><div class=\"stylrMrPBookCity\">{0}</div></td></tr>\n",
                                    (rec.City.Length > 0) ? (rec.City) : (rec.OrgCity));
                }
                sb.AppendLine("</table>");
                literalDetails.Text   = sb.ToString();
                imageDetails.ImageUrl = sPictureHandler;
            }
            else
            {
                javaScript            = "hideDetailsDiv('divMrPBookRecordDetailsOuter');";
                imageDetails.ImageUrl = _siteUrl + _sNoProfileImageFile;
                literalDetails.Text   = "";
            }
            javaScript = String.Format("showDetailsDiv({0});",
                                       (show) ? ('1') : ('0'));
            this.Page.ClientScript.RegisterStartupScript(this.GetType(),
                                                         "RecDetailsWindowInCenterScreen", javaScript, true);
        }