Get_Translation() public method

Generic method requests translation from the appropriate translation dictionary
public Get_Translation ( string English, Web_Language_Enum Language ) : string
English string Term in english
Language Web_Language_Enum Current language of the web interface
return string
        /// <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>");
            Output.WriteLine("    <td style=\"width:" + LEFT_MARGIN + "px\">&nbsp;</td>");

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

            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(label_to_show, 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(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 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=\"" + 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 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_Views_Searches_Enum ThisView, Navigation_Object Current_Mode, Language_Support_Info Translations )
        {
            string skinCode = Current_Mode.Base_Skin_Or_Skin;

            switch (ThisView)
            {
                case Item_Aggregation_Views_Searches_Enum.Advanced_Search:
                case Item_Aggregation_Views_Searches_Enum.Advanced_Search_YearRange:
                case Item_Aggregation_Views_Searches_Enum.Advanced_Search_MimeType:
                    return Menu_HTML_Helper(skinCode, Search_Type_Enum.Advanced, Translations.Get_Translation("Advanced Search", Current_Mode.Language), Current_Mode);

                case Item_Aggregation_Views_Searches_Enum.Basic_Search:
                case Item_Aggregation_Views_Searches_Enum.Basic_Search_YearRange:
                case Item_Aggregation_Views_Searches_Enum.Basic_Search_MimeType:
                    return Menu_HTML_Helper(skinCode, Search_Type_Enum.Basic, Translations.Get_Translation("Basic Search", Current_Mode.Language), Current_Mode);

                case Item_Aggregation_Views_Searches_Enum.Map_Search:
                    return Menu_HTML_Helper(skinCode, Search_Type_Enum.Map, Translations.Get_Translation("Map Search", Current_Mode.Language), Current_Mode);

                case Item_Aggregation_Views_Searches_Enum.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_Views_Searches_Enum.Newspaper_Search:
                    return Menu_HTML_Helper(skinCode, Search_Type_Enum.Newspaper, Translations.Get_Translation("Newspaper Search", Current_Mode.Language), Current_Mode);

                case Item_Aggregation_Views_Searches_Enum.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_Views_Searches_Enum.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_Views_Searches_Enum.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> 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 about any related items here.";
                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>");
            }

            // Make sure there is at least one related item
            if (Bib.Bib_Info.RelatedItems_Count == 0)
                Bib.Bib_Info.Add_Related_Item(new Related_Item_Info());

            Output.WriteLine("    <td>");
            Output.WriteLine("      <table>");
            Output.WriteLine("        <tr>");
            Output.WriteLine("          <td>");
            Output.Write("      <div id=\"" + html_element_name + "_div\">");
            int item_index = 1;
            if (Bib.Bib_Info.RelatedItems_Count > 0)
            {
                foreach (Related_Item_Info thisItem in Bib.Bib_Info.RelatedItems)
                {
                    // Add this related item links
                    if ((thisItem.hasMainTitle) && (thisItem.Main_Title.Title.Length > 0))
                    {
                        Output.Write("\n        <a title=\"Click to edit this related item\" href=\"" + Base_URL + "l/technical/javascriptrequired\" onfocus=\"link_focused2('form_related_item_term_" + item_index + "')\" onblur=\"link_blurred2('form_related_item_term_" + item_index + "')\" onkeypress=\"return popup_keypress_focus('form_related_item_" + item_index + "', 'form_relateditem_title_" + item_index + "', '" + IsMozilla.ToString() + "' );\" onclick=\"return popup_focus('form_related_item_" + item_index + "', 'form_relateditem_title_" + item_index + "' );\"><div class=\"form_linkline form_related_item_line\" id=\"form_related_item_term_" + item_index + "\">");

                        if (thisItem.URL_Display_Label.Length > 0)
                        {
                            Output.Write("( <i>" + thisItem.URL_Display_Label + "</i> ) " + thisItem.Main_Title.Title);
                        }
                        else
                        {
                            string relation = String.Empty;
                            switch (thisItem.Relationship)
                            {
                                case Related_Item_Type_Enum.Succeeding:
                                    relation = "( <i>Succeeded by</i> ) ";
                                    break;

                                case Related_Item_Type_Enum.OtherVersion:
                                    relation = "( <i>Other Version</i> ) ";
                                    break;

                                case Related_Item_Type_Enum.OtherFormat:
                                    relation = "( <i>Other Format</i> ) ";
                                    break;

                                case Related_Item_Type_Enum.Preceding:
                                    relation = "( <i>Preceded by</i> ) ";
                                    break;

                                case Related_Item_Type_Enum.Host:
                                    relation = "( <i>Host</i> ) ";
                                    break;
                            }
                            Output.Write(relation + thisItem.Main_Title.Title);
                        }
                    }
                    else
                    {
                        Output.Write("\n        <a title=\"Click to edit this related item\" href=\"" + Base_URL + "l/technical/javascriptrequired\" onfocus=\"link_focused2('form_related_item_term_" + item_index + "')\" onblur=\"link_blurred2('form_related_item_term_" + item_index + "')\" onkeypress=\"return popup_keypress_focus('form_related_item_" + item_index + "', 'form_relateditem_title_" + item_index + "', '" + IsMozilla.ToString() + "' );\" onclick=\"return popup_focus('form_related_item_" + item_index + "', 'form_relateditem_title_" + item_index + "' );\"><div class=\"form_linkline_empty form_related_item_line\" id=\"form_related_item_term_" + item_index + "\">");

                        Output.Write("<i>Empty Related Item</i>");
                    }

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

                    // Add the popup form
                    PopupFormBuilder.AppendLine("<!-- Related Item Form " + item_index + " -->");
                    PopupFormBuilder.AppendLine("<div class=\"related_item_popup_div sbkMetadata_PopupDiv\" id=\"form_related_item_" + item_index + "\" style=\"display:none;\">");
                    PopupFormBuilder.AppendLine("  <div class=\"sbkMetadata_PopupTitle\"><table style=\"width:100%\"><tr><td style=\"text-align:left\">Edit Related Items</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_related_item_form('form_related_item_" + item_index + "')\">X</a> &nbsp; </td></tr></table></div>");
                    PopupFormBuilder.AppendLine("  <br />");
                    PopupFormBuilder.AppendLine("  <table class=\"sbkMetadata_PopupTable\">");

                    // Add the relation and display label
                    PopupFormBuilder.Append("    <tr><td style=\"width:90px\">Relation:</td><td><select class=\"form_relateditem_select\" name=\"form_relateditem_relation_" + item_index + "\" id=\"form_relateditem_relation_" + item_index + "\" >");
                    PopupFormBuilder.Append(thisItem.Relationship == Related_Item_Type_Enum.UNKNOWN
                                                  ? "<option value=\"\" selected=\"selected\" >&nbsp;</option>"
                                                  : "<option value=\"\">&nbsp;</option>");

                    PopupFormBuilder.Append(thisItem.Relationship == Related_Item_Type_Enum.Host
                                                  ? "<option value=\"host\" selected=\"selected\" >Host</option>"
                                                  : "<option value=\"host\">Host</option>");

                    PopupFormBuilder.Append(thisItem.Relationship == Related_Item_Type_Enum.OtherFormat
                                                  ? "<option value=\"other_format\" selected=\"selected\" >Other Format</option>"
                                                  : "<option value=\"other_format\">Other Format</option>");

                    PopupFormBuilder.Append(thisItem.Relationship == Related_Item_Type_Enum.OtherVersion
                                                  ? "<option value=\"other_version\" selected=\"selected\" >Other Version</option>"
                                                  : "<option value=\"other_version\">Other Version</option>");

                    PopupFormBuilder.Append(thisItem.Relationship == Related_Item_Type_Enum.Preceding
                                                  ? "<option value=\"preceding\" selected=\"selected\" >Preceding</option>"
                                                  : "<option value=\"preceding\">Preceding</option>");

                    PopupFormBuilder.Append(thisItem.Relationship == Related_Item_Type_Enum.Succeeding
                                                  ? "<option value=\"succeeding\" selected=\"selected\" >Succeeding</option>"
                                                  : "<option value=\"succeeding\">Succeeding</option>");

                    PopupFormBuilder.Append("</select></td>");
                    PopupFormBuilder.AppendLine("      <td style=\"width:255px\">Display Label: &nbsp; <input class=\"form_relateditem_medium_input sbk_Focusable\" name=\"form_relateditem_display_" + item_index + "\" id=\"form_relateditem_display_" + item_index + "\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(thisItem.URL_Display_Label) + "\" /></td>");
                    PopupFormBuilder.AppendLine("    </tr>");

                    string issn = String.Empty;
                    string oclc = String.Empty;
                    string lccn = String.Empty;
                    if (thisItem.Identifiers_Count > 0)
                    {
                        foreach (Identifier_Info thisIdentifier in thisItem.Identifiers)
                        {
                            switch (thisIdentifier.Type.ToUpper())
                            {
                                case "ISSN":
                                    issn = thisIdentifier.Identifier;
                                    break;

                                case "OCLC":
                                    oclc = thisIdentifier.Identifier;
                                    break;

                                case "LCCN":
                                    lccn = thisIdentifier.Identifier;
                                    break;
                            }
                        }
                    }

                    // Add the title and URL rows
                    string related_title = String.Empty;
                    if (thisItem.hasMainTitle)
                        related_title = thisItem.Main_Title.Title;

                    PopupFormBuilder.AppendLine("    <tr><td>Title:</td><td colspan=\"2\"><input class=\"form_relateditem_large_input sbk_Focusable\" name=\"form_relateditem_title_" + item_index + "\" id=\"form_relateditem_title_" + item_index + "\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(related_title) + "\" /></td></tr>");
                    PopupFormBuilder.AppendLine("    <tr><td>URL:</td><td colspan=\"2\"><input class=\"form_relateditem_large_input sbk_Focusable\" name=\"form_relateditem_url_" + item_index + "\" id=\"form_relateditem_url_" + item_index + "\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(thisItem.URL) + "\" /></td></tr>");

                    // Add the system ID and ISSN row
                    PopupFormBuilder.AppendLine("    <tr><td>System ID:</td><td><input class=\"form_relateditem_medium_input sbk_Focusable\" name=\"form_relateditem_sobekid_" + item_index + "\" id=\"form_relateditem_sobekid_" + item_index + "\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(thisItem.SobekCM_ID) + "\" /></td>");
                    PopupFormBuilder.AppendLine("        <td>ISSN: &nbsp; <input class=\"form_relateditem_medium_input sbk_Focusable\" name=\"form_relateditem_issn_" + item_index + "\" id=\"form_relateditem_issn_" + item_index + "\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(issn) + "\" /></td></tr>");

                    // Add the OCLC and LCCN row
                    PopupFormBuilder.AppendLine("    <tr><td>OCLC:</td><td><input class=\"form_relateditem_medium_input sbk_Focusable\" name=\"form_relateditem_oclc_" + item_index + "\" id=\"form_relateditem_oclc_" + item_index + "\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(oclc) + "\" /></td>");
                    PopupFormBuilder.AppendLine("        <td>LCCN: &nbsp; <input class=\"form_relateditem_medium_input sbk_Focusable\" name=\"form_relateditem_lccn_" + item_index + "\" id=\"form_relateditem_lccn_" + item_index + "\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(lccn) + "\" /></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_related_item_form('form_related_item_" + item_index + "');\">CLOSE</button></td>");
                    PopupFormBuilder.AppendLine("    </tr>");
                    PopupFormBuilder.AppendLine("  </table>");
                    PopupFormBuilder.AppendLine("</div>");
                    PopupFormBuilder.AppendLine();

                    item_index++;
                }
            }

            // Add the link to add a new related item 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 related item", CurrentLanguage) + ".\" alt=\"+\" class=\"repeat_button\" src=\"" + REPEAT_BUTTON_URL + "\" onmousedown=\"new_relateditem_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=\"" + 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> 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>");
            Output.WriteLine("    <td style=\"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 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 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 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 border=\"0px\" class=\"help_button\" src=\"" + 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 sbk_Focusable\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(instance_value.Replace("<i>", "").Replace("</i>", "")) + "\" />");
                Output.WriteLine("            </div>");
                Output.WriteLine("          </td>");
                Output.WriteLine("          <td style=\"vertical-align: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 class=\"repeat_button\" src=\"" + 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=\"" + 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;
                }
            }

            // Get the list of viewers in the system available
            List<string> systemViewers = new List<string>();
            foreach (var viewer in UI_ApplicationCache_Gateway.Configuration.UI.WriterViewers.Items.Viewers)
            {
                if ((viewer.Enabled) && (!viewer.ManagementViewer))
                {
                    systemViewers.Add(viewer.ViewerType);
                }
            }

            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.Views != null ) && ( Bib.Behaviors.Views_Count > 0))
            {
                views.AddRange(Bib.Behaviors.Views.Where(ThisView => !ThisView.Exclude));
            }

            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\" >");
                Output.Write("<option value=\"\" selected=\"selected\">&nbsp;</option>");

                foreach (string systemViewer in systemViewers)
                {
                    Output.Write("<option value=\"" + systemViewer + "\">" + systemViewer.Replace("_", " ") + "</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
            {
                int viewCount = 1;
                foreach (View_Object thisView in views)
                {
                    // Add the view types select
                    Output.Write("<select name=\"" + id_name + "_type" + viewCount + "\" id=\"" + id_name + "_type" + viewCount + "\" class=\"" + html_element_name + "_type\" >");
                    Output.Write("<option value=\"\" selected=\"selected\">&nbsp;</option>");

                    foreach (string systemViewer in systemViewers)
                    {
                        if (String.Compare(thisView.View_Type, systemViewer, StringComparison.OrdinalIgnoreCase) == 0)
                            Output.Write("<option value=\"" + systemViewer + "\" selected=\"selected\" >" + systemViewer.Replace("_", " ") + "</option>");
                        else
                            Output.Write("<option value=\"" + systemViewer + "\">" + systemViewer.Replace("_", " ") + "</option>");
                    }
                    Output.Write("</select>");

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

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

                    //if (thisView.Attributes.Length > 0)
                    //{
                    //    Output.Write("<option value=\"\">&nbsp;</option>");
                    //    Output.Write("<option value=\"" + thisView.Attributes + "\" selected=\"selected\">" + thisView.Attributes + "</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" + viewCount + "\" id=\"" + id_name + "_label" + viewCount + "\" class=\"" + html_element_name + "_label_input sbk_Focusable\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(thisView.Label) + "\" /></span>");

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

                    viewCount++;
                }

                // Add an empty viewer line as well
                // Add the view types select
                Output.Write("<select name=\"" + id_name + "_type" + viewCount + "\" id=\"" + id_name + "_type" + viewCount + "\" class=\"" + html_element_name + "_type\" >");
                Output.Write("<option value=\"\" selected=\"selected\">&nbsp;</option>");

                foreach (string systemViewer in systemViewers)
                {
                    Output.Write("<option value=\"" + systemViewer + "\">" + systemViewer.Replace("_", " ") + "</option>");
                }
                Output.Write("</select>");

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

                //// Add the file select
                //Output.Write("<select name=\"" + id_name + "_file" + viewCount + "\" id=\"" + id_name + "_file" + viewCount + "\" 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.Write("<input name=\"" + id_name + "_label" + viewCount + "\" id=\"" + id_name + "_label" + viewCount + "\" class=\"" + html_element_name + "_label_input sbk_Focusable\" type=\"text\" value=\"\" /></span>");

                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 a new type of viewer", CurrentLanguage) + ".\" href=\"" + Base_URL + "l/technical/javascriptrequired\" onmousedown=\"return add_viewer_element();\"><img border=\"0px\" class=\"repeat_button\" src=\"" + 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=\"" + 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 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=\"" + 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=\"" + 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>");
            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\">");
            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 sbk_Focusable\" >" + 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 sbk_Focusable\" >" + HttpUtility.HtmlEncode(allValues[i]) + "</textarea><br />");
                }
            }
            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=\"" + 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=\"" + 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 = "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 = 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;
                }
            }

            // 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>");
            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 style=\"text-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\" >");
                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 sbk_Focusable\" type=\"text\" value=\"\" />");
                Output.WriteLine("              </div>");
                Output.WriteLine("              <textarea rows=\"" + Rows + "\" cols=\"" + actual_cols + "\" name=\"" + id_name + "_textarea1\" id=\"" + id_name + "_textarea1\" class=\"" + html_element_name + "_input sbk_Focusable\" ></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 + "\" >");
                    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 sbk_Focusable\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(thisAbstract.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 sbk_Focusable\" >" + 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 style=\"vertical-align: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 class=\"repeat_button\" src=\"" + 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=\"" + 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>");
            Output.WriteLine("    <td style=\"width:" + LEFT_MARGIN + "px\">&nbsp;</td>");
            if (Title.IndexOf(":") < 0)
            {
                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>");
                }
            }
            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 + "\">" + 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\">");

                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 sbk_Focusable\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(instance_values_text1[i - 1]) + "\" />");

                    // 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 sbk_Focusable\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(instance_values_text2[i - 1]) + "\"  />");
                    Output.WriteLine(i < instance_values_text1.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 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=\"" + 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=\"" + 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 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=\"" + 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=\"" + 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 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=\"" + 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> 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 Tabs2_Get_Nav_Bar_HTML( Item_Aggregation_Views_Searches_Enum ThisView, Navigation_Object Current_Mode, Language_Support_Info Translations, bool Downward_Tabs )
        {
            string skinCode = Current_Mode.Base_Skin_Or_Skin;

            switch (ThisView)
            {
                case Item_Aggregation_Views_Searches_Enum.Advanced_Search:
                case Item_Aggregation_Views_Searches_Enum.Advanced_Search_YearRange:
                    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 Tabs_HTML_Helper(skinCode, Search_Type_Enum.Advanced, Translations.Get_Translation("ADVANCED SEARCH", Current_Mode.Language), Current_Mode, Downward_Tabs);

                case Item_Aggregation_Views_Searches_Enum.Basic_Search:
                case Item_Aggregation_Views_Searches_Enum.Basic_Search_YearRange:
                    return Tabs_HTML_Helper(skinCode, Search_Type_Enum.Basic, Translations.Get_Translation("BASIC SEARCH", Current_Mode.Language), Current_Mode, Downward_Tabs);

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

                case Item_Aggregation_Views_Searches_Enum.Map_Search_Beta:
                    return Tabs_HTML_Helper(skinCode, Search_Type_Enum.Map_Beta, Translations.Get_Translation("MAP SEARCH", Current_Mode.Language), Current_Mode, Downward_Tabs);

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

                case Item_Aggregation_Views_Searches_Enum.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_Views_Searches_Enum.DLOC_FullText_Search:
                    return Tabs_HTML_Helper(skinCode, Search_Type_Enum.dLOC_Full_Text, Translations.Get_Translation("TEXT SEARCH", Current_Mode.Language), Current_Mode, Downward_Tabs);

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

            return String.Empty;
        }
        /// <summary> Method helps to render all multiple 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="possible_values"> Possible vlaues for this combo boxes </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, List<string> possible_values, 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 (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>");
                Output.Write(instance_value);
                Output.WriteLine("</td>");
            }
            else
            {
                Output.WriteLine("    <td>");
                Output.WriteLine("      <table>");
                Output.WriteLine("        <tr>");
                Output.WriteLine("          <td>");
                Output.WriteLine("            <div id=\"" + html_element_name + "_div\">");

                const int i = 1;

                string value = instance_value;
                    Output.WriteLine("              <select name=\"" + id_name + i + "\" id=\"" + id_name + i + "\" class=\"" + html_element_name + "_input\" type=\"text\" >");
                    bool found = false;
                    if (value.Length == 0)
                    {
                        found = true;
                        Output.WriteLine("                <option value=\"\" selected=\"selected\" >&nbsp;</option>");
                    }
                    else
                    {
                        Output.WriteLine("                <option value=\"\">&nbsp;</option>");
                    }
                    foreach (string item in possible_values)
                    {
                        if (item.ToUpper() == value.ToUpper())
                        {
                            found = true;
                            Output.WriteLine("                <option value=\"" + item + "\" selected=\"selected\" >" + item + "</option>");
                        }
                        else
                        {
                            Output.WriteLine("                <option value=\"" + item + "\">" + item + "</option>");
                        }
                    }
                    if (!found)
                    {
                        Output.WriteLine("                <option value=\"" + value + "\" selected=\"selected\" >" + value + "</option>");
                    }
                    Output.WriteLine("              </select>");

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

                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)
                {
                    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=\"" + REPEAT_BUTTON_URL + "\" onmousedown=\"add_new_multi_combo_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 class=\"help_button\" src=\"" + 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 )
        {
            string onChange = "javascript:__doPostBack('newpagebutton1','')";

            // 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.DefaultType)
                            {
                                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>");
            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\">");

            // 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\" >");
                }
            }

            // Correction for aerials
            if (instance_value == "Aerial Photography")
                instance_value = "Aerial";

            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;
            string computerfileform = 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;

                case "DATASET":
                    formType = Type_Format_Type_Enum.Computer_Files;
                    class_name = "typeformat_computer_popup_div";
                    form_title = "Edit Computer File 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, territorial, 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 literary forms
            List<string> computer_file_form_list = new List<string>(12)
                                                  {
                                                      "numeric data",
                                                      "computer program",
                                                      "representational",
                                                      "document",
                                                      "bibliographic data",
                                                      "font",
                                                      "game",
                                                      "sound",
                                                      "interactive multimedia",
                                                      "online system or service",
                                                      "combination",
                                                      "other computer file"
                                                  };

            // 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 (formType == Type_Format_Type_Enum.Computer_Files)
                        {
                            if (computer_file_form_list.Contains(genre_term_lower))
                                computerfileform = 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 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=\"" + 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
            PopupFormBuilder.AppendLine("<!-- Type Format Form -->");
            PopupFormBuilder.AppendLine("<div class=\"" + class_name + " sbkMetadata_PopupDiv\" id=\"form_typeformat\" style=\"display:none;\">");
            PopupFormBuilder.AppendLine("  <div class=\"sbkMetadata_PopupTitle\"><table style=\"width:100%\"><tr><td style=\"text-align:left\">" + form_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_typeformat_form()\">X</a> &nbsp; </td></tr></table></div>");
            PopupFormBuilder.AppendLine("  <br />");
            PopupFormBuilder.AppendLine("  <table class=\"sbkMetadata_PopupTable\">");

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

            // Add the extent information
            PopupFormBuilder.Append("    <tr><td> &nbsp; &nbsp; Physical Desc:</td><td colspan=\"2\">");
            PopupFormBuilder.Append("<input class=\"formtype_large_input sbk_Focusable\" name=\"form_typeformat_extent\" id=\"form_typeformat_extent\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(Bib.Bib_Info.Original_Description.Extent) + "\" />");
            PopupFormBuilder.AppendLine("</td></tr>");

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

            // Add the place code info
            PopupFormBuilder.Append("    <tr><td> &nbsp; &nbsp; Place Code:</td><td colspan=\"2\">");
            PopupFormBuilder.Append("<input class=\"formtype_small_input sbk_Focusable\" name=\"form_typeformat_placecode\" id=\"form_typeformat_placecode\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(place_code) + "\" />");
            PopupFormBuilder.AppendLine("</td></tr>");

            // Add the language code info
            PopupFormBuilder.Append("    <tr><td> &nbsp; &nbsp; Language Code:</td><td colspan=\"2\">");
            PopupFormBuilder.Append("<input class=\"formtype_small_input sbk_Focusable\" name=\"form_typeformat_langcode\" id=\"form_typeformat_langcode\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(language_code) + "\" />");
            PopupFormBuilder.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
                PopupFormBuilder.AppendLine("    <tr><td colspan=\"3\" class=\"SobekEditItemSectionTitle\" >Book Details</td></tr>");

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

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

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

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

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

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

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

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

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

                // Add the checkboxes
                PopupFormBuilder.Append("    <tr><td colspan=\"3\"> &nbsp; &nbsp; ");
                PopupFormBuilder.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; ");

                PopupFormBuilder.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; ");

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

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

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

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

                // Add the bibliography info
                PopupFormBuilder.Append("    <tr><td> &nbsp; &nbsp; Biography:</td><td colspan=\"2\">");
                PopupFormBuilder.Append("<select class=\"formtype_medium_select\" name=\"form_typeformat_biography\" id=\"form_typeformat_biography\" >");
                PopupFormBuilder.Append(biography.Length == 0
                                              ? "<option value=\"\" selected=\"selected\" ></option>"
                                              : "<option value=\"\"></option>");
                foreach (string thisString in biography_list)
                {
                    if (biography == thisString)
                    {
                        PopupFormBuilder.Append("<option value=\"" + thisString + "\" selected=\"selected\">" + thisString + "</option>");
                    }
                    else
                    {
                        PopupFormBuilder.Append("<option value=\"" + thisString + "\">" + thisString + "</option>");
                    }
                }
                PopupFormBuilder.Append("</select>");
                PopupFormBuilder.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
                PopupFormBuilder.AppendLine("    <tr><td colspan=\"3\" class=\"SobekEditItemSectionTitle\">Visual Materials Details</td></tr>");

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

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

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

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

            #endregion

            #region Render the 'Map Materials' section if necessary

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

                // Add the projection code and scale
                PopupFormBuilder.Append("    <tr><td> &nbsp; &nbsp; Projection Code:</td><td>");
                PopupFormBuilder.Append("<input class=\"formtype_small_input sbk_Focusable\" name=\"form_typeformat_projcode\" id=\"form_typeformat_projcode\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(projection) + "\" /></td>");
                PopupFormBuilder.AppendLine("<td width=\"250px\">Scale: &nbsp; &nbsp; <input class=\"formtype_small_input sbk_Focusable\" name=\"form_typeformat_scale\" id=\"form_typeformat_scale\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(scale) + "\" /></td></tr>");

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

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

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

                PopupFormBuilder.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
                PopupFormBuilder.AppendLine("    <tr><td colspan=\"3\" class=\"SobekEditItemSectionTitle\" >Continuing Resources Details</td></tr>");

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

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

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

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

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

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

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

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

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

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

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

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

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

                // Add the checkboxes
                PopupFormBuilder.Append("    <tr><td> &nbsp; &nbsp; Conference Production:");
                PopupFormBuilder.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; ");
                PopupFormBuilder.AppendLine("</td></tr>");
            }

            #endregion

            #region Render the 'Computer Files' section if necessary

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

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

                // Add the form
                PopupFormBuilder.Append("    <tr><td> &nbsp; &nbsp; File Type:</td><td colspan=\"2\">");
                PopupFormBuilder.Append("<select class=\"formtype_medium_select\" name=\"form_typeformat_subtype\" id=\"form_typeformat_subtype\" >");
                PopupFormBuilder.Append(subtype.Length == 0
                                              ? "<option value=\"\" selected=\"selected\" ></option>"
                                              : "<option value=\"\"></option>");
                foreach (string thisString in computer_file_form_list)
                {
                    if (computerfileform == thisString)
                    {
                        PopupFormBuilder.Append("<option value=\"" + thisString + "\" selected=\"selected\">" + thisString + "</option>");
                    }
                    else
                    {
                        PopupFormBuilder.Append("<option value=\"" + thisString + "\">" + thisString + "</option>");
                    }
                }
                PopupFormBuilder.Append("</select>");
                PopupFormBuilder.AppendLine("</td></tr>");

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

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

            #endregion

            #region Finish the pop-up form

            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_typeformat_form();\">CLOSE</button></td>");
            PopupFormBuilder.AppendLine("    </tr>");
            PopupFormBuilder.AppendLine("  </table>");
            PopupFormBuilder.AppendLine("</div>");
            PopupFormBuilder.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 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=\"" + 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="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 type which best categorizes this material and provide information about the larger body of work on the next line.";
                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;
                }
            }

            // Determine the material type
            string material_type;
            string sobekcm_type = Bib.Bib_Info.SobekCM_Type_String;
            if (sobekcm_type.Length == 0)
                material_type = "Select Material Type";
            else
            {
                material_type = sobekcm_type == "Archival" ? Bib.Bib_Info.Original_Description.Extent : sobekcm_type;
            }

            // Determine the text for the larger body of work
            string larger_text;
            string larger_value = String.Empty;
            bool other_value = false;
            switch (material_type)
            {
                case "Book Chapter":
                    larger_text = "Book Title:";
                    larger_value = Bib.Bib_Info.SeriesTitle.ToString();
                    break;

                case "Conference Papers":
                case "Conference Proceedings":
                    larger_text = "Conference Name:";
                    if (Bib.Bib_Info.Names_Count > 0)
                    {
                        foreach (Name_Info thisName in Bib.Bib_Info.Names)
                        {
                            if ((thisName.Name_Type == Name_Info_Type_Enum.Conference) && (thisName.Full_Name.Length > 0))
                            {
                                larger_value = thisName.ToString();
                                break;
                            }
                        }
                    }
                    break;

                case "Course Material":
                    larger_text = "Course Name:";
                    larger_value = Bib.Bib_Info.SeriesTitle.ToString();
                    break;

                case "Journal Article":
                    larger_text = "Journal Citation:";
                    larger_value = Bib.Bib_Info.SeriesTitle.ToString();
                    break;

                case "Technical Reports":
                    larger_text = "Series Title:";
                    larger_value = Bib.Bib_Info.SeriesTitle.ToString();
                    break;

                case "Select Material Type":
                    larger_text = "Larger Body of Work:";
                    larger_value = Bib.Bib_Info.SeriesTitle.ToString();
                    break;

                default:
                    material_type = "Other";
                    larger_text = "Larger Body of Work:";
                    larger_value = Bib.Bib_Info.SeriesTitle.ToString();
                    other_value = true;
                    break;
            }

            string id_name ="irtype";
            string html_element_name_irtype = "ir_type";
            string title = "Material Type";

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

            Output.WriteLine("  <!-- Institutional Repository Material Type 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_irtype.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_irtype.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_irtype + "_div\">");
            if (material_type.IndexOf("Select") == 0)
            {
                Output.WriteLine("              <select class=\"" + html_element_name_irtype + "_input_init\" name=\"" + id_name + "\" id=\"" + id_name + "\" onchange=\"javascript:ir_type_change()\" >");
            }
            else
            {
                Output.WriteLine("              <select class=\"" + html_element_name_irtype + "_input\" name=\"" + id_name + "\" id=\"" + id_name + "\" onchange=\"javascript:ir_type_change()\" >");
            }

            bool found_option = false;
            foreach (string thisOption in items)
            {
                if (thisOption == material_type)
                {
                    Output.WriteLine("                <option selected=\"selected=\" value=\"" + thisOption + "\">" + thisOption + "</option>");
                    found_option = true;
                }
                else
                {
                    Output.WriteLine("                <option value=\"" + thisOption + "\">" + thisOption + "</option>");
                }
            }
            if ((material_type.Length > 0) && (!restrict_values) && (!found_option))
            {
                Output.WriteLine("                <option selected=\"selected=\" value=\"" + material_type + "\">" + material_type + "</option>");
            }
            Output.WriteLine("              </select>");
            if (other_value)
            {
                Output.WriteLine("              <span class=\"metadata_sublabel\" id=\"irtype_othertext\" name=\"irtype_othertext\">" + Translator.Get_Translation("Specify Type", CurrentLanguage) + ":</span>");
                Output.WriteLine("              <input type=\"text\" class=\"irtype_other_input sbk_Focusable\" id=\"irtype_otherinput\" name=\"irtype_otherinput\" value=\"" + HttpUtility.HtmlEncode(Bib.Bib_Info.Original_Description.Extent) + "\" />");

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

            id_name = "largerbody";
            html_element_name_irtype = "larger_body";
            title = larger_text;

            Output.WriteLine("  <!-- Institutional Repository Larger Body of Work (IR_Type_Element) -->");
            Output.WriteLine("  <tr>");
            Output.WriteLine("    <td style\"" + LEFT_MARGIN + "px\">&nbsp;</td>");
            if (Read_Only)
            {
                Output.WriteLine("    <td class=\"metadata_label\">" + Translator.Get_Translation(title, CurrentLanguage) + "</td>");
            }
            else
            {
                if (Acronym.Length > 0)
                {
                    Output.WriteLine("    <td class=\"metadata_label\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" target=\"_" + html_element_name_irtype.ToUpper() + "\"><acronym title=\"" + Acronym + "\"><span id=\"larger_body_label\">" + title + "</span></acronym></a></td>");
                }
                else
                {
                    Output.WriteLine("    <td class=\"metadata_label\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" target=\"_" + html_element_name_irtype.ToUpper() + "\"><span id=\"larger_body_label\">" + title + "</span></a></td>");
                }
            }

            if (Read_Only)
            {
                Output.Write("    <td>");
                Output.Write(larger_value);
                Output.WriteLine("</td>");
            }
            else
            {
                Output.WriteLine("    <td>");
                Output.WriteLine("      <table><tr><td>");
                Output.WriteLine("      <div id=\"" + html_element_name_irtype + "_div\">");
                Output.WriteLine("      <input name=\"" + id_name + "\" id=\"" + id_name + "\" class=\"" + html_element_name_irtype + "_input sbk_Focusable\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(larger_value.Replace("<i>", "").Replace("</i>", "")) + "\" /></div>");
                Output.WriteLine("    </td>");
                Output.WriteLine("         <td vstyle=\"vertical-align=:bottom\" >");
                Output.WriteLine("            <a target=\"_" + html_element_name_irtype.ToUpper() + "\"  title=\"" + Translator.Get_Translation("Get help.", CurrentLanguage) + "\" href=\"" + Help_URL(Skin_Code, Base_URL) + "\" ><img class=\"help_button\" src=\"" + HELP_BUTTON_URL + "\" /></a>");
                Output.WriteLine("          </td>");
                Output.WriteLine("  </tr></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 (( String.IsNullOrWhiteSpace(instance_value)) && (default_values.Count > 0))
            {
                instance_value = default_values[0];
            }

            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\">");
            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 (( !String.IsNullOrWhiteSpace(instance_value)) && (!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 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=\"" + 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=\"" + 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>");
            Output.WriteLine("    <td style=\"width:" + LEFT_MARGIN + "px\">&nbsp;</td>");
            if (Read_Only)
            {
                Output.WriteLine("    <td class=\"metadata_label\">" + Translator.Get_Translation(Title, CurrentLanguage) + ":</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 + "\">" + 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>");
            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 sbk_Focusable\">" + 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 class=\"repeat_button\" src=\"" + 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=\"" + 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=\"" + 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=\"" + 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 the title of this material here.";
                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;
                }
            }

            // Determine the statement of responsibility
            string statement_responsibility = String.Empty;
            if (Bib.Bib_Info.Notes_Count > 0)
            {
                foreach (Note_Info thisNote in Bib.Bib_Info.Notes)
                {
                    if (thisNote.Note_Type == Note_Type_Enum.StatementOfResponsibility)
                    {
                        statement_responsibility = HttpUtility.HtmlEncode(thisNote.Note);
                        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\">");

            // Add the link for the main title
            if (Bib.Bib_Info.Main_Title.Title.Length == 0)
            {
                Output.Write("              <a title=\"Click to edit the main title\" href=\"" + Base_URL + "l/technical/javascriptrequired\" onfocus=\"link_focused2('form_maintitle_term')\" onblur=\"link_blurred2('form_maintitle_term')\" onkeypress=\"return popup_keypress_focus('form_maintitle', 'formmaintitletitle', '" + IsMozilla.ToString() + "');\" onclick=\"return popup_focus('form_maintitle', 'formmaintitletitle');\"><div class=\"form_linkline_empty form_title_main_line\" id=\"form_maintitle_term\"><i>Empty Main Title</i>");
            }
            else
            {
                Output.Write("              <a title=\"Click to edit the main title\" href=\"" + Base_URL + "l/technical/javascriptrequired\" onfocus=\"link_focused2('form_maintitle_term')\" onblur=\"link_blurred2('form_maintitle_term')\" onkeypress=\"return popup_keypress_focus('form_maintitle', 'formmaintitletitle', '" + IsMozilla.ToString() + "');\" onclick=\"return popup_focus('form_maintitle', 'formmaintitletitle');\"><div class=\"form_linkline form_title_main_line\" id=\"form_maintitle_term\">" + Bib.Bib_Info.Main_Title.NonSort + Bib.Bib_Info.Main_Title.Title);
                if (Bib.Bib_Info.Main_Title.Subtitle.Length > 0)
                    Output.Write(" : " + Bib.Bib_Info.Main_Title.Subtitle);
            }
            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=\"" + 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("<!-- Main Title Form -->");
            PopupFormBuilder.AppendLine("<div class=\"title_main_popup_div sbkMetadata_PopupDiv\" id=\"form_maintitle\" style=\"display:none;\">");
            PopupFormBuilder.AppendLine("  <div class=\"sbkMetadata_PopupTitle\"><table style=\"width:100%\"><tr><td style=\"text-align:left\">Edit Main 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_maintitle_form('form_maintitle')\">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.AppendLine("    <tr><td style=\"width:90px\">Title Type:</td><td colspan=\"2\"><span style=\"color: Blue; padding-bottom: 7px;\" >Main Title</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=\"formmaintitlenonsort\" id=\"formmainttitlenonsort\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(Bib.Bib_Info.Main_Title.NonSort) + "\" />");
            PopupFormBuilder.Append("</td><td style=\"width:255px\" >Language: &nbsp; ");
            PopupFormBuilder.Append("<input class=\"formtitle_small_input sbk_Focusable\" name=\"formmaintitlelanguage\" id=\"formmainttitlelanguage\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(Bib.Bib_Info.Main_Title.Language) + "\" />");
            PopupFormBuilder.AppendLine("</td></tr>");

            // Add the title, subtitle, and statement of responsibility
            PopupFormBuilder.AppendLine("    <tr><td>Title:</td><td colspan=\"2\"><input class=\"formtitle_large_input sbk_Focusable\" name=\"formmaintitletitle\" id=\"formmaintitletitle\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(Bib.Bib_Info.Main_Title.Title) + "\" /></td></tr>");
            PopupFormBuilder.AppendLine("    <tr><td>Sub Title:</td><td colspan=\"2\"><input class=\"formtitle_large_input sbk_Focusable\" name=\"formmaintitlesubtitle\" id=\"formmaintitlesubtitle\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(Bib.Bib_Info.Main_Title.Subtitle) + "\" /></td></tr>");
            PopupFormBuilder.AppendLine("    <tr><td colspan=\"3\">Statement of Responsibility: &nbsp; &nbsp; <input class=\"formtitle_medium_input sbk_Focusable\" name=\"formmaintitlestatement\" id=\"formmaintitlestatement\" type=\"text\" value=\"" + statement_responsibility + "\" /></td></tr>");

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

            // Add the part names and authority
            PopupFormBuilder.Append("    <tr><td>Part Names:</td><td>");
            if (Bib.Bib_Info.Main_Title.Part_Names_Count > 0)
            {
                PopupFormBuilder.Append("<input class=\"formtitle_small_input sbk_Focusable\" name=\"formmaintitlepartname1\" id=\"formmaintitlepartname1\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(Bib.Bib_Info.Main_Title.Part_Names[0]) + "\" />");
            }
            else
            {
                PopupFormBuilder.Append("<input class=\"formtitle_small_input sbk_Focusable\" name=\"formmaintitlepartname1\" id=\"formmaintitlepartname1\" type=\"text\" value=\"\" />");
            }
            if (Bib.Bib_Info.Main_Title.Part_Names_Count > 1)
            {
                PopupFormBuilder.Append("<input class=\"formtitle_small_input sbk_Focusable\" name=\"formmaintitlepartname2\" id=\"formmaintitlepartname2\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(Bib.Bib_Info.Main_Title.Part_Names[1]) + "\" />");
            }
            else
            {
                PopupFormBuilder.Append("<input class=\"formtitle_small_input sbk_Focusable\" name=\"formmaintitlepartname2\" id=\"formmaintitlepartname2\" type=\"text\" value=\"\" />");
            }
            PopupFormBuilder.Append("<td>Authority: &nbsp; <input class=\"formtitle_small_input sbk_Focusable\" name=\"formmaintitleauthority\" id=\"formmaintitleauthority\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(Bib.Bib_Info.Main_Title.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=\"return close_maintitle_form('form_maintitle');\">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="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 defaultAcronym = "Enter the information about the manufacturer of the original item.";
                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>");
            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\">");

            if (Bib.Bib_Info.Manufacturers_Count == 0)
            {
                const int i = 1;
                Output.WriteLine("              <span class=\"metadata_sublabel2\">" + Translator.Get_Translation("Name", CurrentLanguage) + ":</span>");
                Output.WriteLine("              <input name=\"" + id_name + "_name" + i + "\" id=\"" + id_name + "_name" + i + "\" class=\"" + html_element_name + "_name_input sbk_Focusable\" type=\"text\" value=\"\" /><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 sbk_Focusable\" type=\"text\" value=\"\" />");
                Output.WriteLine("              <input name=\"" + id_name + "_secondloc" + i + "\" id=\"" + id_name + "_secondloc" + i + "\" class=\"" + html_element_name + "_location_input sbk_Focusable\" type=\"text\" value=\"\" />");
                Output.Write("              <input name=\"" + id_name + "_thirdloc" + i + "\" id=\"" + id_name + "_thirdloc" + i + "\" class=\"" + html_element_name + "_location_input sbk_Focusable\" type=\"text\" value=\"\" />");
                Output.WriteLine("</div>");
                Output.WriteLine("          </td>");
            }
            else
            {
                ReadOnlyCollection<Publisher_Info> manufacturers = Bib.Bib_Info.Manufacturers;
                for (int i = 1; i <= manufacturers.Count; i++)
                {
                    Output.WriteLine("              <span class=\"metadata_sublabel2\">" + Translator.Get_Translation("Name", CurrentLanguage) + ":</span>");
                    Output.WriteLine("              <input name=\"" + id_name + "_name" + i + "\" id=\"" + id_name + "_name" + i + "\" class=\"" + html_element_name + "_name_input sbk_Focusable\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(manufacturers[i - 1].Name) + "\" /><br />");
                    Output.WriteLine("              <span class=\"metadata_sublabel2\">" + Translator.Get_Translation("Location(s)", CurrentLanguage) + ":</span>");
                    ReadOnlyCollection<Origin_Info_Place> places = manufacturers[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 sbk_Focusable\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(places[0].Place_Text) + "\" />");
                    }
                    else
                    {
                        Output.WriteLine("              <input name=\"" + id_name + "_firstloc" + i + "\" id=\"" + id_name + "_firstloc" + i + "\" class=\"" + html_element_name + "_location_input sbk_Focusable\" type=\"text\" value=\"\" />");
                    }
                    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 sbk_Focusable\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(places[1].Place_Text) + "\" />");
                    }
                    else
                    {
                        Output.WriteLine("              <input name=\"" + id_name + "_secondloc" + i + "\" id=\"" + id_name + "_secondloc" + i + "\" class=\"" + html_element_name + "_location_input sbk_Focusable\" type=\"text\" value=\"\" />");
                    }
                    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 sbk_Focusable\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(places[2].Place_Text) + "\" />");
                    }
                    else
                    {
                        Output.Write("              <input name=\"" + id_name + "_thirdloc" + i + "\" id=\"" + id_name + "_thirdloc" + i + "\" class=\"" + html_element_name + "_location_input sbk_Focusable\" type=\"text\" value=\"\" />");
                    }

                    if (i < manufacturers.Count)
                    {
                        Output.WriteLine("<br />");
                    }
                    else
                    {
                        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 a new manufacturer", CurrentLanguage) + ".\" href=\"" + Base_URL + "l/technical/javascriptrequired\" onmousedown=\"return add_publisher_element('" + html_element_name + "');\"><img class=\"repeat_button\" src=\"" + 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=\"" + 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 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 = 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;
                }
            }

            // 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_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_full_" + name_count + "', '" + IsMozilla.ToString() + "' );\" onclick=\"return popup_focus('form_name_" + name_count + "', 'form_name_full_" + name_count + "' );\"><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_full_" + name_count + "', '" + IsMozilla.ToString() + "' );\" onclick=\"return popup_focus('form_name_" + name_count + "', 'form_name_full_" + name_count + "' );\"><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
                PopupFormBuilder.AppendLine("<!-- Name Form " + name_count + " -->");
                PopupFormBuilder.AppendLine("<div class=\"" + form_class + " sbkMetadata_PopupDiv\" id=\"form_name_" + name_count + "\" style=\"display:none;\">");
                PopupFormBuilder.AppendLine("  <div class=\"sbkMetadata_PopupTitle\"><table style=\"width:100%\"><tr><td style=\"text-align:left\">Edit Named Entity</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_name_form('form_name_" + name_count + "')\">X</a> &nbsp; </td></tr></table></div>");
                PopupFormBuilder.AppendLine("  <br />");
                PopupFormBuilder.AppendLine("  <table class=\"sbkMetadata_PopupTable\">");

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

                PopupFormBuilder.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 ))
                    PopupFormBuilder.AppendLine("          <option value=\"personal\" selected=\"selected\" >Personal</option>");
                else
                    PopupFormBuilder.AppendLine("          <option value=\"personal\">Personal</option>");

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

                    PopupFormBuilder.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; ");
                    PopupFormBuilder.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
                {
                    PopupFormBuilder.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; ");
                    PopupFormBuilder.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>");
                }
                PopupFormBuilder.AppendLine("    </tr>");

                // Add the full name box
                PopupFormBuilder.AppendLine("    <tr><td>Full Name:</td><td colspan=\"2\"><input type=\"text\" class=\"form_name_large_input sbk_Focusable\" id=\"form_name_full_" + name_count + "\" name=\"form_name_full_" + name_count + "\" value=\"" + HttpUtility.HtmlEncode(thisName.Full_Name) + "\" /></td></tr>");

                // Add the given name and family name(s)
                PopupFormBuilder.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 sbk_Focusable\" id=\"form_name_given_" + name_count + "\" name=\"form_name_given_" + name_count + "\" value=\"" + HttpUtility.HtmlEncode(thisName.Given_Name) + "\" style=\"display:" + personal_values_display + ";\" /></td>");
                PopupFormBuilder.AppendLine("<td><span  id=\"name_personallabel2_" + name_count + "\" style=\"display:" + personal_values_display + ";\" >Family Name:</span><input type=\"text\" class=\"form_name_medium_input sbk_Focusable\" id=\"form_name_family_" + name_count + "\" name=\"form_name_family_" + name_count + "\" value=\"" + HttpUtility.HtmlEncode(thisName.Family_Name) + "\" style=\"display:" + personal_values_display + ";\" /></td></tr>");

                // Add the display form and terms of address
                PopupFormBuilder.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 sbk_Focusable\" id=\"form_name_display_" + name_count + "\" name=\"form_name_display_" + name_count + "\" value=\"" + HttpUtility.HtmlEncode(thisName.Display_Form) + "\" style=\"display:" + personal_values_display + ";\" /></td>");
                PopupFormBuilder.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 sbk_Focusable\" id=\"form_name_terms_" + name_count + "\" name=\"form_name_terms_" + name_count + "\" value=\"" + HttpUtility.HtmlEncode(thisName.Terms_Of_Address) + "\" style=\"display:" + personal_values_display + ";\" /></td></tr>");

                // Add the dates
                PopupFormBuilder.AppendLine("    <tr><td>Dates:</td><td colspan=\"2\"><input type=\"text\" class=\"form_name_medium_input sbk_Focusable\" id=\"form_name_dates_" + name_count + "\" name=\"form_name_dates_" + name_count + "\" value=\"" + HttpUtility.HtmlEncode(thisName.Dates) + "\" /></td></tr>");

                // Add the description
                PopupFormBuilder.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 sbk_Focusable\" id=\"form_name_desc_" + name_count + "\" name=\"form_name_desc_" + name_count + "\" value=\"" + HttpUtility.HtmlEncode(thisName.Description) + "\" /></td></tr>");

                // Add the affiliation
                PopupFormBuilder.AppendLine("    <tr><td>Affiliation:</td><td colspan=\"2\"><input type=\"text\" class=\"form_name_large_input sbk_Focusable\" id=\"form_name_affiliation_" + name_count + "\" name=\"form_name_affiliation_" + name_count + "\" value=\"" + HttpUtility.HtmlEncode(thisName.Affiliation) + "\" /></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
                PopupFormBuilder.Append("    <tr><td>Roles:</td><td colspan=\"2\">");
                PopupFormBuilder.Append("<input type=\"text\" class=\"form_name_small_input sbk_Focusable\" id=\"form_name_role1_" + name_count + "\" name=\"form_name_role1_" + name_count + "\" value=\"" + HttpUtility.HtmlEncode(role1) + "\" />");
                PopupFormBuilder.Append("<input type=\"text\" class=\"form_name_small_input sbk_Focusable\" id=\"form_name_role2_" + name_count + "\" name=\"form_name_role2_" + name_count + "\" value=\"" + HttpUtility.HtmlEncode(role2) + "\" />");
                PopupFormBuilder.Append("<input type=\"text\" class=\"form_name_small_input sbk_Focusable\" id=\"form_name_role3_" + name_count + "\" name=\"form_name_role3_" + name_count + "\" value=\"" + HttpUtility.HtmlEncode(role3) + "\" />");
                PopupFormBuilder.AppendLine("</td></tr>");

                // Close the form and add the 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_name_form('form_name_" + name_count + "');\">CLOSE</button></td>");
                PopupFormBuilder.AppendLine("    </tr>");
                PopupFormBuilder.AppendLine("  </table>");
                PopupFormBuilder.AppendLine("</div>");
                PopupFormBuilder.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 style=\"vertical-align:bottom\" >");
            if (Repeatable)
            {
                Output.WriteLine("            <img title=\"" + Translator.Get_Translation("Click to add a new named object to this resource", CurrentLanguage) + ".\" alt=\"+\" class=\"repeat_button\" src=\"" + REPEAT_BUTTON_URL + "\" onmousedown=\"return new_creator_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=\"" + 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 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>");
            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\">");

            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 sbk_Focusable\" type=\"text\" value=\"\" />");
                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 sbk_Focusable\" type=\"text\" value=\"\" />");
                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 sbk_Focusable\" type=\"text\" value=\"\" /></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 sbk_Focusable\" type=\"text\" value=\"" + temporalSubjects[i - 1].Start_Year.ToString().Replace("-1", "") + "\" />");
                    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 sbk_Focusable\" type=\"text\" value=\"" + temporalSubjects[i - 1].End_Year.ToString().Replace("-1", "") + "\" />");
                    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 sbk_Focusable\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(temporalSubjects[i - 1].TimePeriod) + "\" />");

                    Output.WriteLine(i < temporalSubjects.Count ? "<br />" : "\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 temporal coverage field", CurrentLanguage) + ".\" href=\"" + Base_URL + "l/technical/javascriptrequired\" onmousedown=\"return add_temporal_element();\"><img class=\"repeat_button\" src=\"" + 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=\"" + 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 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>");
            Output.WriteLine("    <td style=\"width:" + LEFT_MARGIN + "px\">&nbsp;</td>");
            if (Title.IndexOf(":") < 0)
            {
                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>");
                }
            }
            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 + "\">" + 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.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 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=\"" + 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 sbk_Focusable\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(allValues[i - 1].Replace("<i>", "").Replace("</i>", "")) + "\" />");
                    }
                    else
                    {
                        Output.WriteLine("              <input name=\"" + HTML_ID_Name + i + "\" id=\"" + HTML_ID_Name + i + "\" class=\"" + html_element_name + "_input sbk_Focusable\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(allValues[i - 1].Replace("<i>", "").Replace("</i>", "")) + "\" /><br />");
                    }
                }

                Output.WriteLine("            </div>");
                Output.WriteLine("          </td>");
                Output.WriteLine("          <td style=\"vertical-align: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 class=\"repeat_button\" src=\"" + 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=\"" + 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_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>");
            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><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 sbk_Focusable\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(text_values[i - 1]) + "\" />");

                // 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 + "\" >");

                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 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_text_box_select_element('" + html_element_name + "', '" + second_label + "');\"><img class=\"repeat_button\" src=\"" + 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=\"" + HELP_BUTTON_URL + "\" /></a>");
            Output.WriteLine("    </td>");
            Output.WriteLine("  </tr></table></td></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;

            // Determine if the code --> statement linking should be present
            bool codeStatementMappingPresent = !((code_to_statement_dictionary == null) || (code_to_statement_dictionary.Count == 0));

                // Write the combo box
            // Write the combo box

            // Determine the javascript to append
            string javascript = String.Empty;
            if (clear_textbox_on_combobox_change)
            {
                if (codeStatementMappingPresent)
                {
                    javascript = "onchange=\"combo_text_element_onchange('" + id_name + "_select" + i + "', '" + id_name + "_text" + i + "',true)\"";
                }
                else
                {
                    javascript = "onchange=\"clear_textbox('" + id_name + "_text" + i + "')\"";
                }
            }
            else if (codeStatementMappingPresent)
            {
                javascript = "onchange=\"combo_text_element_onchange('" + id_name + "_select" + i + "', '" + id_name + "_text" + i + "',false)\"";
            }

            // Start the select box
            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')\"" + javascript + " >");

                bool found_option = false;
                foreach (string thisOption in possible_select_items)
                {
                    // Determine the value
                    string value = thisOption;
                    if ((codeStatementMappingPresent) && (code_to_statement_dictionary.ContainsKey(thisOption)))
                        value = thisOption + "|" + code_to_statement_dictionary[thisOption];

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

                if ((select_value.Length > 0) && (!Restrict_Values) && (!found_option))
                {
                    // Get this option
                    string option = select_value;

                    // Determine the value
                    string value = option;
                    if ((codeStatementMappingPresent) && (code_to_statement_dictionary.ContainsKey(option)))
                        value = option + "|" + code_to_statement_dictionary[option];

                    Output.Write("<option value=\"" + HttpUtility.HtmlEncode(value) + "\" selected=\"selected=\">" + option + "</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=\"" + 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=\"" + 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 zoological taxonomic information about living organisms related to this 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\">");

            // Get the zoological taxonomy
            Zoological_Taxonomy_Info zooInfo = Bib.Get_Metadata_Module(GlobalVar.ZOOLOGICAL_TAXONOMY_METADATA_MODULE_KEY) as Zoological_Taxonomy_Info;
            if (zooInfo == null)
                zooInfo = new Zoological_Taxonomy_Info();

            int zoo_index = 1;

            // Add this subject linke
            string zoo_as_string = zooInfo.ToString();
            if (zoo_as_string.Length > 0)
                Output.Write("\n        <a title=\"Click to edit this zoological taxonomic information\" href=\"" + Base_URL + "l/technical/javascriptrequired\" onfocus=\"link_focused2('form_zootaxon_term_" + zoo_index + "')\" onblur=\"link_blurred2('form_zootaxon_term_" + zoo_index + "')\" onkeypress=\"return popup_keypress_focus('form_zootaxon_" + zoo_index + "', 'formzootaxonkingdom_" + zoo_index + "', '" + IsMozilla.ToString() + "' );\"  onclick=\"return popup_focus('form_zootaxon_" + zoo_index + "', 'formzootaxonkingdom_" + zoo_index + "' );\"><div class=\"form_linkline form_zootaxon_line\" id=\"form_zootaxon_term_" + zoo_index + "\">" + zoo_as_string + "</div></a>");
            else
                Output.Write("\n        <a title=\"Click to edit this hierarchical zootaxon information\" href=\"" + Base_URL + "l/technical/javascriptrequired\" onfocus=\"link_focused2('form_zootaxon_term_" + zoo_index + "')\" onblur=\"link_blurred2('form_zootaxon_term_" + zoo_index + "')\" onkeypress=\"return popup_keypress_focus('form_zootaxon_" + zoo_index + "', 'formzootaxonkingdom_" + zoo_index + "', '" + IsMozilla.ToString() + "' );\"  onclick=\"return popup_focus('form_zootaxon_" + zoo_index + "', 'formzootaxonkingdom_" + zoo_index + "' );\"><div class=\"form_linkline_empty form_zootaxon_line\" id=\"form_zootaxon_term_" + zoo_index + "\"><i>No taxonomic information</i></div></a>");

            // Add the popup form
            PopupFormBuilder.AppendLine("<!-- Zoological Taxonomy Form " + zoo_index + " -->");
            PopupFormBuilder.AppendLine("<div class=\"zootaxon_popup_div sbkMetadata_PopupDiv\" id=\"form_zootaxon_" + zoo_index + "\" style=\"display:none;\">");
            PopupFormBuilder.AppendLine("  <div class=\"sbkMetadata_PopupTitle\"><table style=\"width:100%\"><tr><td style=\"text-align:left\">Edit Zoological Taxonomy</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=\"return close_zootaxon_form('form_zootaxon_" + zoo_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;\">Kingdom:</td><td colspan=\"2\"><input class=\"formzootaxon_input sbk_Focusable\" name=\"formzootaxonkingdom_" + zoo_index + "\" id=\"formzootaxonkingdom_" + zoo_index + "\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(zooInfo.Kingdom) + "\" /></td></tr>");
            PopupFormBuilder.AppendLine("    <tr><td>Phylum:</td><td colspan=\"2\"><input class=\"formzootaxon_input sbk_Focusable\" name=\"formzootaxonphylum_" + zoo_index + "\" id=\"formzootaxonphylum_" + zoo_index + "\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(zooInfo.Phylum) + "\" /></td></tr>");
            PopupFormBuilder.AppendLine("    <tr><td>Class:</td><td colspan=\"2\"><input class=\"formzootaxon_input sbk_Focusable\" name=\"formzootaxonclass_" + zoo_index + "\" id=\"formzootaxonclass_" + zoo_index + "\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(zooInfo.Class) + "\" /></td></tr>");
            PopupFormBuilder.AppendLine("    <tr><td>Order:</td><td colspan=\"2\"><input class=\"formzootaxon_input sbk_Focusable\" name=\"formzootaxonorder_" + zoo_index + "\" id=\"formzootaxonorder_" + zoo_index + "\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(zooInfo.Order) + "\" /></td></tr>");
            PopupFormBuilder.AppendLine("    <tr><td>Family:</td><td colspan=\"2\"><input class=\"formzootaxon_input sbk_Focusable\" name=\"formzootaxonfamily_" + zoo_index + "\" id=\"formzootaxonfamily_" + zoo_index + "\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(zooInfo.Family) + "\" /></td></tr>");
            PopupFormBuilder.AppendLine("    <tr><td>Genus:</td><td colspan=\"2\"><input class=\"formzootaxon_input sbk_Focusable\" name=\"formzootaxongenus_" + zoo_index + "\" id=\"formzootaxongenus_" + zoo_index + "\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(zooInfo.Genus) + "\" /></td></tr>");
            PopupFormBuilder.AppendLine("    <tr><td>Species:</td><td colspan=\"2\"><input class=\"formzootaxon_input sbk_Focusable\" name=\"formzootaxonspecies_" + zoo_index + "\" id=\"formzootaxonspecies_" + zoo_index + "\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(zooInfo.Specific_Epithet) + "\" /></td></tr>");
            PopupFormBuilder.AppendLine("    <tr><td>Common Name:</td><td colspan=\"2\"><input class=\"formzootaxon_input sbk_Focusable\" name=\"formzootaxoncommon_" + zoo_index + "\" id=\"formzootaxoncommon_" + zoo_index + "\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(zooInfo.Common_Name) + "\" /></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_zootaxon_form('form_zootaxon_" + zoo_index + "');\">CLOSE</button></td>");
            PopupFormBuilder.AppendLine("    </tr>");

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

            zoo_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 zoological taxonomy object", CurrentLanguage) + ".\" href=\"" + Base_URL + "l/technical/javascriptrequired\" onmousedown=\"return new_zoo_link_clicked('" + Template_Page + "');\"><img class=\"repeat_button\" src=\"" + 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=\"" + 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>
        /// <param name="Current_Item"> Current digital resource, with the viewers that should be displayed </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, 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(allVolumeCode, Translator.Get_Translation("All Issues", Current_Mode.Language), Current_Mode));
                    }
                    else
                    {
                        if (resource_type_upper.IndexOf("MAP") >= 0)
                        {
                            returnVal.Add(HTML_Helper(allVolumeCode, Translator.Get_Translation("Related Maps", Current_Mode.Language), Current_Mode));
                        }
                        else
                        {
                            returnVal.Add(resource_type_upper.IndexOf("AERIAL") >= 0
                                              ? HTML_Helper(allVolumeCode, Translator.Get_Translation("Related Flights", Current_Mode.Language), Current_Mode)
                                              : HTML_Helper(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(Current_Mode.ViewerCode, Translator.Get_Translation("Citation", Current_Mode.Language), Current_Mode));
                    }
                    else
                    {
                        returnVal.Add(HTML_Helper("citation", Translator.Get_Translation("Citation", Current_Mode.Language), Current_Mode));
                    }
                    break;

                case View_Enum.DATASET_CODEBOOK:
                    returnVal.Add(HTML_Helper("dscodebook", Translator.Get_Translation("Data Structure", Current_Mode.Language), Current_Mode));
                    break;

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

                case View_Enum.DATASET_VIEWDATA:
                    returnVal.Add(HTML_Helper("dsview", Translator.Get_Translation("Explore Data", Current_Mode.Language), Current_Mode));
                    break;

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

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

                case View_Enum.FLASH:
                    returnVal.Add( String.IsNullOrEmpty(Item_View.Label)
                                      ? HTML_Helper("flash", Translator.Get_Translation("Flash View", Current_Mode.Language), Current_Mode)
                                      : HTML_Helper("flash", Translator.Get_Translation(Item_View.Label.ToUpper(), Current_Mode.Language), Current_Mode));
                    break;

                case View_Enum.GOOGLE_MAP:
                    if ( !String.IsNullOrEmpty(Current_Mode.Coordinates))
                    {
                        if (Current_Mode.ViewerCode == "mapsearch")
                        {
                            returnVal.Add( HTML_Helper("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("map", Translator.Get_Translation("Search Results", Current_Mode.Language), Current_Mode));
                            }
                            else
                            {
                                returnVal.Add(HTML_Helper("map", Translator.Get_Translation("Map Coverage", Current_Mode.Language), Current_Mode));
                            }

                        }
                    }
                    else
                    {
                        returnVal.Add(HTML_Helper("map", Translator.Get_Translation("Map It!", Current_Mode.Language), Current_Mode));
                    }
                    break;

                case View_Enum.GOOGLE_MAP_BETA:
                    if (!String.IsNullOrEmpty(Current_Mode.Coordinates))
                    {
                        if (Current_Mode.ViewerCode == "mapsearchbeta")
                        {
                            returnVal.Add(HTML_Helper("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("mapbeta", Translator.Get_Translation("Search Results", Current_Mode.Language), Current_Mode));
                            }
                            else
                            {
                                returnVal.Add(HTML_Helper("mapbeta", Translator.Get_Translation("Map Coverage", Current_Mode.Language), Current_Mode));
                            }

                        }
                    }
                    else
                    {
                        returnVal.Add(HTML_Helper("map", Translator.Get_Translation("Map It!", Current_Mode.Language), Current_Mode));
                    }
                    break;

                case View_Enum.HTML:
                    returnVal.Add(!String.IsNullOrEmpty(Item_View.Label)
                                      ? HTML_Helper("html", Item_View.Label.ToUpper(), Current_Mode)
                                      : HTML_Helper("html", "HTML LINK", Current_Mode));
                    break;

                case View_Enum.JPEG:
                    returnVal.Add(HTML_Helper_PageView(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(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(Page_Sequence.ToString() + "x", Translator.Get_Translation("Zoomable", Current_Mode.Language), Current_Mode));
                    }
                    break;

                case View_Enum.PDF:
                    returnVal.Add(HTML_Helper("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(Current_Mode.ViewerCode, Translator.Get_Translation("Thumbnails", Current_Mode.Language), Current_Mode)
                                      : HTML_Helper("thumbs", Translator.Get_Translation("Thumbnails", Current_Mode.Language), Current_Mode));
                    break;

                case View_Enum.SEARCH:
                    returnVal.Add(HTML_Helper("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("streets", Translator.Get_Translation("Streets", Current_Mode.Language), Current_Mode));
                    break;

                case View_Enum.TEXT:
                    returnVal.Add(HTML_Helper_PageView(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("restricted", Translator.Get_Translation("Restricted", Current_Mode.Language), Current_Mode));
                    break;

                case View_Enum.EAD_CONTAINER_LIST:
                    returnVal.Add(HTML_Helper("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("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("youtube", Translator.Get_Translation("Video", Current_Mode.Language), Current_Mode));
                    break;

                case View_Enum.EMBEDDED_VIDEO:
                    returnVal.Add(HTML_Helper("videoem", Translator.Get_Translation("Video", Current_Mode.Language), Current_Mode));
                    break;

                case View_Enum.VIDEO:
                    returnVal.Add(HTML_Helper("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 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 = "Enter any notes about this digital manifestation or the original 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;
                }
            }

            // 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>");
            Output.WriteLine("    <td 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 style=\text-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.StatementOfResponsibility) || (Include_Statement_Responsibility)) && (ThisNote.Note_Type != Note_Type_Enum.DefaultType));
            }

            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=\"complexnote_type_change('1');\" >");
                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 sbk_Focusable\" ></textarea>");
            }
            else
            {
                int i = 1;
                foreach (Note_Info thisNote in Bib.Bib_Info.Notes)
                {
                    if (((thisNote.Note_Type != Note_Type_Enum.StatementOfResponsibility) || (Include_Statement_Responsibility)) &&
                        ( thisNote.Note_Type != Note_Type_Enum.DefaultType ))
                    {
                        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=\"complexnote_type_change('" + i + "');\" >");

                        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.AdditionalPhysicalForm
                                             ? "                  <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.CitationReference
                                             ? "                  <option value=\"510\" selected=\"selected\">Citation/Reference</option>"
                                             : "                  <option value=\"510\">Citation/Reference</option>");

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

                        if (thisNote.Note_Type == Note_Type_Enum.DatesSequentialDesignation)
                        {
                            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.InternalComments
                                             ? "                  <option value=\"internal\" selected=\"selected\">Internal Comments</option>"
                                             : "                  <option value=\"internal\">Internal Comments</option>");

                        Output.WriteLine(thisNote.Note_Type == Note_Type_Enum.IssuingBody
                                             ? "                  <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.NumberingPeculiarities
                                             ? "                  <option value=\"515\" selected=\"selected\">Numbering Peculiarities</option>"
                                             : "                  <option value=\"515\">Numbering Peculiarities</option>");

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

                        Output.WriteLine(thisNote.Note_Type == Note_Type_Enum.OriginalVersion
                                             ? "                  <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.PreferredCitation)
                        {
                            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.PublicationStatus
                                             ? "                  <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.StatementOfResponsibility
                                                 ? "                  <option value=\"245\" selected=\"selected\">Statement of Responsibility</option>"
                                                 : "                  <option value=\"245\">Statement of Responsibility</option>");
                        }

                        Output.WriteLine(thisNote.Note_Type == Note_Type_Enum.SystemDetails
                                             ? "                  <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.DateVenue)
                        {
                            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.VersionIdentification
                                             ? "                  <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 sbk_Focusable\" id=\"complexnote_inputtext" + i + "\" name=\"complexnote_input" + i + "\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(note_display_label) + "\" />");
                        }

                        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 sbk_Focusable\" >" + 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 style=\"vertical-align:bottom\" >");

            if (Repeatable)
            {
                Output.WriteLine("            <a title=\"" + Translator.Get_Translation("Click to add a new note", CurrentLanguage) + ".\" href=\"" + Base_URL + "l/technical/javascriptrequired\" onmousedown=\"return add_complex_note('" + Rows + "','" + actual_cols + "');\"><img class=\"repeat_button\" src=\"" + 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=\"" + HELP_BUTTON_URL + "\" /></a>");
            Output.WriteLine("          </td>");

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