/// <summary> Returns the HTML for one element within tab which appears over the search box in the collection view </summary>
        /// <param name="ThisView"> Collection view type for this tab </param>
        /// <param name="Current_Mode"> Mode / navigation information for the current request, to see if the tab is currently selected or not and determine current skin language </param>
        /// <param name="Translations"> Language support object for writing the name of the view in the appropriate interface language </param>
        /// <returns> HTML to display the tab, including the link if it is not currently selected </returns>
        public static string Menu_Get_Nav_Bar_HTML(Item_Aggregation.CollectionViewsAndSearchesEnum ThisView, SobekCM_Navigation_Object Current_Mode, Language_Support_Info Translations )
        {
            string skinCode = Current_Mode.Base_Skin;

            switch (ThisView)
            {
                case Item_Aggregation.CollectionViewsAndSearchesEnum.Advanced_Search:
                case Item_Aggregation.CollectionViewsAndSearchesEnum.Advanced_Search_YearRange:
                    return Menu_HTML_Helper(skinCode, Search_Type_Enum.Advanced, Translations.Get_Translation("ADVANCED SEARCH", Current_Mode.Language), Current_Mode);

                case Item_Aggregation.CollectionViewsAndSearchesEnum.Basic_Search:
                case Item_Aggregation.CollectionViewsAndSearchesEnum.Basic_Search_YearRange:
                    return Menu_HTML_Helper(skinCode, Search_Type_Enum.Basic, Translations.Get_Translation("BASIC SEARCH", Current_Mode.Language), Current_Mode);

                case Item_Aggregation.CollectionViewsAndSearchesEnum.Map_Search:
                    return Menu_HTML_Helper(skinCode, Search_Type_Enum.Map, Translations.Get_Translation("MAP SEARCH", Current_Mode.Language), Current_Mode);

                case Item_Aggregation.CollectionViewsAndSearchesEnum.Map_Search_Beta:
                    return Menu_HTML_Helper(skinCode, Search_Type_Enum.Map_Beta, Translations.Get_Translation("MAP SEARCH", Current_Mode.Language), Current_Mode);

                case Item_Aggregation.CollectionViewsAndSearchesEnum.Newspaper_Search:
                    return Menu_HTML_Helper(skinCode, Search_Type_Enum.Newspaper, Translations.Get_Translation("NEWSPAPER SEARCH", Current_Mode.Language), Current_Mode);

                case Item_Aggregation.CollectionViewsAndSearchesEnum.Admin_View:
                    return String.Empty; // HTML_Helper(Skin_Code, SobekCM.Library.Navigation.Search_Type_Enum.Admin_View, Translations.Get_Translation("ADMIN", Current_Mode.Language), Current_Mode, Downward_Tabs);

                case Item_Aggregation.CollectionViewsAndSearchesEnum.DLOC_FullText_Search:
                    return Menu_HTML_Helper(skinCode, Search_Type_Enum.dLOC_Full_Text, Translations.Get_Translation("TEXT SEARCH", Current_Mode.Language), Current_Mode);

                case Item_Aggregation.CollectionViewsAndSearchesEnum.FullText_Search:
                    return Menu_HTML_Helper(skinCode, Search_Type_Enum.Full_Text, Translations.Get_Translation("TEXT SEARCH", Current_Mode.Language), Current_Mode);
            }

            return String.Empty;
        }
        /// <summary> Method helps to render all simple text box based elements </summary>
        /// <param name="Output"> Output for the generated html for this element </param>
        /// <param name="instance_value"> Value for the current digital resource to display</param>
        /// <param name="Skin_Code"> Code for the current html skin </param>
        /// <param name="Current_User"> Current user, who's rights may impact the way an element is rendered </param>
        /// <param name="CurrentLanguage"> Current user-interface language </param>
        /// <param name="Translator"> Language support object which handles simple translational duties </param>
        /// <param name="Base_URL"> Base URL for the current request </param>
        protected void render_helper(TextWriter Output, bool instance_value, string Skin_Code, User_Object Current_User, Web_Language_Enum CurrentLanguage, Language_Support_Info Translator, string Base_URL)
        {
            Output.WriteLine("  <!-- " + Title + " Element -->");
            Output.WriteLine("  <tr align=\"left\">");
            Output.WriteLine("    <td width=\"" + LEFT_MARGIN + "px\">&nbsp;</td>");

            // Get the label to show
            string label_to_show = Title.Replace(":", "");

            if (Acronym.Length > 0)
            {
                Output.WriteLine("    <td valign=\"top\" class=\"metadata_label\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" target=\"_" + html_element_name.ToUpper() + "\"><acronym title=\"" + Acronym + "\">" + Translator.Get_Translation(label_to_show, CurrentLanguage) + ":</acronym></a></td>");
            }
            else
            {
                Output.WriteLine("    <td valign=\"top\" class=\"metadata_label\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" target=\"_" + html_element_name.ToUpper() + "\">" + Translator.Get_Translation(label_to_show, CurrentLanguage) + ":</a></td>");
            }

            Output.WriteLine("    <td>");
            Output.WriteLine("      <table>");
            Output.WriteLine("        <tr>");
            Output.WriteLine("          <td>");
            if (!instance_value)
            {
                Output.WriteLine("            <input type=\"checkbox\" name=\"" + html_element_name + "\" id=\"" + html_element_name + "\"><label for=\"" + html_element_name + "\">" + checkBoxText + "</label>");
            }
            else
            {
                Output.WriteLine("            <input type=\"checkbox\" name=\"" + html_element_name + "\" id=\"" + html_element_name + "\" checked=\"checked\"><label for=\"" + html_element_name + "\">" + checkBoxText + "</label>");
            }
            Output.WriteLine("          </td>");
            Output.WriteLine("          <td valign=\"bottom\" >");

            Output.WriteLine("            <a target=\"_" + html_element_name.ToUpper() + "\"  title=\"" + Translator.Get_Translation("Get help.", CurrentLanguage) + "\" href=\"" + Help_URL(Skin_Code, Base_URL) + "\" ><img border=\"0px\" class=\"help_button\" src=\"" + Base_URL + HELP_BUTTON_URL + "\" /></a>");

            Output.WriteLine("          </td>");
            Output.WriteLine("        </tr>");
            Output.WriteLine("      </table>");

            Output.WriteLine("    </td>");

            Output.WriteLine("  </tr>");
            Output.WriteLine();
        }
        /// <summary> Returns the HTML for one tab which appears over the search box in the collection view </summary>
        /// <param name="thisView"> Collection view type for this tab </param>
        /// <param name="Current_Mode"> Mode / navigation information for the current request, to see if the tab is currently selected or not and determine current skin language </param>
        /// <param name="Translations"> Language support object for writing the name of the view in the appropriate interface language </param>
        /// <param name="Downward_Tabs"> Flag indicates if this tab faces downward, rather than the default upward </param>
        /// <returns> HTML to display the tab, including the link if it is not currently selected </returns>
        public static string Get_Nav_Bar_HTML( Item_Aggregation.CollectionViewsAndSearchesEnum thisView, SobekCM_Navigation_Object Current_Mode, Language_Support_Info Translations, bool Downward_Tabs )
        {
            string skinCode = Current_Mode.Base_Skin;

            switch (thisView)
            {
                case Item_Aggregation.CollectionViewsAndSearchesEnum.Advanced_Search:
                    if (Current_Mode.Is_Robot)
                    {
                        return "<img src=\"" + Current_Mode.Base_URL + "design/skins/" + skinCode + "/tabs/cL.gif\" border=\"0\" class=\"tab_image\" alt=\"\" /><span class=\"tab\"> ADVANCED SEARCH </span><img src=\"" + Current_Mode.Base_URL + "design/skins/" + skinCode + "/tabs/cR.gif\" border=\"0\" class=\"tab_image\" alt=\"\" />" + Environment.NewLine ;
                    }
                    return HTML_Helper(skinCode, Search_Type_Enum.Advanced, Translations.Get_Translation("ADVANCED SEARCH", Current_Mode.Language), Current_Mode, Downward_Tabs);

                case Item_Aggregation.CollectionViewsAndSearchesEnum.Basic_Search:
                    return HTML_Helper(skinCode, Search_Type_Enum.Basic, Translations.Get_Translation("BASIC SEARCH", Current_Mode.Language), Current_Mode, Downward_Tabs);

                case Item_Aggregation.CollectionViewsAndSearchesEnum.Map_Search:
                    return HTML_Helper(skinCode, Search_Type_Enum.Map, Translations.Get_Translation("MAP SEARCH", Current_Mode.Language), Current_Mode, Downward_Tabs);

                case Item_Aggregation.CollectionViewsAndSearchesEnum.Newspaper_Search:
                    return HTML_Helper(skinCode, Search_Type_Enum.Newspaper, Translations.Get_Translation("NEWSPAPER SEARCH", Current_Mode.Language), Current_Mode, Downward_Tabs);

                case Item_Aggregation.CollectionViewsAndSearchesEnum.Admin_View:
                    return String.Empty; // HTML_Helper(Skin_Code, SobekCM.Library.Navigation.Search_Type_Enum.Admin_View, Translations.Get_Translation("ADMIN", Current_Mode.Language), Current_Mode, Downward_Tabs);

                case Item_Aggregation.CollectionViewsAndSearchesEnum.dLOC_FullText_Search:
                    return HTML_Helper(skinCode, Search_Type_Enum.dLOC_Full_Text, Translations.Get_Translation("TEXT SEARCH", Current_Mode.Language), Current_Mode, Downward_Tabs);

                case Item_Aggregation.CollectionViewsAndSearchesEnum.FullText_Search:
                    return HTML_Helper(skinCode, Search_Type_Enum.Full_Text, Translations.Get_Translation("TEXT SEARCH", Current_Mode.Language), Current_Mode, Downward_Tabs);
            }

            return String.Empty;
        }
        /// <summary> Renders the HTML for this element </summary>
        /// <param name="Output"> Textwriter to write the HTML for this element </param>
        /// <param name="Bib"> Object to populate this element from </param>
        /// <param name="Skin_Code"> Code for the current skin </param>
        /// <param name="isMozilla"> Flag indicates if the current browse is Mozilla Firefox (different css choices for some elements)</param>
        /// <param name="popup_form_builder"> Builder for any related popup forms for this element </param>
        /// <param name="Current_User"> Current user, who's rights may impact the way an element is rendered </param>
        /// <param name="CurrentLanguage"> Current user-interface language </param>
        /// <param name="Translator"> Language support object which handles simple translational duties </param>
        /// <param name="Base_URL"> Base URL for the current request </param>
        /// <remarks> This element appends a popup form to the popup_form_builder</remarks>
        public override void Render_Template_HTML(TextWriter Output, SobekCM_Item Bib, string Skin_Code, bool isMozilla, StringBuilder popup_form_builder, User_Object Current_User, Web_Language_Enum CurrentLanguage, Language_Support_Info Translator, string Base_URL )
        {
            // Check that an acronym exists
            if (Acronym.Length == 0)
            {
                const string defaultAcronym = "Select the resource type information which best describes this material.";
                switch (CurrentLanguage)
                {
                    case Web_Language_Enum.English:
                        Acronym = defaultAcronym;
                        break;

                    case Web_Language_Enum.Spanish:
                        Acronym = defaultAcronym;
                        break;

                    case Web_Language_Enum.French:
                        Acronym = defaultAcronym;
                        break;

                    default:
                        Acronym = defaultAcronym;
                        break;
                }
            }

             // Determine the material type
            string instance_value = "Select Material Type";
            bool initial_value = true;
            string thisType = Bib.Bib_Info.SobekCM_Type_String;
            if (thisType.Length > 0)
            {
                if (thisType.ToUpper() != "PROJECT")
                {
                    instance_value = thisType;
                    initial_value = false;
                }
                else
                {
                    if (Bib.Bib_Info.Notes_Count > 0)
                    {
                        foreach (Note_Info thisNote in Bib.Bib_Info.Notes)
                        {
                            if (thisNote.Note_Type == Note_Type_Enum.default_type)
                            {
                                instance_value = thisNote.Note;
                                initial_value = false;
                                break;
                            }
                        }
                    }
                }
            }

            if ((instance_value.Length == 0) && (default_values.Count > 0))
            {
                instance_value = default_values[0];
            }

            // Render the title
            Output.WriteLine("  <!-- " + Title + " Form Element -->");
            Output.WriteLine("  <tr align=\"left\">");
            Output.WriteLine("    <td width=\"" + LEFT_MARGIN + "px\">&nbsp;</td>");
            if (Acronym.Length > 0)
            {
                Output.WriteLine("    <td valign=\"top\" class=\"metadata_label\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" target=\"_" + html_element_name.ToUpper() + "\"><acronym title=\"" + Acronym + "\">" + Translator.Get_Translation(Title, CurrentLanguage) + ":</acronym></a></td>");
            }
            else
            {
                Output.WriteLine("    <td valign=\"top\" class=\"metadata_label\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" target=\"_" + html_element_name.ToUpper() + "\">" + Translator.Get_Translation(Title, CurrentLanguage) + ":</a></td>");
            }

            Output.WriteLine("    <td>");
            Output.WriteLine("      <table>");
            Output.WriteLine("        <tr>");
            Output.WriteLine("          <td>");
            Output.WriteLine("            <div id=\"" + html_element_name + "_div\">");

            // Start the select combo box
            if (onChange.Length > 0)
            {
                if (initial_value)
                {
                    Output.WriteLine("              <select class=\"" + html_element_name + "_select_init\" name=\"form_typeformat_type\" id=\"form_typeformat_type\" onChange=\"" + onChange + "\" >");
                }
                else
                {
                    Output.WriteLine("              <select class=\"" + html_element_name + "_select\" name=\"form_typeformat_type\" id=\"form_typeformat_type\" onChange=\"" + onChange + "\" >");
                }
            }
            else
            {
                if (initial_value)
                {
                    Output.WriteLine("              <select class=\"" + html_element_name + "_select_init\" name=\"form_typeformat_type\" id=\"form_typeformat_type\" >");
                }
                else
                {
                    Output.WriteLine("              <select class=\"" + html_element_name + "_select\" name=\"form_typeformat_type\" id=\"form_typeformat_type\" >");
                }
            }

            bool found_option = false;
            foreach (string thisOption in items)
            {
                if (thisOption == instance_value)
                {
                    Output.WriteLine("                <option selected=\"selected=\" value=\"" + thisOption + "\">" + thisOption + "</option>");
                    found_option = true;
                }
                else
                {
                    Output.WriteLine("                <option value=\"" + thisOption + "\">" + thisOption + "</option>");
                }
            }
            if ((instance_value.Length > 0) && (!found_option))
            {
                Output.WriteLine("                <option selected=\"selected=\" value=\"" + instance_value + "\">" + instance_value + "</option>");
            }
            Output.WriteLine("              </select>");

            #region Determine the values to display for this bib id

            // Collect the data to show
            bool festschrift = false;
            bool indexPresent = false;
            bool conferencePublication = false;
            string targetAudience1 = String.Empty;
             string frequency1 = String.Empty;
            string frequency2 = String.Empty;
            string regularity1 = String.Empty;
            string regularity2 = String.Empty;

            string nature1 = String.Empty;
            string nature2 = String.Empty;
            string nature3 = String.Empty;
            string nature4 = String.Empty;
            string govt = String.Empty;
            string literaryform1 = String.Empty;
            string literaryform2 = String.Empty;
            string biography = String.Empty;
            string subtype = String.Empty;
            string projection = String.Empty;
            string scale = String.Empty;
            string place_code = String.Empty;
            string language_code = String.Empty;

            // Determine which form will be used and set several values
            Type_Format_Type_Enum formType = Type_Format_Type_Enum.None;
            string class_name = "typeformat_popup_div";
            string form_title = "EDIT MATERIAL DETAILS";
            int windowheight = 270;
            switch (instance_value.ToUpper())
            {
                case "BOOK":
                    formType = Type_Format_Type_Enum.Book;
                    class_name = "typeformat_book_popup_div";
                    form_title = "EDIT BOOK MATERIAL DETAILS";
                    windowheight = 515 - 100; // Fudge to move the form down a bit
                    break;

                case "AERIAL":
                case "ARTIFACT":
                case "PHOTOGRAPH":
                case "VIDEO":
                    formType = Type_Format_Type_Enum.Visual_Materials;
                    class_name = "typeformat_visual_popup_div";
                    form_title = "EDIT VISUAL MATERIAL DETAILS";
                    windowheight = 390;
                    break;

                case "SERIAL":
                case "NEWSPAPER":
                    formType = Type_Format_Type_Enum.Continuing_Resource;
                    class_name = "typeformat_serial_popup_div";
                    form_title = "EDIT CONTINUING RESOURCES MATERIAL DETAILS";
                    windowheight = 430;
                    break;

                case "MAP":
                    formType = Type_Format_Type_Enum.Map;
                    class_name = "typeformat_map_popup_div";
                    form_title = "EDIT MAP MATERIALS DETAILS";
                    windowheight = 430;
                    break;

            }

            // List of possible audiences (marcgt)
            List<string> audiences_list = new List<string>(8)
                                              {
                                                  "adolescent",
                                                  "adult",
                                                  "general",
                                                  "juvenile",
                                                  "pre-adolescent",
                                                  "preschool",
                                                  "primary",
                                                  "specialized"
                                              };

            // List of possible nature of contents
            List<string> nature_contents_list = new List<string>(26)
                                                    {
                                                        "abstract or summary",
                                                        "bibliography",
                                                        "calendar",
                                                        "catalog",
                                                        "comic/graphic novel",
                                                        "dictionary",
                                                        "directory",
                                                        "discography",
                                                        "filmography",
                                                        "handbook",
                                                        "index",
                                                        "law report or digest",
                                                        "legal article",
                                                        "legal case and case notes",
                                                        "legislation",
                                                        "offprint",
                                                        "patent",
                                                        "programmed text",
                                                        "review",
                                                        "statistics",
                                                        "survey of literature",
                                                        "technical report",
                                                        "theses",
                                                        "treaty",
                                                        "yearbook"
                                                    };

            // List of government genres
            List<string> government_list = new List<string>(8)
                                               {
                                                   "federal government publication",
                                                   "international intergovernmental publication",
                                                   "local government publication",
                                                   "government publication",
                                                   "government publication (autonomous or semiautonomous component)",
                                                   "government publication (state, provincial, terriorial, dependent)",
                                                   "multilocal government publication",
                                                   "multistate government publication"
                                               };

            // Get list of literary forms
            List<string> literary_form_list = new List<string>(11)
                                                  {
                                                      "comic strip",
                                                      "drama",
                                                      "essay",
                                                      "fiction",
                                                      "humor, satire",
                                                      "letter",
                                                      "novel",
                                                      "non-fiction",
                                                      "poetry",
                                                      "short story",
                                                      "speech"
                                                  };

            // Get list of biography type information
            List<string> biography_list = new List<string>(3)
                                              {"autobiography", "individual biography", "collective biography"};

            // Get list of map subtypes
            List<string> map_subtypes = new List<string>(5) {"atlas", "globe", "map serial", "map series", "single map"};

            // Get the list of visual materials subtypes
            List<string> visual_subtypes = new List<string>(17)
                                               {
                                                   "art original",
                                                   "art reproduction",
                                                   "chart",
                                                   "diorama",
                                                   "filmstrip",
                                                   "flash card",
                                                   "graphic",
                                                   "kit",
                                                   "microscope slide",
                                                   "model",
                                                   "motion picture",
                                                   "picture",
                                                   "realia",
                                                   "slide",
                                                   "technical drawing",
                                                   "toy",
                                                   "transparency"
                                               };

            // Get the list of continuing materials subtypes
            List<string> continuing_subtypes = new List<string>(6)
                                                   {
                                                       "database",
                                                       "loose-leaf",
                                                       "newspaper",
                                                       "periodical",
                                                       "series",
                                                       "web site"
                                                   };

            // Get the list of frequency
            List<string> frequency_list = new List<string>(17)
                                              {
                                                  "annual",
                                                  "biennial",
                                                  "bimonthly",
                                                  "biweekly",
                                                  "continuously updated",
                                                  "daily",
                                                  "monthly",
                                                  "other",
                                                  "quarterly",
                                                  "semiannual",
                                                  "semimonthly",
                                                  "semiweekly",
                                                  "three times a month",
                                                  "three times a week",
                                                  "three times a year",
                                                  "triennial",
                                                  "weekly"
                                              };

            // Get the list of regularities
            List<string> regularity_list = new List<string>(3)
                                               {"completely irregular", "normalized irregular", "regular"};

            // Get the place code
            if (Bib.Bib_Info.Origin_Info.Places_Count > 0)
            {
                foreach (Origin_Info_Place thisPlace in Bib.Bib_Info.Origin_Info.Places.Where(thisPlace => thisPlace.Place_MarcCountry.Length > 0))
                {
                    place_code = thisPlace.Place_MarcCountry;
                    break;
                }
            }

            // Get the language code
            if (Bib.Bib_Info.Languages_Count > 0)
            {
                foreach (Language_Info thisLanguage in Bib.Bib_Info.Languages.Where(thisLanguage => thisLanguage.Language_ISO_Code.Length > 0))
                {
                    language_code = thisLanguage.Language_ISO_Code;
                    break;
                }
            }

            // Set the target audience
            if (Bib.Bib_Info.Target_Audiences_Count > 0)
            {
                foreach (TargetAudience_Info audience in Bib.Bib_Info.Target_Audiences.Where(audience => audiences_list.Contains(audience.Audience.ToLower())))
                {
                    if (targetAudience1.Length == 0)
                    {
                        targetAudience1 = audience.Audience.ToLower();
                        break;
                    }
                }
            }

            // Set the frequencies and regularities
            if (Bib.Bib_Info.Origin_Info.Frequencies_Count > 0)
            {
                foreach (Origin_Info_Frequency thisFrequency in Bib.Bib_Info.Origin_Info.Frequencies)
                {
                    // Check for frequency information
                    if (frequency_list.Contains(thisFrequency.Term.ToLower()))
                    {
                        if (frequency1.Length == 0)
                        {
                            frequency1 = thisFrequency.Term.ToLower();
                        }
                        else
                        {
                            if (frequency2.Length == 0)
                            {
                                frequency2 = thisFrequency.Term.ToLower();
                            }
                        }
                    }

                    // Check for regularity information
                    if (regularity_list.Contains(thisFrequency.Term.ToLower()))
                    {
                        if (regularity1.Length == 0)
                        {
                            regularity1 = thisFrequency.Term.ToLower();
                        }
                        else
                        {
                            if (regularity2.Length == 0)
                            {
                                regularity2 = thisFrequency.Term.ToLower();
                            }
                        }
                    }
                }
            }

            // Step through each genre
            int nature_index = 1;
            int literary_form_index = 1;
            if (Bib.Bib_Info.Genres_Count > 0)
            {
                foreach (Genre_Info thisGenre in Bib.Bib_Info.Genres)
                {
                    if ((thisGenre.Genre_Term == "conference publication") || (thisGenre.Genre_Term == "festschrift") || (thisGenre.Genre_Term == "indexed"))
                    {
                        if (thisGenre.Genre_Term == "conference publication")
                            conferencePublication = true;

                        if (thisGenre.Genre_Term == "festschrift")
                            festschrift = true;

                        if (thisGenre.Genre_Term == "indexed")
                            indexPresent = true;
                    }
                    else
                    {
                        string genre_term_lower = thisGenre.Genre_Term.ToLower();

                        if (biography_list.Contains(genre_term_lower))
                            biography = genre_term_lower;

                        if (government_list.Contains(genre_term_lower))
                            govt = genre_term_lower;

                        if (formType == Type_Format_Type_Enum.Continuing_Resource)
                        {
                            if (continuing_subtypes.Contains(genre_term_lower))
                                subtype = genre_term_lower;
                        }

                        if (formType == Type_Format_Type_Enum.Visual_Materials)
                        {
                            if (visual_subtypes.Contains(genre_term_lower))
                                subtype = genre_term_lower;
                        }

                        if (formType == Type_Format_Type_Enum.Map)
                        {
                            if (map_subtypes.Contains(genre_term_lower))
                                subtype = genre_term_lower;
                        }

                        if (nature_contents_list.Contains(genre_term_lower))
                        {
                            switch (nature_index)
                            {
                                case 1:
                                    nature1 = genre_term_lower;
                                    break;

                                case 2:
                                    nature2 = genre_term_lower;
                                    break;

                                case 3:
                                    nature3 = genre_term_lower;
                                    break;

                                case 4:
                                    nature4 = genre_term_lower;
                                    break;
                            }

                            nature_index++;
                        }

                        if (literary_form_list.Contains(genre_term_lower))
                        {
                            switch (literary_form_index)
                            {
                                case 1:
                                    literaryform1 = genre_term_lower;
                                    break;

                                case 2:
                                    literaryform2 = genre_term_lower;
                                    break;
                            }

                            literary_form_index++;
                        }
                    }
                }
            }

            // If this is map, get the projection and scale
            if (formType == Type_Format_Type_Enum.Map)
            {
                // Step through each cartographic
                string scale_034 = String.Empty;
                string scale_255 = String.Empty;
                if ( Bib.Bib_Info.Subjects_Count > 0 )
                {
                    foreach (Subject_Info thisSubject in Bib.Bib_Info.Subjects)
                    {
                        if (thisSubject.Class_Type == Subject_Info_Type.Cartographics)
                        {
                            Subject_Info_Cartographics carto = (Subject_Info_Cartographics)thisSubject;
                            if (carto.Scale.Length > 0)
                            {
                                if (carto.ID.IndexOf("SUBJ034") >= 0)
                                    scale_034 = carto.Scale;
                                else
                                {
                                    if (carto.ID.IndexOf("SUBJ255") >= 0)
                                        scale_255 = carto.Scale;
                                    else
                                        scale = carto.Scale;
                                }
                            }
                        }
                    }
                }

                if (scale_255.Length > 0)
                {
                    scale = scale_255.Replace("Scale", "").Replace("ca.", "").Trim();
                }

                if (scale_034.Length > 0)
                {
                    scale = "1:" + scale_034;
                }
            }

            #endregion

            #region Render the link in the template form

            // Render the label with additional information
            string additional_info = show_material_type_details(Bib);
            string style = "form_linkline";
            if (additional_info.Length == 0)
            {
                additional_info = "<i>no additional type information<i>";
                style = "form_linkline_empty";
            }
            if (additional_info.Length > 60)
                additional_info = additional_info.Substring(0, 60) + "...";
            Output.WriteLine("        &nbsp; &nbsp; ");
            Output.WriteLine("              <a title=\"Click to edit the material details\" href=\"" + Base_URL + "l/technical/javascriptrequired\" onfocus=\"link_focused2('form_typeformat_term')\" onblur=\"link_blurred2('form_typeformat_term')\" onkeypress=\"return popup_keypress_focus('form_typeformat', 'form_typeformat_term', 'form_typeformat_extent', " + windowheight + ", 675, '" + isMozilla.ToString() + "' );\" onclick=\"return popup_focus('form_typeformat', 'form_typeformat_term', 'form_typeformat_extent', " + windowheight + ", 675 );\"><span class=\"" + style + " form_typeformat_line\" id=\"form_typeformat_term\">" + additional_info + "</span></a>");
            Output.WriteLine("            </div>");
            Output.WriteLine("          </td>");
            Output.WriteLine("          <td valign=\"bottom\" >");
            Output.WriteLine("            <a target=\"_" + html_element_name.ToUpper() + "\"  title=\"" + Translator.Get_Translation("Get help.", CurrentLanguage) + "\" href=\"" + Help_URL(Skin_Code, Base_URL) + "\" ><img border=\"0px\" class=\"help_button\" src=\"" + Base_URL + HELP_BUTTON_URL + "\" /></a>");
            Output.WriteLine("          </td>");
            Output.WriteLine("        </tr>");
            Output.WriteLine("      </table>");
            Output.WriteLine("    </td>");
            Output.WriteLine("  </tr>");
            Output.WriteLine();

            #endregion

            #region Create the pop-up form for the All Materials section

            // Add the popup form
            popup_form_builder.AppendLine("<!-- Type Format Form -->");
            popup_form_builder.AppendLine("<div class=\"" + class_name + "\" id=\"form_typeformat\" style=\"display:none;\">");
            popup_form_builder.AppendLine("  <div class=\"popup_title\"><table width=\"100%\"><tr><td align=\"left\">" + form_title + "</td><td align=\"right\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" alt=\"HELP\" target=\"_" + html_element_name.ToUpper() + "\" >?</a> &nbsp; <a href=\"#template\" alt=\"CLOSE\" onclick=\"close_typeformat_form()\">X</a> &nbsp; </td></tr></table></div>");
            popup_form_builder.AppendLine("  <br />");
            popup_form_builder.AppendLine("  <table class=\"popup_table\">");

            // Add the all materials title
            popup_form_builder.AppendLine("    <tr><td colspan=\"3\" class=\"SobekEditItemSectionTitle_first\" >All Materials</td></tr>");

            // Add the extent information
            popup_form_builder.Append("    <tr><td> &nbsp; &nbsp; Physical Desc:</td><td colspan=\"2\">");
            popup_form_builder.Append("<input class=\"formtype_large_input\" name=\"form_typeformat_extent\" id=\"form_typeformat_extent\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(Bib.Bib_Info.Original_Description.Extent) + "\"  onfocus=\"javascript:textbox_enter('form_typeformat_extent', 'formtype_large_input_focused')\" onblur=\"javascript:textbox_leave('form_typeformat_extent', 'formtype_large_input')\" />");
            popup_form_builder.AppendLine("</td></tr>");

            // Add the date range info
            popup_form_builder.Append("    <tr><td> &nbsp; &nbsp; Year Range:</td><td colspan=\"2\">");
            popup_form_builder.Append("<span class=\"metadata_sublabel2\">Start Year:</span><input class=\"formtype_small_input\" name=\"form_typeformat_datestart\" id=\"form_typeformat_datestart\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(Bib.Bib_Info.Origin_Info.MARC_DateIssued_Start) + "\"  onfocus=\"javascript:textbox_enter('form_typeformat_datestart', 'formtype_small_input_focused')\" onblur=\"javascript:textbox_leave('form_typeformat_datestart', 'formtype_small_input')\" />");
            popup_form_builder.Append("<span class=\"metadata_sublabel\">End Year:</span><input class=\"formtype_small_input\" name=\"form_typeformat_dateend\" id=\"form_typeformat_dateend\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(Bib.Bib_Info.Origin_Info.MARC_DateIssued_End) + "\"  onfocus=\"javascript:textbox_enter('form_typeformat_dateend', 'formtype_small_input_focused')\" onblur=\"javascript:textbox_leave('form_typeformat_dateend', 'formtype_small_input')\" />");
            popup_form_builder.AppendLine("</td></tr>");

            // Add the place code info
            popup_form_builder.Append("    <tr><td> &nbsp; &nbsp; Place Code:</td><td colspan=\"2\">");
            popup_form_builder.Append("<input class=\"formtype_small_input\" name=\"form_typeformat_placecode\" id=\"form_typeformat_placecode\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(place_code) + "\"  onfocus=\"javascript:textbox_enter('form_typeformat_placecode', 'formtype_small_input_focused')\" onblur=\"javascript:textbox_leave('form_typeformat_placecode', 'formtype_small_input')\" />");
            popup_form_builder.AppendLine("</td></tr>");

            // Add the language code info
            popup_form_builder.Append("    <tr><td> &nbsp; &nbsp; Language Code:</td><td colspan=\"2\">");
            popup_form_builder.Append("<input class=\"formtype_small_input\" name=\"form_typeformat_langcode\" id=\"form_typeformat_langcode\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(language_code) + "\"  onfocus=\"javascript:textbox_enter('form_typeformat_langcode', 'formtype_small_input_focused')\" onblur=\"javascript:textbox_leave('form_typeformat_langcode', 'formtype_small_input')\" />");
            popup_form_builder.AppendLine("</td></tr>");

            #endregion

            #region Render the 'Book Details' section if this is a book

            if (formType ==  Type_Format_Type_Enum.Book)
            {
                // Add the book details title
                popup_form_builder.AppendLine("    <tr><td colspan=\"3\" class=\"SobekEditItemSectionTitle\" >Book Details</td></tr>");

                // Add the target audience
                popup_form_builder.Append("    <tr><td> &nbsp; &nbsp; Target Audience:</td><td colspan=\"2\">");
                popup_form_builder.Append("<select class=\"formtype_small_select\" name=\"form_typeformat_audience\" id=\"form_typeformat_audience\" >");
                popup_form_builder.Append(targetAudience1.Length == 0
                                              ? "<option value=\"\" selected=\"selected\" ></option>"
                                              : "<option value=\"\"></option>");
                foreach (string thisAudience in audiences_list)
                {
                    if ( targetAudience1 == thisAudience )
                    {
                        popup_form_builder.Append("<option value=\"" + thisAudience + "\" selected=\"selected\">" + thisAudience +"</option>");
                    }
                    else
                    {
                        popup_form_builder.Append("<option value=\"" + thisAudience + "\">" + thisAudience + "</option>");
                    }
                }
                popup_form_builder.Append("</select>");
                popup_form_builder.AppendLine("</td></tr>");

                // Add the nature of contents
                popup_form_builder.Append("    <tr><td> &nbsp; &nbsp; Nature of contents:</td><td colspan=\"2\">");
                popup_form_builder.Append("<select class=\"formtype_medium_select\" name=\"form_typeformat_nature1\" id=\"form_typeformat_nature1\" >");
                popup_form_builder.Append(nature1.Length == 0
                                              ? "<option value=\"\" selected=\"selected\" ></option>"
                                              : "<option value=\"\"></option>");
                foreach (string thisString in nature_contents_list)
                {
                    if (nature1 == thisString)
                    {
                        popup_form_builder.Append("<option value=\"" + thisString + "\" selected=\"selected\">" + thisString + "</option>");
                    }
                    else
                    {
                        popup_form_builder.Append("<option value=\"" + thisString + "\">" + thisString + "</option>");
                    }
                }
                popup_form_builder.Append("</select>");

                popup_form_builder.Append("<select class=\"formtype_medium_select\" name=\"form_typeformat_nature2\" id=\"form_typeformat_nature2\" >");
                popup_form_builder.Append(nature2.Length == 0
                                              ? "<option value=\"\" selected=\"selected\" ></option>"
                                              : "<option value=\"\"></option>");
                foreach (string thisString in nature_contents_list)
                {
                    if (nature2 == thisString)
                    {
                        popup_form_builder.Append("<option value=\"" + thisString + "\" selected=\"selected\">" + thisString + "</option>");
                    }
                    else
                    {
                        popup_form_builder.Append("<option value=\"" + thisString + "\">" + thisString + "</option>");
                    }
                }
                popup_form_builder.Append("</select>");

                popup_form_builder.AppendLine("</td></tr>");

                popup_form_builder.Append("    <tr><td>&nbsp;</td><td colspan=\"2\">");
                popup_form_builder.Append("<select class=\"formtype_medium_select\" name=\"form_typeformat_nature3\" id=\"form_typeformat_nature3\" >");
                popup_form_builder.Append(nature3.Length == 0
                                              ? "<option value=\"\" selected=\"selected\" ></option>"
                                              : "<option value=\"\"></option>");
                foreach (string thisString in nature_contents_list)
                {
                    if (nature3 == thisString)
                    {
                        popup_form_builder.Append("<option value=\"" + thisString + "\" selected=\"selected\">" + thisString + "</option>");
                    }
                    else
                    {
                        popup_form_builder.Append("<option value=\"" + thisString + "\">" + thisString + "</option>");
                    }
                }
                popup_form_builder.Append("</select>");

                popup_form_builder.Append("<select class=\"formtype_medium_select\" name=\"form_typeformat_nature4\" id=\"form_typeformat_nature4\" >");
                popup_form_builder.Append(nature4.Length == 0
                                              ? "<option value=\"\" selected=\"selected\" ></option>"
                                              : "<option value=\"\"></option>");
                foreach (string thisString in nature_contents_list)
                {
                    if (nature4 == thisString)
                    {
                        popup_form_builder.Append("<option value=\"" + thisString + "\" selected=\"selected\">" + thisString + "</option>");
                    }
                    else
                    {
                        popup_form_builder.Append("<option value=\"" + thisString + "\">" + thisString + "</option>");
                    }
                }
                popup_form_builder.Append("</select>");

                popup_form_builder.AppendLine("</td></tr>");

                // Add the government publication
                popup_form_builder.Append("    <tr><td> &nbsp; &nbsp; Government:</td><td colspan=\"2\">");
                popup_form_builder.Append("<select class=\"formtype_large_select\" name=\"form_typeformat_govt\" id=\"form_typeformat_govt\" >");
                popup_form_builder.Append(govt.Length == 0
                                              ? "<option value=\"\" selected=\"selected\" ></option>"
                                              : "<option value=\"\"></option>");
                foreach (string thisString in government_list)
                {
                    if (govt == thisString)
                    {
                        popup_form_builder.Append("<option value=\"" + thisString + "\" selected=\"selected\">" + thisString + "</option>");
                    }
                    else
                    {
                        popup_form_builder.Append("<option value=\"" + thisString + "\">" + thisString + "</option>");
                    }
                }
                popup_form_builder.Append("</select>");

                popup_form_builder.AppendLine("</td></tr>");

                // Add the checkboxes
                popup_form_builder.Append("    <tr><td colspan=\"3\"> &nbsp; &nbsp; ");
                popup_form_builder.Append(conferencePublication
                                              ? "Conference Publication: <input type=\"checkbox\" name=\"form_typeformat_conference\" checked=\"checked\" /> &nbsp; &nbsp; &nbsp; &nbsp; "
                                              : "Conference Publication: <input type=\"checkbox\" name=\"form_typeformat_conference\" /> &nbsp; &nbsp; &nbsp; &nbsp; ");

                popup_form_builder.Append(festschrift
                                              ? "Festschrift: <input type=\"checkbox\" name=\"form_typeformat_festschrift\" checked=\"checked\" /> &nbsp; &nbsp; &nbsp; &nbsp; "
                                              : "Festschrift: <input type=\"checkbox\" name=\"form_typeformat_festschrift\" /> &nbsp; &nbsp; &nbsp; &nbsp; ");

                popup_form_builder.Append(indexPresent
                                              ? "Index Present: <input type=\"checkbox\" name=\"form_typeformat_index\" checked=\"checked\" />"
                                              : "Index Present: <input type=\"checkbox\" name=\"form_typeformat_index\" />");

                popup_form_builder.AppendLine("</td></tr>");

                // Add the literary form
                popup_form_builder.Append("    <tr><td> &nbsp; &nbsp; Literary Form:</td><td colspan=\"2\">");
                popup_form_builder.Append("<select class=\"formtype_medium_select\" name=\"form_typeformat_literary1\" id=\"form_typeformat_literary1\" >");
                popup_form_builder.Append(literaryform1.Length == 0
                                              ? "<option value=\"\" selected=\"selected\" ></option>"
                                              : "<option value=\"\"></option>");
                foreach (string thisString in literary_form_list)
                {
                    if (literaryform1 == thisString)
                    {
                        popup_form_builder.Append("<option value=\"" + thisString + "\" selected=\"selected\">" + thisString + "</option>");
                    }
                    else
                    {
                        popup_form_builder.Append("<option value=\"" + thisString + "\">" + thisString + "</option>");
                    }
                }
                popup_form_builder.Append("</select>");

                popup_form_builder.Append("<select class=\"formtype_medium_select\" name=\"form_typeformat_literary2\" id=\"form_typeformat_literary2\" >");
                popup_form_builder.Append(literaryform2.Length == 0
                                              ? "<option value=\"\" selected=\"selected\" ></option>"
                                              : "<option value=\"\"></option>");
                foreach (string thisString in literary_form_list)
                {
                    if (literaryform2 == thisString)
                    {
                        popup_form_builder.Append("<option value=\"" + thisString + "\" selected=\"selected\">" + thisString + "</option>");
                    }
                    else
                    {
                        popup_form_builder.Append("<option value=\"" + thisString + "\">" + thisString + "</option>");
                    }
                }
                popup_form_builder.Append("</select>");
                popup_form_builder.AppendLine("</td></tr>");

                // Add the bibliography info
                popup_form_builder.Append("    <tr><td> &nbsp; &nbsp; Biography:</td><td colspan=\"2\">");
                popup_form_builder.Append("<select class=\"formtype_medium_select\" name=\"form_typeformat_biography\" id=\"form_typeformat_biography\" >");
                popup_form_builder.Append(biography.Length == 0
                                              ? "<option value=\"\" selected=\"selected\" ></option>"
                                              : "<option value=\"\"></option>");
                foreach (string thisString in biography_list)
                {
                    if (biography == thisString)
                    {
                        popup_form_builder.Append("<option value=\"" + thisString + "\" selected=\"selected\">" + thisString + "</option>");
                    }
                    else
                    {
                        popup_form_builder.Append("<option value=\"" + thisString + "\">" + thisString + "</option>");
                    }
                }
                popup_form_builder.Append("</select>");
                popup_form_builder.AppendLine("</td></tr>");
            }

            #endregion

            #region Render the 'Visual Materials' section if necessary

            if (formType == Type_Format_Type_Enum.Visual_Materials)
            {
                // Add the book details title
                popup_form_builder.AppendLine("    <tr><td colspan=\"3\" class=\"SobekEditItemSectionTitle\">Visual Materials Details</td></tr>");

                // Add the target audience
                popup_form_builder.Append("    <tr><td> &nbsp; &nbsp; Target Audience:</td><td colspan=\"2\">");
                popup_form_builder.Append("<select class=\"formtype_small_select\" name=\"form_typeformat_audience\" id=\"form_typeformat_audience\" >");
                popup_form_builder.Append(targetAudience1.Length == 0
                                              ? "<option value=\"\" selected=\"selected\" ></option>"
                                              : "<option value=\"\"></option>");
                foreach (string thisAudience in audiences_list)
                {
                    if (targetAudience1 == thisAudience)
                    {
                        popup_form_builder.Append("<option value=\"" + thisAudience + "\" selected=\"selected\">" + thisAudience + "</option>");
                    }
                    else
                    {
                        popup_form_builder.Append("<option value=\"" + thisAudience + "\">" + thisAudience + "</option>");
                    }
                }
                popup_form_builder.Append("</select>");
                popup_form_builder.AppendLine("</td></tr>");

                // Add the subtype
                popup_form_builder.Append("    <tr><td> &nbsp; &nbsp; Sub-type:</td><td colspan=\"2\">");
                popup_form_builder.Append("<select class=\"formtype_medium_select\" name=\"form_typeformat_subtype\" id=\"form_typeformat_subtype\" >");
                popup_form_builder.Append(subtype.Length == 0
                                              ? "<option value=\"\" selected=\"selected\" ></option>"
                                              : "<option value=\"\"></option>");
                foreach (string thisString in visual_subtypes)
                {
                    if (subtype == thisString)
                    {
                        popup_form_builder.Append("<option value=\"" + thisString + "\" selected=\"selected\">" + thisString + "</option>");
                    }
                    else
                    {
                        popup_form_builder.Append("<option value=\"" + thisString + "\">" + thisString + "</option>");
                    }
                }
                popup_form_builder.Append("</select>");
                popup_form_builder.AppendLine("</td></tr>");

                // Add the government publication
                popup_form_builder.Append("    <tr><td> &nbsp; &nbsp; Government:</td><td colspan=\"2\">");
                popup_form_builder.Append("<select class=\"formtype_large_select\" name=\"form_typeformat_govt\" id=\"form_typeformat_govt\" >");
                popup_form_builder.Append(govt.Length == 0
                                              ? "<option value=\"\" selected=\"selected\" ></option>"
                                              : "<option value=\"\"></option>");
                foreach (string thisString in government_list)
                {
                    if (govt == thisString)
                    {
                        popup_form_builder.Append("<option value=\"" + thisString + "\" selected=\"selected\">" + thisString + "</option>");
                    }
                    else
                    {
                        popup_form_builder.Append("<option value=\"" + thisString + "\">" + thisString + "</option>");
                    }
                }
                popup_form_builder.Append("</select>");

                popup_form_builder.AppendLine("</td></tr>");
            }

            #endregion

            #region Render the 'Map Materials' section if necessary

            if (formType == Type_Format_Type_Enum.Map)
            {
                // Add the book details title
                popup_form_builder.AppendLine("    <tr><td colspan=\"3\" class=\"SobekEditItemSectionTitle\">Map Details</td></tr>");

                // Add the projection code and scale
                popup_form_builder.Append("    <tr><td> &nbsp; &nbsp; Projection Code:</td><td>");
                popup_form_builder.Append("<input class=\"formtype_small_input\" name=\"form_typeformat_projcode\" id=\"form_typeformat_projcode\" type=\"text\" value=\"" + HttpUtility.HtmlEncode( projection ) + "\"  onfocus=\"javascript:textbox_enter('form_typeformat_projcode', 'formtype_small_input_focused')\" onblur=\"javascript:textbox_leave('form_typeformat_projcode', 'formtype_small_input')\" ></td>");
                popup_form_builder.AppendLine("<td width=\"250px\">Scale: &nbsp; &nbsp; <input class=\"formtype_small_input\" name=\"form_typeformat_scale\" id=\"form_typeformat_scale\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(scale) + "\"  onfocus=\"javascript:textbox_enter('form_typeformat_scale', 'formtype_small_input_focused')\" onblur=\"javascript:textbox_leave('form_typeformat_scale', 'formtype_small_input')\" ></td></tr>");

                // Add the subtype
                popup_form_builder.Append("    <tr><td> &nbsp; &nbsp; Sub-type:</td><td colspan=\"2\">");
                popup_form_builder.Append("<select class=\"formtype_medium_select\" name=\"form_typeformat_subtype\" id=\"form_typeformat_subtype\" >");
                popup_form_builder.Append(subtype.Length == 0
                                              ? "<option value=\"\" selected=\"selected\" ></option>"
                                              : "<option value=\"\"></option>");
                foreach (string thisString in map_subtypes)
                {
                    if (subtype == thisString)
                    {
                        popup_form_builder.Append("<option value=\"" + thisString + "\" selected=\"selected\">" + thisString + "</option>");
                    }
                    else
                    {
                        popup_form_builder.Append("<option value=\"" + thisString + "\">" + thisString + "</option>");
                    }
                }
                popup_form_builder.Append("</select>");
                popup_form_builder.AppendLine("</td></tr>");

                // Add the government publication
                popup_form_builder.Append("    <tr><td> &nbsp; &nbsp; Government:</td><td colspan=\"2\">");
                popup_form_builder.Append("<select class=\"formtype_large_select\" name=\"form_typeformat_govt\" id=\"form_typeformat_govt\" >");
                popup_form_builder.Append(govt.Length == 0
                                              ? "<option value=\"\" selected=\"selected\" ></option>"
                                              : "<option value=\"\"></option>");
                foreach (string thisString in government_list)
                {
                    if (govt == thisString)
                    {
                        popup_form_builder.Append("<option value=\"" + thisString + "\" selected=\"selected\">" + thisString + "</option>");
                    }
                    else
                    {
                        popup_form_builder.Append("<option value=\"" + thisString + "\">" + thisString + "</option>");
                    }
                }
                popup_form_builder.Append("</select>");
                popup_form_builder.AppendLine("</td></tr>");

                // Add the checkboxes
                popup_form_builder.Append("    <tr><td> &nbsp; &nbsp; Index Present:</td>");
                popup_form_builder.Append(indexPresent
                                              ? "<td colspan=\"2\"><input type=\"checkbox\" name=\"form_typeformat_index\" checked=\"checked\" />"
                                              : "<td colspan=\"2\"><input type=\"checkbox\" name=\"form_typeformat_index\" />");

                popup_form_builder.Append("</td></tr>");
            }

            #endregion

            #region Render the 'Continuing Resources' section if necessary

            if (formType == Type_Format_Type_Enum.Continuing_Resource)
            {
                // Add the book details title
                popup_form_builder.AppendLine("    <tr><td colspan=\"3\" class=\"SobekEditItemSectionTitle\" >Continuing Resources Details</td></tr>");

                // Add the frequency
                popup_form_builder.Append("    <tr><td> &nbsp; &nbsp; Frequency:</td><td colspan=\"2\">");
                popup_form_builder.Append("<select class=\"formtype_medium_select\" name=\"form_typeformat_frequency1\" id=\"form_typeformat_frequency1\" >");
                popup_form_builder.Append(frequency1.Length == 0
                                              ? "<option value=\"\" selected=\"selected\" ></option>"
                                              : "<option value=\"\"></option>");
                foreach (string thisString in frequency_list)
                {
                    if (frequency1 == thisString)
                    {
                        popup_form_builder.Append("<option value=\"" + thisString + "\" selected=\"selected\">" + thisString + "</option>");
                    }
                    else
                    {
                        popup_form_builder.Append("<option value=\"" + thisString + "\">" + thisString + "</option>");
                    }
                }
                popup_form_builder.Append("</select>");

                popup_form_builder.Append("<select class=\"formtype_medium_select\" name=\"form_typeformat_frequency2\" id=\"form_typeformat_frequency2\" >");
                popup_form_builder.Append(frequency2.Length == 0
                                              ? "<option value=\"\" selected=\"selected\" ></option>"
                                              : "<option value=\"\"></option>");
                foreach (string thisString in frequency_list)
                {
                    if (frequency2 == thisString)
                    {
                        popup_form_builder.Append("<option value=\"" + thisString + "\" selected=\"selected\">" + thisString + "</option>");
                    }
                    else
                    {
                        popup_form_builder.Append("<option value=\"" + thisString + "\">" + thisString + "</option>");
                    }
                }
                popup_form_builder.Append("</select>");
                popup_form_builder.AppendLine("</td></tr>");

                // Add the regularity
                popup_form_builder.Append("    <tr><td> &nbsp; &nbsp; Regularity:</td><td colspan=\"2\">");
                popup_form_builder.Append("<select class=\"formtype_medium_select\" name=\"form_typeformat_regularity1\" id=\"form_typeformat_regularity1\" >");
                popup_form_builder.Append(regularity1.Length == 0
                                              ? "<option value=\"\" selected=\"selected\" ></option>"
                                              : "<option value=\"\"></option>");
                foreach (string thisString in regularity_list)
                {
                    if (regularity1 == thisString)
                    {
                        popup_form_builder.Append("<option value=\"" + thisString + "\" selected=\"selected\">" + thisString + "</option>");
                    }
                    else
                    {
                        popup_form_builder.Append("<option value=\"" + thisString + "\">" + thisString + "</option>");
                    }
                }
                popup_form_builder.Append("</select>");

                popup_form_builder.Append("<select class=\"formtype_medium_select\" name=\"form_typeformat_regularity2\" id=\"form_typeformat_regularity2\" >");
                popup_form_builder.Append(regularity2.Length == 0
                                              ? "<option value=\"\" selected=\"selected\" ></option>"
                                              : "<option value=\"\"></option>");
                foreach (string thisString in regularity_list)
                {
                    if (regularity2 == thisString)
                    {
                        popup_form_builder.Append("<option value=\"" + thisString + "\" selected=\"selected\">" + thisString + "</option>");
                    }
                    else
                    {
                        popup_form_builder.Append("<option value=\"" + thisString + "\">" + thisString + "</option>");
                    }
                }
                popup_form_builder.Append("</select>");
                popup_form_builder.AppendLine("</td></tr>");

                // Add the subtype
                popup_form_builder.Append("    <tr><td> &nbsp; &nbsp; Sub-type:</td><td colspan=\"2\">");
                popup_form_builder.Append("<select class=\"formtype_medium_select\" name=\"form_typeformat_subtype\" id=\"form_typeformat_subtype\" >");
                popup_form_builder.Append(subtype.Length == 0
                                              ? "<option value=\"\" selected=\"selected\" ></option>"
                                              : "<option value=\"\"></option>");
                foreach (string thisString in continuing_subtypes)
                {
                    if (subtype == thisString)
                    {
                        popup_form_builder.Append("<option value=\"" + thisString + "\" selected=\"selected\">" + thisString + "</option>");
                    }
                    else
                    {
                        popup_form_builder.Append("<option value=\"" + thisString + "\">" + thisString + "</option>");
                    }
                }
                popup_form_builder.Append("</select>");
                popup_form_builder.AppendLine("</td></tr>");

                // Add the nature of contents
                popup_form_builder.Append("    <tr><td> &nbsp; &nbsp; Nature of contents:</td><td colspan=\"2\">");
                popup_form_builder.Append("<select class=\"formtype_medium_select\" name=\"form_typeformat_nature1\" id=\"form_typeformat_nature1\" >");
                popup_form_builder.Append(nature1.Length == 0
                                              ? "<option value=\"\" selected=\"selected\" ></option>"
                                              : "<option value=\"\"></option>");
                foreach (string thisString in nature_contents_list)
                {
                    if (nature1 == thisString)
                    {
                        popup_form_builder.Append("<option value=\"" + thisString + "\" selected=\"selected\">" + thisString + "</option>");
                    }
                    else
                    {
                        popup_form_builder.Append("<option value=\"" + thisString + "\">" + thisString + "</option>");
                    }
                }
                popup_form_builder.Append("</select>");

                popup_form_builder.Append("<select class=\"formtype_medium_select\" name=\"form_typeformat_nature2\" id=\"form_typeformat_nature2\" >");
                popup_form_builder.Append(nature2.Length == 0
                                              ? "<option value=\"\" selected=\"selected\" ></option>"
                                              : "<option value=\"\"></option>");
                foreach (string thisString in nature_contents_list)
                {
                    if (nature2 == thisString)
                    {
                        popup_form_builder.Append("<option value=\"" + thisString + "\" selected=\"selected\">" + thisString + "</option>");
                    }
                    else
                    {
                        popup_form_builder.Append("<option value=\"" + thisString + "\">" + thisString + "</option>");
                    }
                }
                popup_form_builder.Append("</select>");

                popup_form_builder.AppendLine("</td></tr>");

                popup_form_builder.Append("    <tr><td>&nbsp;</td><td colspan=\"2\">");
                popup_form_builder.Append("<select class=\"formtype_medium_select\" name=\"form_typeformat_nature3\" id=\"form_typeformat_nature3\" >");
                popup_form_builder.Append(nature3.Length == 0
                                              ? "<option value=\"\" selected=\"selected\" ></option>"
                                              : "<option value=\"\"></option>");
                foreach (string thisString in nature_contents_list)
                {
                    if (nature3 == thisString)
                    {
                        popup_form_builder.Append("<option value=\"" + thisString + "\" selected=\"selected\">" + thisString + "</option>");
                    }
                    else
                    {
                        popup_form_builder.Append("<option value=\"" + thisString + "\">" + thisString + "</option>");
                    }
                }
                popup_form_builder.Append("</select>");

                popup_form_builder.Append("<select class=\"formtype_medium_select\" name=\"form_typeformat_nature4\" id=\"form_typeformat_nature4\" >");
                popup_form_builder.Append(nature4.Length == 0
                                              ? "<option value=\"\" selected=\"selected\" ></option>"
                                              : "<option value=\"\"></option>");
                foreach (string thisString in nature_contents_list)
                {
                    if (nature4 == thisString)
                    {
                        popup_form_builder.Append("<option value=\"" + thisString + "\" selected=\"selected\">" + thisString + "</option>");
                    }
                    else
                    {
                        popup_form_builder.Append("<option value=\"" + thisString + "\">" + thisString + "</option>");
                    }
                }
                popup_form_builder.Append("</select>");

                popup_form_builder.AppendLine("</td></tr>");

                // Add the government publication
                popup_form_builder.Append("    <tr><td> &nbsp; &nbsp; Government:</td><td colspan=\"2\">");
                popup_form_builder.Append("<select class=\"formtype_large_select\" name=\"form_typeformat_govt\" id=\"form_typeformat_govt\" >");
                popup_form_builder.Append(govt.Length == 0
                                              ? "<option value=\"\" selected=\"selected\" ></option>"
                                              : "<option value=\"\"></option>");
                foreach (string thisString in government_list)
                {
                    if (govt == thisString)
                    {
                        popup_form_builder.Append("<option value=\"" + thisString + "\" selected=\"selected\">" + thisString + "</option>");
                    }
                    else
                    {
                        popup_form_builder.Append("<option value=\"" + thisString + "\">" + thisString + "</option>");
                    }
                }
                popup_form_builder.Append("</select>");

                popup_form_builder.AppendLine("</td></tr>");

                // Add the checkboxes
                popup_form_builder.Append("    <tr><td> &nbsp; &nbsp; Conference Production:");
                popup_form_builder.Append(conferencePublication
                                              ? "<td colspan=\"2\"><input type=\"checkbox\" name=\"form_typeformat_conference\" checked=\"checked\" /> &nbsp; &nbsp; &nbsp; &nbsp; "
                                              : "<td colspan=\"2\"><input type=\"checkbox\" name=\"form_typeformat_conference\" /> &nbsp; &nbsp; &nbsp; &nbsp; ");
                popup_form_builder.AppendLine("</td></tr>");
            }

            #endregion

            #region Finish the pop-up form

            popup_form_builder.AppendLine("  </table>");
            popup_form_builder.AppendLine("  <br />");

            // Add the close button
            popup_form_builder.AppendLine("  <center><a href=\"#template\" onclick=\"return close_typeformat_form();\"><img border=\"0\" src=\"" + Close_Button_URL(Skin_Code, Base_URL ) + "\" alt=\"CLOSE\" /></a></center>");
            popup_form_builder.AppendLine("</div>");
            popup_form_builder.AppendLine();

            #endregion
        }
        /// <summary> Renders the HTML for this element </summary>
        /// <param name="Output"> Textwriter to write the HTML for this element </param>
        /// <param name="Bib"> Object to populate this element from </param>
        /// <param name="Skin_Code"> Code for the current skin </param>
        /// <param name="IsMozilla"> Flag indicates if the current browse is Mozilla Firefox (different css choices for some elements)</param>
        /// <param name="PopupFormBuilder"> Builder for any related popup forms for this element </param>
        /// <param name="Current_User"> Current user, who's rights may impact the way an element is rendered </param>
        /// <param name="CurrentLanguage"> Current user-interface language </param>
        /// <param name="Translator"> Language support object which handles simple translational duties </param>
        /// <param name="Base_URL"> Base URL for the current request </param>
        /// <remarks> This element appends a popup form to the popup_form_builder</remarks>
        public override void Render_Template_HTML(TextWriter Output, SobekCM_Item Bib, string Skin_Code, bool IsMozilla, StringBuilder PopupFormBuilder, User_Object Current_User, Web_Language_Enum CurrentLanguage, Language_Support_Info Translator, string Base_URL )
        {
            // Check that an acronym exists
            if (Acronym.Length == 0)
            {
                const string DEFAULT_ACRONYM = "Enter spatial information about this material hierarchically.  This can either be the source or the subject of the material.";
                switch (CurrentLanguage)
                {
                    case Web_Language_Enum.English:
                        Acronym = DEFAULT_ACRONYM;
                        break;

                    case Web_Language_Enum.Spanish:
                        Acronym = DEFAULT_ACRONYM;
                        break;

                    case Web_Language_Enum.French:
                        Acronym = DEFAULT_ACRONYM;
                        break;

                    default:
                        Acronym = DEFAULT_ACRONYM;
                        break;
                }
            }

            Output.WriteLine("  <!-- " + Title + " Form Element -->");
            Output.WriteLine("  <tr>");
            Output.WriteLine("    <td style=\"width:" + LEFT_MARGIN + "px\">&nbsp;</td>");
            if (Acronym.Length > 0)
            {
                Output.WriteLine("    <td class=\"metadata_label\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" target=\"_" + html_element_name.ToUpper() + "\"><acronym title=\"" + Acronym + "\">" + Translator.Get_Translation(Title, CurrentLanguage) + ":</acronym></a></td>");
            }
            else
            {
                Output.WriteLine("    <td class=\"metadata_label\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" target=\"_" + html_element_name.ToUpper() + "\">" + Translator.Get_Translation(Title, CurrentLanguage) + ":</a></td>");
            }

            Output.WriteLine("    <td>");
            Output.WriteLine("      <table>");
            Output.WriteLine("        <tr>");
            Output.WriteLine("          <td>");
            Output.Write("      <div id=\"" + html_element_name + "_div\">");

            // Ensure there is at least one spatial subject
            bool found_spatial = false;
            if (Bib.Bib_Info.Subjects_Count > 0)
            {
                if (Bib.Bib_Info.Subjects.Any(ThisSubject => ThisSubject.Class_Type == Subject_Info_Type.Hierarchical_Spatial))
                {
                    found_spatial = true;
                }
            }
            if (!found_spatial)
            {
                Bib.Bib_Info.Add_Hierarchical_Geographic_Subject();
            }

            int subject_index = 1;
            if (Bib.Bib_Info.Subjects_Count > 0)
            {
                foreach (Subject_Info thisSubject in Bib.Bib_Info.Subjects)
                {

                    if (thisSubject.Class_Type == Subject_Info_Type.Hierarchical_Spatial)
                    {
                        Subject_Info_HierarchicalGeographic hieroSubject = (Subject_Info_HierarchicalGeographic)thisSubject;

                        // Add this subject linke
                        if (hieroSubject.hasData)
                            Output.Write("\n        <a title=\"Click to edit this hierarchical spatial information\" href=\"" + Base_URL + "l/technical/javascriptrequired\" onfocus=\"link_focused2('form_spatial_term_" + subject_index + "')\" onblur=\"link_blurred2('form_spatial_term_" + subject_index + "')\" onkeypress=\"return popup_keypress_focus('form_spatial_" + subject_index + "', 'formspatialcontinent_" + subject_index + "', '" + IsMozilla.ToString() + "' );\"  onclick=\"return popup_focus('form_spatial_" + subject_index + "', 'formspatialcontinent_" + subject_index + "' );\"><div class=\"form_linkline form_spatial_line\" id=\"form_spatial_term_" + subject_index + "\">" + hieroSubject + "</div></a>");
                        else
                            Output.Write("\n        <a title=\"Click to edit this hierarchical spatial information\" href=\"" + Base_URL + "l/technical/javascriptrequired\" onfocus=\"link_focused2('form_spatial_term_" + subject_index + "')\" onblur=\"link_blurred2('form_spatial_term_" + subject_index + "')\" onkeypress=\"return popup_keypress_focus('form_spatial_" + subject_index + "', 'formspatialcontinent_" + subject_index + "', '" + IsMozilla.ToString() + "' );\"  onclick=\"return popup_focus('form_spatial_" + subject_index + "', 'formspatialcontinent_" + subject_index + "' );\"><div class=\"form_linkline_empty form_spatial_line\" id=\"form_spatial_term_" + subject_index + "\"><i>Empty Spatial Coverage</i></div></a>");

                        // Add the popup form
                        PopupFormBuilder.AppendLine("<!-- Hierarchical Spatial Form " + subject_index + " -->");
                        PopupFormBuilder.AppendLine("<div class=\"spatial_popup_div sbkMetadata_PopupDiv\" id=\"form_spatial_" + subject_index + "\" style=\"display:none;\">");
                        PopupFormBuilder.AppendLine("  <div class=\"sbkMetadata_PopupTitle\"><table style=\"width:100%\"><tr><td style=\"text-align:left\">Edit Hierarchical Spatial</td><td style=\"text-align:right\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" alt=\"HELP\" target=\"_" + html_element_name.ToUpper() + "\" >?</a> &nbsp; <a href=\"#template\" alt=\"CLOSE\" onclick=\"close_spatial_form('form_spatial_" + subject_index + "')\">X</a> &nbsp; </td></tr></table></div>");
                        PopupFormBuilder.AppendLine("  <br />");
                        PopupFormBuilder.AppendLine("  <table class=\"sbkMetadata_PopupTable\">");

                        // Add the rows of data
                        PopupFormBuilder.AppendLine("    <tr><td style=\"width:100px;\">Continent:</td><td colspan=\"2\"><input class=\"formspatial_input sbk_Focusable\" name=\"formspatialcontinent_" + subject_index + "\" id=\"formspatialcontinent_" + subject_index + "\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(hieroSubject.Continent) + "\" /></td></tr>");
                        PopupFormBuilder.AppendLine("    <tr><td>Country:</td><td colspan=\"2\"><input class=\"formspatial_input sbk_Focusable\" name=\"formspatialcountry_" + subject_index + "\" id=\"formspatialcountry_" + subject_index + "\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(hieroSubject.Country) + "\" /></td></tr>");
                        PopupFormBuilder.AppendLine("    <tr><td>Province:</td><td colspan=\"2\"><input class=\"formspatial_input sbk_Focusable\" name=\"formspatialprovince_" + subject_index + "\" id=\"formspatialprovince_" + subject_index + "\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(hieroSubject.Province) + "\" /></td></tr>");
                        PopupFormBuilder.AppendLine("    <tr><td>Region:</td><td colspan=\"2\"><input class=\"formspatial_input sbk_Focusable\" name=\"formspatialregion_" + subject_index + "\" id=\"formspatialregion_" + subject_index + "\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(hieroSubject.Region) + "\" /></td></tr>");
                        PopupFormBuilder.AppendLine("    <tr><td>State:</td><td colspan=\"2\"><input class=\"formspatial_input sbk_Focusable\" name=\"formspatialstate_" + subject_index + "\" id=\"formspatialstate_" + subject_index + "\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(hieroSubject.State) + "\" /></td></tr>");
                        PopupFormBuilder.AppendLine("    <tr><td>Territory:</td><td colspan=\"2\"><input class=\"formspatial_input sbk_Focusable\" name=\"formspatialterritory_" + subject_index + "\" id=\"formspatialterritory_" + subject_index + "\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(hieroSubject.Territory) + "\" /></td></tr>");
                        PopupFormBuilder.AppendLine("    <tr><td>County:</td><td colspan=\"2\"><input class=\"formspatial_input sbk_Focusable\" name=\"formspatialcounty_" + subject_index + "\" id=\"formspatialcounty_" + subject_index + "\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(hieroSubject.County) + "\" /></td></tr>");
                        PopupFormBuilder.AppendLine("    <tr><td>City:</td><td colspan=\"2\"><input class=\"formspatial_input sbk_Focusable\" name=\"formspatialcity_" + subject_index + "\" id=\"formspatialcity_" + subject_index + "\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(hieroSubject.City) + "\" /></td></tr>");
                        PopupFormBuilder.AppendLine("    <tr><td>City Section:</td><td colspan=\"2\"><input class=\"formspatial_input sbk_Focusable\" name=\"formspatialsectioncity_" + subject_index + "\" id=\"formspatialsectioncity_" + subject_index + "\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(hieroSubject.CitySection) + "\" /></td></tr>");
                        PopupFormBuilder.AppendLine("    <tr><td>Island:</td><td colspan=\"2\"><input class=\"formspatial_input sbk_Focusable\" name=\"formspatialisland_" + subject_index + "\" id=\"formspatialisland_" + subject_index + "\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(hieroSubject.Island) + "\" /></td></tr>");
                        PopupFormBuilder.AppendLine("    <tr><td>Area:</td><td colspan=\"2\"><input class=\"formspatial_input sbk_Focusable\" name=\"formspatialarea_" + subject_index + "\" id=\"formspatialarea_" + subject_index + "\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(hieroSubject.Area) + "\" /></td></tr>");

                        // Add the authority and language text boxes
                        PopupFormBuilder.Append("    <tr><td>Authority:</td><td>");
                        PopupFormBuilder.Append("<input class=\"formspatial_small_input sbk_Focusable\" name=\"formspatialauthority_" + subject_index + "\" id=\"formspatialauthority_" + subject_index + "\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(hieroSubject.Authority) + "\" />");
                        PopupFormBuilder.Append("</td><td style=\"width:255px\" > &nbsp; Language: &nbsp; ");
                        PopupFormBuilder.Append("<input class=\"formspatial_small_input sbk_Focusable\" name=\"formspatiallanguage_" + subject_index + "\" id=\"formspatiallanguage_" + subject_index + "\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(hieroSubject.Language) + "\" />");
                        PopupFormBuilder.AppendLine("</td></tr>");
                        PopupFormBuilder.AppendLine("    <tr style=\"height:30px; vertical-align:bottom\"><td colspan=\"3\" style=\"text-align:center\">");

                        if (hieroSubject.ID.IndexOf("SUBJ752") >= 0)
                        {
                            PopupFormBuilder.AppendLine("        <input type=\"radio\" name=\"formspatialtype_" + subject_index + "\" id=\"formspatialtype_subj_" + subject_index + "\" value=\"subject\" /><label for=\"formspatialtype_subj_" + subject_index + "\">Hierarchical Subject</label> &nbsp; &nbsp; ");
                            PopupFormBuilder.AppendLine("        <input type=\"radio\" name=\"formspatialtype_" + subject_index + "\" id=\"formspatialtype_added_" + subject_index + "\" value=\"addedentry\" checked=\"checked\" /><label for=\"formspatialtype_added_" + subject_index + "\">Added Hierarchical Entry</label>");
                        }
                        else
                        {
                            PopupFormBuilder.AppendLine("        <input type=\"radio\" name=\"formspatialtype_" + subject_index + "\" id=\"formspatialtype_subj_" + subject_index + "\" value=\"subject\" checked=\"checked\" /><label for=\"formspatialtype_subj_" + subject_index + "\">Hierarchical Subject</label> &nbsp; &nbsp; ");
                            PopupFormBuilder.AppendLine("        <input type=\"radio\" name=\"formspatialtype_" + subject_index + "\" id=\"formspatialtype_added_" + subject_index + "\" value=\"addedentry\" /><label for=\"formspatialtype_added_" + subject_index + "\">Added Hierarchical Entry</label>");
                        }
                        PopupFormBuilder.AppendLine("    </td></tr>");
                        PopupFormBuilder.AppendLine("    <tr style=\"height:35px; text-align: center; vertical-align: bottom;\">");
                        PopupFormBuilder.AppendLine("      <td colspan=\"3\"><button title=\"Close\" class=\"sbkMetadata_RoundButton\" onclick=\"return close_spatial_form('form_spatial_" + subject_index + "');\">CLOSE</button></td>");
                        PopupFormBuilder.AppendLine("    </tr>");

                        PopupFormBuilder.AppendLine("  </table>");
                        PopupFormBuilder.AppendLine("</div>");
                        PopupFormBuilder.AppendLine();

                        subject_index++;
                    }
                }
            }

            // Add the link to add a new other subject and close the main element
            Output.WriteLine("\n            </div>");
            Output.WriteLine("          </td>");
            Output.WriteLine("          <td style=\"vertical-align:bottom\" >");
            if (Repeatable)
            {
                Output.WriteLine("            <a title=\"" + Translator.Get_Translation("Click to add a new spatial coverage object", CurrentLanguage) + ".\" href=\"" + Base_URL + "l/technical/javascriptrequired\" onmousedown=\"return new_spatial_link_clicked('" + Template_Page + "');\"><img class=\"repeat_button\" src=\"" + Base_URL + REPEAT_BUTTON_URL + "\" /></a>");
            }
            Output.WriteLine("            <a target=\"_" + html_element_name.ToUpper() + "\"  title=\"" + Translator.Get_Translation("Get help.", CurrentLanguage) + "\" href=\"" + Help_URL(Skin_Code, Base_URL) + "\" ><img class=\"help_button\" src=\"" + Base_URL + HELP_BUTTON_URL + "\" /></a>");
            Output.WriteLine("          </td>");

            Output.WriteLine("        </tr>");
            Output.WriteLine("      </table>");
            Output.WriteLine("    </td>");
            Output.WriteLine("  </tr>");
            Output.WriteLine();
        }
        /// <summary> Renders the HTML for this element </summary>
        /// <param name="Output"> Textwriter to write the HTML for this element </param>
        /// <param name="Bib"> Object to populate this element from </param>
        /// <param name="Skin_Code"> Code for the current skin </param>
        /// <param name="isMozilla"> Flag indicates if the current browse is Mozilla Firefox (different css choices for some elements)</param>
        /// <param name="popup_form_builder"> Builder for any related popup forms for this element </param>
        /// <param name="Current_User"> Current user, who's rights may impact the way an element is rendered </param>
        /// <param name="CurrentLanguage"> Current user-interface language </param>
        /// <param name="Translator"> Language support object which handles simple translational duties </param>
        /// <param name="Base_URL"> Base URL for the current request </param>
        /// <remarks> This element appends a popup form to the popup_form_builder</remarks>
        public override void Render_Template_HTML(TextWriter Output, SobekCM_Item Bib, string Skin_Code, bool isMozilla, StringBuilder popup_form_builder, User_Object Current_User, Web_Language_Enum CurrentLanguage, Language_Support_Info Translator, string Base_URL )
        {
            // Check that an acronym exists
            if (Acronym.Length == 0)
            {
                const string defaultAcronym = "Enter each person or group which created this material. Personal names should be entered as [Family Name], [Given Name].";
                switch (CurrentLanguage)
                {
                    case Web_Language_Enum.English:
                        Acronym = defaultAcronym;
                        break;

                    case Web_Language_Enum.Spanish:
                        Acronym = defaultAcronym;
                        break;

                    case Web_Language_Enum.French:
                        Acronym = defaultAcronym;
                        break;

                    default:
                        Acronym = defaultAcronym;
                        break;
                }
            }

            // Render this in HTML
            Output.WriteLine("  <!-- " + Title + " Form Element -->");
            Output.WriteLine("  <tr align=\"left\">");
            Output.WriteLine("    <td width=\"" + LEFT_MARGIN + "px\">&nbsp;</td>");
            if (Acronym.Length > 0)
            {
                Output.WriteLine("    <td valign=\"top\" class=\"metadata_label\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" target=\"_" + html_element_name.ToUpper() + "\"><acronym title=\"" + Acronym + "\">" + Translator.Get_Translation(Title, CurrentLanguage) + ":</acronym></a></td>");
            }
            else
            {
                Output.WriteLine("    <td valign=\"top\" class=\"metadata_label\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" target=\"_" + html_element_name.ToUpper() + "\">" + Translator.Get_Translation(Title, CurrentLanguage) + ":</a></td>");
            }

            Output.WriteLine("    <td>");
            Output.WriteLine("      <table>");
            Output.WriteLine("        <tr>");
            Output.WriteLine("          <td>");
            Output.WriteLine("            <div class=\"form_name_div\">");

            // Collect all the names
            int name_count = 1;
            bool first_is_main = false;
            List<Name_Info> names = new List<Name_Info>();
            if (( Bib.Bib_Info.hasMainEntityName ) && ( Bib.Bib_Info.Main_Entity_Name.hasData))
            {
                names.Add(Bib.Bib_Info.Main_Entity_Name);
                first_is_main = true;
            }
            if (Bib.Bib_Info.Names_Count > 0)
            {
                names.AddRange(Bib.Bib_Info.Names);
            }

            // There should always be one name at least
            if (names.Count == 0)
                names.Add(new Name_Info());

            // Step through and create the popup forms and inks
            foreach (Name_Info thisName in names)
            {
                // Add the link for the other title
                string thisNameText = thisName.ToString();
                if (!thisName.hasData)
                {
                    thisNameText = "<i>Empty Name</i>";
                    Output.WriteLine("              <a title=\"Click to edit this named entity\" href=\"" + Base_URL + "l/technical/javascriptrequired\" onfocus=\"link_focused2('form_name_line_" + name_count + "')\" onblur=\"link_blurred2('form_name_line_" + name_count + "')\" onkeypress=\"return popup_keypress_focus('form_name_" + name_count + "', 'form_name_line_" + name_count + "', 'form_name_full_" + name_count + "', 375, 700, '" + isMozilla.ToString() + "' );\" onclick=\"return popup_focus('form_name_" + name_count + "', 'form_name_line_" + name_count + "', 'form_name_full_" + name_count + "', 375, 700 );\"><div class=\"form_linkline_empty form_name_line\" id=\"form_name_line_" + name_count + "\">" + thisNameText + "</div></a>");

                }
                else
                {
                    Output.WriteLine("              <a title=\"Click to edit this named entity\" href=\"" + Base_URL + "l/technical/javascriptrequired\" onfocus=\"link_focused2('form_name_line_" + name_count + "')\" onblur=\"link_blurred2('form_name_line_" + name_count + "')\" onkeypress=\"return popup_keypress_focus('form_name_" + name_count + "', 'form_name_line_" + name_count + "', 'form_name_full_" + name_count + "', 375, 700, '" + isMozilla.ToString() + "' );\" onclick=\"return popup_focus('form_name_" + name_count + "', 'form_name_line_" + name_count + "', 'form_name_full_" + name_count + "', 375, 700 );\"><div class=\"form_linkline form_name_line\" id=\"form_name_line_" + name_count + "\">" + thisNameText + "</div></a>");
                }

                // Determine if this is a personal name
                string personal_values_display = "none";
                string description_location_display = "Location";
                string form_class = "name_popup_div";
                if ((thisName.Name_Type == Name_Info_Type_Enum.personal) || ( thisName.Name_Type == Name_Info_Type_Enum.UNKNOWN ))
                {
                    personal_values_display = "inline";
                    description_location_display = "Description";
                    form_class = "name_popup_div_personal";
                }

                // Add the popup form
                popup_form_builder.AppendLine("<!-- Name Form " + name_count + " -->");
                popup_form_builder.AppendLine("<div class=\"" + form_class + "\" id=\"form_name_" + name_count + "\" style=\"display:none;\">");
                popup_form_builder.AppendLine("  <div class=\"popup_title\"><table width=\"100%\"><tr><td align=\"left\">EDIT NAMED ENTITY</td><td align=\"right\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" alt=\"HELP\" target=\"_" + html_element_name.ToUpper() + "\" >?</a> &nbsp; <a href=\"#template\" alt=\"CLOSE\" onclick=\"close_name_form('form_name_" + name_count + "')\">X</a> &nbsp; </td></tr></table></div>");
                popup_form_builder.AppendLine("  <br />");
                popup_form_builder.AppendLine("  <table class=\"popup_table\">");

                // Add the name type combo box and radio buttons
                popup_form_builder.AppendLine("    <tr>");
                popup_form_builder.AppendLine("      <td>Name Type:</td>");
                popup_form_builder.AppendLine("      <td>");
                popup_form_builder.AppendLine("        <select class=\"form_name_select\" id=\"form_name_type_" + name_count + "\" name=\"form_name_type_" + name_count + "\" onChange=\"javascript:name_type_changed('" + name_count + "')\" >");
                popup_form_builder.AppendLine(thisName.Name_Type == Name_Info_Type_Enum.conference
                                                  ? "          <option value=\"conference\" selected=\"selected\" >Conference</option>"
                                                  : "          <option value=\"conference\">Conference</option>");

                popup_form_builder.AppendLine(thisName.Name_Type == Name_Info_Type_Enum.corporate
                                                  ? "          <option value=\"corporate\" selected=\"selected\" >Corporate</option>"
                                                  : "          <option value=\"corporate\">Corporate</option>");

                if (( thisName.Name_Type == Name_Info_Type_Enum.personal ) || ( thisName.Name_Type == Name_Info_Type_Enum.UNKNOWN ))
                    popup_form_builder.AppendLine("          <option value=\"personal\" selected=\"selected\" >Personal</option>");
                else
                    popup_form_builder.AppendLine("          <option value=\"personal\">Personal</option>");

                popup_form_builder.AppendLine("        </select>");
                popup_form_builder.AppendLine("      </td>");
                if (( name_count == 1 ) && ( first_is_main ))
                {

                    popup_form_builder.Append("      <td><input type=\"radio\" name=\"form_name_main_" + name_count + "\" id=\"form_name_main_main_" + name_count + "\" value=\"main\" checked=\"checked\" onclick=\"focus_element( 'form_name_full_" + name_count + "');\" /><label for=\"form_name_main_main_" + name_count + "\">Principal Author</label> &nbsp; &nbsp; &nbsp; &nbsp; ");
                    popup_form_builder.AppendLine("<input type=\"radio\" name=\"form_name_main_" + name_count + "\" id=\"form_name_main_added_" + name_count + "\" value=\"added\" onclick=\"focus_element( 'form_name_full_" + name_count + "');\" /><label for=\"form_name_main_added_" + name_count + "\">Other Author</label></td>");
                }
                else
                {
                    popup_form_builder.Append("      <td><input type=\"radio\" name=\"form_name_main_" + name_count + "\" id=\"form_name_main_main_" + name_count + "\" value=\"main\" onclick=\"focus_element( 'form_name_full_" + name_count + "');\" /><label for=\"form_name_main_main_" + name_count + "\">Main Entry</label> &nbsp; &nbsp; &nbsp; &nbsp; ");
                    popup_form_builder.AppendLine("<input type=\"radio\" name=\"form_name_main_" + name_count + "\" id=\"form_name_main_added_" + name_count + "\" value=\"added\" checked=\"checked\" onclick=\"focus_element( 'form_name_full_" + name_count + "');\" /><label for=\"form_name_main_added_" + name_count + "\">Added Entry</label></td>");
                }
                popup_form_builder.AppendLine("    </tr>");

                // Add the full name box
                popup_form_builder.AppendLine("    <tr><td>Full Name:</td><td colspan=\"2\"><input type=\"text\" class=\"form_name_large_input\" id=\"form_name_full_" + name_count + "\" name=\"form_name_full_" + name_count + "\" value=\"" + HttpUtility.HtmlEncode(thisName.Full_Name) + "\" onfocus=\"javascript:textbox_enter('form_name_full_" + name_count + "', 'form_name_large_input_focused')\" onblur=\"javascript:textbox_leave('form_name_full_" + name_count + "', 'form_name_large_input')\" /></td></tr>");

                // Add the given name and family name(s)
                popup_form_builder.Append("    <tr><td><span  id=\"name_personallabel1_" + name_count + "\" style=\"display:" + personal_values_display + ";\" >Given Names:</span></td><td><input type=\"text\" class=\"form_name_medium_input\" id=\"form_name_given_" + name_count + "\" name=\"form_name_given_" + name_count + "\" value=\"" + HttpUtility.HtmlEncode(thisName.Given_Name) + "\" onfocus=\"javascript:textbox_enter('form_name_given_" + name_count + "', 'form_name_medium_input_focused')\" onblur=\"javascript:textbox_leave('form_name_given_" + name_count + "', 'form_name_medium_input')\" style=\"display:" + personal_values_display + ";\" /></td>");
                popup_form_builder.AppendLine("<td><span  id=\"name_personallabel2_" + name_count + "\" style=\"display:" + personal_values_display + ";\" >Family Name:</span><input type=\"text\" class=\"form_name_medium_input\" id=\"form_name_family_" + name_count + "\" name=\"form_name_family_" + name_count + "\" value=\"" + HttpUtility.HtmlEncode(thisName.Family_Name) + "\" onfocus=\"javascript:textbox_enter('form_name_family_" + name_count + "', 'form_name_medium_input_focused')\" onblur=\"javascript:textbox_leave('form_name_family_" + name_count + "', 'form_name_medium_input')\" style=\"display:" + personal_values_display + ";\" /></td></tr>");

                // Add the display form and terms of address
                popup_form_builder.Append("    <tr><td><span  id=\"name_personallabel3_" + name_count + "\" style=\"display:" + personal_values_display + ";\" >Display Form:</span></td><td><input type=\"text\" class=\"form_name_medium_input\" id=\"form_name_display_" + name_count + "\" name=\"form_name_display_" + name_count + "\" value=\"" + HttpUtility.HtmlEncode(thisName.Display_Form) + "\" onfocus=\"javascript:textbox_enter('form_name_display_" + name_count + "', 'form_name_medium_input_focused')\" onblur=\"javascript:textbox_leave('form_name_display_" + name_count + "', 'form_name_medium_input')\" style=\"display:" + personal_values_display + ";\" /></td>");
                popup_form_builder.AppendLine("<td><span  id=\"name_personallabel4_" + name_count + "\" style=\"display:" + personal_values_display + ";\" >Terms of Address:</span><input type=\"text\" class=\"form_name_small_input\" id=\"form_name_terms_" + name_count + "\" name=\"form_name_terms_" + name_count + "\" value=\"" + HttpUtility.HtmlEncode(thisName.Terms_Of_Address) + "\" onfocus=\"javascript:textbox_enter('form_name_terms_" + name_count + "', 'form_name_small_input_focused')\" onblur=\"javascript:textbox_leave('form_name_terms_" + name_count + "', 'form_name_small_input')\" style=\"display:" + personal_values_display + ";\" /></td></tr>");

                // Add the dates
                popup_form_builder.AppendLine("    <tr><td>Dates:</td><td colspan=\"2\"><input type=\"text\" class=\"form_name_medium_input\" id=\"form_name_dates_" + name_count + "\" name=\"form_name_dates_" + name_count + "\" value=\"" + HttpUtility.HtmlEncode(thisName.Dates) + "\" onfocus=\"javascript:textbox_enter('form_name_dates_" + name_count + "', 'form_name_medium_input_focused')\" onblur=\"javascript:textbox_leave('form_name_dates_" + name_count + "', 'form_name_medium_input')\" /></td></tr>");

                // Add the description
                popup_form_builder.AppendLine("    <tr><td><span id=\"name_desc_location_span_" + name_count + "\">" + description_location_display + ":</span></td><td colspan=\"2\"><input type=\"text\" class=\"form_name_large_input\" id=\"form_name_desc_" + name_count + "\" name=\"form_name_desc_" + name_count + "\" value=\"" + HttpUtility.HtmlEncode(thisName.Description) + "\" onfocus=\"javascript:textbox_enter('form_name_desc_" + name_count + "', 'form_name_large_input_focused')\" onblur=\"javascript:textbox_leave('form_name_desc_" + name_count + "', 'form_name_large_input')\" /></td></tr>");

                // Add the affiliation
                popup_form_builder.AppendLine("    <tr><td>Affiliation:</td><td colspan=\"2\"><input type=\"text\" class=\"form_name_large_input\" id=\"form_name_affiliation_" + name_count + "\" name=\"form_name_affiliation_" + name_count + "\" value=\"" + HttpUtility.HtmlEncode(thisName.Affiliation) + "\" onfocus=\"javascript:textbox_enter('form_name_affiliation_" + name_count + "', 'form_name_large_input_focused')\" onblur=\"javascript:textbox_leave('form_name_affiliation_" + name_count + "', 'form_name_large_input')\" /></td></tr>");

                // Determine the roles to display
                string role1 = String.Empty;
                string role2 = String.Empty;
                string role3 = String.Empty;
                int role_index = 1;
                foreach (Name_Info_Role thisRole in thisName.Roles)
                {
                    if ((thisRole.Role.Length > 0) && (thisRole.Role_Type == Name_Info_Role_Type_Enum.text))
                    {
                        switch (role_index)
                        {
                            case 1:
                                role1 = thisRole.Role;
                                break;

                            case 2:
                                role2 = thisRole.Role;
                                break;

                            case 3:
                                role3 = thisRole.Role;
                                break;
                        }
                        role_index++;
                    }
                }

                // Add the roles
                popup_form_builder.Append("    <tr><td>Roles:</td><td colspan=\"2\">");
                popup_form_builder.Append("<input type=\"text\" class=\"form_name_small_input\" id=\"form_name_role1_" + name_count + "\" name=\"form_name_role1_" + name_count + "\" value=\"" + HttpUtility.HtmlEncode(role1) + "\" onfocus=\"javascript:textbox_enter('form_name_role1_" + name_count + "', 'form_name_small_input_focused')\" onblur=\"javascript:textbox_leave('form_name_role1_" + name_count + "', 'form_name_small_input')\" />");
                popup_form_builder.Append("<input type=\"text\" class=\"form_name_small_input\" id=\"form_name_role2_" + name_count + "\" name=\"form_name_role2_" + name_count + "\" value=\"" + HttpUtility.HtmlEncode(role2) + "\" onfocus=\"javascript:textbox_enter('form_name_role2_" + name_count + "', 'form_name_small_input_focused')\" onblur=\"javascript:textbox_leave('form_name_role2_" + name_count + "', 'form_name_small_input')\" />");
                popup_form_builder.Append("<input type=\"text\" class=\"form_name_small_input\" id=\"form_name_role3_" + name_count + "\" name=\"form_name_role3_" + name_count + "\" value=\"" + HttpUtility.HtmlEncode(role3) + "\" onfocus=\"javascript:textbox_enter('form_name_role3_" + name_count + "', 'form_name_small_input_focused')\" onblur=\"javascript:textbox_leave('form_name_role3_" + name_count + "', 'form_name_small_input')\" />");
                popup_form_builder.AppendLine("</td></tr>");

                popup_form_builder.AppendLine("  </table>");
                popup_form_builder.AppendLine("  <br />");

                // Add the close button
                popup_form_builder.AppendLine("  <center><a href=\"#template\" onclick=\"return close_name_form('form_name_" + name_count + "')\"><img border=\"0\" src=\"" + Close_Button_URL(Skin_Code, Base_URL ) + "\" alt=\"CLOSE\" /></a></center>");
                popup_form_builder.AppendLine("</div>");
                popup_form_builder.AppendLine();

                name_count++;
            }

            // Add the link to add a new name
            //<span class=\"add_new_link\"><a href=\"#template\" onclick=\"new_creator_link_clicked('" + Template_Page + "')\">Add New Creator</a></span>");

            Output.WriteLine("            </div>");
            Output.WriteLine("          </td>");

            Output.WriteLine("          <td valign=\"bottom\" >");
            if (Repeatable)
            {
                Output.WriteLine("            <img title=\"" + Translator.Get_Translation("Click to add a new named object to this resource", CurrentLanguage) + ".\" alt=\"+\" border=\"0px\" class=\"repeat_button\" src=\"" + Base_URL + REPEAT_BUTTON_URL + "\" onmousedown=\"return new_creator_link_clicked('" + Template_Page + "');\" />");
            }
            Output.WriteLine("            <a target=\"_" + html_element_name.ToUpper() + "\"  title=\"" + Translator.Get_Translation("Get help.", CurrentLanguage) + "\" href=\"" + Help_URL(Skin_Code, Base_URL) + "\" ><img border=\"0px\" class=\"help_button\" src=\"" + Base_URL + HELP_BUTTON_URL + "\" /></a>");
            Output.WriteLine("          </td>");

            Output.WriteLine("        </tr>");
            Output.WriteLine("      </table>");
            Output.WriteLine("    </td>");
            Output.WriteLine("  </tr>");
            Output.WriteLine();
        }
        /// <summary> Renders the HTML for this element </summary>
        /// <param name="Output"> Textwriter to write the HTML for this element </param>
        /// <param name="Bib"> Object to populate this element from </param>
        /// <param name="Skin_Code"> Code for the current skin </param>
        /// <param name="IsMozilla"> Flag indicates if the current browse is Mozilla Firefox (different css choices for some elements)</param>
        /// <param name="PopupFormBuilder"> Builder for any related popup forms for this element </param>
        /// <param name="Current_User"> Current user, who's rights may impact the way an element is rendered </param>
        /// <param name="CurrentLanguage"> Current user-interface language </param>
        /// <param name="Translator"> Language support object which handles simple translational duties </param>
        /// <param name="Base_URL"> Base URL for the current request </param>
        /// <remarks> This element appends a popup form to the popup_form_builder</remarks>
        public override void Render_Template_HTML(TextWriter Output, SobekCM_Item Bib, string Skin_Code, bool IsMozilla, StringBuilder PopupFormBuilder, User_Object Current_User, Web_Language_Enum CurrentLanguage, Language_Support_Info Translator, string Base_URL)
        {
            // Check that an acronym exists
            if (Acronym.Length == 0)
            {
                const string DEFAULT_ACRONYM = "Enter serial hierarchy information which explains how this volume related to the larger body of work.";
                switch (CurrentLanguage)
                {
                    case Web_Language_Enum.English:
                        Acronym = DEFAULT_ACRONYM;
                        break;

                    case Web_Language_Enum.Spanish:
                        Acronym = DEFAULT_ACRONYM;
                        break;

                    case Web_Language_Enum.French:
                        Acronym = DEFAULT_ACRONYM;
                        break;

                    default:
                        Acronym = DEFAULT_ACRONYM;
                        break;
                }
            }

            Output.WriteLine("  <!-- " + Title + " Form Element -->");
            Output.WriteLine("  <tr>");
            Output.WriteLine("    <td style=\"width:" + LEFT_MARGIN + "px\">&nbsp;</td>");
            if (Acronym.Length > 0)
            {
                Output.WriteLine("    <td class=\"metadata_label\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" target=\"_" + html_element_name.ToUpper() + "\"><acronym title=\"" + Acronym + "\">" + Translator.Get_Translation(Title, CurrentLanguage) + ":</acronym></a></td>");
            }
            else
            {
                Output.WriteLine("    <td class=\"metadata_label\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" target=\"_" + html_element_name.ToUpper() + "\">" + Translator.Get_Translation(Title, CurrentLanguage) + ":</a></td>");
            }

            Output.WriteLine("    <td>");
            Output.WriteLine("      <table>");

            Output.WriteLine("    <tr><td>&nbsp;</td><td><span style=\"color:Gray;padding-left:55px;\">Display Text</span></td><td><span style=\"color:Gray;\"> &nbsp; Display Order</span></td></tr>");

            // Add the rows of enumeration data
            Output.WriteLine("    <tr><td style=\"width:100px\">Level 1:</td>");
            if (Bib.Behaviors.Serial_Info.Count > 0)
            {
                Output.WriteLine("<td><input type=\"text\" class=\"form_serialhierarchy_text_input sbk_Focusable\" id=\"form_serialhierarchy_enum1text\" name=\"form_serialhierarchy_enum1text\" value=\"" + HttpUtility.HtmlEncode(Bib.Behaviors.Serial_Info[0].Display) + "\" /></td>");
                Output.WriteLine("<td><input type=\"text\" class=\"form_serialhierarchy_order_input sbk_Focusable\" id=\"form_serialhierarchy_enum1order\" name=\"form_serialhierarchy_enum1order\" value=\"" + HttpUtility.HtmlEncode(Bib.Behaviors.Serial_Info[0].Order.ToString()) + "\" /></td></tr>");
            }
            else
            {
                Output.WriteLine("<td><input type=\"text\" class=\"form_serialhierarchy_text_input sbk_Focusable\" id=\"form_serialhierarchy_enum1text\" name=\"form_serialhierarchy_enum1text\" value=\"\" /></td>");
                Output.WriteLine("<td><input type=\"text\" class=\"form_serialhierarchy_order_input sbk_Focusable\" id=\"form_serialhierarchy_enum1order\" name=\"form_serialhierarchy_enum1order\" value=\"\" /></td></tr>");
            }

            Output.WriteLine("    <tr><td>Level 2:</td>");
            if (Bib.Behaviors.Serial_Info.Count > 1)
            {
                Output.WriteLine("<td><input type=\"text\" class=\"form_serialhierarchy_text_input sbk_Focusable\" id=\"form_serialhierarchy_enum2text\" name=\"form_serialhierarchy_enum2text\" value=\"" + HttpUtility.HtmlEncode(Bib.Behaviors.Serial_Info[1].Display) + "\"  /></td>");
                Output.WriteLine("<td><input type=\"text\" class=\"form_serialhierarchy_order_input sbk_Focusable\" id=\"form_serialhierarchy_enum2order\" name=\"form_serialhierarchy_enum2order\" value=\"" + HttpUtility.HtmlEncode(Bib.Behaviors.Serial_Info[1].Order.ToString()) + "\" /></td></tr>");
            }
            else
            {
                Output.WriteLine("<td><input type=\"text\" class=\"form_serialhierarchy_text_input sbk_Focusable\" id=\"form_serialhierarchy_enum2text\" name=\"form_serialhierarchy_enum2text\" value=\"\" /></td>");
                Output.WriteLine("<td><input type=\"text\" class=\"form_serialhierarchy_order_input sbk_Focusable\" id=\"form_serialhierarchy_enum2order\" name=\"form_serialhierarchy_enum2order\" value=\"\" /></td></tr>");
            }

            Output.WriteLine("    <tr><td>Level 3:</td>");
            if (Bib.Behaviors.Serial_Info.Count > 2)
            {
                Output.WriteLine("<td><input type=\"text\" class=\"form_serialhierarchy_text_input sbk_Focusable\" id=\"form_serialhierarchy_enum3text\" name=\"form_serialhierarchy_enum3text\" value=\"" + HttpUtility.HtmlEncode(Bib.Behaviors.Serial_Info[2].Display) + "\" /></td>");
                Output.WriteLine("<td><input type=\"text\" class=\"form_serialhierarchy_order_input sbk_Focusable\" id=\"form_serialhierarchy_enum3order\" name=\"form_serialhierarchy_enum3order\" value=\"" + HttpUtility.HtmlEncode(Bib.Behaviors.Serial_Info[2].Order.ToString()) + "\" /></td></tr>");
            }
            else
            {
                Output.WriteLine("<td><input type=\"text\" class=\"form_serialhierarchy_text_input sbk_Focusable\" id=\"form_serialhierarchy_enum3text\" name=\"form_serialhierarchy_enum3text\" value=\"\" /></td>");
                Output.WriteLine("<td><input type=\"text\" class=\"form_serialhierarchy_order_input sbk_Focusable\" id=\"form_serialhierarchy_enum3order\" name=\"form_serialhierarchy_enum3order\" value=\"\" /></td></tr>");
            }

            Output.WriteLine("      </table>");
            Output.WriteLine("    </td>");
            Output.WriteLine("  </tr>");
            Output.WriteLine();

            //// Determine which is primary, the enumeration or chronology.
            //bool enum_primary = true;
            //if (Bib.Serial_Info.Count > 0)
            //{
            //    if (Bib.Bib_Info.Series_Part_Info.Year == Bib.Serial_Info[0].Display)
            //    {
            //        enum_primary = false;
            //    }
            //}
            //else
            //{
            //    // If no default, set it by type
            //    if (Bib.Bib_Info.Type.Type.ToUpper().IndexOf("NEWSPAPER") >= 0)
            //    {
            //        enum_primary = false;
            //    }
            //}
        }
        /// <summary> Renders the HTML for this element </summary>
        /// <param name="Output"> Textwriter to write the HTML for this element </param>
        /// <param name="Bib"> Object to populate this element from </param>
        /// <param name="Skin_Code"> Code for the current skin </param>
        /// <param name="IsMozilla"> Flag indicates if the current browse is Mozilla Firefox (different css choices for some elements)</param>
        /// <param name="PopupFormBuilder"> Builder for any related popup forms for this element </param>
        /// <param name="Current_User"> Current user, who's rights may impact the way an element is rendered </param>
        /// <param name="CurrentLanguage"> Current user-interface language </param>
        /// <param name="Translator"> Language support object which handles simple translational duties </param>
        /// <param name="Base_URL"> Base URL for the current request </param>
        /// <remarks> This element appends a popup form to the popup_form_builder</remarks>
        public override void Render_Template_HTML(TextWriter Output, SobekCM_Item Bib, string Skin_Code, bool IsMozilla, StringBuilder PopupFormBuilder, User_Object Current_User, Web_Language_Enum CurrentLanguage, Language_Support_Info Translator, string Base_URL )
        {
            // Check that an acronym exists
            if (Acronym.Length == 0)
            {
                const string DEFAULT_ACRONYM = "Enter information for any electronic finding guide to which this material belongs.";
                switch (CurrentLanguage)
                {
                    case Web_Language_Enum.English:
                        Acronym = DEFAULT_ACRONYM;
                        break;

                    case Web_Language_Enum.Spanish:
                        Acronym = DEFAULT_ACRONYM;
                        break;

                    case Web_Language_Enum.French:
                        Acronym = DEFAULT_ACRONYM;
                        break;

                    default:
                        Acronym = DEFAULT_ACRONYM;
                        break;
                }
            }

            Output.WriteLine("  <!-- " + Title + " Form Element -->");
            Output.WriteLine("  <tr>");
            Output.WriteLine("    <td style=\"width:" + LEFT_MARGIN + "px\">&nbsp;</td>");
            if (Acronym.Length > 0)
            {
                Output.WriteLine("    <td class=\"metadata_label\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" target=\"_" + html_element_name.ToUpper() + "\"><acronym title=\"" + Acronym + "\">" + Translator.Get_Translation(Title, CurrentLanguage) + ":</acronym></a></td>");
            }
            else
            {
                Output.WriteLine("    <td class=\"metadata_label\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" target=\"_" + html_element_name.ToUpper() + "\">" + Translator.Get_Translation(Title, CurrentLanguage) + ":</a></td>");
            }

            Output.WriteLine("    <td>");
            Output.WriteLine("      <table>");
            Output.WriteLine("        <tr>");
            Output.WriteLine("          <td>");
            Output.WriteLine("            <div id=\"" + html_element_name + "_div\">");

            // Write the EAD popup link
            if (( !Bib.Bib_Info.hasLocationInformation ) || ((Bib.Bib_Info.Location.EAD_Name.Length == 0) && (Bib.Bib_Info.Location.EAD_URL.Length == 0 )))
            {
                Output.Write("              <a title=\"Click to edit the related EAD information\" href=\"" + Base_URL + "l/technical/javascriptrequired\" onfocus=\"link_focused2('form_ead_term')\" onblur=\"link_blurred2('form_ead_term')\" onkeypress=\"return popup_keypress_focus('form_ead', 'formead_name', '" + IsMozilla.ToString() + "' );\" onclick=\"return popup_focus('form_ead', 'formead_name' );\"><div class=\"form_linkline_empty form_ead_line\" id=\"form_ead_term\">");
                Output.Write("<i>Empty Related EAD</i>");
            }
            else
            {
                Output.Write("              <a title=\"Click to edit the related EAD information\" href=\"" + Base_URL + "l/technical/javascriptrequired\" onfocus=\"link_focused2('form_ead_term')\" onblur=\"link_blurred2('form_ead_term')\" onkeypress=\"return popup_keypress_focus('form_ead', 'formead_name', '" + IsMozilla.ToString() + "' );\" onclick=\"return popup_focus('form_ead', 'formead_name' );\"><div class=\"form_linkline form_ead_line\" id=\"form_ead_term\">");
                Output.Write(Bib.Bib_Info.Location.EAD_Name.Length > 0
                                 ? HttpUtility.HtmlEncode(Bib.Bib_Info.Location.EAD_Name)
                                 : HttpUtility.HtmlEncode(Bib.Bib_Info.Location.EAD_URL));
            }
            Output.WriteLine("</div></a>");
            Output.WriteLine("              </div>");
            Output.WriteLine("          </td>");
            Output.WriteLine("          <td style=\"vertical-align:bottom\" >");
            Output.WriteLine("            <a target=\"_" + html_element_name.ToUpper() + "\"  title=\"" + Translator.Get_Translation("Get help.", CurrentLanguage) + "\" href=\"" + Help_URL(Skin_Code, Base_URL) + "\" ><img class=\"help_button\" src=\"" + Base_URL + HELP_BUTTON_URL + "\" /></a>");
            Output.WriteLine("          </td>");
            Output.WriteLine("        </tr>");
            Output.WriteLine("      </table>");
            Output.WriteLine("    </td>");
            Output.WriteLine("  </tr>");
            Output.WriteLine();

            // Add the popup form
            PopupFormBuilder.AppendLine("<!-- Related EAD Form -->");
            PopupFormBuilder.AppendLine("<div class=\"ead_popup_div sbkMetadata_PopupDiv\" id=\"form_ead\" style=\"display:none;\">");
            PopupFormBuilder.AppendLine("  <div class=\"sbkMetadata_PopupTitle\"><table style=\"width:100%\"><tr><td style=\"text-align:left\">Edit Related EAD / Finding Guide</td><td style=\"text-align:right\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" alt=\"HELP\" target=\"_" + html_element_name.ToUpper() + "\" >?</a> &nbsp; <a href=\"#template\" alt=\"CLOSE\" onclick=\"close_ead_form()\">X</a> &nbsp; </td></tr></table></div>");
            PopupFormBuilder.AppendLine("  <br />");
            PopupFormBuilder.AppendLine("  <table class=\"sbkMetadata_PopupTable\">");

            // Add the rows of data
            PopupFormBuilder.AppendLine("    <tr><td style=\"width:90px\">EAD Name:</td><td><input class=\"formead_input sbk_Focusable\" name=\"formead_name\" id=\"formead_name\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(Bib.Bib_Info.Location.EAD_Name) + "\" /></td></tr>");
            PopupFormBuilder.AppendLine("    <tr><td>EAD URL:</td><td><input class=\"formead_input sbk_Focusable\" name=\"formead_url\" id=\"formead_url\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(Bib.Bib_Info.Location.EAD_URL) + "\" /></td></tr>");

            // Finish the popup form and add the CLOSE button
            PopupFormBuilder.AppendLine("    <tr style=\"height:35px; text-align: center; vertical-align: bottom;\">");
            PopupFormBuilder.AppendLine("      <td colspan=\"2\"><button title=\"Close\" class=\"sbkMetadata_RoundButton\" onclick=\"return close_ead_form();\">CLOSE</button></td>");
            PopupFormBuilder.AppendLine("    </tr>");
            PopupFormBuilder.AppendLine("  </table>");
            PopupFormBuilder.AppendLine("</div>");
            PopupFormBuilder.AppendLine();
        }
        /// <summary> Method helps to render all simple text box based elements </summary>
        /// <param name="Output"> Output for the generated html for this element </param>
        /// <param name="instance_values"> Value(s) for the current digital resource to display</param>
        /// <param name="Skin_Code"> Code for the current html skin </param>
        /// <param name="Current_User"> Current user, who's rights may impact the way an element is rendered </param>
        /// <param name="CurrentLanguage"> Current user-interface language </param>
        /// <param name="Translator"> Language support object which handles simple translational duties </param>
        /// <param name="Base_URL"> Base URL for the current request </param>
        /// <param name="HTML_ID_Name"> ID name used for these elements.  This is usually provided when there are multiple fixed-roles or fixed-type elements </param>
        protected void render_helper(TextWriter Output, ReadOnlyCollection<string> instance_values, string Skin_Code, User_Object Current_User, Web_Language_Enum CurrentLanguage, Language_Support_Info Translator, string Base_URL, string HTML_ID_Name)
        {
            List<string> allValues = new List<string>();
            allValues.AddRange(default_values);
            allValues.AddRange(instance_values);

            if (allValues.Count == 0)
            {
                render_helper(Output, String.Empty, Skin_Code, Current_User, CurrentLanguage, Translator, Base_URL, HTML_ID_Name);
                return;
            }

            if (allValues.Count == 1)
            {
                render_helper(Output, allValues[0], Skin_Code, Current_User, CurrentLanguage, Translator, Base_URL, HTML_ID_Name);
                return;
            }

            Output.WriteLine("  <!-- " + Title + " Element -->");
            Output.WriteLine("  <tr align=\"left\">");
            Output.WriteLine("    <td width=\"" + LEFT_MARGIN + "px\">&nbsp;</td>");
            if (Title.IndexOf(":") < 0)
            {
                if (Acronym.Length > 0)
                {
                    Output.WriteLine("    <td valign=\"top\" class=\"metadata_label\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" target=\"_" + html_element_name.ToUpper() + "\"><acronym title=\"" + Acronym + "\">" + Translator.Get_Translation(Title, CurrentLanguage) + ":</acronym></a></td>");
                }
                else
                {
                    Output.WriteLine("    <td valign=\"top\" class=\"metadata_label\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" target=\"_" + html_element_name.ToUpper() + "\">" + Translator.Get_Translation(Title, CurrentLanguage) + ":</a></td>");
                }
            }
            else
            {
                if (Acronym.Length > 0)
                {
                    Output.WriteLine("    <td valign=\"top\" class=\"metadata_label\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" target=\"_" + html_element_name.ToUpper() + "\"><acronym title=\"" + Acronym + "\">" + Translator.Get_Translation(Title, CurrentLanguage) + "</acronym></a></td>");
                }
                else
                {
                    Output.WriteLine("    <td valign=\"top\" class=\"metadata_label\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" target=\"_" + html_element_name.ToUpper() + "\">" + Translator.Get_Translation(Title, CurrentLanguage) + "</a></td>");
                }
            }

            if (Read_Only)
            {
                Output.WriteLine("    <td>");
                Output.WriteLine("      <table>");
                Output.WriteLine("        <tr>");
                Output.Write("          <td><div class=\"" + HTML_ID_Name + "_div\">");
                for (int i = 0; i < instance_values.Count; i++)
                {
                    Output.Write(instance_values[i]);
                    if (i < (instance_values.Count - 1))
                        Output.Write("<br />");
                }
                Output.WriteLine("</div></td>");
                Output.WriteLine("          <td valign=\"bottom\" >");
                Output.WriteLine("            <a target=\"_" + html_element_name.ToUpper() + "\"  title=\"" + Translator.Get_Translation("Get help.", CurrentLanguage) + "\" href=\"" + Help_URL(Skin_Code, Base_URL) + "\" ><img border=\"0px\" class=\"help_button\" src=\"" + Base_URL + HELP_BUTTON_URL + "\" /></a>");
                Output.WriteLine("          </td>");
                Output.WriteLine("        </tr>");
                Output.WriteLine("      </table>");
                Output.WriteLine("    </td>");
            }
            else
            {
                Output.WriteLine("    <td>");
                Output.WriteLine("      <table>");
                Output.WriteLine("        <tr>");
                Output.WriteLine("          <td>");
                Output.WriteLine("            <div id=\"" + HTML_ID_Name + "_div\">");

                for (int i = 1; i <= allValues.Count; i++)
                {
                    if (i == allValues.Count)
                    {
                        Output.WriteLine("              <input name=\"" + HTML_ID_Name + i + "\" id=\"" + HTML_ID_Name + i + "\" class=\"" + html_element_name + "_input\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(allValues[i - 1].Replace("<i>", "").Replace("</i>", "")) + "\" onfocus=\"javascript:textbox_enter('" + HTML_ID_Name + i + "', '" + html_element_name + "_input_focused')\" onblur=\"javascript:textbox_leave('" + HTML_ID_Name + i + "', '" + html_element_name + "_input')\" />");
                    }
                    else
                    {
                        Output.WriteLine("              <input name=\"" + HTML_ID_Name + i + "\" id=\"" + HTML_ID_Name + i + "\" class=\"" + html_element_name + "_input\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(allValues[i - 1].Replace("<i>", "").Replace("</i>", "")) + "\" onfocus=\"javascript:textbox_enter('" + HTML_ID_Name + i + "', '" + html_element_name + "_input_focused')\" onblur=\"javascript:textbox_leave('" + HTML_ID_Name + i + "', '" + html_element_name + "_input')\" /><br />");
                    }
                }

                Output.WriteLine("            </div>");
                Output.WriteLine("          </td>");
                Output.WriteLine("          <td valign=\"bottom\" >");

                if (view_choices_string.Length > 0)
                {
                    Output.WriteLine("            " + view_choices_string.Replace("<%INTERFACE%>", Skin_Code) + "&nbsp; ");
                }

                if (Repeatable)
                {
                    Output.WriteLine("          <a title=\"" + Translator.Get_Translation("Click to add another " + Title.ToLower(), CurrentLanguage) + ".\" href=\"" + Base_URL + "l/technical/javascriptrequired\" onmousedown=\"return add_new_element_adv('" + HTML_ID_Name + "', '" + html_element_name + "');\"><img border=\"0px\" class=\"repeat_button\" src=\"" + Base_URL + REPEAT_BUTTON_URL + "\" /></a>");
                }

                Output.WriteLine("            <a target=\"_" + html_element_name.ToUpper() + "\"  title=\"" + Translator.Get_Translation("Get help.", CurrentLanguage) + "\" href=\"" + Help_URL(Skin_Code, Base_URL) + "\" ><img border=\"0px\" class=\"help_button\" src=\"" + Base_URL + HELP_BUTTON_URL + "\" /></a>");

                Output.WriteLine("          </td>");
                Output.WriteLine("        </tr>");
                Output.WriteLine("      </table>");

                Output.WriteLine("    </td>");
            }

            Output.WriteLine("  </tr>");
            Output.WriteLine();
        }
        /// <summary> Renders the HTML for this element </summary>
        /// <param name="Output"> Textwriter to write the HTML for this element </param>
        /// <param name="Bib"> Object to populate this element from </param>
        /// <param name="Skin_Code"> Code for the current skin </param>
        /// <param name="isMozilla"> Flag indicates if the current browse is Mozilla Firefox (different css choices for some elements)</param>
        /// <param name="popup_form_builder"> Builder for any related popup forms for this element </param>
        /// <param name="Current_User"> Current user, who's rights may impact the way an element is rendered </param>
        /// <param name="CurrentLanguage"> Current user-interface language </param>
        /// <param name="Translator"> Language support object which handles simple translational duties </param>
        /// <param name="Base_URL"> Base URL for the current request </param>
        /// <remarks> This element appends a popup form to the popup_form_builder</remarks>
        public override void Render_Template_HTML(TextWriter Output, SobekCM_Item Bib, string Skin_Code, bool isMozilla, StringBuilder popup_form_builder, User_Object Current_User, Web_Language_Enum CurrentLanguage, Language_Support_Info Translator, string Base_URL )
        {
            // Check that an acronym exists
            if (Acronym.Length == 0)
            {
                const string defaultAcronym = "Enter information for any electronic finding guide to which this material belongs.";
                switch (CurrentLanguage)
                {
                    case Web_Language_Enum.English:
                        Acronym = defaultAcronym;
                        break;

                    case Web_Language_Enum.Spanish:
                        Acronym = defaultAcronym;
                        break;

                    case Web_Language_Enum.French:
                        Acronym = defaultAcronym;
                        break;

                    default:
                        Acronym = defaultAcronym;
                        break;
                }
            }

            Output.WriteLine("  <!-- " + Title + " Form Element -->");
            Output.WriteLine("  <tr align=\"left\">");
            Output.WriteLine("    <td width=\"" + LEFT_MARGIN + "px\">&nbsp;</td>");
            if (Acronym.Length > 0)
            {
                Output.WriteLine("    <td valign=\"top\" class=\"metadata_label\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" target=\"_" + html_element_name.ToUpper() + "\"><acronym title=\"" + Acronym + "\">" + Translator.Get_Translation(Title, CurrentLanguage) + ":</acronym></a></td>");
            }
            else
            {
                Output.WriteLine("    <td valign=\"top\" class=\"metadata_label\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" target=\"_" + html_element_name.ToUpper() + "\">" + Translator.Get_Translation(Title, CurrentLanguage) + ":</a></td>");
            }

            Output.WriteLine("    <td>");
            Output.WriteLine("      <table>");
            Output.WriteLine("        <tr>");
            Output.WriteLine("          <td>");
            Output.WriteLine("            <div id=\"" + html_element_name + "_div\">");

            // Write the EAD popup link
            if (( !Bib.Bib_Info.hasLocationInformation ) || ((Bib.Bib_Info.Location.EAD_Name.Length == 0) && (Bib.Bib_Info.Location.EAD_URL.Length == 0 )))
            {
                Output.Write("              <a title=\"Click to edit the related EAD information\" href=\"" + Base_URL + "l/technical/javascriptrequired\" onfocus=\"link_focused2('form_ead_term')\" onblur=\"link_blurred2('form_ead_term')\" onkeypress=\"return popup_keypress_focus('form_ead', 'form_ead_term', 'formead_name', 175, 620, '" + isMozilla.ToString() + "' );\" onclick=\"return popup_focus('form_ead', 'form_ead_term', 'formead_name', 175, 620 );\"><div class=\"form_linkline_empty form_ead_line\" id=\"form_ead_term\">");
                Output.Write("<i>Empty Related EAD</i>");
            }
            else
            {
                Output.Write("              <a title=\"Click to edit the related EAD information\" href=\"" + Base_URL + "l/technical/javascriptrequired\" onfocus=\"link_focused2('form_ead_term')\" onblur=\"link_blurred2('form_ead_term')\" onkeypress=\"return popup_keypress_focus('form_ead', 'form_ead_term', 'formead_name', 175, 620, '" + isMozilla.ToString() + "' );\" onclick=\"return popup_focus('form_ead', 'form_ead_term', 'formead_name', 175, 620 );\"><div class=\"form_linkline form_ead_line\" id=\"form_ead_term\">");
                Output.Write(Bib.Bib_Info.Location.EAD_Name.Length > 0
                                 ? HttpUtility.HtmlEncode(Bib.Bib_Info.Location.EAD_Name)
                                 : HttpUtility.HtmlEncode(Bib.Bib_Info.Location.EAD_URL));
            }
            Output.WriteLine("</div></a>");
            Output.WriteLine("              </div>");
            Output.WriteLine("          </td>");
            Output.WriteLine("          <td valign=\"bottom\" >");
            Output.WriteLine("            <a target=\"_" + html_element_name.ToUpper() + "\"  title=\"" + Translator.Get_Translation("Get help.", CurrentLanguage) + "\" href=\"" + Help_URL(Skin_Code, Base_URL) + "\" ><img border=\"0px\" class=\"help_button\" src=\"" + Base_URL + HELP_BUTTON_URL + "\" /></a>");
            Output.WriteLine("          </td>");
            Output.WriteLine("        </tr>");
            Output.WriteLine("      </table>");
            Output.WriteLine("    </td>");
            Output.WriteLine("  </tr>");
            Output.WriteLine();

            // Add the popup form
            popup_form_builder.AppendLine("<!-- Related EAD Form -->");
            popup_form_builder.AppendLine("<div class=\"ead_popup_div\" id=\"form_ead\" style=\"display:none;\">");
            popup_form_builder.AppendLine("  <div class=\"popup_title\"><table width=\"100%\"><tr><td align=\"left\">EDIT RELATED EAD / FINDING GUIDE</td><td align=\"right\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" alt=\"HELP\" target=\"_" + html_element_name.ToUpper() + "\" >?</a> &nbsp; <a href=\"#template\" alt=\"CLOSE\" onclick=\"close_ead_form()\">X</a> &nbsp; </td></tr></table></div>");
            popup_form_builder.AppendLine("  <br />");
            popup_form_builder.AppendLine("  <table class=\"popup_table\">");

            // Add the rows of data
            popup_form_builder.AppendLine("    <tr><td width=\"90px\">EAD Name:</td><td><input class=\"formead_input\" name=\"formead_name\" id=\"formead_name\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(Bib.Bib_Info.Location.EAD_Name) + "\" onfocus=\"javascript:textbox_enter('formead_name', 'formead_input_focused')\" onblur=\"javascript:textbox_leave('formead_name', 'formead_input')\" /></td></tr>");
            popup_form_builder.AppendLine("    <tr><td>EAD URL:</td><td><input class=\"formead_input\" name=\"formead_url\" id=\"formead_url\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(Bib.Bib_Info.Location.EAD_URL) + "\" onfocus=\"javascript:textbox_enter('formead_url', 'formead_input_focused')\" onblur=\"javascript:textbox_leave('formead_url', 'formead_input')\" /></td></tr>");

            // Finish the popup form
            popup_form_builder.AppendLine("  </table>");
            popup_form_builder.AppendLine("  <br />");
            popup_form_builder.AppendLine("  <center><a href=\"#template\" onclick=\"return close_ead_form()\"><img border=\"0\" src=\"" + Close_Button_URL(Skin_Code, Base_URL ) + "\" alt=\"CLOSE\" /></a></center>");
            popup_form_builder.AppendLine("</div>");
            popup_form_builder.AppendLine();
        }
        /// <summary> Renders the HTML for this element </summary>
        /// <param name="Output"> Textwriter to write the HTML for this element </param>
        /// <param name="Bib"> Object to populate this element from </param>
        /// <param name="Skin_Code"> Code for the current skin </param>
        /// <param name="isMozilla"> Flag indicates if the current browse is Mozilla Firefox (different css choices for some elements)</param>
        /// <param name="popup_form_builder"> Builder for any related popup forms for this element </param>
        /// <param name="Current_User"> Current user, who's rights may impact the way an element is rendered </param>
        /// <param name="CurrentLanguage"> Current user-interface language </param>
        /// <param name="Translator"> Language support object which handles simple translational duties </param>
        /// <param name="Base_URL"> Base URL for the current request </param>
        /// <remarks> This simple element does not append any popup form to the popup_form_builder</remarks>
        public override void Render_Template_HTML(TextWriter Output, SobekCM_Item Bib, string Skin_Code, bool isMozilla, StringBuilder popup_form_builder, User_Object Current_User, Web_Language_Enum CurrentLanguage, Language_Support_Info Translator, string Base_URL )
        {
            // Check that an acronym exists
            if (Acronym.Length == 0)
            {
                const string defaultAcronym = "Enter the period of time which is the subject of this material.";
                switch (CurrentLanguage)
                {
                    case Web_Language_Enum.English:
                        Acronym = defaultAcronym;
                        break;

                    case Web_Language_Enum.Spanish:
                        Acronym = defaultAcronym;
                        break;

                    case Web_Language_Enum.French:
                        Acronym = defaultAcronym;
                        break;

                    default:
                        Acronym = defaultAcronym;
                        break;
                }
            }

            string id_name = html_element_name.Replace("_", "");

            Output.WriteLine("  <!-- " + Title + " Element -->");
            Output.WriteLine("  <tr align=\"left\">");
            Output.WriteLine("    <td width=\"" + LEFT_MARGIN + "px\">&nbsp;</td>");
            if (Acronym.Length > 0)
            {
                Output.WriteLine("    <td valign=\"top\" class=\"metadata_label\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" target=\"_" + html_element_name.ToUpper() + "\"><acronym title=\"" + Acronym + "\">" + Translator.Get_Translation(Title, CurrentLanguage) + ":</acronym></a></td>");
            }
            else
            {
                Output.WriteLine("    <td valign=\"top\" class=\"metadata_label\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" target=\"_" + html_element_name.ToUpper() + "\">" + Translator.Get_Translation(Title, CurrentLanguage) + ":</a></td>");
            }
            Output.WriteLine("    <td>");
            Output.WriteLine("      <table>");
            Output.WriteLine("        <tr>");
            Output.WriteLine("          <td>");
            Output.WriteLine("            <div id=\"" + html_element_name + "_div\">");

            if (Bib.Bib_Info.TemporalSubjects_Count == 0)
            {
                const int  i = 1;
                Output.Write("              <span class=\"metadata_sublabel2\">" + Translator.Get_Translation("Start Year", CurrentLanguage) + ":</span>");
                Output.Write("<input name=\"" + id_name + "_start" + i + "\" id=\"" + id_name + "_start" + i + "\" class=\"" + html_element_name + "_year_input\" type=\"text\" value=\"\" onfocus=\"javascript:textbox_enter('" + id_name + "_start" + i + "', '" + html_element_name + "_year_input_focused')\" onblur=\"javascript:textbox_leave('" + id_name + "_start" + i + "', '" + html_element_name + "_year_input')\" />");
                Output.Write("<span class=\"metadata_sublabel\">" + Translator.Get_Translation("End Year", CurrentLanguage) + ":</span>");
                Output.Write("<input name=\"" + id_name + "_end" + i + "\" id=\"" + id_name + "_end" + i + "\" class=\"" + html_element_name + "_year_input\" type=\"text\" value=\"\" onfocus=\"javascript:textbox_enter('" + id_name + "_end" + i + "', '" + html_element_name + "_year_input_focused')\" onblur=\"javascript:textbox_leave('" + id_name + "_end" + i + "', '" + html_element_name + "_year_input')\" />");
                Output.Write("<span class=\"metadata_sublabel\">" + Translator.Get_Translation("Period", CurrentLanguage) + ":</span>");
                Output.WriteLine("<input name=\"" + id_name + "_period" + i + "\" id=\"" + id_name + "_period" + i + "\" class=\"" + html_element_name + "_period_input\" type=\"text\" value=\"\" onfocus=\"javascript:textbox_enter('" + id_name + "_period" + i + "', '" + html_element_name + "_period_input_focused')\" onblur=\"javascript:textbox_leave('" + id_name + "_period" + i + "', '" + html_element_name + "_period_input')\" /></div>");
                Output.WriteLine("            </div>");
            }
            else
            {
                ReadOnlyCollection<Temporal_Info> temporalSubjects = Bib.Bib_Info.TemporalSubjects;
                for (int i = 1; i <= temporalSubjects.Count; i++)
                {
                    Output.Write("              <span class=\"metadata_sublabel2\">" + Translator.Get_Translation("Start Year", CurrentLanguage) + ":</span>");
                    Output.Write("<input name=\"" + id_name + "_start" + i + "\" id=\"" + id_name + "_start" + i + "\" class=\"" + html_element_name + "_year_input\" type=\"text\" value=\"" + temporalSubjects[i - 1].Start_Year.ToString().Replace("-1", "") + "\" onfocus=\"javascript:textbox_enter('" + id_name + "_start" + i + "', '" + html_element_name + "_year_input_focused')\" onblur=\"javascript:textbox_leave('" + id_name + "_start" + i + "', '" + html_element_name + "_year_input')\" />");
                    Output.Write("<span class=\"metadata_sublabel\">" + Translator.Get_Translation("End Year", CurrentLanguage) + ":</span>");
                    Output.Write("<input name=\"" + id_name + "_end" + i + "\" id=\"" + id_name + "_end" + i + "\" class=\"" + html_element_name + "_year_input\" type=\"text\" value=\"" + temporalSubjects[i - 1].End_Year.ToString().Replace("-1", "") + "\" onfocus=\"javascript:textbox_enter('" + id_name + "_end" + i + "', '" + html_element_name + "_year_input_focused')\" onblur=\"javascript:textbox_leave('" + id_name + "_end" + i + "', '" + html_element_name + "_year_input')\" />");
                    Output.Write("<span class=\"metadata_sublabel\">" + Translator.Get_Translation("Period", CurrentLanguage) + ":</span>");
                    Output.Write("<input name=\"" + id_name + "_period" + i + "\" id=\"" + id_name + "_period" + i + "\" class=\"" + html_element_name + "_period_input\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(temporalSubjects[i - 1].TimePeriod) + "\" onfocus=\"javascript:textbox_enter('" + id_name + "_period" + i + "', '" + html_element_name + "_period_input_focused')\" onblur=\"javascript:textbox_leave('" + id_name + "_period" + i + "', '" + html_element_name + "_period_input')\" />");

                    Output.WriteLine(i < temporalSubjects.Count ? "<br />" : "\n            </div>");
                }
            }
            Output.WriteLine("          </td>");

            Output.WriteLine("          <td valign=\"bottom\" >");
            if (Repeatable)
            {
                Output.WriteLine("            <a title=\"" + Translator.Get_Translation("Click to add a new temporal coverage field", CurrentLanguage) + ".\" href=\"" + Base_URL + "l/technical/javascriptrequired\" onmousedown=\"return add_temporal_element();\"><img border=\"0px\" class=\"repeat_button\" src=\"" + Base_URL + REPEAT_BUTTON_URL + "\" /></a>");
            }
            Output.WriteLine("            <a target=\"_" + html_element_name.ToUpper() + "\"  title=\"" + Translator.Get_Translation("Get help.", CurrentLanguage) + "\" href=\"" + Help_URL(Skin_Code, Base_URL) + "\" ><img border=\"0px\" class=\"help_button\" src=\"" + Base_URL + HELP_BUTTON_URL + "\" /></a>");
            Output.WriteLine("          </td>");

            Output.WriteLine("        </tr>");
            Output.WriteLine("      </table>");
            Output.WriteLine("    </td>");
            Output.WriteLine("  </tr>");
            Output.WriteLine();
        }
        /// <summary> Method helps to render the html for all elements based on comboBox_TextBox_Element class </summary>
        /// <param name="Output"> Output for the generate html for this element </param>
        /// <param name="select_value"> Value for the current digital resource to display in the combo box</param>
        /// <param name="userdefined_possible"> List of possible select values, set by the user </param>
        /// <param name="text_value"> Value for the current digital resource to display in the text box</param>
        /// <param name="Skin_Code"> Code for the current html skin </param>
        /// <param name="Current_User"> Current user, who's rights may impact the way an element is rendered </param>
        /// <param name="CurrentLanguage"> Current user-interface language </param>
        /// <param name="Translator"> Language support object which handles simple translational duties </param>
        /// <param name="Base_URL"> Base URL for the current request </param>
        /// <param name="initial_value"> Flag indicates if the value in the select_value param is actually instructional text, and not a true value</param>
        protected void render_helper(TextWriter Output, string select_value, List<string> userdefined_possible, string text_value, string Skin_Code, User_Object Current_User, Web_Language_Enum CurrentLanguage, Language_Support_Info Translator, string Base_URL, bool initial_value)
        {
            string id_name = html_element_name.Replace("_", "");

            Output.WriteLine("  <!-- " + Title + " Element -->");
            Output.WriteLine("  <tr>");
            Output.WriteLine("    <td style=\"width:" + LEFT_MARGIN + "px\">&nbsp;</td>");
            if (Acronym.Length > 0)
            {
                Output.WriteLine("    <td class=\"metadata_label\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" target=\"_" + html_element_name.ToUpper() + "\"><acronym title=\"" + Acronym + "\">" + Translator.Get_Translation(Title, CurrentLanguage) + ":</acronym></a></td>");
            }
            else
            {
                Output.WriteLine("    <td class=\"metadata_label\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" target=\"_" + html_element_name.ToUpper() + "\">" + Translator.Get_Translation(Title, CurrentLanguage) + ":</a></td>");
            }
            Output.WriteLine("    <td>");

            Output.WriteLine("      <table>");
            Output.WriteLine("        <tr>");
            Output.WriteLine("          <td>");
            Output.WriteLine("            <div id=\"" + html_element_name + "_div\">");

            const int i = 1;

                // Write the combo box
            // Write the combo box
            if (clear_textbox_on_combobox_change)
            {
                Output.Write("            <select class=\"" + html_element_name + "_select\" name=\"" + id_name + "_select" + i + "\" id=\"" + id_name + "_select" + i + "\" onblur=\"javascript:selectbox_leave('" + id_name + "_select" + i + "','" + html_element_name + "_select', '" + html_element_name + "_select_init')\" onchange=\"clear_textbox('" + id_name + "_text" + i + "')\" >");
            }
            else
            {
                Output.Write("            <select class=\"" + html_element_name + "_select\" name=\"" + id_name + "_select" + i + "\" id=\"" + id_name + "_select" + i + "\" onblur=\"javascript:selectbox_leave('" + id_name + "_select" + i + "','" + html_element_name + "_select', '" + html_element_name + "_select_init')\" >");
            }

                bool found_option = false;
                foreach (string thisOption in possible_select_items)
                {
                    if ((i < possible_select_items.Count) && (thisOption == select_value))
                    {
                        Output.Write("<option value=\"" + thisOption + "\" selected=\"selected=\">" + thisOption + "</option>");
                        found_option = true;
                    }
                    else
                    {
                        Output.Write("<option value=\"" + thisOption + "\" >" + thisOption + "</option>");
                    }
                }

                if ((select_value.Length > 0) && (!Restrict_Values) && (!found_option))
                {
                    Output.Write("<option value=\"" + select_value + "\" selected=\"selected=\">" + select_value + "</option>");
                }
                Output.Write("</select>");

                // Write the second text
                if (second_label.Length > 0)
                {
                    Output.Write("<span class=\"metadata_sublabel\">" + second_label + ":</span>");
                }

                // Write the text box
                Output.Write("<input name=\"" + id_name + "_text" + i + "\" id=\"" + id_name + "_text" + i + "\" class=\"" + html_element_name + "_input sbk_Focusable\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(text_value) + "\" />");

                Output.WriteLine("</div>");

            Output.WriteLine("        </td>");
            Output.WriteLine("        <td style=\"vertical-align:bottom\" >");
            if (Repeatable)
            {
                Output.WriteLine("          <a title=\"" + Translator.Get_Translation("Click to add another " + Title.ToLower(), CurrentLanguage) + ".\" href=\"" + Base_URL + "l/technical/javascriptrequired\" onmousedown=\"return " + html_element_name + "_add_new_item();\"><img class=\"repeat_button\" src=\"" + Base_URL + REPEAT_BUTTON_URL + "\" /></a>");
            }

            Output.WriteLine("            <a target=\"_" + html_element_name.ToUpper() + "\"  title=\"" + Translator.Get_Translation("Get help.", CurrentLanguage) + "\" href=\"" + Help_URL(Skin_Code, Base_URL) + "\" ><img class=\"help_button\" src=\"" + Base_URL + HELP_BUTTON_URL + "\" /></a>");

            Output.WriteLine("        </td>");
            Output.WriteLine("      </tr>");
            Output.WriteLine("    </table>");

            Output.WriteLine("    </td>");
            Output.WriteLine("  </tr>");
            Output.WriteLine();
        }
        /// <summary> Renders the HTML for this element </summary>
        /// <param name="Output"> Textwriter to write the HTML for this element </param>
        /// <param name="Bib"> Object to populate this element from </param>
        /// <param name="Skin_Code"> Code for the current skin </param>
        /// <param name="isMozilla"> Flag indicates if the current browse is Mozilla Firefox (different css choices for some elements)</param>
        /// <param name="popup_form_builder"> Builder for any related popup forms for this element </param>
        /// <param name="Current_User"> Current user, who's rights may impact the way an element is rendered </param>
        /// <param name="CurrentLanguage"> Current user-interface language </param>
        /// <param name="Translator"> Language support object which handles simple translational duties </param>
        /// <param name="Base_URL"> Base URL for the current request </param>
        /// <remarks> This simple element does not append any popup form to the popup_form_builder</remarks>
        public override void Render_Template_HTML(TextWriter Output, SobekCM_Item Bib, string Skin_Code, bool isMozilla, StringBuilder popup_form_builder, User_Object Current_User, Web_Language_Enum CurrentLanguage, Language_Support_Info Translator, string Base_URL )
        {
            // Check that an acronym exists
            if (Acronym.Length == 0)
            {
                const string defaultAcronym = "Enter any notes about this digital manifestation or the original material";
                switch (CurrentLanguage)
                {
                    case Web_Language_Enum.English:
                        Acronym = defaultAcronym;
                        break;

                    case Web_Language_Enum.Spanish:
                        Acronym = defaultAcronym;
                        break;

                    case Web_Language_Enum.French:
                        Acronym = defaultAcronym;
                        break;

                    default:
                        Acronym = defaultAcronym;
                        break;
                }
            }

            // Determine the columns for this text area, based on browser
            int actual_cols = cols;
            if (isMozilla)
                actual_cols = colsMozilla;

            string id_name = html_element_name.Replace("_", "");

            Output.WriteLine("  <!-- " + Title + " Element -->");
            Output.WriteLine("  <tr align=\"left\">");
            Output.WriteLine("    <td width=\"" + LEFT_MARGIN + "px\">&nbsp;</td>");
            if (Acronym.Length > 0)
            {
                Output.WriteLine("    <td valign=\"top\" class=\"metadata_label\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" target=\"_" + html_element_name.ToUpper() + "\"><acronym title=\"" + Acronym + "\">" + Translator.Get_Translation(Title, CurrentLanguage) + ":</acronym></a></td>");
            }
            else
            {
                Output.WriteLine("    <td valign=\"top\" class=\"metadata_label\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" target=\"_" + html_element_name.ToUpper() + "\">" + Translator.Get_Translation(Title, CurrentLanguage) + ":</a></td>");
            }
            Output.WriteLine("    <td>");
            Output.WriteLine("      <table>");
            Output.WriteLine("        <tr align=\"left\">");
            Output.WriteLine("          <td>");
            Output.WriteLine("            <div id=\"" + html_element_name + "_div\">");

            int notes_count = 0;
            if (Bib.Bib_Info.Notes_Count > 0)
            {
                notes_count += Bib.Bib_Info.Notes.Count(thisNote => ((thisNote.Note_Type != Note_Type_Enum.statement_of_responsibility) || (Include_Statement_Responsibility)) && (thisNote.Note_Type != Note_Type_Enum.default_type));
            }

            if (notes_count == 0)
            {
                Output.WriteLine("              <div id=\"" + html_element_name + "_topdiv1\">");
                Output.WriteLine("                <span class=\"metadata_sublabel2\">" + Translator.Get_Translation("Type", CurrentLanguage) + ":</span>");
                Output.WriteLine("                <select class=\"" + html_element_name + "_type\" name=\"" + id_name + "_type1\" id=\"" + id_name + "_type1\" onchange=\"javascript:complexnote_type_change('1')\" onfocus=\"javascript:textbox_enter('" + id_name + "_type1','" + html_element_name + "_type_focused')\" onblur=\"javascript:textbox_leave('" + id_name + "_type1','" + html_element_name + "_type')\" >");
                Output.WriteLine("                  <option selected=\"selected=\" value=\"500\"></option>");
                Output.WriteLine("                  <option value=\"541\">Acquisition</option>");
                Output.WriteLine("                  <option value=\"530\">Additional Physical Form</option>");
                Output.WriteLine("                  <option value=\"504\">Bibliography</option>");
                Output.WriteLine("                  <option value=\"545\">Biographical</option>");
                Output.WriteLine("                  <option value=\"510\">Citation/Reference</option>");
                Output.WriteLine("                  <option value=\"508\">Creation/Production Credits</option>");
                Output.WriteLine("                  <option value=\"362\">Dates/Sequential Designation</option>");
                Output.WriteLine("                  <option value=\"donation\">Donation</option>");
                Output.WriteLine("                  <option value=\"585\">Exhibitions</option>");
                Output.WriteLine("                  <option value=\"536\">Funding</option>");
                Output.WriteLine("                  <option value=\"internal\">Internal Comments</option>");
                Output.WriteLine("                  <option value=\"550\">Issuing Body</option>");
                Output.WriteLine("                  <option value=\"546\">Language</option>");
                Output.WriteLine("                  <option value=\"515\">Numbering Peculiarities</option>");
                Output.WriteLine("                  <option value=\"535\">Original Location</option>");
                Output.WriteLine("                  <option value=\"534\">Original Version</option>");
                Output.WriteLine("                  <option value=\"561\">Ownership</option>");
                Output.WriteLine("                  <option value=\"511\">Performers</option>");
                Output.WriteLine("                  <option value=\"524\">Preferred Citation</option>");
                Output.WriteLine("                  <option value=\"581\">Publications</option>");
                Output.WriteLine("                  <option value=\"pubstatus\">Publication Status</option>");
                Output.WriteLine("                  <option value=\"506\">Restriction</option>");
                if (Include_Statement_Responsibility)
                {
                    Output.WriteLine("                  <option value=\"245\">Statement of Responsibility</option>");
                }
                Output.WriteLine("                  <option value=\"538\">System Details</option>");
                Output.WriteLine("                  <option value=\"502\">Thesis</option>");
                Output.WriteLine("                  <option value=\"518\">Venue</option>");
                Output.WriteLine("                  <option value=\"562\">Version Identification</option>");
                Output.WriteLine("                </select>");
                Output.WriteLine("              </div>");

                Output.WriteLine("              <textarea rows=\"" + Rows + "\" cols=\"" + actual_cols + "\" name=\"" + id_name + "_textarea1\" id=\"" + id_name + "_textarea1\" class=\"" + html_element_name + "_input\" onfocus=\"javascript:textbox_enter('" + id_name + "_textarea1','" + html_element_name + "_input_focused')\" onblur=\"javascript:textbox_leave('" + id_name + "_textarea1','" + html_element_name + "_input')\"></textarea>");
            }
            else
            {
                int i = 1;
                foreach (Note_Info thisNote in Bib.Bib_Info.Notes)
                {
                    if (((thisNote.Note_Type != Note_Type_Enum.statement_of_responsibility) || (Include_Statement_Responsibility)) &&
                        ( thisNote.Note_Type != Note_Type_Enum.default_type ))
                    {
                        string note_display_label = String.Empty;
                        string display_label_prompt = "Materials Selected";

                        Output.WriteLine("              <div id=\"" + html_element_name + "_topdiv" + i + "\">");
                        Output.WriteLine("                <span class=\"metadata_sublabel2\">Type:</span>");
                        Output.WriteLine("                <select class=\"" + html_element_name + "_type\" name=\"" + id_name + "_type" + i + "\" id=\"" + id_name + "_type" + i + "\" onchange=\"javascript:complexnote_type_change('" + i + "')\" onfocus=\"javascript:textbox_enter('" + id_name + "_type" + i + "','" + html_element_name + "_type_focused')\" onblur=\"javascript:textbox_leave('" + id_name + "_type" + i + "','" + html_element_name + "_type')\" >");

                        if (thisNote.Note_Type == Note_Type_Enum.NONE)
                        {
                            Output.WriteLine("                  <option value=\"500\" selected=\"selected\"></option>");
                            note_display_label = thisNote.Display_Label;
                            display_label_prompt = "Display Label";
                        }
                        else
                            Output.WriteLine("                  <option value=\"500\"></option>");

                        Output.WriteLine(thisNote.Note_Type == Note_Type_Enum.acquisition
                                             ? "                  <option value=\"541\" selected=\"selected\">Acquisition</option>"
                                             : "                  <option value=\"541\">Acquisition</option>");

                        Output.WriteLine(thisNote.Note_Type == Note_Type_Enum.additional_physical_form
                                             ? "                  <option value=\"530\" selected=\"selected\">Additional Physical Form</option>"
                                             : "                  <option value=\"530\">Additional Physical Form</option>");

                        Output.WriteLine(thisNote.Note_Type == Note_Type_Enum.bibliography
                                             ? "                  <option value=\"504\" selected=\"selected\">Bibliography</option>"
                                             : "                  <option value=\"504\">Bibliography</option>");

                        Output.WriteLine(thisNote.Note_Type == Note_Type_Enum.biographical
                                             ? "                  <option value=\"545\" selected=\"selected\">Biographical</option>"
                                             : "                  <option value=\"545\">Biographical</option>");

                        Output.WriteLine(thisNote.Note_Type == Note_Type_Enum.citation_reference
                                             ? "                  <option value=\"510\" selected=\"selected\">Citation/Reference</option>"
                                             : "                  <option value=\"510\">Citation/Reference</option>");

                        Output.WriteLine(thisNote.Note_Type == Note_Type_Enum.creation_credits
                                             ? "                  <option value=\"508\" selected=\"selected\">Creation/Production Credits</option>"
                                             : "                  <option value=\"508\">Creation/Production Credits</option>");

                        if (thisNote.Note_Type == Note_Type_Enum.dates_sequential_designation)
                        {
                            Output.WriteLine("                  <option value=\"362\" selected=\"selected\">Dates/Sequential Designation</option>");
                            note_display_label = thisNote.Display_Label;
                            display_label_prompt = "Source";
                        }
                        else
                            Output.WriteLine("                  <option value=\"362\">Dates/Sequential Designation</option>");

                        Output.WriteLine(thisNote.Note_Type == Note_Type_Enum.donation
                                             ? "                  <option value=\"donation\" selected=\"selected\">Donation</option>"
                                             : "                  <option value=\"donation\">Donation</option>");

                        if (thisNote.Note_Type == Note_Type_Enum.exhibitions)
                        {
                            Output.WriteLine("                  <option value=\"585\" selected=\"selected\">Exhibitions</option>");
                            note_display_label = thisNote.Display_Label;
                        }
                        else
                            Output.WriteLine("                  <option value=\"585\">Exhibitions</option>");

                        Output.WriteLine(thisNote.Note_Type == Note_Type_Enum.funding
                                             ? "                  <option value=\"536\" selected=\"selected\">Funding</option>"
                                             : "                  <option value=\"536\">Funding</option>");

                        Output.WriteLine(thisNote.Note_Type == Note_Type_Enum.internal_comments
                                             ? "                  <option value=\"internal\" selected=\"selected\">Internal Comments</option>"
                                             : "                  <option value=\"internal\">Internal Comments</option>");

                        Output.WriteLine(thisNote.Note_Type == Note_Type_Enum.issuing_body
                                             ? "                  <option value=\"550\" selected=\"selected\">Issuing Body</option>"
                                             : "                  <option value=\"550\">Issuing Body</option>");

                        if (thisNote.Note_Type == Note_Type_Enum.language)
                        {
                            Output.WriteLine("                  <option value=\"546\" selected=\"selected\">Language</option>");
                            note_display_label = thisNote.Display_Label;
                        }
                        else
                            Output.WriteLine("                  <option value=\"546\">Language</option>");

                        Output.WriteLine(thisNote.Note_Type == Note_Type_Enum.numbering_peculiarities
                                             ? "                  <option value=\"515\" selected=\"selected\">Numbering Peculiarities</option>"
                                             : "                  <option value=\"515\">Numbering Peculiarities</option>");

                        Output.WriteLine(thisNote.Note_Type == Note_Type_Enum.original_location
                                             ? "                  <option value=\"535\" selected=\"selected\">Original Location</option>"
                                             : "                  <option value=\"535\">Original Location</option>");

                        Output.WriteLine(thisNote.Note_Type == Note_Type_Enum.original_version
                                             ? "                  <option value=\"534\" selected=\"selected\">Original Version</option>"
                                             : "                  <option value=\"534\">Original Version</option>");

                        if (thisNote.Note_Type == Note_Type_Enum.ownership)
                        {
                            Output.WriteLine("                  <option value=\"561\" selected=\"selected\">Ownership</option>");
                            note_display_label = thisNote.Display_Label;
                        }
                        else
                            Output.WriteLine("                  <option value=\"561\">Ownership</option>");

                        if (thisNote.Note_Type == Note_Type_Enum.performers)
                        {
                            Output.WriteLine("                  <option value=\"511\" selected=\"selected\">Performers</option>");
                            note_display_label = thisNote.Display_Label;
                            display_label_prompt = "Display Label";
                        }
                        else
                            Output.WriteLine("                  <option value=\"511\">Performers</option>");

                        if (thisNote.Note_Type == Note_Type_Enum.preferred_citation)
                        {
                            Output.WriteLine("                  <option value=\"524\" selected=\"selected\">Preferred Citation</option>");
                            note_display_label = thisNote.Display_Label;
                        }
                        else
                            Output.WriteLine("                  <option value=\"524\">Preferred Citation</option>");

                        if (thisNote.Note_Type == Note_Type_Enum.publications)
                        {
                            Output.WriteLine("                  <option value=\"581\" selected=\"selected\">Publications</option>");
                            note_display_label = thisNote.Display_Label;
                        }
                        else
                            Output.WriteLine("                  <option value=\"581\">Publications</option>");

                        Output.WriteLine(thisNote.Note_Type == Note_Type_Enum.publication_status
                                             ? "                  <option value=\"pubstatus\" selected=\"selected\">Publication Status</option>"
                                             : "                  <option value=\"pubstatus\">Publication Status</option>");

                        Output.WriteLine(thisNote.Note_Type == Note_Type_Enum.restriction
                                             ? "                  <option value=\"506\" selected=\"selected\">Restriction</option>"
                                             : "                  <option value=\"506\">Restriction</option>");

                        if (Include_Statement_Responsibility)
                        {
                            Output.WriteLine(thisNote.Note_Type == Note_Type_Enum.statement_of_responsibility
                                                 ? "                  <option value=\"245\" selected=\"selected\">Statement of Responsibility</option>"
                                                 : "                  <option value=\"245\">Statement of Responsibility</option>");
                        }

                        Output.WriteLine(thisNote.Note_Type == Note_Type_Enum.system_details
                                             ? "                  <option value=\"538\" selected=\"selected\">System Details</option>"
                                             : "                  <option value=\"538\">System Details</option>");

                        Output.WriteLine(thisNote.Note_Type == Note_Type_Enum.thesis
                                             ? "                  <option value=\"502\" selected=\"selected\">Thesis</option>"
                                             : "                  <option value=\"502\">Thesis</option>");

                        if (thisNote.Note_Type == Note_Type_Enum.date_venue)
                        {
                            Output.WriteLine("                  <option value=\"518\" selected=\"selected\">Venue</option>");
                            note_display_label = thisNote.Display_Label;
                        }
                        else
                            Output.WriteLine("                  <option value=\"518\">Venue</option>");

                        Output.WriteLine(thisNote.Note_Type == Note_Type_Enum.version_identification
                                             ? "                  <option value=\"562\" selected=\"selected\">Version Identification</option>"
                                             : "                  <option value=\"562\">Version Identification</option>");

                        Output.WriteLine("                </select>");

                        if (note_display_label.Length > 0)
                        {
                            Output.Write("<span class=\"metadata_sublabel\" id=\"complexnote_inputtext" + i + "\" name=\"complexnote_inputtext" + i + "\">" + display_label_prompt + ":</span>");
                            Output.WriteLine("<input class=\"complexnote_input\" id=\"complexnote_inputtext" + i + "\" name=\"complexnote_input" + i + "\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(note_display_label) + "\" onfocus=\"javascript:textbox_enter('complexnote_input" + i + "', 'complexnote_input_focused')\" onblur=\"javascript:textbox_leave('complexnote_input" + i + "', 'complexnote_input')\" />");
                        }

                        Output.WriteLine("              </div>");

                        Output.Write("              <textarea rows=\"" + Rows + "\" cols=\"" + actual_cols + "\" name=\"" + id_name + "_textarea" + i + "\" id=\"" + id_name + "_textarea" + i + "\" class=\"" + html_element_name + "_input\" onfocus=\"javascript:textbox_enter('" + id_name + "_textarea" + i + "','" + html_element_name + "_input_focused')\" onblur=\"javascript:textbox_leave('" + id_name + "_textarea" + i + "','" + html_element_name + "_input')\">" + HttpUtility.HtmlEncode(thisNote.Note) + "</textarea>");

                        if (i < Bib.Bib_Info.Notes_Count)
                        {
                            Output.WriteLine("<br />");
                        }
                        else
                        {
                            Output.WriteLine();
                        }

                        i++;
                    }
                }
                Output.WriteLine("            </div>");
                Output.WriteLine("          </td>");
            }

            Output.WriteLine("          <td valign=\"bottom\" >");
            if (Repeatable)
            {
                Output.WriteLine("            <a title=\"" + Translator.Get_Translation("Click to add a new abstract", CurrentLanguage) + ".\" href=\"" + Base_URL + "l/technical/javascriptrequired\" onmousedown=\"return add_complex_note('" + Rows + "','" + actual_cols + "');\"><img border=\"0px\" class=\"repeat_button\" src=\"" + Base_URL + REPEAT_BUTTON_URL + "\" /></a>");
            }
            Output.WriteLine("            <a target=\"_" + html_element_name.ToUpper() + "\"  title=\"" + Translator.Get_Translation("Get help.", CurrentLanguage) + "\" href=\"" + Help_URL(Skin_Code, Base_URL) + "\" ><img border=\"0px\" class=\"help_button\" src=\"" + Base_URL + HELP_BUTTON_URL + "\" /></a>");
            Output.WriteLine("          </td>");

            Output.WriteLine("        </tr>");
            Output.WriteLine("      </table>");
            Output.WriteLine("    </td>");
            Output.WriteLine("  </tr>");
            Output.WriteLine();
        }
        /// <summary> Renders the HTML for this element </summary>
        /// <param name="Output"> Textwriter to write the HTML for this element </param>
        /// <param name="Bib"> Object to populate this element from </param>
        /// <param name="Skin_Code"> Code for the current skin </param>
        /// <param name="isMozilla"> Flag indicates if the current browse is Mozilla Firefox (different css choices for some elements)</param>
        /// <param name="popup_form_builder"> Builder for any related popup forms for this element </param>
        /// <param name="Current_User"> Current user, who's rights may impact the way an element is rendered </param>
        /// <param name="CurrentLanguage"> Current user-interface language </param>
        /// <param name="Translator"> Language support object which handles simple translational duties </param>
        /// <param name="Base_URL"> Base URL for the current request </param>
        /// <remarks> This simple element does not append any popup form to the popup_form_builder</remarks>
        public override void Render_Template_HTML(TextWriter Output, SobekCM_Item Bib, string Skin_Code, bool isMozilla, StringBuilder popup_form_builder, User_Object Current_User, Web_Language_Enum CurrentLanguage, Language_Support_Info Translator, string Base_URL )
        {
            // Check that an acronym exists
            if (Acronym.Length == 0)
            {
                const string defaultAcronym = "Enter the rights you give for sharing, repurposing, or remixing your item to other users.  You may also select a creative commons license below.";
                switch (CurrentLanguage)
                {
                    case Web_Language_Enum.English:
                        Acronym = defaultAcronym;
                        break;

                    case Web_Language_Enum.Spanish:
                        Acronym = defaultAcronym;
                        break;

                    case Web_Language_Enum.French:
                        Acronym = defaultAcronym;
                        break;

                    default:
                        Acronym = defaultAcronym;
                        break;
                }
            }

            // render_helper(Output, Bib.Bib_Info.Access_Condition.Text, Skin_Code, isMozilla, Current_User, CurrentLanguage, Translator);

            string id_name = html_element_name.Replace("_", "");

            int actual_cols = cols;
            if (isMozilla)
                actual_cols = cols_mozilla;

            Output.WriteLine("  <!-- " + Title + " Element -->");
            Output.WriteLine("  <tr align=\"left\">");
            Output.WriteLine("    <td width=\"" + LEFT_MARGIN + "px\">&nbsp;</td>");
            if (Read_Only)
            {
                Output.WriteLine("    <td valign=\"top\" class=\"metadata_label\">" + Title + ":</b></td>");
            }
            else
            {
                if (Acronym.Length > 0)
                {
                    Output.WriteLine("    <td valign=\"top\" class=\"metadata_label\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" target=\"_" + html_element_name.ToUpper() + "\"><acronym title=\"" + Acronym + "\">" + Title + ":</acronym></a></td>");
                }
                else
                {
                    Output.WriteLine("    <td valign=\"top\" class=\"metadata_label\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" target=\"_" + html_element_name.ToUpper() + "\">" + Title + ":</a></td>");
                }
            }
            Output.WriteLine("    <td>");
            Output.WriteLine("      <table>");
            Output.WriteLine("        <tr>");
            Output.WriteLine("          <td>");
            Output.WriteLine("            <div id=\"" + html_element_name + "_div\">");
            Output.WriteLine("              <textarea rows=\"" + rows + "\" cols=\"" + actual_cols + "\" name=\"" + id_name + "1\" id=\"" + id_name + "1\" class=\"" + html_element_name + "_input\" onfocus=\"javascript:textbox_enter('" + id_name + "1','" + html_element_name + "_input_focused')\" onblur=\"javascript:textbox_leave('" + id_name + "1','" + html_element_name + "_input')\">" + HttpUtility.HtmlEncode(Bib.Bib_Info.Access_Condition.Text.Trim()) + "</textarea>");
            Output.WriteLine("              <div class=\"ShowOptionsRow\">");
            Output.WriteLine("                <a href=\"\" onclick=\"return open_cc_rights();\"><img src=\"" + baseURL + "design/skins/" + Skin_Code + "/tabs/cLDG.gif\" border=\"0\" class=\"tab_image\" alt=\"\" /><span class=\"tab\">CREATIVE COMMONS</span><img src=\"" + baseURL + "design/skins/" + Skin_Code + "/tabs/cRDG.gif\" border=\"0\" class=\"tab_image\" alt=\"\" /></a>");
            Output.WriteLine("              </div>");
            Output.WriteLine("            </div>");
            Output.WriteLine("          </td>");
            Output.WriteLine("          <td valign=\"bottom\" >");
            Output.WriteLine("            <a target=\"_" + html_element_name.ToUpper() + "\"  title=\"" + Translator.Get_Translation("Get help.", CurrentLanguage) + "\" href=\"" + Help_URL(Skin_Code, Base_URL) + "\" ><img border=\"0px\" class=\"help_button_rightsmgmt\" src=\"" + Base_URL + HELP_BUTTON_URL + "\" /></a>");
            Output.WriteLine("          </td>");
            Output.WriteLine("        </tr>");
            Output.WriteLine("      </table>");
            Output.WriteLine("    </td>");
            Output.WriteLine("  </tr>");
            Output.WriteLine();

            Output.WriteLine("  <tr align=\"left\">");
            Output.WriteLine("    <td colspan=\"2\">&nbsp;</td>");
            Output.WriteLine("    <td>");
            Output.WriteLine("      <table id=\"cc_rights\" cellpadding=\"3px\" cellspacing=\"3px\" style=\"display:none;\">");
            Output.WriteLine("        <tr><td colspan=\"2\">You may also select a <a title=\"Explanation of different creative commons licenses.\" href=\"http://creativecommons.org/about/licenses/\">Creative Commons License</a> option below.<br /></td></tr>");
            Output.WriteLine("        <tr><td> &nbsp; <a href=\"\" onclick=\"return set_cc_rights('rightsmgmt1','[cc0] The author dedicated the work to the Commons by waiving all of his or her rights to the work worldwide under copyright law and all related or neighboring legal rights he or she had in the work, to the extent allowable by law.');\"><img title=\"You dedicate the work to the Commons by waiving all of your rights to the work worldwide under copyright law and all related or neighboring legal rights you had in the work, to the extent allowable by law.\" src=\"" + baseURL + "default/images/cc_zero.png\" /></a></td><td><b>No Copyright</b><br /><i>cc0</i></td></tr>");
            Output.WriteLine("        <tr><td> &nbsp; <a href=\"\" onclick=\"return set_cc_rights('rightsmgmt1','[cc by] This item is licensed with the Creative Commons Attribution License.  This license lets others distribute, remix, tweak, and build upon this work, even commercially, as long as they credit the author for the original creation.');\"><img title=\"This license lets others distribute, remix, tweak, and build upon your work, even commercially, as long as they credit you for the original creation.\" src=\"" + baseURL + "default/images/cc_by.png\" /></a></td><td><b>Attribution</b><br /><i>cc by</i></td></tr>");
            Output.WriteLine("        <tr><td> &nbsp; <a href=\"\" onclick=\"return set_cc_rights('rightsmgmt1','[cc by-sa] This item is licensed with the Creative Commons Attribution Share Alike License.  This license lets others remix, tweak, and build upon this work even for commercial reasons, as long as they credit the author and license their new creations under the identical terms.');\"><img title=\"This license lets others remix, tweak, and build upon your work even for commercial reasons, as long as they credit you and license their new creations under the identical terms.\" src=\"" + baseURL + "default/images/cc_by_sa.png\" /></a></td><td><b>Attribution Share Alike</b><br /><i>cc by-sa</i></td></tr>");
            Output.WriteLine("        <tr><td> &nbsp; <a href=\"\" onclick=\"return set_cc_rights('rightsmgmt1','[cc by-nd] This item is licensed with the Creative Commons Attribution No Derivatives License.  This license allows for redistribution, commercial and non-commercial, as long as it is passed along unchanged and in whole, with credit to the author.');\"><img title=\"This license allows for redistribution, commercial and non-commercial, as long as it is passed along unchanged and in whole, with credit to you.\" src=\"" + baseURL + "default/images/cc_by_nd.png\" /></a></td><td><b>Attribution No Derivatives</b><br /><i>cc by-nd</i></td></tr>");
            Output.WriteLine("        <tr><td> &nbsp; <a href=\"\" onclick=\"return set_cc_rights('rightsmgmt1','[cc by-nc] This item is licensed with the Creative Commons Attribution Non-Commerical License.  This license lets others remix, tweak, and build upon this work non-commercially, and although their new works must also acknowledge the author and be non-commercial, they don’t have to license their derivative works on the same terms.');\"><img title=\"This license lets others remix, tweak, and build upon your work non-commercially, and although their new works must also acknowledge you and be non-commercial, they don’t have to license their derivative works on the same terms.\" src=\"" + baseURL + "default/images/cc_by_nc.png\" /></a></td><td><b>Attribution Non-Commercial</b><br /><i>cc by-nc</i></td></tr>");
            Output.WriteLine("        <tr><td> &nbsp; <a href=\"\" onclick=\"return set_cc_rights('rightsmgmt1','[cc by-nc-sa] This item is licensed with the Creative Commons Attribution Non-Commercial Share Alike License.  This license lets others remix, tweak, and build upon this work non-commercially, as long as they credit the author and license their new creations under the identical terms.');\"><img title=\"This license lets others remix, tweak, and build upon your work non-commercially, as long as they credit you and license their new creations under the identical terms.\" src=\"" + baseURL + "default/images/cc_by_nc_sa.png\" /></a></td><td><b>Attribution Non-Commercial Share Alike</b><br /><i>cc by-nc-sa</i></td></tr>");
            Output.WriteLine("        <tr><td> &nbsp; <a href=\"\" onclick=\"return set_cc_rights('rightsmgmt1','[cc by-nc-nd] This item is licensed with the Creative Commons Attribution Non-Commercial No Derivative License.  This license allows others to download this work and share them with others as long as they mention the author and link back to the author, but they can’t change them in any way or use them commercially.');\"><img title=\"This license allows others to download your works and share them with others as long as they mention you and link back to you, but they can’t change them in any way or use them commercially.\" src=\"" + baseURL + "default/images/cc_by_nc_nd.png\" /></a></td><td><b>Attribution Non-Commercial No Derivatives</b><br /><i>cc by-nc-nd</i></td></tr>");
            Output.WriteLine("      </table>");
            Output.WriteLine("    </td>");
            Output.WriteLine("  </tr>");
            Output.WriteLine("");
        }
        /// <summary> Method helps to render the html for all elements based on textBox_ComboBox_Element class </summary>
        /// <param name="Output"> Output for the generate html for this element </param>
        /// <param name="text_values"> Value(s) for the current digital resource to display in the text box </param>
        /// <param name="select_values"> Value(s) for the current digital resource to display in the combo box</param>
        /// <param name="Skin_Code"> Code for the current html skin </param>
        /// <param name="Current_User"> Current user, who's rights may impact the way an element is rendered </param>
        /// <param name="CurrentLanguage"> Current user-interface language </param>
        /// <param name="Translator"> Language support object which handles simple translational duties </param>
        /// <param name="Base_URL"> Base URL for the current request </param>
        protected void render_helper(TextWriter Output, List<string> text_values, List<string> select_values, string Skin_Code, User_Object Current_User, Web_Language_Enum CurrentLanguage, Language_Support_Info Translator, string Base_URL )
        {
            if (text_values.Count == 0)
            {
                text_values.Add(String.Empty);
                select_values.Add(String.Empty);
            }

            string id_name = html_element_name.Replace("_", "");

            Output.WriteLine("  <!-- " + Title + " Element -->");
            Output.WriteLine("  <tr align=\"left\">");
            Output.WriteLine("    <td width=\"" + LEFT_MARGIN + "px\">&nbsp;</td>");
            if (Acronym.Length > 0)
            {
                Output.WriteLine("    <td valign=\"top\" class=\"metadata_label\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" target=\"_" + html_element_name.ToUpper() + "\"><acronym title=\"" + Acronym + "\">" + Translator.Get_Translation(Title, CurrentLanguage) + ":</acronym></a></td>");
            }
            else
            {
                Output.WriteLine("    <td valign=\"top\" class=\"metadata_label\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" target=\"_" + html_element_name.ToUpper() + "\">" + Translator.Get_Translation(Title, CurrentLanguage) + ":</a></td>");
            }
            Output.WriteLine("    <td>");
            Output.WriteLine("      <table><tr><td>");
            Output.WriteLine("      <div id=\"" + html_element_name + "_div\">");
            for (int i = 1; i <= text_values.Count; i++)
            {
                // Write the text box
                Output.Write("        <input name=\"" + id_name + "_text" + i + "\" id=\"" + id_name + "_text" + i + "\" class=\"" + html_element_name + "_input\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(text_values[i - 1]) + "\" onfocus=\"javascript:textbox_enter('" + id_name + "_text" + i + "','" + html_element_name + "_input_focused')\" onblur=\"javascript:textbox_leave('" + id_name + "_text" + i + "','" + html_element_name + "_input')\" />");

                // If there is a second label, draw that
                if (second_label.Length > 0)
                {
                    Output.WriteLine("<span class=\"metadata_sublabel\">" + Translator.Get_Translation(second_label, CurrentLanguage) + ":</span>");
                }
                else
                {
                    Output.WriteLine();
                }

                // Write the combo box
                Output.WriteLine("        <select class=\"" + html_element_name + "_select\" name=\"" + id_name + "_select" + i + "\" id=\"" + id_name + "_select" + i + "\" onfocus=\"javascript:textbox_enter('" + id_name + "_select" + i + "','" + html_element_name + "_select_focused')\" onblur=\"javascript:selectbox_leave('" + id_name + "_select" + i + "','" + html_element_name + "_select','" + html_element_name + "_select_init')\" >");

                bool found_option = false;
                for ( int j = 0 ; j < possible_select_items_text.Count ; j++ )
                {
                    if ((i < possible_select_items_text.Count) && (possible_select_items_text[j] == select_values[i - 1]))
                    {
                        if (possible_select_items_value.Count > j)
                        {
                            Output.WriteLine("          <option selected=\"selected=\" value=\"" + possible_select_items_value[j] + "\">" + possible_select_items_text[j] + "</option>");
                        }
                        else
                        {
                            Output.WriteLine("          <option selected=\"selected=\" value=\"" + possible_select_items_text[j] + "\">" + possible_select_items_text[j] + "</option>");
                        }
                        found_option = true;
                    }
                    else
                    {
                        if (possible_select_items_value.Count > j)
                        {
                            Output.WriteLine("          <option value=\"" + possible_select_items_value[j] + "\">" + possible_select_items_text[j] + "</option>");
                        }
                        else
                        {
                            Output.WriteLine("          <option value=\"" + possible_select_items_text[j] + "\">" + possible_select_items_text[j] + "</option>");
                        }
                    }
                }

                if (( i <= select_values.Count ) && ( select_values[i-1].Length > 0  ) && ( !Restrict_Values ) && ( !found_option ))
                {
                    Output.WriteLine("          <option value=\"" + select_values[i-1] + "\" selected=\"selected=\">" + select_values[i-1] + "</option>");
                }
                Output.Write("        </select>");

                if (i == text_values.Count )
                {
                    Output.WriteLine();
                    Output.WriteLine("      </div>");
                }
                else
                {
                    Output.WriteLine("<br />");
                }
            }

            Output.WriteLine("    </td>");
            Output.WriteLine("    <td valign=\"bottom\" >");

            if (Repeatable)
            {
                Output.WriteLine("            <a title=\"" + Translator.Get_Translation("Click to add another " + Title.ToLower(), CurrentLanguage) + ".\" href=\"" + Base_URL + "l/technical/javascriptrequired\" onmousedown=\"return add_text_box_select_element('" + html_element_name + "', '" + second_label + "');\"><img border=\"0px\" class=\"repeat_button\" src=\"" + Base_URL + REPEAT_BUTTON_URL + "\" /></a>");
            }
            Output.WriteLine("            <a target=\"_" + html_element_name.ToUpper() + "\"  title=\"" + Translator.Get_Translation("Get help.", CurrentLanguage) + "\" href=\"" + Help_URL(Skin_Code, Base_URL) + "\" ><img border=\"0px\" class=\"help_button\" src=\"" + Base_URL + HELP_BUTTON_URL + "\" /></a>");
            Output.WriteLine("    </td>");
            Output.WriteLine("  </tr></table></td></tr>");

            Output.WriteLine();
        }
        /// <summary> Method helps to render all multiple text box based elements </summary>
        /// <param name="Output"> Output for the generated html for this element </param>
        /// <param name="instance_values"> Value(s) for the current digital resource to display</param>
        /// <param name="Skin_Code"> Code for the current html skin </param>
        /// <param name="Current_User"> Current user, who's rights may impact the way an element is rendered </param>
        /// <param name="CurrentLanguage"> Current user-interface language </param>
        /// <param name="Translator"> Language support object which handles simple translational duties </param>
        /// <param name="Base_URL"> Base URL for the current request </param>
        protected void render_helper(TextWriter Output, ReadOnlyCollection<string> instance_values, string Skin_Code, User_Object Current_User, Web_Language_Enum CurrentLanguage, Language_Support_Info Translator, string Base_URL )
        {
            List<string> allValues = new List<string>();
            allValues.AddRange(instance_values);

            if (allValues.Count == 0)
            {
                render_helper(Output, String.Empty, Skin_Code, Current_User, CurrentLanguage, Translator, Base_URL);
                return;
            }

            if (allValues.Count == 1)
            {
                render_helper(Output, allValues[0], Skin_Code, Current_User, CurrentLanguage, Translator, Base_URL);
                return;
            }

            string id_name = html_element_name.Replace("_", "");

            Output.WriteLine("  <!-- " + Title + " Element -->");
            Output.WriteLine("  <tr>");
            Output.WriteLine("    <td style=\"width:" + LEFT_MARGIN + "px\">&nbsp;</td>");

            if (Acronym.Length > 0)
            {
                Output.WriteLine("    <td class=\"metadata_label\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" target=\"_" + html_element_name.ToUpper() + "\"><acronym title=\"" + Acronym + "\">" + Translator.Get_Translation(Title, CurrentLanguage) + ":</acronym></a></td>");
            }
            else
            {
                Output.WriteLine("    <td class=\"metadata_label\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" target=\"_" + html_element_name.ToUpper() + "\">" + Translator.Get_Translation(Title, CurrentLanguage) + ":</a></td>");
            }

            if (Read_Only)
            {
                Output.Write("    <td>");
                for (int i = 0; i < instance_values.Count; i++)
                {
                    Output.Write(instance_values[i]);
                    if (i < (instance_values.Count - 1))
                        Output.Write("<br />");
                }
                Output.WriteLine("</td>");
            }
            else
            {
                Output.WriteLine("    <td>");
                Output.WriteLine("      <table>");
                Output.WriteLine("        <tr>");
                Output.WriteLine("          <td>");
                Output.WriteLine("            <div id=\"" + html_element_name + "_div\">");
                for (int i = 1; i <= allValues.Count; i++)
                {
                    if (i == allValues.Count)
                    {
                        Output.WriteLine("              <input name=\"" + id_name + i + "\" id=\"" + id_name + i + "\" class=\"" + html_element_name + "_input sbk_Focusable\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(allValues[i - 1].Replace("<i>", "").Replace("</i>", "")) + "\" /></div>");
                    }
                    else
                    {
                        Output.WriteLine("              <input name=\"" + id_name + i + "\" id=\"" + id_name + i + "\" class=\"" + html_element_name + "_input sbk_Focusable\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(allValues[i - 1].Replace("<i>", "").Replace("</i>", "")) + "\" />");
                    }
                }

                Output.WriteLine("          </td>");
                Output.WriteLine("          <td style=\"vertical-align:bottom\" >");

                if (view_choices_string.Length > 0)
                {
                    Output.WriteLine("            " + view_choices_string.Replace("<%WEBSKIN%>", Skin_Code).Replace("<%?URLOPTS%>", "") + "&nbsp; ");
                }

                if ((Repeatable) && (( max_boxes < 0 ) || ( allValues.Count < max_boxes )))
                {
                    Output.WriteLine("          <span id=\"" + html_element_name + "_repeaticon\" name=\"" + html_element_name + "_repeaticon\"><img title=\"" + Translator.Get_Translation("Click to add another " + Title.ToLower(), CurrentLanguage) + ".\" alt=\"+\" class=\"repeat_button\" src=\"" + Base_URL + REPEAT_BUTTON_URL + "\" onmousedown=\"add_new_multi_element('" + html_element_name + "', " + instance_values.Count + "," + max_boxes + "," + boxes_per_line + "); return false;\" /></span>");
                }

                Output.WriteLine("            <a target=\"_" + html_element_name.ToUpper() + "\"  title=\"" + Translator.Get_Translation("Get help.", CurrentLanguage) + "\" href=\"" + Help_URL(Skin_Code, Base_URL) + "\" ><img class=\"help_button\" src=\"" + Base_URL + HELP_BUTTON_URL + "\" /></a>");

                Output.WriteLine("          </td>");
                Output.WriteLine("        </tr>");
                Output.WriteLine("      </table>");
                Output.WriteLine("    </td>");
            }

            Output.WriteLine("  </tr>");
            Output.WriteLine();
        }
        /// <summary> Method helps to render the html for all elements based on textBox_TextBox_Element class </summary>
        /// <param name="Output"> Output for the generate html for this element </param>
        /// <param name="instance_values_text1"> Value(s) for the current digital resource to display in the first text box</param>
        /// <param name="instance_values_text2" >Value(s) for the current digital resource to display in the second text box</param>
        /// <param name="Skin_Code"> Code for the current html skin </param>
        /// <param name="Current_User"> Current user, who's rights may impact the way an element is rendered </param>
        /// <param name="CurrentLanguage"> Current user-interface language </param>
        /// <param name="Translator"> Language support object which handles simple translational duties </param>
        /// <param name="Base_URL"> Base URL for the current request </param>
        protected void render_helper(TextWriter Output, List<string> instance_values_text1, List<string> instance_values_text2, string Skin_Code, User_Object Current_User, Web_Language_Enum CurrentLanguage, Language_Support_Info Translator, string Base_URL )
        {
            if ((instance_values_text1.Count == 0) && ( instance_values_text2.Count == 0 ))
            {
                render_helper(Output, String.Empty, String.Empty, Skin_Code, Current_User, CurrentLanguage, Translator, Base_URL);
                return;
            }

            if ((instance_values_text1.Count == 1) && (instance_values_text2.Count == 1))
            {
                render_helper(Output, instance_values_text1[0], instance_values_text2[0], Skin_Code, Current_User, CurrentLanguage, Translator, Base_URL);
                return;
            }

            string id_name = html_element_name.Replace("_", "");

            Output.WriteLine("  <!-- " + Title.Replace(":","") + " Element -->");
            Output.WriteLine("  <tr align=\"left\">");
            Output.WriteLine("    <td width=\"" + LEFT_MARGIN + "px\">&nbsp;</td>");
            if (Title.IndexOf(":") < 0)
            {
                if (Acronym.Length > 0)
                {
                    Output.WriteLine("    <td valign=\"top\" class=\"metadata_label\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" target=\"_" + html_element_name.ToUpper() + "\"><acronym title=\"" + Acronym + "\">" + Translator.Get_Translation(Title, CurrentLanguage) + ":</acronym></a></td>");
                }
                else
                {
                    Output.WriteLine("    <td valign=\"top\" class=\"metadata_label\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" target=\"_" + html_element_name.ToUpper() + "\">" + Translator.Get_Translation(Title, CurrentLanguage) + ":</a></td>");
                }
            }
            else
            {
                if (Acronym.Length > 0)
                {
                    Output.WriteLine("    <td valign=\"top\" class=\"metadata_label\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" target=\"_" + html_element_name.ToUpper() + "\"><acronym title=\"" + Acronym + "\">" + Translator.Get_Translation(Title, CurrentLanguage) + "</acronym></a></td>");
                }
                else
                {
                    Output.WriteLine("    <td valign=\"top\" class=\"metadata_label\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" target=\"_" + html_element_name.ToUpper() + "\">" + Translator.Get_Translation(Title, CurrentLanguage) + "</a></td>");
                }
            }
            Output.WriteLine("    <td>");

                Output.WriteLine("      <table>");
                Output.WriteLine("        <tr>");
                Output.WriteLine("          <td>");
                Output.WriteLine("            <div id=\"" + html_element_name + "_div\">");

                for (int i = 1; i <= instance_values_text1.Count; i++)
                {
                    // Write the first text
                    if (first_label.Length > 0)
                    {
                        Output.Write("              <span class=\"metadata_sublabel2\">" + Translator.Get_Translation(first_label, CurrentLanguage) + ":</span>");
                    }
                    else
                    {
                        Output.Write("              ");
                    }

                    // Write the first text box
                    Output.Write("<input name=\"" + id_name + "_first" + i + "\" id=\"" + id_name + "_first" + i + "\" class=\"" + html_element_name + "_first_input\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(instance_values_text1[i - 1]) + "\" onfocus=\"javascript:textbox_enter('" + id_name + "_first" + i + "', '" + html_element_name + "_first_input_focused')\" onblur=\"javascript:textbox_leave('" + id_name + "_first" + i + "', '" + html_element_name + "_first_input')\" />");

                    // Write the second text
                    if (second_label.Length > 0)
                    {
                        Output.Write("<span class=\"metadata_sublabel\">" + Translator.Get_Translation(second_label, CurrentLanguage) + ":</span>");
                    }

                    // Write the second text box
                    Output.Write("<input name=\"" + id_name + "_second" + i + "\" id=\"" + id_name + "_second" + i + "\" class=\"" + html_element_name + "_second_input\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(instance_values_text2[i - 1]) + "\" onfocus=\"javascript:textbox_enter('" + id_name + "_second" + i + "', '" + html_element_name + "_second_input_focused')\" onblur=\"javascript:textbox_leave('" + id_name + "_second" + i + "', '" + html_element_name + "_second_input')\" />");
                    Output.WriteLine(i < instance_values_text1.Count ? "<br />" : "</div>");
                }

                Output.WriteLine("          </td>");
                Output.WriteLine("          <td valign=\"bottom\" >");
                if (Repeatable)
                {
                    Output.WriteLine("            <a title=\"" + Translator.Get_Translation("Click to add another " + Title.ToLower(), CurrentLanguage) + ".\" href=\"" + Base_URL + "l/technical/javascriptrequired\" onmousedown=\"return add_two_text_box_element('" + html_element_name + "','" + first_label + "','" + second_label + "');\"><img border=\"0px\" class=\"repeat_button\" src=\"" + Base_URL + REPEAT_BUTTON_URL + "\" /></a>");
                }
                Output.WriteLine("            <a target=\"_" + html_element_name.ToUpper() + "\"  title=\"" + Translator.Get_Translation("Get help.", CurrentLanguage) + "\" href=\"" + Help_URL(Skin_Code, Base_URL) + "\" ><img border=\"0px\" class=\"help_button\" src=\"" + Base_URL + HELP_BUTTON_URL + "\" /></a>");
                Output.WriteLine("          </td>"); Output.WriteLine("        </tr>");
                Output.WriteLine("      </table>");

            Output.WriteLine("    </td>");
            Output.WriteLine("  </tr>");
            Output.WriteLine();
        }
        /// <summary> Method helps to render all simple text area based elements </summary>
        /// <param name="Output"> Output for the generated html for this element </param>
        /// <param name="instance_value"> Value for the current digital resource to display </param>
        /// <param name="Skin_Code"> Code for the current html skin </param>
        /// <param name="isMozilla"> Flag indicates if the browser is Mozilla Firefox</param>
        /// <param name="Current_User"> Current user, who's rights may impact the way an element is rendered </param>
        /// <param name="CurrentLanguage"> Current user-interface language </param>
        /// <param name="Translator"> Language support object which handles simple translational duties </param>
        /// <param name="Base_URL"> Base URL for the current request </param>
        protected void render_helper(TextWriter Output, string instance_value, string Skin_Code, bool isMozilla, User_Object Current_User, Web_Language_Enum CurrentLanguage, Language_Support_Info Translator, string Base_URL)
        {
            string id_name = html_element_name.Replace("_", "");

            int actual_cols = cols;
            if (isMozilla)
                actual_cols = cols_mozilla;

            Output.WriteLine("  <!-- " + Title + " Element -->");
            Output.WriteLine("  <tr align=\"left\">");
            Output.WriteLine("    <td width=\"" + LEFT_MARGIN + "px\">&nbsp;</td>");
            if (Read_Only)
            {
                Output.WriteLine("    <td valign=\"top\" class=\"metadata_label\">" + Translator.Get_Translation(Title, CurrentLanguage) + ":</b></td>");
            }
            else
            {
                if (Acronym.Length > 0)
                {
                    Output.WriteLine("    <td valign=\"top\" class=\"metadata_label\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" target=\"_" + html_element_name.ToUpper() + "\"><acronym title=\"" + Acronym + "\">" + Translator.Get_Translation(Title, CurrentLanguage) + ":</acronym></a></td>");
                }
                else
                {
                    Output.WriteLine("    <td valign=\"top\" class=\"metadata_label\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" target=\"_" + html_element_name.ToUpper() + "\">" + Translator.Get_Translation(Title, CurrentLanguage) + ":</a></td>");
                }
            }
            Output.WriteLine("    <td>");
            const int i = 1;

            Output.WriteLine("      <table>");
            Output.WriteLine("        <tr>");
            Output.WriteLine("          <td>");
            Output.WriteLine("            <div id=\"" + html_element_name + "_div\">");
            Output.WriteLine("              <textarea rows=\"" + rows + "\" cols=\"" + actual_cols + "\" name=\"" + id_name + i + "\" id=\"" + id_name + i + "\" class=\"" + html_element_name + "_input\" onfocus=\"javascript:textbox_enter('" + id_name + i + "','" + html_element_name + "_input_focused')\" onblur=\"javascript:textbox_leave('" + id_name + i + "','" + html_element_name + "_input')\">" + HttpUtility.HtmlEncode(instance_value) + "</textarea></div>");
            Output.WriteLine("            </div>");
            Output.WriteLine("          </td>");
            Output.WriteLine("          <td valign=\"bottom\" >");
            if (Repeatable)
            {
                Output.WriteLine("            <a title=\"" + Translator.Get_Translation("Click to add another " + Title.ToLower(), CurrentLanguage) + ".\" href=\"" + Base_URL + "l/technical/javascriptrequired\" onmousedown=\"return " + html_element_name + "_add_new_item();\"><img border=\"0px\" class=\"repeat_button\" src=\"" + Base_URL + REPEAT_BUTTON_URL + "\" /></a>");
            }

            Output.WriteLine("            <a target=\"_" + html_element_name.ToUpper() + "\"  title=\"" + Translator.Get_Translation("Get help.", CurrentLanguage) + "\" href=\"" + Help_URL(Skin_Code, Base_URL) + "\" ><img border=\"0px\" class=\"help_button\" src=\"" + Base_URL + HELP_BUTTON_URL + "\" /></a>");
            Output.WriteLine("          </td>");
            Output.WriteLine("        </tr>");
            Output.WriteLine("      </table>");

            Output.WriteLine("    </td>");
            Output.WriteLine("  </tr>");
            Output.WriteLine();
        }
        /// <summary> Renders the HTML for this element </summary>
        /// <param name="Output"> Textwriter to write the HTML for this element </param>
        /// <param name="Bib"> Object to populate this element from </param>
        /// <param name="Skin_Code"> Code for the current skin </param>
        /// <param name="isMozilla"> Flag indicates if the current browse is Mozilla Firefox (different css choices for some elements)</param>
        /// <param name="popup_form_builder"> Builder for any related popup forms for this element </param>
        /// <param name="Current_User"> Current user, who's rights may impact the way an element is rendered </param>
        /// <param name="CurrentLanguage"> Current user-interface language </param>
        /// <param name="Translator"> Language support object which handles simple translational duties </param>
        /// <param name="Base_URL"> Base URL for the current request </param>
        /// <remarks> This simple element does not append any popup form to the popup_form_builder</remarks>
        public override void Render_Template_HTML(TextWriter Output, SobekCM_Item Bib, string Skin_Code, bool isMozilla, StringBuilder popup_form_builder, User_Object Current_User, Web_Language_Enum CurrentLanguage, Language_Support_Info Translator, string Base_URL )
        {
            // Check that an acronym exists
            if (Acronym.Length == 0)
            {
                const string defaultAcronym = "Enter your abstract here. If your material does not have an abstract, you may include a summary of your document here.";
                switch (CurrentLanguage)
                {
                    case Web_Language_Enum.English:
                        Acronym = defaultAcronym;
                        break;

                    case Web_Language_Enum.Spanish:
                        Acronym = defaultAcronym;
                        break;

                    case Web_Language_Enum.French:
                        Acronym = defaultAcronym;
                        break;

                    default:
                        Acronym = defaultAcronym;
                        break;
                }
            }

            // Determine the columns for this text area, based on browser
            int actual_cols = cols;
            if (isMozilla)
                actual_cols = colsMozilla;

            string id_name = html_element_name.Replace("_", "");

            Output.WriteLine("  <!-- " + Title + " Element -->");
            Output.WriteLine("  <tr align=\"left\">");
            Output.WriteLine("    <td width=\"" + LEFT_MARGIN + "px\">&nbsp;</td>");
            if (Acronym.Length > 0)
            {
                Output.WriteLine("    <td valign=\"top\" class=\"metadata_label\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" target=\"_" + html_element_name.ToUpper() + "\"><acronym title=\"" + Acronym + "\">" + Translator.Get_Translation(Title, CurrentLanguage) + ":</acronym></a></td>");
            }
            else
            {
                Output.WriteLine("    <td valign=\"top\" class=\"metadata_label\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" target=\"_" + html_element_name.ToUpper() + "\">" + Translator.Get_Translation(Title, CurrentLanguage) + ":</a></td>");
            }
            Output.WriteLine("    <td>");
            Output.WriteLine("      <table>");
            Output.WriteLine("        <tr align=\"left\">");
            Output.WriteLine("          <td>");
            Output.WriteLine("            <div id=\"" + html_element_name + "_div\">");

            if (Bib.Bib_Info.Abstracts_Count == 0)
            {
                Output.WriteLine("              <div id=\"" + html_element_name + "_topdiv1\">");
                Output.WriteLine("                <span class=\"metadata_sublabel2\">" + Translator.Get_Translation("Type", CurrentLanguage) +":</span>");
                Output.WriteLine("                <select class=\"" + html_element_name + "_type\" name=\"" + id_name + "_type1\" id=\"" + id_name + "_type1\" onfocus=\"javascript:textbox_enter('" + id_name + "_type1','" + html_element_name + "_type_focused')\" onblur=\"javascript:textbox_leave('" + id_name + "_type1','" + html_element_name + "_type')\" >");
                Output.WriteLine("                  <option selected=\"selected=\" value=\"\"></option>");
                Output.WriteLine("                  <option value=\"abstract\">Abstract</option>");
                Output.WriteLine("                  <option value=\"content\">Content Advice</option>");
                Output.WriteLine("                  <option value=\"review\">Review</option>");
                Output.WriteLine("                  <option value=\"scope\">Scope and Content</option>");
                Output.WriteLine("                  <option value=\"subject\">Subject</option>");
                Output.WriteLine("                  <option value=\"summary\">Summary</option>");
                Output.WriteLine("                </select>");

                Output.WriteLine("                <span class=\"metadata_sublabel\">" + Translator.Get_Translation("Language", CurrentLanguage) + ":</span>");
                Output.WriteLine("                <input name=\"" + id_name + "_language1\" id=\"" + id_name + "_language1\" class=\"" + html_element_name + "_language\" type=\"text\" value=\"\" onfocus=\"javascript:textbox_enter('" + id_name + "_language1', '" + html_element_name + "_language_focused')\" onblur=\"javascript:textbox_leave('" + id_name + "_language1', '" + html_element_name + "_language')\" />");
                Output.WriteLine("              </div>");
                Output.WriteLine("              <textarea rows=\"" + Rows + "\" cols=\"" + actual_cols + "\" name=\"" + id_name + "_textarea1\" id=\"" + id_name + "_textarea1\" class=\"" + html_element_name + "_input\" onfocus=\"javascript:textbox_enter('" + id_name + "_textarea1','" + html_element_name + "_input_focused')\" onblur=\"javascript:textbox_leave('" + id_name + "_textarea1','" + html_element_name + "_input')\"></textarea>");
            }
            else
            {
                int i = 1;
                foreach (Abstract_Info thisAbstract in Bib.Bib_Info.Abstracts)
                {
                    Output.WriteLine("              <div id=\"" + html_element_name + "_topdiv" + i + "\">");
                    Output.WriteLine("                <span class=\"metadata_sublabel2\">Type:</span>");
                    Output.WriteLine("                <select class=\"" + html_element_name + "_type\" name=\"" + id_name + "_type" + i + "\" id=\"" + id_name + "_type" + i + "\" onfocus=\"javascript:textbox_enter('" + id_name + "_type" + i + "','" + html_element_name + "_type_focused')\" onblur=\"javascript:textbox_leave('" + id_name + "_type" + i + "','" + html_element_name + "_type')\" >");
                    Output.WriteLine("                  <option value=\"\"></option>");

                    Output.WriteLine(thisAbstract.Type.ToLower() != "abstract"
                                         ? "                  <option value=\"abstract\">Abstract</option>"
                                         : "                  <option value=\"abstract\" selected=\"selected\">Abstract</option>");

                    Output.WriteLine(thisAbstract.Type.ToLower() != "content advice"
                                         ? "                  <option value=\"content\">Content Advice</option>"
                                         : "                  <option value=\"content\" selected=\"selected\">Content Advice</option>");

                    Output.WriteLine(thisAbstract.Type.ToLower() != "review"
                                         ? "                  <option value=\"review\">Review</option>"
                                         : "                  <option value=\"review\" selected=\"selected\">Review</option>");

                    Output.WriteLine(thisAbstract.Type.ToLower() != "scope and content"
                                         ? "                  <option value=\"scope\">Scope and Content</option>"
                                         : "                  <option value=\"scope\" selected=\"selected\">Scope and Content</option>");

                    Output.WriteLine(thisAbstract.Type.ToLower() != "subject"
                                         ? "                  <option value=\"subject\">Subject</option>"
                                         : "                  <option value=\"subject\" selected=\"selected\">Subject</option>");

                    Output.WriteLine(thisAbstract.Type.ToLower() != "summary"
                                         ? "                  <option value=\"summary\">Summary</option>"
                                         : "                  <option value=\"summary\" selected=\"selected\">Summary</option>");

                    Output.WriteLine("                </select>");

                    Output.WriteLine("                <span class=\"metadata_sublabel\">Language:</span>");
                    Output.WriteLine("                <input name=\"" + id_name + "_language1\" id=\"" + id_name + "_language1\" class=\"" + html_element_name + "_language\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(thisAbstract.Language) + "\" onfocus=\"javascript:textbox_enter('" + id_name + "_language1', '" + html_element_name + "_language_focused')\" onblur=\"javascript:textbox_leave('" + id_name + "_language1', '" + html_element_name + "_language')\" />");
                    Output.WriteLine("              </div>");
                    Output.Write("              <textarea rows=\"" + Rows + "\" cols=\"" + actual_cols + "\" name=\"" + id_name + "_textarea" + i + "\" id=\"" + id_name + "_textarea" + i + "\" class=\"" + html_element_name + "_input\" onfocus=\"javascript:textbox_enter('" + id_name + "_textarea" + i + "','" + html_element_name + "_input_focused')\" onblur=\"javascript:textbox_leave('" + id_name + "_textarea" + i + "','" + html_element_name + "_input')\">" + HttpUtility.HtmlEncode(thisAbstract.Abstract_Text) + "</textarea>");

                    if ( i < Bib.Bib_Info.Notes_Count )
                    {
                        Output.WriteLine("<br />");
                    }
                    else
                    {
                        Output.WriteLine();
                    }

                    i++;
                }
            }

            Output.WriteLine("            </div>");
            Output.WriteLine("          </td>");

            Output.WriteLine("          <td valign=\"bottom\" >");
            if (Repeatable)
            {
                Output.WriteLine("            <a title=\"" + Translator.Get_Translation("Click to add a new abstract", CurrentLanguage) + ".\" href=\"" + Base_URL + "l/technical/javascriptrequired\" onmousedown=\"return add_complex_abstract('" + Rows + "','" + actual_cols + "');\"><img border=\"0px\" class=\"repeat_button\" src=\"" + Base_URL + REPEAT_BUTTON_URL + "\" /></a>");
            }

            Output.WriteLine("            <a target=\"_" + html_element_name.ToUpper() + "\"  title=\"" + Translator.Get_Translation("Get help.", CurrentLanguage) + "\" href=\"" + Help_URL(Skin_Code, Base_URL) + "\" ><img border=\"0px\" class=\"help_button\" src=\"" + Base_URL + HELP_BUTTON_URL + "\" /></a>");

            Output.WriteLine("          </td>");

            Output.WriteLine("        </tr>");
            Output.WriteLine("      </table>");
            Output.WriteLine("    </td>");
            Output.WriteLine("  </tr>");
            Output.WriteLine();
        }
        /// <summary> Method helps to render all simple text area based elements </summary>
        /// <param name="Output"> Output for the generated html for this element </param>
        /// <param name="instance_values"> Value(s) for the current digital resource to display </param>
        /// <param name="Skin_Code"> Code for the current html skin </param>
        /// <param name="isMozilla"> Flag indicates if the browser is Mozilla Firefox</param>
        /// <param name="Current_User"> Current user, who's rights may impact the way an element is rendered </param>
        /// <param name="CurrentLanguage"> Current user-interface language </param>
        /// <param name="Translator"> Language support object which handles simple translational duties </param>
        /// <param name="Base_URL"> Base URL for the current request </param>
        protected void render_helper(TextWriter Output, List<string> instance_values, string Skin_Code, bool isMozilla, User_Object Current_User, Web_Language_Enum CurrentLanguage, Language_Support_Info Translator, string Base_URL)
        {
            List<string> allValues = new List<string>();
            allValues.AddRange(defaultValues);
            allValues.AddRange(instance_values);

            if (allValues.Count == 0)
            {
                render_helper(Output, String.Empty, Skin_Code, isMozilla, Current_User, CurrentLanguage, Translator, Base_URL);
                return;
            }

            if (allValues.Count == 1)
            {
                render_helper(Output, allValues[0], Skin_Code, isMozilla, Current_User, CurrentLanguage, Translator, Base_URL);
                return;
            }

            // Determine the columns for this text area, based on browser
            int actual_cols = cols;
            if (isMozilla)
                actual_cols = cols_mozilla;

            string id_name = html_element_name.Replace("_", "");

            Output.WriteLine("  <!-- " + Title + " Element -->");
            Output.WriteLine("  <tr align=\"left\">");
            Output.WriteLine("    <td width=\"" + LEFT_MARGIN + "px\">&nbsp;</td>");
            if (Acronym.Length > 0)
            {
                Output.WriteLine("    <td valign=\"top\" class=\"metadata_label\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" target=\"_" + html_element_name.ToUpper() + "\"><acronym title=\"" + Acronym + "\">" + Translator.Get_Translation(Title, CurrentLanguage) + ":</acronym></a></td>");
            }
            else
            {
                Output.WriteLine("    <td valign=\"top\" class=\"metadata_label\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" target=\"_" + html_element_name.ToUpper() + "\">" + Translator.Get_Translation(Title, CurrentLanguage) + ":</a></td>");
            }
            Output.WriteLine("    <td>");

            Output.WriteLine("      <table>");
            Output.WriteLine("        <tr>");
            Output.WriteLine("          <td>");
            Output.WriteLine("            <div id=\"" + html_element_name + "_div\">");
            for (int i = 0; i < allValues.Count; i++)
            {
                if (i == allValues.Count - 1)
                {
                    Output.WriteLine("              <textarea rows=\"" + rows + "\" cols=\"" + actual_cols + "\" name=\"" + id_name + i + "\" id=\"" + id_name + i + "\" class=\"" + html_element_name + "_input\" onfocus=\"javascript:textbox_enter('" + id_name + i + "','" + html_element_name + "_input_focused')\" onblur=\"javascript:textbox_leave('" + id_name + i + "','" + html_element_name + "_input')\">" + HttpUtility.HtmlEncode(allValues[i]) + "</textarea></div>");
                }
                else
                {
                    Output.WriteLine("              <textarea rows=\"" + rows + "\" cols=\"" + actual_cols + "\" name=\"" + id_name + i + "\" id=\"" + id_name + i + "\" class=\"" + html_element_name + "_input\" onfocus=\"javascript:textbox_enter('" + id_name + i + "','" + html_element_name + "_input_focused')\" onblur=\"javascript:textbox_leave('" + id_name + i + "','" + html_element_name + "_input')\">" + HttpUtility.HtmlEncode(allValues[i]) + "</textarea><br />");
                }
            }
            Output.WriteLine("            </div>");
            Output.WriteLine("          </td>");
            Output.WriteLine("          <td valign=\"bottom\" >");
            if (Repeatable)
            {
                Output.WriteLine("            <a title=\"" + Translator.Get_Translation("Click to add another " + Title.ToLower(), CurrentLanguage) + ".\" href=\"" + Base_URL + "l/technical/javascriptrequired\" onmousedown=\"return " + html_element_name + "_add_new_item();\"><img border=\"0px\" class=\"repeat_button\" src=\"" + Base_URL + REPEAT_BUTTON_URL + "\" /></a>");
            }

            Output.WriteLine("            <a target=\"_" + html_element_name.ToUpper() + "\"  title=\"" + Translator.Get_Translation("Get help.", CurrentLanguage) + "\" href=\"" + Help_URL(Skin_Code, Base_URL) + "\" ><img border=\"0px\" class=\"help_button\" src=\"" + Base_URL + HELP_BUTTON_URL + "\" /></a>");

            Output.WriteLine("          </td>");
            Output.WriteLine("        </tr>");
            Output.WriteLine("      </table>");

            Output.WriteLine("    </td>");
            Output.WriteLine("  </tr>");
            Output.WriteLine();
        }
        /// <summary> Renders the HTML for this element </summary>
        /// <param name="Output"> Textwriter to write the HTML for this element </param>
        /// <param name="Bib"> Object to populate this element from </param>
        /// <param name="Skin_Code"> Code for the current skin </param>
        /// <param name="IsMozilla"> Flag indicates if the current browse is Mozilla Firefox (different css choices for some elements)</param>
        /// <param name="PopupFormBuilder"> Builder for any related popup forms for this element </param>
        /// <param name="Current_User"> Current user, who's rights may impact the way an element is rendered </param>
        /// <param name="CurrentLanguage"> Current user-interface language </param>
        /// <param name="Translator"> Language support object which handles simple translational duties </param>
        /// <param name="Base_URL"> Base URL for the current request </param>
        /// <remarks> This element appends a popup form to the popup_form_builder</remarks>
        public override void Render_Template_HTML(TextWriter Output, SobekCM_Item Bib, string Skin_Code, bool IsMozilla, StringBuilder PopupFormBuilder, User_Object Current_User, Web_Language_Enum CurrentLanguage, Language_Support_Info Translator, string Base_URL )
        {
            // Check that an acronym exists
            if (Acronym.Length == 0)
            {
                const string defaultAcronym = "Enter serial hierarchy information which explains how this volume related to the larger body of work.";
                switch (CurrentLanguage)
                {
                    case Web_Language_Enum.English:
                        Acronym = defaultAcronym;
                        break;

                    case Web_Language_Enum.Spanish:
                        Acronym = defaultAcronym;
                        break;

                    case Web_Language_Enum.French:
                        Acronym = defaultAcronym;
                        break;

                    default:
                        Acronym = defaultAcronym;
                        break;
                }
            }

            Output.WriteLine("  <!-- " + Title + " Form Element -->");
            Output.WriteLine("  <tr>");
            Output.WriteLine("    <td style=\"width:" + LEFT_MARGIN + "px\">&nbsp;</td>");
            if (Acronym.Length > 0)
            {
                Output.WriteLine("    <td class=\"metadata_label\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" target=\"_" + html_element_name.ToUpper() + "\"><acronym title=\"" + Acronym + "\">" + Translator.Get_Translation(Title, CurrentLanguage) + ":</acronym></a></td>");
            }
            else
            {
                Output.WriteLine("    <td class=\"metadata_label\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" target=\"_" + html_element_name.ToUpper() + "\">" + Translator.Get_Translation(Title, CurrentLanguage) + ":</a></td>");
            }

            Output.WriteLine("    <td>");
            Output.WriteLine("      <table>");
            Output.WriteLine("        <tr>");
            Output.WriteLine("          <td>");
            Output.WriteLine("            <div id=\"" + html_element_name + "_div\">");
            string serial_hierarchy_string = show_hierarchy_value(Bib.Behaviors.Serial_Info);
            if (serial_hierarchy_string.Length == 0)
            {
                Output.WriteLine("              <a title=\"Click to edit the serial hierarchy\" href=\"" + Base_URL + "l/technical/javascriptrequired\" onfocus=\"link_focused2('form_serial_hierarchy_term')\" onblur=\"return link_blurred2('form_serial_hierarchy_term')\" onkeypress=\"return popup_keypress_focus('form_serial_hierarchy', 'form_serialhierarchy_enum1text', '" + IsMozilla.ToString() + "' );\" onclick=\"return popup_focus('form_serial_hierarchy', 'form_serialhierarchy_enum1text' );\"><div class=\"form_linkline_empty form_serial_hierarchy_line\" id=\"form_serial_hierarchy_term\"><i>Empty Serial Hierarchy</i></div></a>");
            }
            else
            {
                Output.WriteLine("              <a title=\"Click to edit the serial hierarchy\" href=\"" + Base_URL + "l/technical/javascriptrequired\" onfocus=\"link_focused2('form_serial_hierarchy_term')\" onblur=\"link_blurred2('form_serial_hierarchy_term')\" onkeypress=\"return popup_keypress_focus('form_serial_hierarchy', 'form_serialhierarchy_enum1text', '" + IsMozilla.ToString() + "' );\" onclick=\"return popup_focus('form_serial_hierarchy', 'form_serialhierarchy_enum1text' );\"><div class=\"form_linkline form_serial_hierarchy_line\" id=\"form_serial_hierarchy_term\">" + serial_hierarchy_string + "</div></a>");
            }
            Output.WriteLine("            </div>");
            Output.WriteLine("          </td>");
            Output.WriteLine("          <td style=\"vertical-align:bottom\" >");
            Output.WriteLine("            <a target=\"_" + html_element_name.ToUpper() + "\"  title=\"" + Translator.Get_Translation("Get help.", CurrentLanguage) + "\" href=\"" + Help_URL(Skin_Code, Base_URL) + "\" ><img class=\"help_button\" src=\"" + Base_URL + HELP_BUTTON_URL + "\" /></a>");
            Output.WriteLine("          </td>");
            Output.WriteLine("        </tr>");
            Output.WriteLine("      </table>");
            Output.WriteLine("    </td>");
            Output.WriteLine("  </tr>");
            Output.WriteLine();

            // Determine which is primary, the enumeration or chronology.
            bool enum_primary = true;
            if ( Bib.Behaviors.Serial_Info.Count > 0)
            {
                if ( Bib.Bib_Info.Series_Part_Info.Year == Bib.Behaviors.Serial_Info[0].Display)
                {
                    enum_primary = false;
                }
            }
            else
            {
                // If no default, set it by type
                if (Bib.Bib_Info.SobekCM_Type == TypeOfResource_SobekCM_Enum.Newspaper )
                {
                    enum_primary = false;
                }
            }

            // Add the popup form
            PopupFormBuilder.AppendLine("<!-- Serial Hierarchy Form -->");
            PopupFormBuilder.AppendLine("<div class=\"serial_hierarchy_popup_div sbkMetadata_PopupDiv\" id=\"form_serial_hierarchy\" style=\"display:none;\">");
            PopupFormBuilder.AppendLine("  <div class=\"sbkMetadata_PopupTitle\"><table style=\"width:100%\"><tr><td style=\"text-align:left\">Edit Serial Hierarchy</td><td style=\"text-align:right\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" alt=\"HELP\" target=\"_" + html_element_name.ToUpper() + "\" >?</a> &nbsp; <a href=\"#template\" alt=\"CLOSE\" onclick=\"close_serial_hierarchy()\">X</a> &nbsp; </td></tr></table></div>");
            PopupFormBuilder.AppendLine("  <br />");
            PopupFormBuilder.AppendLine("  <table class=\"sbkMetadata_PopupTable\">");

            // Add the Enumeration Information title
            PopupFormBuilder.AppendLine("    <tr><td colspan=\"4\" class=\"SobekEditItemSectionTitle_first\" >Enumeration Information</td></tr>");

            // Add the enumeration as primary radio button
            PopupFormBuilder.Append("    <tr><td colspan=\"2\"> &nbsp; &nbsp; <input type=\"radio\" id=\"form_serialhierarchy_primary_enum\" name=\"form_serialhierarchy_primary\" value=\"enum\"");
            if (enum_primary)
                PopupFormBuilder.Append(" checked=\"checked\"");
            PopupFormBuilder.AppendLine(" onclick=\"focus_element( 'form_serialhierarchy_enum1text');\" /> <label for=\"form_serialhierarchy_primary_enum\">Primary</label> </td><td><span style=\"color:Gray;padding-left:55px;\">Display Text</span></td><td><span style=\"color:Gray;\"> &nbsp; Display Order</span></td></tr>");

            // determine the first enumeration data
            string enum1 = Bib.Bib_Info.Series_Part_Info.Enum1;
            if (Bib.Bib_Info.Series_Part_Info.Enum1.ToUpper().Replace(" ", "").Replace(".", "") == Bib.Bib_Info.Main_Title.Title.ToUpper().Replace(" ", "").Replace(".", ""))
                enum1 = "[TITLE]";

            // Add the rows of enumeration data
            PopupFormBuilder.Append("    <tr><td style=\"width:90px\">&nbsp;</td><td style=\"width:100px\">(Volume):</td>");
            PopupFormBuilder.Append("<td><input type=\"text\" class=\"form_serialhierarchy_text_input sbk_Focusable\" id=\"form_serialhierarchy_enum1text\" name=\"form_serialhierarchy_enum1text\" value=\"" + HttpUtility.HtmlEncode(enum1) + "\" ></td>");
            if ( Bib.Bib_Info.Series_Part_Info.Enum1_Index >= 0 )
                PopupFormBuilder.AppendLine("<td><input type=\"text\" class=\"form_serialhierarchy_order_input sbk_Focusable\" id=\"form_serialhierarchy_enum1order\" name=\"form_serialhierarchy_enum1order\" value=\"" + HttpUtility.HtmlEncode(Bib.Bib_Info.Series_Part_Info.Enum1_Index.ToString()) + "\" ></td></tr>");
            else
                PopupFormBuilder.AppendLine("<td><input type=\"text\" class=\"form_serialhierarchy_order_input sbk_Focusable\" id=\"form_serialhierarchy_enum1order\" name=\"form_serialhierarchy_enum1order\" value=\"\" ></td></tr>");

            PopupFormBuilder.Append("    <tr><td>&nbsp;</td><td>(Issue):</td>");
            PopupFormBuilder.Append("<td><input type=\"text\" class=\"form_serialhierarchy_text_input sbk_Focusable\" id=\"form_serialhierarchy_enum2text\" name=\"form_serialhierarchy_enum2text\" value=\"" + HttpUtility.HtmlEncode(Bib.Bib_Info.Series_Part_Info.Enum2) + "\" ></td>");
            if (Bib.Bib_Info.Series_Part_Info.Enum2_Index >= 0)
                PopupFormBuilder.AppendLine("<td><input type=\"text\" class=\"form_serialhierarchy_order_input sbk_Focusable\" id=\"form_serialhierarchy_enum2order\" name=\"form_serialhierarchy_enum2order\" value=\"" + HttpUtility.HtmlEncode(Bib.Bib_Info.Series_Part_Info.Enum2_Index.ToString()) + "\" ></td></tr>");
            else
                PopupFormBuilder.AppendLine("<td><input type=\"text\" class=\"form_serialhierarchy_order_input sbk_Focusable\" id=\"form_serialhierarchy_enum2order\" name=\"form_serialhierarchy_enum2order\" value=\"\" ></td></tr>");

            PopupFormBuilder.Append("    <tr><td>&nbsp;</td><td>(Part):</td>");
            PopupFormBuilder.Append("<td><input type=\"text\" class=\"form_serialhierarchy_text_input sbk_Focusable\" id=\"form_serialhierarchy_enum3text\" name=\"form_serialhierarchy_enum3text\" value=\"" + HttpUtility.HtmlEncode(Bib.Bib_Info.Series_Part_Info.Enum3) + "\" ></td>");
            if (Bib.Bib_Info.Series_Part_Info.Enum3_Index >= 0)
                PopupFormBuilder.AppendLine("<td><input type=\"text\" class=\"form_serialhierarchy_order_input sbk_Focusable\" id=\"form_serialhierarchy_enum3order\" name=\"form_serialhierarchy_enum3order\" value=\"" + HttpUtility.HtmlEncode(Bib.Bib_Info.Series_Part_Info.Enum3_Index.ToString()) + "\" ></td></tr>");
            else
                PopupFormBuilder.AppendLine("<td><input type=\"text\" class=\"form_serialhierarchy_order_input sbk_Focusable\" id=\"form_serialhierarchy_enum3order\" name=\"form_serialhierarchy_enum3order\" value=\"\" ></td></tr>");

            // Add the Chronological Information title
            PopupFormBuilder.AppendLine("    <tr><td colspan=\"4\" class=\"SobekEditItemSectionTitle sbk_Focusable\" >Chronological Information</td></tr>");

            // Add the chronology as primary radio button
            PopupFormBuilder.Append("    <tr><td colspan=\"2\"> &nbsp; &nbsp; <input type=\"radio\" id=\"form_serialhierarchy_primary_chrono\" name=\"form_serialhierarchy_primary\" value=\"chrono\"");
            if (!enum_primary)
                PopupFormBuilder.Append(" checked=\"checked\"");
            PopupFormBuilder.AppendLine(" onclick=\"focus_element( 'form_serialhierarchy_chrono1text');\" /> <label for=\"form_serialhierarchy_primary_chrono\">Primary</label> </td><td><span style=\"color:Gray;padding-left:55px;\">Display Text</span></td><td><span style=\"color:Gray;\"> &nbsp; Display Order</span></td></tr>");

            // Add the rows of chronological data
            PopupFormBuilder.Append("    <tr><td>&nbsp;</td><td>Year:</td>");
            PopupFormBuilder.Append("<td><input type=\"text\" class=\"form_serialhierarchy_text_input sbk_Focusable\" id=\"form_serialhierarchy_chrono1text\" name=\"form_serialhierarchy_chrono1text\" value=\"" + HttpUtility.HtmlEncode(Bib.Bib_Info.Series_Part_Info.Year) + "\" ></td>");
            if (Bib.Bib_Info.Series_Part_Info.Year_Index >= 0)
                PopupFormBuilder.AppendLine("<td><input type=\"text\" class=\"form_serialhierarchy_order_input sbk_Focusable\" id=\"form_serialhierarchy_chrono1order\" name=\"form_serialhierarchy_chrono1order\" value=\"" + HttpUtility.HtmlEncode(Bib.Bib_Info.Series_Part_Info.Year_Index.ToString()) + "\" ></td></tr>");
            else
                PopupFormBuilder.AppendLine("<td><input type=\"text\" class=\"form_serialhierarchy_order_input sbk_Focusable\" id=\"form_serialhierarchy_chrono1order\" name=\"form_serialhierarchy_chrono1order\" value=\"\" ></td></tr>");

            PopupFormBuilder.Append("    <tr><td>&nbsp;</td><td>(Month):</td>");
            PopupFormBuilder.Append("<td><input type=\"text\" class=\"form_serialhierarchy_text_input sbk_Focusable\" id=\"form_serialhierarchy_chrono2text\" name=\"form_serialhierarchy_chrono2text\" value=\"" + HttpUtility.HtmlEncode(Bib.Bib_Info.Series_Part_Info.Month) + "\" ></td>");
            if (Bib.Bib_Info.Series_Part_Info.Month_Index >= 0)
                PopupFormBuilder.AppendLine("<td><input type=\"text\" class=\"form_serialhierarchy_order_input sbk_Focusable\" id=\"form_serialhierarchy_chrono2order\" name=\"form_serialhierarchy_chrono2order\" value=\"" + HttpUtility.HtmlEncode(Bib.Bib_Info.Series_Part_Info.Month_Index.ToString()) + "\" ></td></tr>");
            else
                PopupFormBuilder.AppendLine("<td><input type=\"text\" class=\"form_serialhierarchy_order_input sbk_Focusable\" id=\"form_serialhierarchy_chrono2order\" name=\"form_serialhierarchy_chrono2order\" value=\"\" ></td></tr>");

            PopupFormBuilder.Append("    <tr><td>&nbsp;</td><td>(Day):</td>");
            PopupFormBuilder.Append("<td><input type=\"text\" class=\"form_serialhierarchy_text_input sbk_Focusable\" id=\"form_serialhierarchy_chrono3text\" name=\"form_serialhierarchy_chrono3text\" value=\"" + HttpUtility.HtmlEncode(Bib.Bib_Info.Series_Part_Info.Day) + "\" ></td>");
            if (Bib.Bib_Info.Series_Part_Info.Day_Index >= 0)
                PopupFormBuilder.AppendLine("<td><input type=\"text\" class=\"form_serialhierarchy_order_input sbk_Focusable\" id=\"form_serialhierarchy_chrono3order\" name=\"form_serialhierarchy_chrono3order\" value=\"" + HttpUtility.HtmlEncode(Bib.Bib_Info.Series_Part_Info.Day_Index.ToString()) + "\" ></td></tr>");
            else
                PopupFormBuilder.AppendLine("<td><input type=\"text\" class=\"form_serialhierarchy_order_input sbk_Focusable\" id=\"form_serialhierarchy_chrono3order\" name=\"form_serialhierarchy_chrono3order\" value=\"\" ></td></tr>");

            // Finish the popup form and add the CLOSE button
            PopupFormBuilder.AppendLine("    <tr style=\"height:35px; text-align: center; vertical-align: bottom;\">");
            PopupFormBuilder.AppendLine("      <td colspan=\"3\"><button title=\"Close\" class=\"sbkMetadata_RoundButton\" onclick=\"return close_serial_hierarchy();\">CLOSE</button></td>");
            PopupFormBuilder.AppendLine("    </tr>");
            PopupFormBuilder.AppendLine("  </table>");
            PopupFormBuilder.AppendLine("</div>");
            PopupFormBuilder.AppendLine();
        }
        /// <summary> Renders the HTML for this element </summary>
        /// <param name="Output"> Textwriter to write the HTML for this element </param>
        /// <param name="Bib"> Object to populate this element from </param>
        /// <param name="Skin_Code"> Code for the current skin </param>
        /// <param name="isMozilla"> Flag indicates if the current browse is Mozilla Firefox (different css choices for some elements)</param>
        /// <param name="popup_form_builder"> Builder for any related popup forms for this element </param>
        /// <param name="Current_User"> Current user, who's rights may impact the way an element is rendered </param>
        /// <param name="CurrentLanguage"> Current user-interface language </param>
        /// <param name="Translator"> Language support object which handles simple translational duties </param>
        /// <param name="Base_URL"> Base URL for the current request </param>
        /// <remarks> This simple element does not append any popup form to the popup_form_builder</remarks>
        public override void Render_Template_HTML(TextWriter Output, SobekCM_Item Bib, string Skin_Code, bool isMozilla, StringBuilder popup_form_builder, User_Object Current_User, Web_Language_Enum CurrentLanguage, Language_Support_Info Translator, string Base_URL )
        {
            // Check that an acronym exists
            if (Acronym.Length == 0)
            {
                const string defaultAcronym = "Enter the name(s) of the publisher(s) of the larger body of work. If your work is currently unpublished, you may enter your name as the publisher or leave the field blank. If you are adding administrative material (newsletters, handbooks, etc.) on behalf of a department within the university, enter the name of your department as the publisher.";
                switch (CurrentLanguage)
                {
                    case Web_Language_Enum.English:
                        Acronym = defaultAcronym;
                        break;

                    case Web_Language_Enum.Spanish:
                        Acronym = defaultAcronym;
                        break;

                    case Web_Language_Enum.French:
                        Acronym = defaultAcronym;
                        break;

                    default:
                        Acronym = defaultAcronym;
                        break;
                }
            }

            string id_name = html_element_name.Replace("_", "");

            Output.WriteLine("  <!-- " + Title + " Element -->");
            Output.WriteLine("  <tr align=\"left\">");
            Output.WriteLine("    <td width=\"" + LEFT_MARGIN + "px\">&nbsp;</td>");
            if (Acronym.Length > 0)
            {
                Output.WriteLine("    <td valign=\"top\" class=\"metadata_label\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" target=\"_" + html_element_name.ToUpper() + "\"><acronym title=\"" + Acronym + "\">" + Translator.Get_Translation(Title, CurrentLanguage) + ":</acronym></a></td>");
            }
            else
            {
                Output.WriteLine("    <td valign=\"top\" class=\"metadata_label\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" target=\"_" + html_element_name.ToUpper() + "\">" + Translator.Get_Translation(Title, CurrentLanguage) + ":</a></td>");
            }
            Output.WriteLine("    <td>");
            Output.WriteLine("      <table>");
            Output.WriteLine("        <tr>");
            Output.WriteLine("          <td>");
            Output.WriteLine("            <div id=\"" + html_element_name + "_div\">");

            if (Bib.Bib_Info.Publishers_Count == 0)
            {
                const int i = 1;
                Output.WriteLine("              <span class=\"metadata_sublabel2\">" + Translator.Get_Translation("Name", CurrentLanguage) + ":</span>");
                Output.Write("              <input name=\"" + id_name + "_name" + i + "\" id=\"" + id_name + "_name" + i + "\" class=\"" + html_element_name + "_name_input\" type=\"text\" value=\"\" onfocus=\"javascript:textbox_enter('" + id_name + "_name" + i + "', '" + html_element_name + "_name_input_focused')\" onblur=\"javascript:textbox_leave('" + id_name + "_name" + i + "', '" + html_element_name + "_name_input')\" />");
                Output.WriteLine("<br />");
                Output.WriteLine("              <span class=\"metadata_sublabel2\">" + Translator.Get_Translation("Location(s)", CurrentLanguage) + ":</span>");
                Output.WriteLine("              <input name=\"" + id_name + "_firstloc" + i + "\" id=\"" + id_name + "_firstloc" + i + "\" class=\"" + html_element_name + "_location_input\" type=\"text\" value=\"\" onfocus=\"javascript:textbox_enter('" + id_name + "_firstloc" + i + "', '" + html_element_name + "_location_input_focused')\" onblur=\"javascript:textbox_leave('" + id_name + "_firstloc" + i + "', '" + html_element_name + "_location_input')\" />");
                Output.WriteLine("              <input name=\"" + id_name + "_secondloc" + i + "\" id=\"" + id_name + "_secondloc" + i + "\" class=\"" + html_element_name + "_location_input\" type=\"text\" value=\"\" onfocus=\"javascript:textbox_enter('" + id_name + "_secondloc" + i + "', '" + html_element_name + "_location_input_focused')\" onblur=\"javascript:textbox_leave('" + id_name + "_secondloc" + i + "', '" + html_element_name + "_location_input')\" />");
                Output.Write("              <input name=\"" + id_name + "_thirdloc" + i + "\" id=\"" + id_name + "_thirdloc" + i + "\" class=\"" + html_element_name + "_location_input\" type=\"text\" value=\"\" onfocus=\"javascript:textbox_enter('" + id_name + "_thirdloc" + i + "', '" + html_element_name + "_location_input_focused')\" onblur=\"javascript:textbox_leave('" + id_name + "_thirdloc" + i + "', '" + html_element_name + "_location_input')\" />");
                Output.WriteLine("</div>");
                Output.WriteLine("          </td>");
            }
            else
            {
                ReadOnlyCollection<Publisher_Info> publishers = Bib.Bib_Info.Publishers;
                for (int i = 1; i <= publishers.Count; i++)
                {
                    Output.WriteLine("              <span class=\"metadata_sublabel2\">" + Translator.Get_Translation("Name", CurrentLanguage) + ":</span>");
                    Output.Write("              <input name=\"" + id_name + "_name" + i + "\" id=\"" + id_name + "_name" + i + "\" class=\"" + html_element_name + "_name_input\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(publishers[i - 1].Name) + "\" onfocus=\"javascript:textbox_enter('" + id_name + "_name" + i + "', '" + html_element_name + "_name_input_focused')\" onblur=\"javascript:textbox_leave('" + id_name + "_name" + i + "', '" + html_element_name + "_name_input')\" />");
                    Output.WriteLine("<br />");
                    Output.WriteLine("              <span class=\"metadata_sublabel2\">" + Translator.Get_Translation("Location(s)", CurrentLanguage) + ":</span>");
                    ReadOnlyCollection<Origin_Info_Place> places = publishers[i - 1].Places;
                    if ((places.Count > 0) && (places[0].Place_Text.Length > 0))
                    {
                        Output.WriteLine("              <input name=\"" + id_name + "_firstloc" + i + "\" id=\"" + id_name + "_firstloc" + i + "\" class=\"" + html_element_name + "_location_input\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(places[0].Place_Text) + "\" onfocus=\"javascript:textbox_enter('" + id_name + "_firstloc" + i + "', '" + html_element_name + "_location_input_focused')\" onblur=\"javascript:textbox_leave('" + id_name + "_firstloc" + i + "', '" + html_element_name + "_location_input')\" />");
                    }
                    else
                    {
                        Output.WriteLine("              <input name=\"" + id_name + "_firstloc" + i + "\" id=\"" + id_name + "_firstloc" + i + "\" class=\"" + html_element_name + "_location_input\" type=\"text\" value=\"\" onfocus=\"javascript:textbox_enter('" + id_name + "_firstloc" + i + "', '" + html_element_name + "_location_input_focused')\" onblur=\"javascript:textbox_leave('" + id_name + "_firstloc" + i + "', '" + html_element_name + "_location_input')\" />");
                    }
                    if ((places.Count > 1) && (places[1].Place_Text.Length > 0))
                    {
                        Output.WriteLine("              <input name=\"" + id_name + "_secondloc" + i + "\" id=\"" + id_name + "_secondloc" + i + "\" class=\"" + html_element_name + "_location_input\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(places[1].Place_Text) + "\" onfocus=\"javascript:textbox_enter('" + id_name + "_secondloc" + i + "', '" + html_element_name + "_location_input_focused')\" onblur=\"javascript:textbox_leave('" + id_name + "_secondloc" + i + "', '" + html_element_name + "_location_input')\" />");
                    }
                    else
                    {
                        Output.WriteLine("              <input name=\"" + id_name + "_secondloc" + i + "\" id=\"" + id_name + "_secondloc" + i + "\" class=\"" + html_element_name + "_location_input\" type=\"text\" value=\"\" onfocus=\"javascript:textbox_enter('" + id_name + "_secondloc" + i + "', '" + html_element_name + "_location_input_focused')\" onblur=\"javascript:textbox_leave('" + id_name + "_secondloc" + i + "', '" + html_element_name + "_location_input')\" />");
                    }
                    if ((places.Count > 2) && (places[2].Place_Text.Length > 0))
                    {
                        Output.Write("              <input name=\"" + id_name + "_thirdloc" + i + "\" id=\"" + id_name + "_thirdloc" + i + "\" class=\"" + html_element_name + "_location_input\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(places[2].Place_Text) + "\" onfocus=\"javascript:textbox_enter('" + id_name + "_thirdloc" + i + "', '" + html_element_name + "_location_input_focused')\" onblur=\"javascript:textbox_leave('" + id_name + "_thirdloc" + i + "', '" + html_element_name + "_location_input')\" />");
                    }
                    else
                    {
                        Output.Write("              <input name=\"" + id_name + "_thirdloc" + i + "\" id=\"" + id_name + "_thirdloc" + i + "\" class=\"" + html_element_name + "_location_input\" type=\"text\" value=\"\" onfocus=\"javascript:textbox_enter('" + id_name + "_thirdloc" + i + "', '" + html_element_name + "_location_input_focused')\" onblur=\"javascript:textbox_leave('" + id_name + "_thirdloc" + i + "', '" + html_element_name + "_location_input')\" />");
                    }

                    if (i < publishers.Count)
                    {
                        Output.WriteLine("<br />");
                    }
                    else
                    {
                        Output.WriteLine("</div>");
                        Output.WriteLine("          </td>");
                    }
                }
            }

            Output.WriteLine("          <td valign=\"bottom\" >");
            if (Repeatable)
            {
                Output.WriteLine("            <a title=\"" + Translator.Get_Translation("Click to add a new publisher", CurrentLanguage) + ".\" href=\"" + Base_URL + "l/technical/javascriptrequired\" onmousedown=\"return add_publisher_element('" + html_element_name + "');\"><img border=\"0px\" class=\"repeat_button\" src=\"" + Base_URL + REPEAT_BUTTON_URL + "\" /></a>");
            }
            Output.WriteLine("            <a target=\"_" + html_element_name.ToUpper() + "\"  title=\"" + Translator.Get_Translation("Get help.", CurrentLanguage) + "\" href=\"" + Help_URL(Skin_Code, Base_URL) + "\" ><img border=\"0px\" class=\"help_button\" src=\"" + Base_URL + HELP_BUTTON_URL + "\" /></a>");
            Output.WriteLine("          </td>");

            Output.WriteLine("        </tr>");
            Output.WriteLine("      </table>");
            Output.WriteLine("    </td>");
            Output.WriteLine("  </tr>");

            Output.WriteLine();
        }
        /// <summary> Get the navigation bar html for a view, given information about the current request </summary>
        /// <param name="Item_View"> View for which to generate the html </param>
        /// <param name="Resource_Type"> Current resource type, which determines the text in several viewer's tabs</param>
        /// <param name="Skin_Code"> Code for the current web sking, which determines which tab images to use </param>
        /// <param name="Current_Mode"> Mode / navigation information for the current request</param>
        /// <param name="Page_Sequence"> Current page sequence </param>
        /// <param name="Translator"> Language support object provides support for translating common user interface elements, like the names of these tabs </param>
        /// <param name="Show_Zoomable"> Flag indicates if the zoomable server is online and should be displayable </param>
        /// <returns> Collection of the html for the navigation bar (one view could have multiple tabs)</returns>
        public static List<string> Get_Nav_Bar_HTML(View_Object Item_View, string Resource_Type, 
            string Skin_Code, SobekCM_Navigation_Object Current_Mode, int Page_Sequence,
            Language_Support_Info Translator, bool Show_Zoomable, SobekCM_Item Current_Item )
        {
            List<string> returnVal = new List<string>();

            switch (Item_View.View_Type)
            {
                case View_Enum.ALL_VOLUMES:
                    string allVolumeCode = "allvolumes";
                    string resource_type_upper = Resource_Type.ToUpper();
                    if (Current_Mode.ViewerCode.IndexOf("allvolumes") == 0)
                        allVolumeCode = Current_Mode.ViewerCode;
                    if (resource_type_upper.IndexOf("NEWSPAPER") >= 0)
                    {
                        returnVal.Add(HTML_Helper(Skin_Code, allVolumeCode, Translator.Get_Translation("ALL ISSUES", Current_Mode.Language), Current_Mode));
                    }
                    else
                    {
                        if (resource_type_upper.IndexOf("MAP") >= 0)
                        {
                            returnVal.Add(HTML_Helper(Skin_Code, allVolumeCode, Translator.Get_Translation("RELATED MAPS", Current_Mode.Language), Current_Mode));
                        }
                        else
                        {
                            returnVal.Add(resource_type_upper.IndexOf("AERIAL") >= 0
                                              ? HTML_Helper(Skin_Code, allVolumeCode, Translator.Get_Translation("RELATED FLIGHTS", Current_Mode.Language), Current_Mode)
                                              : HTML_Helper(Skin_Code, allVolumeCode, Translator.Get_Translation("ALL VOLUMES", Current_Mode.Language), Current_Mode));
                        }
                    }
                    break;

                case View_Enum.CITATION:
                    if ((Current_Mode.ViewerCode == "citation") || ( Current_Mode.ViewerCode == "marc" ) || ( Current_Mode.ViewerCode == "metadata" ) || ( Current_Mode.ViewerCode == "usage" ))
                    {
                        returnVal.Add(HTML_Helper(Skin_Code, Current_Mode.ViewerCode, Translator.Get_Translation("CITATION", Current_Mode.Language), Current_Mode));
                    }
                    else
                    {
                        returnVal.Add(HTML_Helper(Skin_Code, "citation", Translator.Get_Translation("CITATION", Current_Mode.Language), Current_Mode));
                    }
                    break;

                case View_Enum.DATASET_CODEBOOK:
                    returnVal.Add(HTML_Helper(Skin_Code, "dscodebook", Translator.Get_Translation("DATA STRUCTURE", Current_Mode.Language), Current_Mode));
                    break;

                case View_Enum.DATASET_REPORTS:
                    returnVal.Add(HTML_Helper(Skin_Code, "dsreports", Translator.Get_Translation("REPORTS", Current_Mode.Language), Current_Mode));
                    break;

                case View_Enum.DATASET_VIEWDATA:
                    returnVal.Add(HTML_Helper(Skin_Code, "dsview", Translator.Get_Translation("EXPLORE DATA", Current_Mode.Language), Current_Mode));
                    break;

                case View_Enum.DOWNLOADS:
                    returnVal.Add(HTML_Helper(Skin_Code, "downloads", Translator.Get_Translation("DOWNLOADS", Current_Mode.Language), Current_Mode));
                    break;

                case View_Enum.FEATURES:
                    returnVal.Add(HTML_Helper(Skin_Code, "features", Translator.Get_Translation("FEATURES", Current_Mode.Language), Current_Mode));
                    break;

                case View_Enum.FLASH:
                    returnVal.Add(Item_View.Label.Length == 0
                                      ? HTML_Helper(Skin_Code, "flash", Translator.Get_Translation("FLASH VIEW", Current_Mode.Language), Current_Mode)
                                      : HTML_Helper(Skin_Code, "flash", Translator.Get_Translation(Item_View.Label.ToUpper(), Current_Mode.Language), Current_Mode));
                    break;

                case View_Enum.GOOGLE_MAP:
                    if (Current_Mode.Coordinates.Length > 0)
                    {
                        if (Current_Mode.ViewerCode == "mapsearch")
                        {
                            returnVal.Add( HTML_Helper(Skin_Code, "mapsearch", Translator.Get_Translation("MAP SEARCH", Current_Mode.Language), Current_Mode));
                        }
                        else
                        {
                            if (( Current_Item.Web.Static_PageCount > 1 ) || ( Current_Item.Bib_Info.SobekCM_Type != TypeOfResource_SobekCM_Enum.Map ))
                            {
                                returnVal.Add(HTML_Helper(Skin_Code, "map", Translator.Get_Translation("SEARCH RESULTS", Current_Mode.Language), Current_Mode));
                            }
                            else
                            {
                                returnVal.Add(HTML_Helper(Skin_Code, "map", Translator.Get_Translation("MAP COVERAGE", Current_Mode.Language), Current_Mode));
                            }

                        }
                    }
                    else
                    {
                        returnVal.Add(HTML_Helper(Skin_Code, "map", Translator.Get_Translation("MAP IT!", Current_Mode.Language), Current_Mode));
                    }
                    break;

                case View_Enum.GOOGLE_MAP_BETA:
                    if (Current_Mode.Coordinates.Length > 0)
                    {
                        if (Current_Mode.ViewerCode == "mapsearchbeta")
                        {
                            returnVal.Add(HTML_Helper(Skin_Code, "mapsearchbeta", Translator.Get_Translation("MAP SEARCH", Current_Mode.Language), Current_Mode));
                        }
                        else
                        {
                            if ((Current_Item.Web.Static_PageCount > 1) || (Current_Item.Bib_Info.SobekCM_Type != TypeOfResource_SobekCM_Enum.Map_Beta))
                            {
                                returnVal.Add(HTML_Helper(Skin_Code, "mapbeta", Translator.Get_Translation("SEARCH RESULTS", Current_Mode.Language), Current_Mode));
                            }
                            else
                            {
                                returnVal.Add(HTML_Helper(Skin_Code, "mapbeta", Translator.Get_Translation("MAP COVERAGE", Current_Mode.Language), Current_Mode));
                            }

                        }
                    }
                    else
                    {
                        returnVal.Add(HTML_Helper(Skin_Code, "map", Translator.Get_Translation("MAP IT!", Current_Mode.Language), Current_Mode));
                    }
                    break;

                case View_Enum.HTML:
                    returnVal.Add(Item_View.Label.Length > 0
                                      ? HTML_Helper(Skin_Code, "html", Item_View.Label.ToUpper(), Current_Mode)
                                      : HTML_Helper(Skin_Code, "html", "HTML LINK", Current_Mode));
                    break;

                case View_Enum.JPEG:
                    returnVal.Add(HTML_Helper_PageView(Skin_Code, Page_Sequence.ToString() + "j", Translator.Get_Translation("STANDARD", Current_Mode.Language), Current_Mode));
                    break;

                case View_Enum.JPEG_TEXT_TWO_UP:
                    returnVal.Add(HTML_Helper_PageView(Skin_Code, Page_Sequence.ToString() + "u", Translator.Get_Translation("PAGE IMAGE WITH TEXT", Current_Mode.Language), Current_Mode));
                    break;

                case View_Enum.JPEG2000:
                    if (Show_Zoomable)
                    {
                        returnVal.Add(HTML_Helper_PageView(Skin_Code, Page_Sequence.ToString() + "x", Translator.Get_Translation("ZOOMABLE", Current_Mode.Language), Current_Mode));
                    }
                    break;

                case View_Enum.PDF:
                    returnVal.Add(HTML_Helper(Skin_Code, "pdf", Translator.Get_Translation("PDF VIEWER", Current_Mode.Language), Current_Mode));
                    break;

                case View_Enum.RELATED_IMAGES:
                    returnVal.Add(Current_Mode.ViewerCode.IndexOf("thumbs") >= 0
                                      ? HTML_Helper(Skin_Code, Current_Mode.ViewerCode, Translator.Get_Translation("THUMBNAILS", Current_Mode.Language), Current_Mode)
                                      : HTML_Helper(Skin_Code, "thumbs", Translator.Get_Translation("THUMBNAILS", Current_Mode.Language), Current_Mode));
                    break;

                case View_Enum.SEARCH:
                    returnVal.Add(HTML_Helper(Skin_Code, "search", Translator.Get_Translation("SEARCH", Current_Mode.Language), Current_Mode));
                    break;

                case View_Enum.SIMPLE_HTML_LINK:
                    returnVal.Add("<li> <a href=\"" + Item_View.Attributes + "\" target=\"_blank\" alt=\"Link to '" + Item_View.Label + "'\"> " + Translator.Get_Translation(Item_View.Label.ToUpper(), Current_Mode.Language) + " </a></li>");
                    break;

                case View_Enum.STREETS:
                    returnVal.Add(HTML_Helper(Skin_Code, "streets", Translator.Get_Translation("STREETS", Current_Mode.Language), Current_Mode));
                    break;

                case View_Enum.TEXT:
                    returnVal.Add(HTML_Helper_PageView(Skin_Code, Page_Sequence.ToString() + "t", Translator.Get_Translation("PAGE TEXT", Current_Mode.Language), Current_Mode));
                    break;

                case View_Enum.TOC:
                     // returnVal.Add(base.HTML_Helper(Skin_Code, "TC", "Table of Contents", Current_Mode));
                    break;

                case View_Enum.RESTRICTED:
                    returnVal.Add(HTML_Helper(Skin_Code, "restricted", Translator.Get_Translation("RESTRICTED", Current_Mode.Language), Current_Mode));
                    break;

                case View_Enum.EAD_CONTAINER_LIST:
                    returnVal.Add(HTML_Helper(Skin_Code, "container", Translator.Get_Translation("CONTAINER LIST", Current_Mode.Language), Current_Mode));
                    break;

                case View_Enum.EAD_DESCRIPTION:
                    // Return nothing, this is currently written when writing the CITATION, for
                    // all EAD type items.
                    //returnVal.Add(HTML_Helper(Skin_Code, "description", Translator.Get_Translation("DESCRIPTION", Current_Mode.Language), Current_Mode));
                    break;

                case View_Enum.PAGE_TURNER:
                    returnVal.Add(HTML_Helper(Skin_Code, "pageturner#page/1/mode/2up", Translator.Get_Translation("PAGE TURNER", Current_Mode.Language), Current_Mode));
                    break;

                case View_Enum.YOUTUBE_VIDEO:
                    returnVal.Add(HTML_Helper(Skin_Code, "youtube", Translator.Get_Translation("VIDEO", Current_Mode.Language), Current_Mode));
                    break;

                case View_Enum.EMBEDDED_VIDEO:
                    returnVal.Add(HTML_Helper(Skin_Code, "video", Translator.Get_Translation("VIDEO", Current_Mode.Language), Current_Mode));
                    break;

                case View_Enum.TRACKING:
                    // DO nothing in this case.. do not write any tab
                    break;

                case View_Enum.TRACKING_SHEET:
                    //DO nothing in this case.. do not write any tab
                    break;

                case View_Enum.QUALITY_CONTROL:
                    // DO nothing in this case.. do not write any tab
                    break;
            }

            return returnVal;
        }
        /// <summary> Renders the HTML for this element </summary>
        /// <param name="Output"> Textwriter to write the HTML for this element </param>
        /// <param name="Bib"> Object to populate this element from </param>
        /// <param name="Skin_Code"> Code for the current skin </param>
        /// <param name="IsMozilla"> Flag indicates if the current browse is Mozilla Firefox (different css choices for some elements)</param>
        /// <param name="PopupFormBuilder"> Builder for any related popup forms for this element </param>
        /// <param name="Current_User"> Current user, who's rights may impact the way an element is rendered </param>
        /// <param name="CurrentLanguage"> Current user-interface language </param>
        /// <param name="Translator"> Language support object which handles simple translational duties </param>
        /// <param name="Base_URL"> Base URL for the current request </param>
        /// <remarks> This element appends a popup form to the popup_form_builder</remarks>
        public override void Render_Template_HTML(TextWriter Output, SobekCM_Item Bib, string Skin_Code, bool IsMozilla, StringBuilder PopupFormBuilder, User_Object Current_User, Web_Language_Enum CurrentLanguage, Language_Support_Info Translator, string Base_URL )
        {
            // Check that an acronym exists
            if (Acronym.Length == 0)
            {
                const string defaultAcronym = "Enter any other titles which relate to this material";
                switch (CurrentLanguage)
                {
                    case Web_Language_Enum.English:
                        Acronym = defaultAcronym;
                        break;

                    case Web_Language_Enum.Spanish:
                        Acronym = defaultAcronym;
                        break;

                    case Web_Language_Enum.French:
                        Acronym = defaultAcronym;
                        break;

                    default:
                        Acronym = defaultAcronym;
                        break;
                }
            }

            // Render this in HTML
            Output.WriteLine("  <!-- " + Title + " Form Element -->");
            Output.WriteLine("  <tr>");
            Output.WriteLine("    <td style=\"width:" + LEFT_MARGIN + "px\">&nbsp;</td>");
            if (Acronym.Length > 0)
            {
                Output.WriteLine("    <td class=\"metadata_label\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" target=\"_" + html_element_name.ToUpper() + "\"><acronym title=\"" + Acronym + "\">" + Translator.Get_Translation(Title, CurrentLanguage) + ":</acronym></a></td>");
            }
            else
            {
                Output.WriteLine("    <td class=\"metadata_label\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" target=\"_" + html_element_name.ToUpper() + "\">" + Translator.Get_Translation(Title, CurrentLanguage) + ":</a></td>");
            }

            Output.WriteLine("    <td>");
            Output.WriteLine("      <table>");
            Output.WriteLine("        <tr>");
            Output.WriteLine("          <td>");
            Output.WriteLine("      <div class=\"form_title_div\">");

            int title_count = 1;
            if (( Bib.Bib_Info.hasSeriesTitle ) && ( Bib.Bib_Info.SeriesTitle.Title.Length > 0))
            {
                Title_Info thisTitle = Bib.Bib_Info.SeriesTitle;

                // Add the link for the series title
                Output.Write("        <a title=\"Click to edit this other title\" href=\"" + Base_URL + "l/technical/javascriptrequired\" onfocus=\"link_focused2('form_othertitle_line_" + title_count + "')\" onblur=\"link_blurred2('form_othertitle_line_" + title_count + "')\" onkeypress=\"return popup_keypress_focus('form_othertitle_" + title_count + "', 'formothertitletitle_" + title_count + "', '" + IsMozilla.ToString() + "' );\" onclick=\"return popup_focus('form_othertitle_" + title_count + "', 'formothertitletitle_" + title_count + "' );\"><div class=\"form_linkline form_title_main_line\" id=\"form_othertitle_line_" + title_count + "\">" + thisTitle.NonSort + thisTitle.Title);
                if (thisTitle.Subtitle.Length > 0)
                    Output.Write(" : " + thisTitle.Subtitle);

                Output.WriteLine(" ( <i>Series Title</i> )</div></a>");

                // Add the popup form
                PopupFormBuilder.AppendLine("<!-- Other Title Form " + title_count + " -->");
                PopupFormBuilder.AppendLine("<div class=\"title_other_popup_div sbkMetadata_PopupDiv\" id=\"form_othertitle_" + title_count + "\" style=\"display:none;\">");
                PopupFormBuilder.AppendLine("  <div class=\"sbkMetadata_PopupTitle\"><table style=\"width:100%\"><tr><td style=\"text-align:left\">Edit Other Title</td><td style=\"text-align:right\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" alt=\"HELP\" target=\"_" + html_element_name.ToUpper() + "\" >?</a> &nbsp; <a href=\"#template\" alt=\"CLOSE\" onclick=\"close_othertitle_form('form_othertitle_" + title_count + "')\">X</a> &nbsp; </td></tr></table></div>");
                PopupFormBuilder.AppendLine("  <br />");
                PopupFormBuilder.AppendLine("  <table class=\"sbkMetadata_PopupTable\">");

                // Add the title type (and optionally display label)
                PopupFormBuilder.Append("    <tr><td style=\"width:90px\">Title Type:</td><td colspan=\"2\"><select class=\"formtitle_type_select\" name=\"formothertitletype_" + title_count + "\" id=\"formothertitletype_" + title_count + "\" onchange=\"other_title_type_change(" + title_count + ")\" >");
                PopupFormBuilder.Append("<option value=\"abbreviated\">Abbreviated Title</option>");
                PopupFormBuilder.Append("<option value=\"alternate\">Alternative Title</option>");
                PopupFormBuilder.Append("<option value=\"series\"  selected=\"selected\" >Series Title</option>");
                PopupFormBuilder.Append("<option value=\"translated\">Translated Title</option>");
                PopupFormBuilder.Append("<option value=\"uniform\">Uniform Title</option>");

                PopupFormBuilder.AppendLine("</select>");
                PopupFormBuilder.AppendLine("        &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;");
                PopupFormBuilder.AppendLine("        <span id=\"formothertitlesubtype_" + title_count + "\" style=\"display:none;\">Display Label: ");
                PopupFormBuilder.Append("        <select class=\"formtitle_display_select\" name=\"formothertitledisplay_" + title_count + "\" id=\"formothertitledisplay_" + title_count + "\" >");
                //popup_form_builder.Append("<option value=\"added\">Added title page title</option>");
                //popup_form_builder.Append("<option value=\"alternate\" selected=\"selected\" >Alternate title</option>");
                //popup_form_builder.Append("<option value=\"caption\">Caption title</option>");
                //popup_form_builder.Append("<option value=\"cover\">Cover title</option>");
                //popup_form_builder.Append("<option value=\"distinctive\">Distinctive title</option>");
                //popup_form_builder.Append("<option value=\"other\">Other title</option>");
                //popup_form_builder.Append("<option value=\"portion\">Portion of title</option>");
                //popup_form_builder.Append("<option value=\"parallel\">Parallel title</option>");
                //popup_form_builder.Append("<option value=\"running\">Running title</option>");
                //popup_form_builder.Append("<option value=\"spine\">Spine title</option>");
                PopupFormBuilder.AppendLine("</select></span></td></tr>");

                // Add the nonsort and language text boxes
                PopupFormBuilder.Append("    <tr><td>Non Sort:</td><td>");
                PopupFormBuilder.Append("<input class=\"formtitle_small_input sbk_Focusable\" name=\"formothertitlenonsort_" + title_count + "\" id=\"formothertitlenonsort_" + title_count + "\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(thisTitle.NonSort) + "\" />");
                PopupFormBuilder.Append("</td><td width=\"255px\" >Language: &nbsp; ");
                PopupFormBuilder.Append("<input class=\"formtitle_small_input sbk_Focusable\" name=\"formothertitlelanguage_" + title_count + "\" id=\"formothertitlelanguage_" + title_count + "\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(thisTitle.Language) + "\" />");
                PopupFormBuilder.AppendLine("</td></tr>");

                // Add the title and subtitle
                PopupFormBuilder.AppendLine("    <tr><td>Title:</td><td colspan=\"2\"><input class=\"formtitle_large_input sbk_Focusable\" name=\"formothertitletitle_" + title_count + "\" id=\"formothertitletitle_" + title_count + "\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(thisTitle.Title) + "\" /></td></tr>");
                PopupFormBuilder.AppendLine("    <tr><td>Sub Title:</td><td colspan=\"2\"><input class=\"formtitle_large_input sbk_Focusable\" name=\"formothertitlesubtitle_" + title_count + "\" id=\"formothertitlesubtitle_" + title_count + "\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(thisTitle.Subtitle) + "\" /></td></tr>");

                // Add the part numbers
                PopupFormBuilder.Append("    <tr><td>Part Numbers:</td><td colspan=\"2\">");
                if (thisTitle.Part_Numbers_Count > 0)
                {
                    PopupFormBuilder.Append("<input class=\"formtitle_small_input sbk_Focusable\" name=\"formothertitlepartnum1_" + title_count + "\" id=\"formothertitlepartnum1_" + title_count + "\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(thisTitle.Part_Numbers[0]) + "\" />");
                }
                else
                {
                    PopupFormBuilder.Append("<input class=\"formtitle_small_input sbk_Focusable\" name=\"formothertitlepartnum1_" + title_count + "\" id=\"formothertitlepartnum1_" + title_count + "\" type=\"text\" value=\"\" />");
                }
                if (thisTitle.Part_Numbers_Count > 1)
                {
                    PopupFormBuilder.Append("<input class=\"formtitle_small_input sbk_Focusable\" name=\"formothertitlepartnum2_" + title_count + "\" id=\"formothertitlepartnum2_" + title_count + "\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(thisTitle.Part_Numbers[1]) + "\" />");
                }
                else
                {
                    PopupFormBuilder.Append("<input class=\"formtitle_small_input sbk_Focusable\" name=\"formothertitlepartnum2_" + title_count + "\" id=\"formothertitlepartnum2_" + title_count + "\" type=\"text\" value=\"\" />");
                }
                PopupFormBuilder.AppendLine("</td></tr>");

                // Add the part names and authority
                PopupFormBuilder.Append("    <tr><td>Part Names:</td><td>");
                if (thisTitle.Part_Names_Count > 0)
                {
                    PopupFormBuilder.Append("<input class=\"formtitle_small_input sbk_Focusable\" name=\"formothertitlepartname1_" + title_count + "\" id=\"formothertitlepartname1_" + title_count + "\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(thisTitle.Part_Names[0]) + "\" />");
                }
                else
                {
                    PopupFormBuilder.Append("<input class=\"formtitle_small_input sbk_Focusable\" name=\"formothertitlepartname1_" + title_count + "\" id=\"formothertitlepartname1_" + title_count + "\" type=\"text\" value=\"\" />");
                }
                if (thisTitle.Part_Names_Count > 1)
                {
                    PopupFormBuilder.Append("<input class=\"formtitle_small_input sbk_Focusable\" name=\"formothertitlepartname2_" + title_count + "\" id=\"formothertitlepartname2_" + title_count + "\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(thisTitle.Part_Names[1]) + "\" />");
                }
                else
                {
                    PopupFormBuilder.Append("<input class=\"formtitle_small_input sbk_Focusable\" name=\"formothertitlepartname2_" + title_count + "\" id=\"formothertitlepartname2_" + title_count + "\" type=\"text\" value=\"\" />");
                }
                PopupFormBuilder.Append("<td>Authority: &nbsp; <input class=\"formtitle_small_input sbk_Focusable\" name=\"formothertitleauthority_" + title_count + "\" id=\"formothertitleauthority_" + title_count + "\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(thisTitle.Authority) + "\" />");
                PopupFormBuilder.AppendLine("</td></tr>");

                // Finish the popup form and add the close button
                PopupFormBuilder.AppendLine("    <tr style=\"height:35px; text-align: center; vertical-align: bottom;\">");
                PopupFormBuilder.AppendLine("      <td colspan=\"3\"><button title=\"Close\" class=\"sbkMetadata_RoundButton\" onclick=\"close_othertitle_form('form_othertitle_" + title_count + "');\">CLOSE</button></td>");
                PopupFormBuilder.AppendLine("    </tr>");
                PopupFormBuilder.AppendLine("  </table>");
                PopupFormBuilder.AppendLine("</div>");
                PopupFormBuilder.AppendLine();

                title_count++;
            }

            // Always have one empty other title
            if ((title_count == 1) && (Bib.Bib_Info.Other_Titles_Count == 0))
            {
                Bib.Bib_Info.Add_Other_Title(String.Empty, Title_Type_Enum.alternative);
            }

            foreach (Title_Info thisTitle in Bib.Bib_Info.Other_Titles)
            {
                // Add the link for the other title
                if ((thisTitle.Title.Trim().Length > 0) || ( thisTitle.NonSort.Trim().Length > 0 ))
                {
                    Output.Write("        <a title=\"Click to edit this other title\" href=\"" + Base_URL + "l/technical/javascriptrequired\" onfocus=\"link_focused2('form_othertitle_line_" + title_count + "')\" onblur=\"link_blurred2('form_othertitle_line_" + title_count + "')\" onkeypress=\"return popup_keypress_focus('form_othertitle_" + title_count + "', 'formothertitletitle_" + title_count + "', '" + IsMozilla.ToString() + "' );\" onclick=\"return popup_focus('form_othertitle_" + title_count + "', 'formothertitletitle_" + title_count + "' );\"><div class=\"form_linkline form_title_main_line\" id=\"form_othertitle_line_" + title_count + "\">" + thisTitle.NonSort + thisTitle.Title);
                    if (thisTitle.Subtitle.Length > 0)
                        Output.Write(" : " + thisTitle.Subtitle);
                    switch (thisTitle.Title_Type)
                    {
                        case Title_Type_Enum.abbreviated:
                            Output.Write(" ( <i>Abbreviated Title</i> )");
                            break;

                        case Title_Type_Enum.translated:
                            Output.Write(" ( <i>Translated Title</i> )");
                            break;

                        case Title_Type_Enum.uniform:
                            Output.Write(" ( <i>Uniform Title</i> )");
                            break;

                        default:
                            Output.Write(" ( <i>Alternative Title</i> )");
                            break;
                    }
                }
                else
                {
                    Output.Write("        <a title=\"Click to edit this other title\" href=\"" + Base_URL + "l/technical/javascriptrequired\" onfocus=\"link_focused2('form_othertitle_line_" + title_count + "')\" onblur=\"link_blurred2('form_othertitle_line_" + title_count + "')\" onkeypress=\"return popup_keypress_focus('form_othertitle_" + title_count + "', 'formothertitletitle_" + title_count + "', '" + IsMozilla.ToString() + "' );\" onclick=\"return popup_focus('form_othertitle_" + title_count + "', 'formothertitletitle_" + title_count + "' );\"><div class=\"form_linkline_empty form_title_main_line\" id=\"form_othertitle_line_" + title_count + "\"><i>Empty Other Title</i>");
                }

                Output.Write("</div></a>");

                // Add the popup form
                PopupFormBuilder.AppendLine("<!-- Other Title Form " + title_count + " -->");

                PopupFormBuilder.AppendLine("<div class=\"title_other_popup_div sbkMetadata_PopupDiv\" id=\"form_othertitle_" + title_count + "\" style=\"display:none;\">");
                PopupFormBuilder.AppendLine("  <div class=\"sbkMetadata_PopupTitle\"><table style=\"width:100%\"><tr><td style=\"text-align:left\">Edit Other Title</td><td style=\"text-align:right\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" alt=\"HELP\" target=\"_" + html_element_name.ToUpper() + "\" >?</a> &nbsp; <a href=\"#template\" alt=\"CLOSE\" onclick=\"close_othertitle_form('form_othertitle_" + title_count + "')\">X</a> &nbsp; </td></tr></table></div>");
                PopupFormBuilder.AppendLine("  <br />");
                PopupFormBuilder.AppendLine("  <table class=\"sbkMetadata_PopupTable\">");

                // Add the title type (and optionally display label)
                PopupFormBuilder.Append("    <tr><td style=\"width:90px\">Title Type:</td><td colspan=\"2\"><select class=\"formtitle_type_select\" name=\"formothertitletype_" + title_count + "\" id=\"formothertitletype_" + title_count + "\" onchange=\"other_title_type_change(" + title_count + ")\" >");
                PopupFormBuilder.Append(thisTitle.Title_Type == Title_Type_Enum.abbreviated
                                              ? "<option value=\"abbreviated\" selected=\"selected\" >Abbreviated Title</option>"
                                              : "<option value=\"abbreviated\">Abbreviated Title</option>");

                if ((thisTitle.Title_Type == Title_Type_Enum.alternative) || ( thisTitle.Title_Type == Title_Type_Enum.UNSPECIFIED ))
                {
                    PopupFormBuilder.Append("<option value=\"alternate\" selected=\"selected\" >Alternative Title</option>");
                }
                else
                {
                    PopupFormBuilder.Append("<option value=\"alternate\">Alternative Title</option>");
                }
                PopupFormBuilder.Append("<option value=\"series\">Series Title</option>");

                PopupFormBuilder.Append(thisTitle.Title_Type == Title_Type_Enum.translated
                                              ? "<option value=\"translated\" selected=\"selected\" >Translated Title</option>"
                                              : "<option value=\"translated\">Translated Title</option>");

                PopupFormBuilder.Append(thisTitle.Title_Type == Title_Type_Enum.uniform
                                              ? "<option value=\"uniform\" selected=\"selected\" >Uniform Title</option>"
                                              : "<option value=\"uniform\">Uniform Title</option>");

                PopupFormBuilder.AppendLine("</select>");

                // Should the SELECT options be pre-established?
                if ((thisTitle.Title_Type == Title_Type_Enum.alternative) || (thisTitle.Title_Type == Title_Type_Enum.uniform))
                {

                    PopupFormBuilder.AppendLine("        &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;");
                    PopupFormBuilder.AppendLine("        <span id=\"formothertitlesubtype_" + title_count + "\">Display Label: ");
                    PopupFormBuilder.Append(" <select class=\"formtitle_display_select\" name=\"formothertitledisplay_" + title_count + "\" id=\"formothertitledisplay_" + title_count + "\" >");

                    if (thisTitle.Title_Type == Title_Type_Enum.alternative)
                    {
                        PopupFormBuilder.Append(thisTitle.Display_Label == "Added title page title"
                                                      ? "<option value=\"added\" selected=\"selected\" >Added title page title</option>"
                                                      : "<option value=\"added\">Added title page title</option>");

                        PopupFormBuilder.Append(thisTitle.Display_Label == "Alternate title"
                                                      ? "<option value=\"alternate\" selected=\"selected\">Alternate title</option>"
                                                      : "<option value=\"alternate\">Alternate title</option>");

                        PopupFormBuilder.Append(thisTitle.Display_Label == "Caption title"
                                                      ? "<option value=\"caption\" selected=\"selected\">Caption title</option>"
                                                      : "<option value=\"caption\">Caption title</option>");

                        PopupFormBuilder.Append(thisTitle.Display_Label == "Cover title"
                                                      ? "<option value=\"cover\" selected=\"selected\">Cover title</option>"
                                                      : "<option value=\"cover\">Cover title</option>");

                        PopupFormBuilder.Append(thisTitle.Display_Label == "Distinctive title"
                                                      ? "<option value=\"distinctive\" selected=\"selected\">Distinctive title</option>"
                                                      : "<option value=\"distinctive\">Distinctive title</option>");

                        PopupFormBuilder.Append(thisTitle.Display_Label == "Other title"
                                                      ? "<option value=\"other\" selected=\"selected\">Other title</option>"
                                                      : "<option value=\"other\">Other title</option>");

                        PopupFormBuilder.Append(thisTitle.Display_Label == "Portion of title"
                                                      ? "<option value=\"portion\" selected=\"selected\">Portion of title</option>"
                                                      : "<option value=\"portion\">Portion of title</option>");

                        PopupFormBuilder.Append(thisTitle.Display_Label == "Parallel title"
                                                      ? "<option value=\"parallel\" selected=\"selected\">Parallel title</option>"
                                                      : "<option value=\"parallel\">Parallel title</option>");

                        PopupFormBuilder.Append(thisTitle.Display_Label == "Running title"
                                                      ? "<option value=\"running\" selected=\"selected\">Running title</option>"
                                                      : "<option value=\"running\">Running title</option>");

                        PopupFormBuilder.Append(thisTitle.Display_Label == "Spine title"
                                                      ? "<option value=\"spine\" selected=\"selected\">Spine title</option>"
                                                      : "<option value=\"spine\">Spine title</option>");
                    }
                    else
                    {
                        PopupFormBuilder.Append(thisTitle.Display_Label == "Main Entry"
                                                      ? "<option value=\"main\" selected=\"selected\">Main Entry</option>"
                                                      : "<option value=\"main\">Main Entry</option>");

                        PopupFormBuilder.Append(thisTitle.Display_Label == "Uncontrolled Added Entry"
                                                      ? "<option value=\"uncontrolled\" selected=\"selected\">Uncontrolled Added Entry</option>"
                                                      : "<option value=\"uncontrolled\">Uncontrolled Added Entry</option>");

                        if ((thisTitle.Display_Label != "Main Entry") && (thisTitle.Display_Label != "Uncontrolled Added Entry"))
                            PopupFormBuilder.Append("<option value=\"uniform\" selected=\"selected\">Uniform Title</option>");
                        else
                            PopupFormBuilder.Append("<option value=\"uniform\">Uniform Title</option>");
                    }

                    PopupFormBuilder.AppendLine("</select></span></td></tr>");
                }
                else
                {
                    PopupFormBuilder.AppendLine("        &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;");
                    PopupFormBuilder.AppendLine("        <span id=\"formothertitlesubtype_" + title_count + "\" style=\"display:none;\">Display Label: ");
                    PopupFormBuilder.Append("        <select class=\"formtitle_display_select\" name=\"formothertitledisplay_" + title_count + "\" id=\"formothertitledisplay_" + title_count + "\" >");
                    //popup_form_builder.Append("<option value=\"added\">Added title page title</option>");
                    //popup_form_builder.Append("<option value=\"alternate\">Alternate title</option>");
                    //popup_form_builder.Append("<option value=\"caption\">Caption title</option>");
                    //popup_form_builder.Append("<option value=\"cover\">Cover title</option>");
                    //popup_form_builder.Append("<option value=\"distinctive\">Distinctive title</option>");
                    //popup_form_builder.Append("<option value=\"other\">Other title</option>");
                    //popup_form_builder.Append("<option value=\"portion\">Portion of title</option>");
                    //popup_form_builder.Append("<option value=\"parallel\">Parallel title</option>");
                    //popup_form_builder.Append("<option value=\"running\">Running title</option>");
                    //popup_form_builder.Append("<option value=\"spine\">Spine title</option>");
                    PopupFormBuilder.AppendLine("</select></span></td></tr>");
                }

                // Add the nonsort and language text boxes
                PopupFormBuilder.Append("    <tr><td>Non Sort:</td><td>");
                PopupFormBuilder.Append("<input class=\"formtitle_small_input sbk_Focusable\" name=\"formothertitlenonsort_" + title_count + "\" id=\"formothertitlenonsort_" + title_count + "\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(thisTitle.NonSort) + "\" />");
                PopupFormBuilder.Append("</td><td width=\"255px\" >Language: &nbsp; ");
                PopupFormBuilder.Append("<input class=\"formtitle_small_input sbk_Focusable\" name=\"formothertitlelanguage_" + title_count + "\" id=\"formothertitlelanguage_" + title_count + "\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(thisTitle.Language) + "\" />");
                PopupFormBuilder.AppendLine("</td></tr>");

                // Add the title and subtitle
                PopupFormBuilder.AppendLine("    <tr><td>Title:</td><td colspan=\"2\"><input class=\"formtitle_large_input sbk_Focusable\" name=\"formothertitletitle_" + title_count + "\" id=\"formothertitletitle_" + title_count + "\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(thisTitle.Title) + "\"  /></td></tr>");
                PopupFormBuilder.AppendLine("    <tr><td>Sub Title:</td><td colspan=\"2\"><input class=\"formtitle_large_input sbk_Focusable\" name=\"formothertitlesubtitle_" + title_count + "\" id=\"formothertitlesubtitle_" + title_count + "\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(thisTitle.Subtitle) + "\" /></td></tr>");

                // Add the part numbers
                PopupFormBuilder.Append("    <tr><td>Part Numbers:</td><td colspan=\"2\">");
                if (thisTitle.Part_Numbers_Count > 0)
                {
                    PopupFormBuilder.Append("<input class=\"formtitle_small_input sbk_Focusable\" name=\"formothertitlepartnum1_" + title_count + "\" id=\"formothertitlepartnum1_" + title_count + "\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(thisTitle.Part_Numbers[0]) + "\" />");
                }
                else
                {
                    PopupFormBuilder.Append("<input class=\"formtitle_small_input sbk_Focusable\" name=\"formothertitlepartnum1_" + title_count + "\" id=\"formothertitlepartnum1_" + title_count + "\" type=\"text\" value=\"\" />");
                }
                if (thisTitle.Part_Numbers_Count > 1)
                {
                    PopupFormBuilder.Append("<input class=\"formtitle_small_input sbk_Focusable\" name=\"formothertitlepartnum2_" + title_count + "\" id=\"formothertitlepartnum2_" + title_count + "\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(thisTitle.Part_Numbers[1]) + "\" />");
                }
                else
                {
                    PopupFormBuilder.Append("<input class=\"formtitle_small_input sbk_Focusable\" name=\"formothertitlepartnum2_" + title_count + "\" id=\"formothertitlepartnum2_" + title_count + "\" type=\"text\" value=\"\" />");
                }
                PopupFormBuilder.AppendLine("</td></tr>");

                // Add the part names and authority
                PopupFormBuilder.Append("    <tr><td>Part Names:</td><td>");
                if (thisTitle.Part_Names_Count > 0)
                {
                    PopupFormBuilder.Append("<input class=\"formtitle_small_input sbk_Focusable\" name=\"formothertitlepartname1_" + title_count + "\" id=\"formothertitlepartname1_" + title_count + "\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(thisTitle.Part_Names[0]) + "\" />");
                }
                else
                {
                    PopupFormBuilder.Append("<input class=\"formtitle_small_input sbk_Focusable\" name=\"formothertitlepartname1_" + title_count + "\" id=\"formothertitlepartname1_" + title_count + "\" type=\"text\" value=\"\" />");
                }
                if (thisTitle.Part_Names_Count > 1)
                {
                    PopupFormBuilder.Append("<input class=\"formtitle_small_input sbk_Focusable\" name=\"formothertitlepartname2_" + title_count + "\" id=\"formothertitlepartname2_" + title_count + "\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(thisTitle.Part_Names[1]) + "\" />");
                }
                else
                {
                    PopupFormBuilder.Append("<input class=\"formtitle_small_input sbk_Focusable\" name=\"formothertitlepartname2_" + title_count + "\" id=\"formothertitlepartname2_" + title_count + "\" type=\"text\" value=\"\" />");
                }
                PopupFormBuilder.Append("<td>Authority: &nbsp; <input class=\"formtitle_small_input sbk_Focusable\" name=\"formothertitleauthority_" + title_count + "\" id=\"formothertitleauthority_" + title_count + "\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(thisTitle.Authority) + "\" />");
                PopupFormBuilder.AppendLine("</td></tr>");

                // Finish the popup form and add the close button
                PopupFormBuilder.AppendLine("    <tr style=\"height:35px; text-align: center; vertical-align: bottom;\">");
                PopupFormBuilder.AppendLine("      <td colspan=\"3\"><button title=\"Close\" class=\"sbkMetadata_RoundButton\" onclick=\"close_othertitle_form('form_othertitle_" + title_count + "');\">CLOSE</button></td>");
                PopupFormBuilder.AppendLine("    </tr>");
                PopupFormBuilder.AppendLine("  </table>");
                PopupFormBuilder.AppendLine("</div>");
                PopupFormBuilder.AppendLine();

                title_count++;
            }

            // Add the link to add a new other title
            Output.WriteLine("      </div>");
            Output.WriteLine("          </td>");
            Output.WriteLine("          <td style=\"vertical-align:bottom\" >");
            if (Repeatable)
            {
                Output.WriteLine("            <img title=\"" + Translator.Get_Translation("Click to add a new other title", CurrentLanguage) + ".\" alt=\"+\" class=\"repeat_button\" src=\"" + Base_URL + REPEAT_BUTTON_URL + "\" onmousedown=\"new_title_link_clicked('" + Template_Page + "');return false;\" />");
            }
            Output.WriteLine("            <a target=\"_" + html_element_name.ToUpper() + "\"  title=\"" + Translator.Get_Translation("Get help.", CurrentLanguage) + "\" href=\"" + Help_URL(Skin_Code, Base_URL) + "\" ><img class=\"help_button\" src=\"" + Base_URL + HELP_BUTTON_URL + "\" /></a>");
            Output.WriteLine("          </td>");
            Output.WriteLine("        </tr>");
            Output.WriteLine("      </table>");
            Output.WriteLine("    </td>");
            Output.WriteLine("  </tr>");
            Output.WriteLine();
        }
        /// <summary> Method helps to render all multiple text box based elements </summary>
        /// <param name="Output"> Output for the generated html for this element </param>
        /// <param name="instance_value"> Value for the current digital resource to display</param>
        /// <param name="Skin_Code"> Code for the current html skin </param>
        /// <param name="Current_User"> Current user, who's rights may impact the way an element is rendered </param>
        /// <param name="CurrentLanguage"> Current user-interface language </param>
        /// <param name="Translator"> Language support object which handles simple translational duties </param>
        /// <param name="Base_URL"> Base URL for the current request </param>
        /// <param name="HTML_ID_Name"> ID name used for these elements.  This is usually provided when there are multiple fixed-roles or fixed-type elements </param>
        protected void render_helper(TextWriter Output, string instance_value, string Skin_Code, User_Object Current_User, Web_Language_Enum CurrentLanguage, Language_Support_Info Translator, string Base_URL, string HTML_ID_Name)
        {
            Output.WriteLine("  <!-- " + Title + " Element -->");
            Output.WriteLine("  <tr align=\"left\">");
            Output.WriteLine("    <td width=\"" + LEFT_MARGIN + "px\">&nbsp;</td>");

            // Get the label to show
            string label_to_show = Title.Replace(":", "");
            if (label_from_template_file.Length > 0)
                label_to_show = label_from_template_file;

            if (Acronym.Length > 0)
            {
                Output.WriteLine("    <td valign=\"top\" class=\"metadata_label\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" target=\"_" + html_element_name.ToUpper() + "\"><acronym title=\"" + Acronym + "\">" + Translator.Get_Translation(label_to_show, CurrentLanguage) + ":</acronym></a></td>");
            }
            else
            {
                Output.WriteLine("    <td valign=\"top\" class=\"metadata_label\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" target=\"_" + html_element_name.ToUpper() + "\">" + Translator.Get_Translation(label_to_show, CurrentLanguage) + ":</a></td>");
            }

            if (Read_Only)
            {
                Output.WriteLine("    <td>");
                Output.WriteLine("      <table>");
                Output.WriteLine("        <tr>");
                Output.WriteLine("          <td><div class=\"" + HTML_ID_Name + "_div\">" + instance_value + "</div></td>");
                Output.WriteLine("          <td valign=\"bottom\" >");
                Output.WriteLine("            <a target=\"_" + html_element_name.ToUpper() + "\"  title=\"" + Translator.Get_Translation("Get help.", CurrentLanguage) + "\" href=\"" + Help_URL(Skin_Code, Base_URL) + "\" ><img border=\"0px\" class=\"help_button\" src=\"" + Base_URL + HELP_BUTTON_URL + "\" /></a>");
                Output.WriteLine("          </td>");
                Output.WriteLine("        </tr>");
                Output.WriteLine("      </table>");
                Output.WriteLine("    </td>");
            }
            else
            {
                Output.WriteLine("    <td>");

                Output.WriteLine("      <table>");
                Output.WriteLine("        <tr>");
                Output.WriteLine("          <td>");
                Output.WriteLine("            <div id=\"" + HTML_ID_Name + "_div\">");
                Output.WriteLine("              <input name=\"" + HTML_ID_Name + "1\" id=\"" + HTML_ID_Name + "1\" class=\"" + html_element_name + "_input\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(instance_value.Replace("<i>", "").Replace("</i>", "")) + "\" onfocus=\"javascript:textbox_enter('" + HTML_ID_Name + "1', '" + html_element_name + "_input_focused')\" onblur=\"javascript:textbox_leave('" + HTML_ID_Name + "1', '" + html_element_name + "_input')\" />");
                Output.WriteLine("            </div>");
                Output.WriteLine("          </td>");
                Output.WriteLine("          <td valign=\"bottom\" >");

                if (view_choices_string.Length > 0)
                {
                    Output.WriteLine("            " + view_choices_string.Replace("<%INTERFACE%>", Skin_Code) + "&nbsp; ");
                }

                if (Repeatable)
                {
                    Output.WriteLine("          <a title=\"" + Translator.Get_Translation("Click to add another " + Title.ToLower(), CurrentLanguage) + ".\" href=\"" + Base_URL + "l/technical/javascriptrequired\" onmousedown=\"return add_new_element_adv('" + HTML_ID_Name + "', '" + html_element_name + "');\"><img border=\"0px\" class=\"repeat_button\" src=\"" + Base_URL + REPEAT_BUTTON_URL + "\" /></a>");
                }

                Output.WriteLine("            <a target=\"_" + html_element_name.ToUpper() + "\"  title=\"" + Translator.Get_Translation("Get help.", CurrentLanguage) + "\" href=\"" + Help_URL(Skin_Code, Base_URL) + "\" ><img border=\"0px\" class=\"help_button\" src=\"" + Base_URL + HELP_BUTTON_URL + "\" /></a>");

                Output.WriteLine("          </td>");
                Output.WriteLine("        </tr>");
                Output.WriteLine("      </table>");

                Output.WriteLine("    </td>");
            }

            Output.WriteLine("  </tr>");
            Output.WriteLine();
        }
        /// <summary> Method helps to render all multiple text box based elements </summary>
        /// <param name="Output"> Output for the generated html for this element </param>
        /// <param name="instance_value"> Value for the current digital resource to display</param>
        /// <param name="Skin_Code"> Code for the current html skin </param>
        /// <param name="Current_User"> Current user, who's rights may impact the way an element is rendered </param>
        /// <param name="CurrentLanguage"> Current user-interface language </param>
        /// <param name="Translator"> Language support object which handles simple translational duties </param>
        /// <param name="Base_URL"> Base URL for the current request </param>
        protected void render_helper(TextWriter Output, string instance_value, string Skin_Code, User_Object Current_User, Web_Language_Enum CurrentLanguage, Language_Support_Info Translator, string Base_URL )
        {
            string id_name = html_element_name.Replace("_", "");

            Output.WriteLine("  <!-- " + Title + " Element -->");
            Output.WriteLine("  <tr align=\"left\">");
            Output.WriteLine("    <td width=\"" + LEFT_MARGIN + "px\">&nbsp;</td>");
            if (Read_Only)
            {
                Output.WriteLine("    <td valign=\"top\" class=\"metadata_label\">" + Translator.Get_Translation(Title, CurrentLanguage) + ":</b></td>");
            }
            else
            {
                if (Acronym.Length > 0)
                {
                    Output.WriteLine("    <td valign=\"top\" class=\"metadata_label\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" target=\"_" + html_element_name.ToUpper() + "\"><acronym title=\"" + Acronym + "\">" + Translator.Get_Translation(Title, CurrentLanguage) + ":</acronym></a></td>");
                }
                else
                {
                    Output.WriteLine("    <td valign=\"top\" class=\"metadata_label\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" target=\"_" + html_element_name.ToUpper() + "\">" + Translator.Get_Translation(Title, CurrentLanguage) + ":</a></td>");
                }
            }

            if (Read_Only)
            {
                Output.WriteLine("    <td>" + instance_value + "</td>");
            }
            else
            {
                Output.WriteLine("    <td>");
                Output.WriteLine("      <table>");
                Output.WriteLine("        <tr>");
                Output.WriteLine("          <td>");
                Output.WriteLine("            <div id=\"" + html_element_name + "_div\">");
                Output.WriteLine("              <input name=\"" + id_name + "1\" id=\"" + id_name + "1\" class=\"" + html_element_name + "_input sbk_Focusable\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(instance_value.Replace("<i>", "").Replace("</i>", "")) + "\" /></div>");
                Output.WriteLine("          </td>");
                Output.WriteLine("          <td valign=\"bottom\" >");

                if (view_choices_string.Length > 0)
                {
                    Output.WriteLine("            " + view_choices_string.Replace("<%WEBSKIN%>", Skin_Code).Replace("<%?URLOPTS%>", "") + "&nbsp; ");
                }

                if (Repeatable)
                {
                    Output.WriteLine("          <span id=\"" + html_element_name + "_repeaticon\" name=\"" + html_element_name + "_repeaticon\"><img title=\"" + Translator.Get_Translation("Click to add another " + Title.ToLower(), CurrentLanguage) + ".\" alt=\"+\" border=\"0px\" class=\"repeat_button\" src=\"" + Base_URL + REPEAT_BUTTON_URL + "\" onmousedown=\"add_new_multi_element('" + html_element_name + "', 1," + max_boxes + "," + boxes_per_line + "); return false;\" /></span>");
                }

                Output.WriteLine("            <a target=\"_" + html_element_name.ToUpper() + "\"  title=\"" + Translator.Get_Translation("Get help.", CurrentLanguage) + "\" href=\"" + Help_URL(Skin_Code, Base_URL) + "\" ><img border=\"0px\" class=\"help_button\" src=\"" + Base_URL + HELP_BUTTON_URL + "\" /></a>");

                Output.WriteLine("          </td>");
                Output.WriteLine("        </tr>");
                Output.WriteLine("      </table>");
                Output.WriteLine("    </td>");
            }

            Output.WriteLine("  </tr>");
            Output.WriteLine();
        }
        /// <summary> Renders the HTML for this element </summary>
        /// <param name="Output"> Textwriter to write the HTML for this element </param>
        /// <param name="Bib"> Object to populate this element from </param>
        /// <param name="Skin_Code"> Code for the current skin </param>
        /// <param name="IsMozilla"> Flag indicates if the current browse is Mozilla Firefox (different css choices for some elements)</param>
        /// <param name="PopupFormBuilder"> Builder for any related popup forms for this element </param>
        /// <param name="Current_User"> Current user, who's rights may impact the way an element is rendered </param>
        /// <param name="CurrentLanguage"> Current user-interface language </param>
        /// <param name="Translator"> Language support object which handles simple translational duties </param>
        /// <param name="Base_URL"> Base URL for the current request </param>
        /// <remarks> This element appends a popup form to the popup_form_builder</remarks>
        public override void Render_Template_HTML(TextWriter Output, SobekCM_Item Bib, string Skin_Code, bool IsMozilla, StringBuilder PopupFormBuilder, User_Object Current_User, Web_Language_Enum CurrentLanguage, Language_Support_Info Translator, string Base_URL )
        {
            // Check that an acronym exists
            if (Acronym.Length == 0)
            {
                const string DEFAULT_ACRONYM = "Enter any subject keyword to describe your material here, along with the vocabulary from which this subject term was pulled.";
                switch (CurrentLanguage)
                {
                    case Web_Language_Enum.English:
                        Acronym = DEFAULT_ACRONYM;
                        break;

                    case Web_Language_Enum.Spanish:
                        Acronym = DEFAULT_ACRONYM;
                        break;

                    case Web_Language_Enum.French:
                        Acronym = DEFAULT_ACRONYM;
                        break;

                    default:
                        Acronym = DEFAULT_ACRONYM;
                        break;
                }
            }

            Output.WriteLine("  <!-- " + Title + " Form Element -->");
            Output.WriteLine("  <tr>");
            Output.WriteLine("    <td style=\"width:" + LEFT_MARGIN + "px\">&nbsp;</td>");
            if (Acronym.Length > 0)
            {
                Output.WriteLine("    <td class=\"metadata_label\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" target=\"_" + html_element_name.ToUpper() + "\"><acronym title=\"" + Acronym + "\">" + Translator.Get_Translation(Title, CurrentLanguage) + ":</acronym></a></td>");
            }
            else
            {
                Output.WriteLine("    <td class=\"metadata_label\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" target=\"_" + html_element_name.ToUpper() + "\">" + Translator.Get_Translation(Title, CurrentLanguage) + ":</a></td>");
            }

            // Ensure there is at least one standard subject
            bool found_standard = false;
            if (Bib.Bib_Info.Subjects_Count > 0)
            {
                if (Bib.Bib_Info.Subjects.Any(ThisSubject => ThisSubject.Class_Type == Subject_Info_Type.Standard))
                {
                    found_standard = true;
                }
            }
            if (!found_standard)
            {
                Bib.Bib_Info.Add_Subject();
            }

            Output.WriteLine("    <td>");
            Output.WriteLine("      <table>");
            Output.WriteLine("        <tr>");
            Output.WriteLine("          <td>");
            Output.Write("      <div id=\"" + html_element_name + "_div\">");
            int subject_index = 1;

            foreach( Subject_Info thisSubject in Bib.Bib_Info.Subjects )
            {

                if ( thisSubject.Class_Type == Subject_Info_Type.Standard )
                {
                    Subject_Info_Standard standSubject = ( Subject_Info_Standard ) thisSubject;

                    // Add this subject linke
                    if ( standSubject.hasData )
                        Output.Write("\n        <a title=\"Click to edit this subject information\" href=\"" + Base_URL + "l/technical/javascriptrequired\" onfocus=\"link_focused2('form_subject_term_" + subject_index + "')\" onblur=\"link_blurred2('form_subject_term_" + subject_index + "')\" onkeypress=\"return popup_keypress_focus('form_subject_" + subject_index + "', 'formsubjecttopic1_" + subject_index + "', '" + IsMozilla.ToString() + "' );\" onclick=\"return popup_focus('form_subject_" + subject_index + "', 'formsubjecttopic1_" + subject_index + "' );\"><div class=\"form_linkline form_subject_line\" id=\"form_subject_term_" + subject_index + "\">" + standSubject + "</div></a>");
                    else
                        Output.Write("\n        <a title=\"Click to edit this subject information\" href=\"" + Base_URL + "l/technical/javascriptrequired\" onfocus=\"link_focused2('form_subject_term_" + subject_index + "')\" onblur=\"link_blurred2('form_subject_term_" + subject_index + "')\" onkeypress=\"return popup_keypress_focus('form_subject_" + subject_index + "', 'formsubjecttopic1_" + subject_index + "', '" + IsMozilla.ToString() + "' );\" onclick=\"return popup_focus('form_subject_" + subject_index + "', 'formsubjecttopic1_" + subject_index + "' );\"><div class=\"form_linkline_empty form_subject_line\" id=\"form_subject_term_" + subject_index + "\"><i>Empty Subject Keyword</i></div></a>");

                    // Add the popup form
                    PopupFormBuilder.AppendLine("<!-- Subject Keyword Form " + subject_index + " -->");
                    PopupFormBuilder.AppendLine("<div class=\"subject_popup_div sbkMetadata_PopupDiv\" id=\"form_subject_" + subject_index + "\" style=\"display:none;\">");
                    PopupFormBuilder.AppendLine("  <div class=\"sbkMetadata_PopupTitle\"><table style=\"width:100%\"><tr><td style=\"text-align:left\">Edit Subject</td><td style=\"text-align:right\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" alt=\"HELP\" target=\"_" + html_element_name.ToUpper() + "\" >?</a> &nbsp; <a href=\"#template\" alt=\"CLOSE\" onclick=\"close_subject_form('form_subject_" + subject_index + "')\">X</a> &nbsp; </td></tr></table></div>");
                    PopupFormBuilder.AppendLine("  <br />");
                    PopupFormBuilder.AppendLine("  <table class=\"sbkMetadata_PopupTable\">");

                    // Add the options for this subject ( standard, name, or title)
                    PopupFormBuilder.Append("    <tr><td>Subject Type:</td><td><select class=\"formsubject_type\" name=\"formsubjecttype_" + subject_index + "\" id=\"formsubjecttype_" + subject_index + "\" >");
                    PopupFormBuilder.Append("<option value=\"standard\" selected=\"selected\">Standard</option>");
                    PopupFormBuilder.AppendLine("</select></td>");
                    PopupFormBuilder.Append("        <td>MARC: &nbsp; <select class=\"formsubject_map\" name=\"formsubjectmap_" + subject_index + "\" id=\"formsubjectmap_" + subject_index + "\" >");

                    PopupFormBuilder.Append(standSubject.ID.IndexOf("SUBJ") < 0
                                                  ? "<option value=\"none\" selected=\"selected\" >&nbsp;</option>"
                                                  : "<option value=\"none\" >&nbsp;</option>");

                    PopupFormBuilder.Append(standSubject.ID.IndexOf("SUBJ648") == 0
                                                  ? "<option value=\"648\" selected=\"selected\" >648 - Chronological Term</option>"
                                                  : "<option value=\"648\" >648 - Chronological Term</option>");

                    PopupFormBuilder.Append(standSubject.ID.IndexOf("SUBJ650") == 0
                                                  ? "<option value=\"650\" selected=\"selected\" >650 - Topical Term</option>"
                                                  : "<option value=\"650\" >650 - Topical Term</option>");

                    PopupFormBuilder.Append(standSubject.ID.IndexOf("SUBJ651") == 0
                                                  ? "<option value=\"651\" selected=\"selected\" >651 - Geographic Name</option>"
                                                  : "<option value=\"651\" >651 - Geographic Name</option>");

                    PopupFormBuilder.Append(standSubject.ID.IndexOf("SUBJ653") == 0
                                                  ? "<option value=\"653\" selected=\"selected\" >653 - Uncontrolled Index</option>"
                                                  : "<option value=\"653\" >653 - Uncontrolled Index</option>");

                    PopupFormBuilder.Append(standSubject.ID.IndexOf("SUBJ654") == 0
                                                  ? "<option value=\"654\" selected=\"selected\" >654 - Faceted Topical</option>"
                                                  : "<option value=\"654\" >654 - Faceted Topical</option>");

                    PopupFormBuilder.Append(standSubject.ID.IndexOf("SUBJ655") == 0
                                                  ? "<option value=\"655\" selected=\"selected\" >655 - Genre / Form</option>"
                                                  : "<option value=\"655\" >655 - Genre / Form</option>");

                    PopupFormBuilder.Append(standSubject.ID.IndexOf("SUBJ656") == 0
                                                  ? "<option value=\"656\" selected=\"selected\" >656 - Occupation</option>"
                                                  : "<option value=\"656\" >656 - Occupation</option>");

                    PopupFormBuilder.Append(standSubject.ID.IndexOf("SUBJ657") == 0
                                                  ? "<option value=\"657\" selected=\"selected\" >657 - Function</option>"
                                                  : "<option value=\"657\" >657 - Function</option>");

                    PopupFormBuilder.Append(standSubject.ID.IndexOf("SUBJ690") == 0
                                                  ? "<option value=\"690\" selected=\"selected\" >690 - Local Topical</option>"
                                                  : "<option value=\"690\" >690 - Local Topical</option>");

                    PopupFormBuilder.Append(standSubject.ID.IndexOf("SUBJ691") == 0
                                                  ? "<option value=\"691\" selected=\"selected\" >691 - Local Geographic</option>"
                                                  : "<option value=\"691\" >691 - Local Geographic</option>");

                    PopupFormBuilder.AppendLine("</select></td></tr>");

                    // Add the first row of topical term boxes
                    PopupFormBuilder.Append("    <tr><td>Topical Term(s):</td><td colspan=\"2\">");
                    if (standSubject.Topics_Count >= 1)
                    {
                        PopupFormBuilder.Append("<input class=\"formsubject_medium_input sbk_Focusable\" name=\"formsubjecttopic1_" + subject_index + "\" id=\"formsubjecttopic1_" + subject_index + "\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(standSubject.Topics[0]) + "\" />");
                    }
                    else
                    {
                        PopupFormBuilder.Append("<input class=\"formsubject_medium_input sbk_Focusable\" name=\"formsubjecttopic1_" + subject_index + "\" id=\"formsubjecttopic1_" + subject_index + "\" type=\"text\" value=\"\" />");
                    }

                    if (standSubject.Topics_Count >= 2)
                    {
                        PopupFormBuilder.Append("<input class=\"formsubject_medium_input sbk_Focusable\" name=\"formsubjecttopic2_" + subject_index + "\" id=\"formsubjecttopic2_" + subject_index + "\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(standSubject.Topics[1]) + "\" />");
                    }
                    else
                    {
                        PopupFormBuilder.Append("<input class=\"formsubject_medium_input sbk_Focusable\" name=\"formsubjecttopic2_" + subject_index + "\" id=\"formsubjecttopic2_" + subject_index + "\" type=\"text\" value=\"\" />");
                    }
                    PopupFormBuilder.AppendLine("</td></tr>");

                    // Add the second row of topical term boxes
                    PopupFormBuilder.Append("    <tr><td>&nbsp;</td><td colspan=\"2\">");
                    if (standSubject.Topics_Count >= 3)
                    {
                        PopupFormBuilder.Append("<input class=\"formsubject_medium_input sbk_Focusable\" name=\"formsubjecttopic3_" + subject_index + "\" id=\"formsubjecttopic3_" + subject_index + "\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(standSubject.Topics[2]) + "\" />");
                    }
                    else
                    {
                        PopupFormBuilder.Append("<input class=\"formsubject_medium_input sbk_Focusable\" name=\"formsubjecttopic3_" + subject_index + "\" id=\"formsubjecttopic3_" + subject_index + "\" type=\"text\" value=\"\" />");
                    }

                    if (standSubject.Topics_Count >= 4)
                    {
                        PopupFormBuilder.Append("<input class=\"formsubject_medium_input sbk_Focusable\" name=\"formsubjecttopic4_" + subject_index + "\" id=\"formsubjecttopic4_" + subject_index + "\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(standSubject.Topics[3]) + "\" />");
                    }
                    else
                    {
                        PopupFormBuilder.Append("<input class=\"formsubject_medium_input sbk_Focusable\" name=\"formsubjecttopic4_" + subject_index + "\" id=\"formsubjecttopic4_" + subject_index + "\" type=\"text\" value=\"\" />");
                    }
                    PopupFormBuilder.AppendLine("</td></tr>");

                    // Add the two chronological term boxes
                    PopupFormBuilder.Append("    <tr><td>Chronological Term(s):</td><td colspan=\"2\">");
                    if (standSubject.Temporals_Count >= 1)
                    {
                        PopupFormBuilder.Append("<input class=\"formsubject_medium_input sbk_Focusable\" name=\"formsubjecttemporal1_" + subject_index + "\" id=\"formsubjecttemporal1_" + subject_index + "\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(standSubject.Temporals[0]) + "\" />");
                    }
                    else
                    {
                        PopupFormBuilder.Append("<input class=\"formsubject_medium_input sbk_Focusable\" name=\"formsubjecttemporal1_" + subject_index + "\" id=\"formsubjecttemporal1_" + subject_index + "\" type=\"text\" value=\"\" />");
                    }

                    if (standSubject.Temporals_Count >= 2)
                    {
                        PopupFormBuilder.Append("<input class=\"formsubject_medium_input sbk_Focusable\" name=\"formsubjecttemporal2_" + subject_index + "\" id=\"formsubjecttemporal2_" + subject_index + "\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(standSubject.Temporals[1]) + "\" />");
                    }
                    else
                    {
                        PopupFormBuilder.Append("<input class=\"formsubject_medium_input sbk_Focusable\" name=\"formsubjecttemporal2_" + subject_index + "\" id=\"formsubjecttemporal2_" + subject_index + "\" type=\"text\" value=\"\" />");
                    }
                    PopupFormBuilder.AppendLine("</td></tr>");

                    // Add the two geographic term boxes
                    PopupFormBuilder.Append("    <tr><td>Geographic Term(s):</td><td colspan=\"2\">");
                    if (standSubject.Geographics_Count >= 1)
                    {
                        PopupFormBuilder.Append("<input class=\"formsubject_medium_input sbk_Focusable\" name=\"formsubjectgeo1_" + subject_index + "\" id=\"formsubjectgeo1_" + subject_index + "\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(standSubject.Geographics[0]) + "\" />");
                    }
                    else
                    {
                        PopupFormBuilder.Append("<input class=\"formsubject_medium_input sbk_Focusable\" name=\"formsubjectgeo1_" + subject_index + "\" id=\"formsubjectgeo1_" + subject_index + "\" type=\"text\" value=\"\" />");
                    }

                    if (standSubject.Geographics_Count >= 2)
                    {
                        PopupFormBuilder.Append("<input class=\"formsubject_medium_input sbk_Focusable\" name=\"formsubjectgeo2_" + subject_index + "\" id=\"formsubjectgeo2_" + subject_index + "\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(standSubject.Geographics[1]) + "\" />");
                    }
                    else
                    {
                        PopupFormBuilder.Append("<input class=\"formsubject_medium_input sbk_Focusable\" name=\"formsubjectgeo2_" + subject_index + "\" id=\"formsubjectgeo2_" + subject_index + "\" type=\"text\" value=\"\" />");
                    }
                    PopupFormBuilder.AppendLine("</td></tr>");

                    // Add the two genre term boxes
                    PopupFormBuilder.Append("    <tr><td>Form / Genre Term(s):</td><td colspan=\"2\">");
                    if (standSubject.Genres_Count >= 1)
                    {
                        PopupFormBuilder.Append("<input class=\"formsubject_medium_input sbk_Focusable\" name=\"formsubjectgenre1_" + subject_index + "\" id=\"formsubjectgenre1_" + subject_index + "\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(standSubject.Genres[0]) + "\" />");
                    }
                    else
                    {
                        PopupFormBuilder.Append("<input class=\"formsubject_medium_input sbk_Focusable\" name=\"formsubjectgenre1_" + subject_index + "\" id=\"formsubjectgenre1_" + subject_index + "\" type=\"text\" value=\"\" />");
                    }

                    if (standSubject.Genres_Count >= 2)
                    {
                        PopupFormBuilder.Append("<input class=\"formsubject_medium_input sbk_Focusable\" name=\"formsubjectgenre2_" + subject_index + "\" id=\"formsubjectgenre2_" + subject_index + "\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(standSubject.Genres[1]) + "\" />");
                    }
                    else
                    {
                        PopupFormBuilder.Append("<input class=\"formsubject_medium_input sbk_Focusable\" name=\"formsubjectgenre2_" + subject_index + "\" id=\"formsubjectgenre2_" + subject_index + "\" type=\"text\" value=\"\" />");
                    }
                    PopupFormBuilder.AppendLine("</td></tr>");

                    // Add the occupational term box
                    PopupFormBuilder.Append("    <tr><td>Occupation:</td><td colspan=\"2\">");
                    if (standSubject.Occupations_Count >= 1)
                    {
                        PopupFormBuilder.Append("<input class=\"formsubject_large_input sbk_Focusable\" name=\"formsubjectoccup1_" + subject_index + "\" id=\"formsubjectoccup1_" + subject_index + "\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(standSubject.Occupations[0]) + "\" />");
                    }
                    else
                    {
                        PopupFormBuilder.Append("<input class=\"formsubject_large_input sbk_Focusable\" name=\"formsubjectoccup1_" + subject_index + "\" id=\"formsubjectoccup1_" + subject_index + "\" type=\"text\" value=\"\" />");
                    }
                    PopupFormBuilder.AppendLine("</td></tr>");

                    // Add the authority and language text boxes
                    PopupFormBuilder.Append("    <tr><td>Authority:</td><td>");
                    if (standSubject.Authority.Length > 0 )
                    {
                        PopupFormBuilder.Append("<input class=\"formsubject_small_input sbk_Focusable\" name=\"formsubjectauthority_" + subject_index + "\" id=\"formsubjectauthority_" + subject_index + "\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(standSubject.Authority) + "\" />");
                    }
                    else
                    {
                        PopupFormBuilder.Append("<input class=\"formsubject_small_input sbk_Focusable\" name=\"formsubjectauthority_" + subject_index + "\" id=\"formsubjectauthority_" + subject_index + "\" type=\"text\" value=\"\" />");
                    }
                    PopupFormBuilder.Append("</td><td width=\"255px\" > &nbsp; Language: &nbsp; ");
                    if (standSubject.Language.Length > 0)
                    {
                        PopupFormBuilder.Append("<input class=\"formsubject_small_input sbk_Focusable\" name=\"formsubjectlanguage_" + subject_index + "\" id=\"formsubjectlanguage_" + subject_index + "\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(standSubject.Language) + "\" />");
                    }
                    else
                    {
                        PopupFormBuilder.Append("<input class=\"formsubject_small_input sbk_Focusable\" name=\"formsubjectlanguage_" + subject_index + "\" id=\"formsubjectlanguage_" + subject_index + "\" type=\"text\" value=\"\" />");
                    }
                    PopupFormBuilder.AppendLine("  </td></tr>");

                    // Finish the popup form and add the CLOSE button
                    PopupFormBuilder.AppendLine("    <tr style=\"height:35px; text-align: center; vertical-align: bottom;\">");
                    PopupFormBuilder.AppendLine("      <td colspan=\"3\"><button title=\"Close\" class=\"sbkMetadata_RoundButton\" onclick=\"return close_subject_form('form_subject_" + subject_index + "');\">CLOSE</button></td>");
                    PopupFormBuilder.AppendLine("    </tr>");
                    PopupFormBuilder.AppendLine("  </table>");
                    PopupFormBuilder.AppendLine("</div>");
                    PopupFormBuilder.AppendLine();

                    subject_index++;
                }
            }

            // Add the link to add a new other subject and close the main element
            Output.WriteLine("\n            </div>");
            Output.WriteLine("          </td>");

            Output.WriteLine("          <td style=\"vertical-align:bottom\" >");
            if (Repeatable)
            {
                Output.WriteLine("            <img title=\"" + Translator.Get_Translation("Click to add a new named subject", CurrentLanguage) + ".\" alt=\"+\" class=\"repeat_button\" src=\"" + Base_URL + REPEAT_BUTTON_URL + "\" onmousedown=\"new_subject_link_clicked('" + Template_Page + "');\" />");
            }
            Output.WriteLine("            <a target=\"_" + html_element_name.ToUpper() + "\"  title=\"" + Translator.Get_Translation("Get help.", CurrentLanguage) + "\" href=\"" + Help_URL(Skin_Code, Base_URL) + "\" ><img class=\"help_button\" src=\"" + Base_URL + HELP_BUTTON_URL + "\" /></a>");
            Output.WriteLine("          </td>");

            Output.WriteLine("        </tr>");
            Output.WriteLine("      </table>");
            Output.WriteLine("    </td>");
            Output.WriteLine("  </tr>");
            Output.WriteLine();
        }
        /// <summary> Method helps to render the html for all elements based on textBox_TextBox_Element class </summary>
        /// <param name="Output"> Output for the generate html for this element </param>
        /// <param name="instance_value_text1"> Value for the current digital resource to display in the first text box</param>
        /// <param name="instance_value_text2" >Value for the current digital resource to display in the second text box</param>
        /// <param name="Skin_Code"> Code for the current html skin </param>
        /// <param name="Current_User"> Current user, who's rights may impact the way an element is rendered </param>
        /// <param name="CurrentLanguage"> Current user-interface language </param>
        /// <param name="Translator"> Language support object which handles simple translational duties </param>
        /// <param name="Base_URL"> Base URL for the current request </param>
        protected void render_helper(TextWriter Output, string instance_value_text1, string instance_value_text2, string Skin_Code, User_Object Current_User, Web_Language_Enum CurrentLanguage, Language_Support_Info Translator, string Base_URL)
        {
            string id_name = html_element_name.Replace("_", "");

            Output.WriteLine("  <!-- " + Title + " Element -->");
            Output.WriteLine("  <tr>");
            Output.WriteLine("    <td style=\"width:" + LEFT_MARGIN + "px\">&nbsp;</td>");
            if (Title.IndexOf(":") < 0)
            {
                if (Read_Only)
                {
                    Output.WriteLine("    <td class=\"metadata_label\">" + Title + ":</b></td>");
                }
                else
                {
                    if (Acronym.Length > 0)
                    {
                        Output.WriteLine("    <td class=\"metadata_label\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" target=\"_" + html_element_name.ToUpper() + "\"><acronym title=\"" + Acronym + "\">" + Title + ":</acronym></a></td>");
                    }
                    else
                    {
                        Output.WriteLine("    <td class=\"metadata_label\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" target=\"_" + html_element_name.ToUpper() + "\">" + Title + ":</a></td>");
                    }
                }
            }
            else
            {
                if (Read_Only)
                {
                    Output.WriteLine("    <td class=\"metadata_label\">" + Title + "</b></td>");
                }
                else
                {
                    if (Acronym.Length > 0)
                    {
                        Output.WriteLine("    <td class=\"metadata_label\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" target=\"_" + html_element_name.ToUpper() + "\"><acronym title=\"" + Acronym + "\">" + Title + "</acronym></a></td>");
                    }
                    else
                    {
                        Output.WriteLine("    <td class=\"metadata_label\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" target=\"_" + html_element_name.ToUpper() + "\">" + Title + "</a></td>");
                    }
                }
            }
            Output.WriteLine("    <td>");

            Output.WriteLine("      <table>");
            Output.WriteLine("        <tr>");
            Output.WriteLine("          <td>");
            Output.WriteLine("            <div id=\"" + html_element_name + "_div\">");

            const int i = 1;

            // Write the first text
            if (first_label.Length > 0)
            {
                Output.Write("              <span class=\"metadata_sublabel2\">" + first_label + ":</span>");
            }

            // Write the first text box
            Output.Write("<input name=\"" + id_name + "_first" + i + "\" id=\"" + id_name + "_first" + i + "\" class=\"" + html_element_name + "_first_input sbk_Focusable\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(instance_value_text1) + "\" />");

            // Write the second text
            if (second_label.Length > 0)
            {
                Output.Write("<span class=\"metadata_sublabel\">" + second_label + ":</span>");
            }

            // Write the second text box
            Output.Write("<input name=\"" + id_name + "_second" + i + "\" id=\"" + id_name + "_second" + i + "\" class=\"" + html_element_name + "_second_input sbk_Focusable\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(instance_value_text2) + "\" />");
            Output.WriteLine("</div>");
            Output.WriteLine("          </td>");
            Output.WriteLine("          <td style=\"vertical-align:bottom\" >");
            if (Repeatable)
            {
                Output.WriteLine("            <a title=\"" + Translator.Get_Translation("Click to add another " + Title.ToLower(), CurrentLanguage) + ".\" href=\"" + Base_URL + "l/technical/javascriptrequired\" onmousedown=\"return add_two_text_box_element('" + html_element_name + "','" + first_label + "','" + second_label + "');\"><img class=\"repeat_button\" src=\"" + Base_URL + REPEAT_BUTTON_URL + "\" /></a>");
            }
            Output.WriteLine("            <a target=\"_" + html_element_name.ToUpper() + "\"  title=\"" + Translator.Get_Translation("Get help.", CurrentLanguage) + "\" href=\"" + Help_URL(Skin_Code, Base_URL) + "\" ><img class=\"help_button\" src=\"" + Base_URL + HELP_BUTTON_URL + "\" /></a>");
            Output.WriteLine("          </td>");
            Output.WriteLine("        </tr>");
            Output.WriteLine("      </table>");

            Output.WriteLine("    </td>");
            Output.WriteLine("  </tr>");
            Output.WriteLine();
        }
        /// <summary> Method helps to render all single combo box based elements </summary>
        /// <param name="Output"> Output for the generated html for this element </param>
        /// <param name="instance_value"> Value for the current digital resource to display </param>
        /// <param name="Skin_Code"> Code for the current html skin </param>
        /// <param name="Current_User"> Current user, who's rights may impact the way an element is rendered </param>
        /// <param name="CurrentLanguage"> Current user-interface language </param>
        /// <param name="Translator"> Language support object which handles simple translational duties </param>
        /// <param name="Base_URL"> Base URL for the current request </param>
        /// <param name="initial_value"> Flag indicates if the value in the instance_value param is actually instructional text, and not a true value</param>
        protected void render_helper(TextWriter Output, string instance_value, string Skin_Code, User_Object Current_User, Web_Language_Enum CurrentLanguage, Language_Support_Info Translator, string Base_URL, bool initial_value)
        {
            string id_name = html_element_name.Replace("_", "");

            if ((instance_value.Length == 0) && (default_values.Count > 0))
            {
                instance_value = default_values[0];
            }

            Output.WriteLine("  <!-- " + Title + " Element -->");
            Output.WriteLine("  <tr align=\"left\">");
            Output.WriteLine("    <td width=\"" + LEFT_MARGIN + "px\">&nbsp;</td>");
            if (Acronym.Length > 0)
            {
                Output.WriteLine("    <td valign=\"top\" class=\"metadata_label\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" target=\"_" + html_element_name.ToUpper() + "\"><acronym title=\"" + Acronym + "\">" + Translator.Get_Translation(Title, CurrentLanguage) + ":</acronym></a></td>");
            }
            else
            {
                Output.WriteLine("    <td valign=\"top\" class=\"metadata_label\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" target=\"_" + html_element_name.ToUpper() + "\">" + Translator.Get_Translation(Title, CurrentLanguage) + ":</a></td>");
            }
            Output.WriteLine("    <td>");

            Output.WriteLine("      <table>");
            Output.WriteLine("        <tr>");
            Output.WriteLine("          <td>");
            Output.WriteLine("            <div id=\"" + html_element_name + "_div\">");
            if (onChange.Length > 0)
            {
                if (initial_value)
                {
                    Output.WriteLine("              <select class=\"" + html_element_name + "_select_init\" name=\"" + id_name + "1\" id=\"" + id_name + "1\" onblur=\"javascript:selectbox_leave('" + id_name + "1', '" + html_element_name + "_select', '" + html_element_name + "_select_init')\" onChange=\"" + onChange + "\" >");
                }
                else
                {
                    Output.WriteLine("              <select class=\"" + html_element_name + "_select\" name=\"" + id_name + "1\" id=\"" + id_name + "1\" onblur=\"javascript:selectbox_leave('" + id_name + "1', '" + html_element_name + "_select', '" + html_element_name + "_select_init')\" onChange=\"" + onChange + "\" >");
                }
            }
            else
            {
                if (initial_value)
                {
                    Output.WriteLine("              <select class=\"" + html_element_name + "_select_init\" name=\"" + id_name + "1\" id=\"" + id_name + "1\" onblur=\"javascript:selectbox_leave('" + id_name + "1', '" + html_element_name + "_select', '" + html_element_name + "_select_init')\" >");
                }
                else
                {
                    Output.WriteLine("              <select class=\"" + html_element_name + "_select\" name=\"" + id_name + "1\" id=\"" + id_name + "1\" onblur=\"javascript:selectbox_leave('" + id_name + "1', '" + html_element_name + "_select', '" + html_element_name + "_select_init')\" >");
                }
            }

            bool found_option = false;
            foreach (string thisOption in items)
            {
                if (thisOption == instance_value)
                {
                    Output.WriteLine("                <option selected=\"selected=\" value=\"" + thisOption + "\">" + thisOption + "</option>");
                    found_option = true;
                }
                else
                {
                    Output.WriteLine("                <option value=\"" + thisOption + "\">" + thisOption + "</option>");
                }
            }
            if ((instance_value.Length > 0) && (!restrict_values) && (!found_option))
            {
                Output.WriteLine("                <option selected=\"selected=\" value=\"" + instance_value + "\">" + instance_value + "</option>");
            }
            Output.WriteLine("              </select>");
            Output.WriteLine("            </div>");
            Output.WriteLine("          </td>");
            Output.WriteLine("          <td valign=\"bottom\" >");
            if (Repeatable)
            {
                Output.WriteLine("            <a title=\"" + Translator.Get_Translation("Click to add another " + Title.ToLower(), CurrentLanguage) + ".\" href=\"" + Base_URL + "l/technical/javascriptrequired\" onmousedown=\"return " + html_element_name + "_add_new_item();\"><img border=\"0px\" class=\"repeat_button\" src=\"" + Base_URL + REPEAT_BUTTON_URL + "\" /></a>");
            }

            Output.WriteLine("            <a target=\"_" + html_element_name.ToUpper() + "\"  title=\"" + Translator.Get_Translation("Get help.", CurrentLanguage) + "\" href=\"" + Help_URL(Skin_Code, Base_URL) + "\" ><img border=\"0px\" class=\"help_button\" src=\"" + Base_URL + HELP_BUTTON_URL + "\" /></a>");

            Output.WriteLine("          </td>");
            Output.WriteLine("        </tr>");
            Output.WriteLine("      </table>");

            Output.WriteLine("    </td>");
            Output.WriteLine("  </tr>");
            Output.WriteLine();
        }
        /// <summary> Renders the HTML for this element </summary>
        /// <param name="Output"> Textwriter to write the HTML for this element </param>
        /// <param name="Bib"> Object to populate this element from </param>
        /// <param name="Skin_Code"> Code for the current skin </param>
        /// <param name="IsMozilla"> Flag indicates if the current browse is Mozilla Firefox (different css choices for some elements)</param>
        /// <param name="PopupFormBuilder"> Builder for any related popup forms for this element </param>
        /// <param name="Current_User"> Current user, who's rights may impact the way an element is rendered </param>
        /// <param name="CurrentLanguage"> Current user-interface language </param>
        /// <param name="Translator"> Language support object which handles simple translational duties </param>
        /// <param name="Base_URL"> Base URL for the current request </param>
        /// <remarks> This simple element does not append any popup form to the popup_form_builder</remarks>
        public override void Render_Template_HTML(TextWriter Output, SobekCM_Item Bib, string Skin_Code, bool IsMozilla, StringBuilder PopupFormBuilder, User_Object Current_User, Web_Language_Enum CurrentLanguage, Language_Support_Info Translator, string Base_URL )
        {
            // Check that an acronym exists
            if (Acronym.Length == 0)
            {
                const string DEFAULT_ACRONYM = "Select the view types for this material when viewed online.";
                switch (CurrentLanguage)
                {
                    case Web_Language_Enum.English:
                        Acronym = DEFAULT_ACRONYM;
                        break;

                    case Web_Language_Enum.Spanish:
                        Acronym = DEFAULT_ACRONYM;
                        break;

                    case Web_Language_Enum.French:
                        Acronym = DEFAULT_ACRONYM;
                        break;

                    default:
                        Acronym = DEFAULT_ACRONYM;
                        break;
                }
            }

            string id_name = html_element_name.Replace("_", "");

            Output.WriteLine("  <!-- " + Title + " Element -->");
            Output.WriteLine("  <tr>");
            Output.WriteLine("    <td style=\"width:" + LEFT_MARGIN + "px\">&nbsp;</td>");
            if (Acronym.Length > 0)
            {
                Output.WriteLine("    <td class=\"metadata_label\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" target=\"_" + html_element_name.ToUpper() + "\"><acronym title=\"" + Acronym + "\">" + Translator.Get_Translation(Title, CurrentLanguage) + ":</acronym></a></td>");
            }
            else
            {
                Output.WriteLine("    <td class=\"metadata_label\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" target=\"_" + html_element_name.ToUpper() + "\">" + Translator.Get_Translation(Title, CurrentLanguage) + ":</a></td>");
            }
            Output.WriteLine("    <td>");
            Output.WriteLine("      <table>");
            Output.WriteLine("        <tr>");
            Output.WriteLine("          <td>");
            Output.WriteLine("            <div id=\"" + html_element_name + "_div\">");

            // Options = NONE, HTML, HTML_MAP, JPEG, JPEG2000, RELATED_IMAGES, TEXT, PAGE TURNER, GOOGLE MAP, EMPTY STRING
            // Get collection of all items
            List<View_Object> views = new List<View_Object>();
            if (Bib.Behaviors.Item_Level_Page_Views_Count > 0)
            {
                views.AddRange(Bib.Behaviors.Item_Level_Page_Views);
            }
            if (Bib.Behaviors.Views_Count > 0)
            {
                views.AddRange(Bib.Behaviors.Views.Where(ItemView => (ItemView.View_Type != View_Enum.CITATION) && (ItemView.View_Type != View_Enum.ALL_VOLUMES) && (ItemView.View_Type != View_Enum.DOWNLOADS) && (ItemView.View_Type != View_Enum.FLASH) && (ItemView.View_Type != View_Enum.GOOGLE_MAP) && (ItemView.View_Type != View_Enum.GOOGLE_MAP_BETA) && (ItemView.View_Type != View_Enum.PDF) && (ItemView.View_Type != View_Enum.TOC)));
            }

            if (views.Count == 0 )
            {
                const int i = 1;

                // Add the view types select
                Output.Write("<select name=\"" + id_name + "_type" + i + "\" id=\"" + id_name + "_type" + i + "\" class=\"" + html_element_name + "_type\" onchange=\"viewer_type_changed('" + id_name + "_type" + i + "');\">");
                Output.Write("<option value=\"\" selected=\"selected\">&nbsp;</option>");
                Output.Write("<option value=\"html\" >HTML</option>");
                Output.Write("<option value=\"htmlmap\" >HTML Map</option>");
                Output.Write("<option value=\"jpeg\" >JPEG</option>");
                Output.Write("<option value=\"jpeg2000\" >JPEG2000</option>");
                Output.Write("<option value=\"map\">Map Display</option>");
                Output.Write("<option value=\"mapbeta\">Map Display Beta</option>");
                Output.Write("<option value=\"pageturner\" >Page Turner</option>");
                Output.Write("<option value=\"related\" >Related Images</option>");
                Output.Write("<option value=\"text\" >Text</option>");
                Output.Write("<option value=\"tei\" >TEI</option>");
                Output.Write("</select>");

                // Add the file sublabel
                Output.Write("<span id=\"" + id_name + "_details" + i + "\" style=\"display:none\">");

                Output.Write("<span class=\"metadata_sublabel\">File:</span>");

                // Add the file select
                Output.Write("<select name=\"" + id_name + "_file" + i + "\" id=\"" + id_name + "_file" + i + "\" class=\"" + html_element_name + "_file\">");
                Output.Write("<option value=\"\" selected=\"selected\">&nbsp;</option>");
                Output.Write("</select>");

                // Add the label sublabel
                Output.Write("<span class=\"metadata_sublabel\">Label:</span>");

                // Add the label input
                Output.WriteLine("<input name=\"" + id_name + "_label" + i + "\" id=\"" + id_name + "_label" + i + "\" class=\"" + html_element_name + "_label_input sbk_Focusable\" type=\"text\" value=\"\" /></span>");
                Output.WriteLine("            </div>");
            }
            else
            {
                List<View_Enum> handledTypes = new List<View_Enum> {View_Enum.HTML, View_Enum.JPEG, View_Enum.JPEG2000, View_Enum.GOOGLE_MAP, View_Enum.PAGE_TURNER, View_Enum.RELATED_IMAGES,  View_Enum.TEXT, View_Enum.TEI, View_Enum.JPEG_TEXT_TWO_UP, View_Enum.DATASET_CODEBOOK, View_Enum.DATASET_REPORTS, View_Enum.DATASET_VIEWDATA };

                for (int i = 1; i <= views.Count; i++)
                {
                    if ((i == 1) || (handledTypes.Contains(views[i - 1].View_Type)))
                    {
                        // Add the view types select
                        Output.Write("<select name=\"" + id_name + "_type" + i + "\" id=\"" + id_name + "_type" + i + "\" class=\"" + html_element_name + "_type\" onchange=\"viewer_type_changed('" + id_name + "_type" + i + "');\">");
                        Output.Write(views[i - 1].View_Type == View_Enum.None
                                         ? "<option value=\"\" selected=\"selected\" >&nbsp;</option>"
                                         : "<option value=\"\">&nbsp;</option>");

                        Output.Write(views[i - 1].View_Type == View_Enum.DATASET_CODEBOOK
                                         ? "<option value=\"dscodebook\" selected=\"selected\" >Dataset Codebook</option>"
                                         : "<option value=\"dscodebook\" >Dataset Codebook</option>");

                        Output.Write(views[i - 1].View_Type == View_Enum.DATASET_REPORTS
                                         ? "<option value=\"dsreports\" selected=\"selected\" >Dataset Reports</option>"
                                         : "<option value=\"dsreports\" >Dataset Reports</option>");

                        Output.Write(views[i - 1].View_Type == View_Enum.DATASET_VIEWDATA
                                         ? "<option value=\"dsviewdata\" selected=\"selected\" >Dataset View Data</option>"
                                         : "<option value=\"dsviewdata\" >Dataset View Data</option>");

                        Output.Write(views[i - 1].View_Type == View_Enum.HTML
                                         ? "<option value=\"html\" selected=\"selected\" >HTML</option>"
                                         : "<option value=\"html\" >HTML</option>");

                        Output.Write(views[i - 1].View_Type == View_Enum.JPEG
                                         ? "<option value=\"jpeg\" selected=\"selected\" >JPEG</option>"
                                         : "<option value=\"jpeg\" >JPEG</option>");

                        Output.Write(views[i - 1].View_Type == View_Enum.JPEG_TEXT_TWO_UP
                                        ? "<option value=\"jpeg2up\" selected=\"selected\" >JPEG AND TEXT</option>"
                                        : "<option value=\"jpeg2up\" >JPEG AND TEXT</option>");

                        Output.Write(views[i - 1].View_Type == View_Enum.JPEG2000
                                         ? "<option value=\"jpeg2000\" selected=\"selected\" >JPEG2000</option>"
                                         : "<option value=\"jpeg2000\" >JPEG2000</option>");

                        Output.Write(views[i - 1].View_Type == View_Enum.GOOGLE_MAP
                                         ? "<option value=\"map\" selected=\"selected\" >Map Display</option>"
                                         : "<option value=\"map\" >Map Display</option>");

                        Output.Write(views[i - 1].View_Type == View_Enum.GOOGLE_MAP_BETA
                                         ? "<option value=\"mapbeta\" selected=\"selected\" >Map Display Beta</option>"
                                         : "<option value=\"mapbeta\" >Map Display Beta</option>");

                        Output.Write(views[i - 1].View_Type == View_Enum.PAGE_TURNER
                                         ? "<option value=\"pageturner\" selected=\"selected\" >Page Turner</option>"
                                         : "<option value=\"pageturner\" >Page Turner</option>");

                        Output.Write(views[i - 1].View_Type == View_Enum.RELATED_IMAGES
                                         ? "<option value=\"related\" selected=\"selected\" >Related Images</option>"
                                         : "<option value=\"related\" >Related Images</option>");

                        Output.Write(views[i - 1].View_Type == View_Enum.TEXT
                                         ? "<option value=\"text\" selected=\"selected\" >Text</option>"
                                         : "<option value=\"text\" >Text</option>");

                        Output.Write(views[i - 1].View_Type == View_Enum.TEI
                                         ? "<option value=\"tei\" selected=\"selected\" >TEI</option>"
                                         : "<option value=\"tei\" >TEI</option>");

                        Output.Write("</select>");

                        // Add the file sublabel
                        Output.Write("<span id=\"" + id_name + "_details" + i + "\" style=\"display:none\">");
                        Output.Write("<span class=\"metadata_sublabel\">File:</span>");

                        // Add the file select
                        Output.Write("<select name=\"" + id_name + "_file" + i + "\" id=\"" + id_name + "_file" + i + "\" class=\"" + html_element_name + "_file\">");

                        if (views[i - 1].FileName.Length > 0)
                        {
                            Output.Write("<option value=\"\">&nbsp;</option>");
                            Output.Write("<option value=\"" + views[i - 1].FileName + "\" selected=\"selected\">" + views[i - 1].FileName + "</option>");
                        }
                        else
                        {
                            Output.Write("<option value=\"\" selected=\"selected\">&nbsp;</option>");
                        }
                        Output.Write("</select>");

                        // Add the label sublabel
                        Output.Write("<span class=\"metadata_sublabel\">Label:</span>");

                        // Add the label input
                        Output.Write("<input name=\"" + id_name + "_label" + i + "\" id=\"" + id_name + "_label" + i + "\" class=\"" + html_element_name + "_label_input sbk_Focusable\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(views[i - 1].Label) + "\" /></span>");

                        Output.WriteLine(i < views.Count ? "<br />" : "</div>");
                    }
                }
            }
            Output.WriteLine("          </td>");

            Output.WriteLine("          <td style=\"vertical-align:bottom\" >");
            if (Repeatable)
            {
                Output.WriteLine("            <a title=\"" + Translator.Get_Translation("Click to add a new type of viewer", CurrentLanguage) + ".\" href=\"" + Base_URL + "l/technical/javascriptrequired\" onmousedown=\"return add_viewer_element();\"><img border=\"0px\" class=\"repeat_button\" src=\"" + Base_URL + REPEAT_BUTTON_URL + "\" /></a>");
            }
            Output.WriteLine("            <a target=\"_" + html_element_name.ToUpper() + "\"  title=\"" + Translator.Get_Translation("Get help.", CurrentLanguage) + "\" href=\"" + Help_URL(Skin_Code, Base_URL) + "\" ><img class=\"help_button\" src=\"" + Base_URL + HELP_BUTTON_URL + "\" /></a>");
            Output.WriteLine("          </td>");

            Output.WriteLine("        </tr>");
            Output.WriteLine("      </table>");
            Output.WriteLine("    </td>");
            Output.WriteLine("  </tr>");
            Output.WriteLine();
        }