/// <summary> Constructor for a new instance of the Metadata_Browse_AggregationViewer class </summary>
        /// <param name="RequestSpecificValues"> All the necessary, non-global data specific to the current request </param>
        /// <param name="ViewBag"> Aggregation-specific request information, such as aggregation object and any browse object requested </param>
        public Metadata_Browse_AggregationViewer(RequestCache RequestSpecificValues, AggregationViewBag ViewBag)
            : base(RequestSpecificValues, ViewBag)
        {
            // If there is not info browse mode listed, use the default
            if (String.IsNullOrEmpty(RequestSpecificValues.Current_Mode.Info_Browse_Mode))
            {
                string defaultBrowseBy = ViewBag.Hierarchy_Object.Default_BrowseBy ?? String.Empty;
                RequestSpecificValues.Current_Mode.Info_Browse_Mode = defaultBrowseBy;

                // Still length of zero?
                if (String.IsNullOrEmpty(RequestSpecificValues.Current_Mode.Info_Browse_Mode))
                {
                    // Just look for the first browse by
                    foreach (Item_Aggregation_Child_Page browse in ViewBag.Hierarchy_Object.Child_Pages)
                    {
                        if (browse.Browse_Type == Item_Aggregation_Child_Visibility_Enum.Metadata_Browse_By)
                        {
                            RequestSpecificValues.Current_Mode.Info_Browse_Mode = browse.Code;
                            break;
                        }
                    }
                }
            }

            if ((String.IsNullOrEmpty(RequestSpecificValues.Current_Mode.Info_Browse_Mode)) && (ViewBag.Hierarchy_Object.Has_Browse_By_Pages))
            {
                RequestSpecificValues.Current_Mode.Info_Browse_Mode = ViewBag.Hierarchy_Object.Child_Page_By_Code(RequestSpecificValues.Current_Mode.Info_Browse_Mode).Code;
            }

            // Get this browse
            browseObject = ViewBag.Hierarchy_Object.Child_Page_By_Code(RequestSpecificValues.Current_Mode.Info_Browse_Mode);

            // Was this a metadata browseby, or just a static html?
            if ((browseObject == null) || (browseObject.Source_Data_Type != Item_Aggregation_Child_Source_Data_Enum.Static_HTML))
            {
                // Determine the correct metadata code
                string metadata_code = RequestSpecificValues.Current_Mode.Info_Browse_Mode.Trim().Replace("_", " ");
                RequestSpecificValues.Current_Mode.Info_Browse_Mode = metadata_code;

                // Only get values if there was a metadata code
                if (metadata_code.Length > 0)
                {
                    // Check the cache for this value
                    List <string> cacheInstance = CachedDataManager.Retrieve_Aggregation_Metadata_Browse(RequestSpecificValues.Current_Mode.Aggregation, RequestSpecificValues.Current_Mode.Info_Browse_Mode, RequestSpecificValues.Tracer);

                    if (cacheInstance != null)
                    {
                        results = cacheInstance;
                    }
                    else
                    {
                        results = Engine_Database.Get_Item_Aggregation_Metadata_Browse(RequestSpecificValues.Current_Mode.Aggregation, RequestSpecificValues.Current_Mode.Info_Browse_Mode, RequestSpecificValues.Tracer);
                        CachedDataManager.Store_Aggregation_Metadata_Browse(RequestSpecificValues.Current_Mode.Aggregation, RequestSpecificValues.Current_Mode.Info_Browse_Mode, results, RequestSpecificValues.Tracer);
                    }
                }
            }
        }
        /// <summary> Add the HTML to be displayed in the search box </summary>
        /// <param name="Output"> Textwriter to write the HTML for this viewer</param>
        /// <param name="Tracer">Trace object keeps a list of each method executed and important milestones in rendering</param>
        public override void Add_Search_Box_HTML(TextWriter Output, Custom_Tracer Tracer)
        {
            if (Tracer != null)
            {
                Tracer.Add_Trace("Basic_Search_AggregationViewer.Add_Search_Box_HTML", "Adding html for search box");
            }

            // Get the list of years for this aggregation
            string     aggrCode  = ViewBag.Hierarchy_Object.Code.ToLower();
            string     key       = aggrCode + "_YearRanges";
            List <int> yearRange = HttpContext.Current.Cache[key] as List <int>;

            if (yearRange == null)
            {
                yearRange = new List <int>();
                List <string> yearRangeString = Engine_Database.Get_Item_Aggregation_Metadata_Browse(aggrCode, "Temporal Year", Tracer);
                foreach (string thisYear in yearRangeString)
                {
                    int result;
                    if (Int32.TryParse(thisYear, out result))
                    {
                        yearRange.Add(result);
                    }
                }
                HttpContext.Current.Cache.Insert(key, yearRange, null, Cache.NoAbsoluteExpiration, TimeSpan.FromMinutes(5));
            }

            string       search_collection = "Search Collection";
            const string YEAR_RANGE        = "Limit by Year";

            if (RequestSpecificValues.Current_Mode.Language == Web_Language_Enum.Spanish)
            {
                search_collection = "Buscar en la colección";
            }

            if (RequestSpecificValues.Current_Mode.Language == Web_Language_Enum.French)
            {
                search_collection = "Recherche dans la collection";
            }

            Output.WriteLine("  <table id=\"sbkBsav_SearchPanel_Years\" >");
            Output.WriteLine("    <tr>");
            Output.WriteLine("      <td style=\"text-align:right;width:27%;\" id=\"sbkBsav_SearchPrompt\"><label for=\"SobekHomeSearchBox\">" + search_collection + ":</label></td>");
            Output.WriteLine("      <td style=\"width:3%;\">&nbsp;</td>");
            Output.WriteLine("      <td style=\"width:60%;\"><input name=\"u_search\" type=\"text\" class=\"sbkBsav_SearchBox sbk_Focusable\" id=\"SobekHomeSearchBox\" value=\"" + textBoxValue + "\" onkeydown=\"return fnTrapKD(event, 'basicyears', '" + arg1 + "', '" + arg2 + "','" + browse_url + "');\" /></td>");
            Output.WriteLine("      <td style=\"width:10%;\"><button class=\"sbk_GoButton\" title=\"" + search_collection + "\" onclick=\"" + Search_Script_Action + ";return false;\">Go</button></td>");
            Output.WriteLine("      <td><div id=\"circular_progress\" name=\"circular_progress\" class=\"hidden_progress\">&nbsp;</div></td>");
            Output.WriteLine("    </tr>");

            // Show the year range data, if there are any years in this
            if (yearRange.Count > 0)
            {
                Output.WriteLine("    <tr style=\"align:right; height:45px;\">");
                Output.WriteLine("      <td align=\"right\" id=\"sbkBsav_SearchYearPrompt\">" + YEAR_RANGE + ":</td>");
                Output.WriteLine("      <td>&nbsp;</td>");
                Output.WriteLine("      <td style=\"text-align:left;\" colspan=\"3\">");

                Output.WriteLine("        <select name=\"YearDropDown1\" id=\"YearDropDown1\" class=\"sbkBsav_YearDropDown\">");
                //	Output.WriteLine("          <option value=\"ZZ\"> </option>");
                int currYear1 = RequestSpecificValues.Current_Mode.DateRange_Year1.HasValue ? RequestSpecificValues.Current_Mode.DateRange_Year1.Value : -1;
                if ((currYear1 != -1) && (!yearRange.Contains(currYear1)))
                {
                    Output.WriteLine("          <option selected=\"selected\" value=\"" + currYear1 + "\">" + currYear1 + "</option>");
                }
                if (currYear1 == -1)
                {
                    currYear1 = yearRange[0];
                }
                foreach (int thisYear in yearRange)
                {
                    if (thisYear == currYear1)
                    {
                        Output.WriteLine("          <option selected=\"selected\" value=\"" + thisYear + "\">" + thisYear + "</option>");
                    }
                    else
                    {
                        Output.WriteLine("          <option value=\"" + thisYear + "\">" + thisYear + "</option>");
                    }
                }
                Output.WriteLine("        </select>");

                Output.WriteLine("&nbsp; through &nbsp;");

                Output.WriteLine("        <select name=\"YearDropDown2\" id=\"YearDropDown2\" class=\"sbkBsav_YearDropDown\">");
                //	Output.WriteLine("          <option value=\"ZZ\"> </option>");
                int currYear2 = RequestSpecificValues.Current_Mode.DateRange_Year2.HasValue ? RequestSpecificValues.Current_Mode.DateRange_Year2.Value : -1;
                if ((currYear2 != -1) && (!yearRange.Contains(currYear2)))
                {
                    Output.WriteLine("          <option selected=\"selected\" value=\"" + currYear2 + "\">" + currYear2 + "</option>");
                }
                if (currYear2 == -1)
                {
                    currYear2 = yearRange[yearRange.Count - 1];
                }
                foreach (int thisYear in yearRange)
                {
                    if (thisYear == currYear2)
                    {
                        Output.WriteLine("          <option selected=\"selected\" value=\"" + thisYear + "\">" + thisYear + "</option>");
                    }
                    else
                    {
                        Output.WriteLine("          <option value=\"" + thisYear + "\">" + thisYear + "</option>");
                    }
                }
                Output.WriteLine("        </select>");

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

            //if (( currentUser != null ) && (currentUser.Is_System_Admin))
            //{
            //	Output.WriteLine("    <tr align=\"right\">");
            //	Output.WriteLine("      <td>&nbsp;</td>");
            //	Output.WriteLine("      <td align=\"left\" colspan=\"4\">");
            //	Output.WriteLine("          &nbsp; &nbsp; &nbsp; &nbsp; <input type=\"checkbox\" value=\"PRIVATE_ITEMS\" name=\"privatecheck\" id=\"privatecheck\" unchecked onclick=\"focus_element( 'SobekHomeSearchBox');\" /><label for=\"privatecheck\">" + INCLUDE_PRIVATES + "</label>");
            //	Output.WriteLine("      </td>");
            //	Output.WriteLine("    </tr>");
            //}

            Output.WriteLine("  </table>");
            Output.WriteLine("<br />");
            Output.WriteLine();
            Output.WriteLine("<!-- Focus on search box -->");
            Output.WriteLine("<script type=\"text/javascript\">focus_element('SobekHomeSearchBox');</script>");
            Output.WriteLine();
        }
        /// <summary> Add the HTML to be displayed in the search box </summary>
        /// <param name="Output"> Textwriter to write the HTML for this viewer</param>
        /// <param name="Tracer">Trace object keeps a list of each method executed and important milestones in rendering</param>
        public override void Add_Search_Box_HTML(TextWriter Output, Custom_Tracer Tracer)
        {
            if (Tracer != null)
            {
                Tracer.Add_Trace("Advanced_Search_AggregationViewer.Add_Search_Box_HTML", "Adding html for search box");
            }

            // Get the list of years for this aggregation
            string     aggrCode  = ViewBag.Hierarchy_Object.Code.ToLower();
            string     key       = aggrCode + "_YearRanges";
            List <int> yearRange = HttpContext.Current.Cache[key] as List <int>;

            if (yearRange == null)
            {
                yearRange = new List <int>();
                List <string> yearRangeString = Engine_Database.Get_Item_Aggregation_Metadata_Browse(aggrCode, "Temporal Year", Tracer);
                foreach (string thisYear in yearRangeString)
                {
                    int result;
                    if (Int32.TryParse(thisYear, out result))
                    {
                        yearRange.Add(result);
                    }
                }
                HttpContext.Current.Cache.Insert(key, yearRange, null, Cache.NoAbsoluteExpiration, TimeSpan.FromMinutes(5));
            }

            string       searchLanguage    = "Search for:";
            string       inLanguage        = "in";
            string       searchButtonText  = "Search";
            string       searchOptions     = "Search Options";
            string       precision         = "Precision";
            string       contains_exactly  = "Contains exactly the search terms";
            string       contains_any_form = "Contains any form of the search terms";
            const string CONTAINS_MEANING  = "Contains the search term or terms of similar meaning";


            //string select_collect_groups = "Select collection groups to include in search:";
            //string select_collect = "Select collections to include in search:";
            //string select_subcollect = "Select subcollections to include in search:";


            if (RequestSpecificValues.Current_Mode.Language == Web_Language_Enum.Spanish)
            {
                searchLanguage    = "Búsqueda de la:";
                inLanguage        = "en";
                searchButtonText  = "Buscar";
                searchOptions     = "Opciones de Búsqueda";
                precision         = "Precisión";
                contains_exactly  = "Contiene exactamente los términos de búsqueda";
                contains_any_form = "Contiene todas las formas de los términos de búsqueda";
            }

            if (RequestSpecificValues.Current_Mode.Language == Web_Language_Enum.French)
            {
                searchLanguage = "Recherche de:";
                inLanguage     = "en";
                //select_collect_groups = "Choisir les group de collection pour inclure dans votre recherche:";
                //select_collect = "Choisir les collections pour inclure dans votre recherche:";
                //select_subcollect = "Choisir les souscollections pour inclure dans votre recherche:";
                searchButtonText = "Search";
            }

            // Now, populate the search terms, if there was one or some
            string text1 = String.Empty;
            string text2 = String.Empty;
            string text3 = String.Empty;
            string text4 = String.Empty;

            if (RequestSpecificValues.Current_Mode.Search_String.Length > 0)
            {
                string[] splitter = RequestSpecificValues.Current_Mode.Search_String.Split(",".ToCharArray());
                text1 = splitter[0].Replace(" =", " or ");
                if (splitter.Length > 1)
                {
                    text2 = splitter[1].Replace(" =", " or ");
                }
                if (splitter.Length > 2)
                {
                    text3 = splitter[2].Replace(" =", " or ");
                }
                if (splitter.Length > 3)
                {
                    text4 = splitter[3].Replace(" =", " or ");
                }
            }

            // Were the search fields specified?
            string andOrValue1    = "+";
            string andOrValue2    = "+";
            string andOrValue3    = "+";
            string dropDownValue1 = "ZZ";
            string dropDownValue2 = "TI";
            string dropDownValue3 = "AU";
            string dropDownValue4 = "TO";

            if (RequestSpecificValues.Current_Mode.Search_Fields.Length > 0)
            {
                // Parse by commas
                string[] fieldSplitter = RequestSpecificValues.Current_Mode.Search_Fields.Replace(" ", "+").Split(",".ToCharArray());

                dropDownValue1 = fieldSplitter[0];

                if ((fieldSplitter.Length > 1) && (fieldSplitter[1].Length > 1))
                {
                    andOrValue1    = fieldSplitter[1][0].ToString();
                    dropDownValue2 = fieldSplitter[1].Substring(1);
                }

                if ((fieldSplitter.Length > 2) && (fieldSplitter[2].Length > 1))
                {
                    andOrValue2    = fieldSplitter[2][0].ToString();
                    dropDownValue3 = fieldSplitter[2].Substring(1);
                }
                if ((fieldSplitter.Length > 3) && (fieldSplitter[3].Length > 1))
                {
                    andOrValue3    = fieldSplitter[3][0].ToString();
                    dropDownValue4 = fieldSplitter[3].Substring(1);
                }
            }

            Output.WriteLine("  <table id=\"sbkAsav_SearchPanel\" >");
            Output.WriteLine("    <tr>");
            Output.WriteLine("      <td style=\"width:28%;text-align:right;\"><label for=\"Textbox1\" id=\"sbkAsav_SearchPrompt\" >" + searchLanguage + "</label></td>");
            Output.WriteLine("      <td style=\"width:3%;\">&nbsp;</td>");
            Output.WriteLine("      <td style=\"width:58%;\">");
            Output.WriteLine("        <input name=\"Textbox1\" type=\"text\" id=\"Textbox1\" class=\"sbkAsav_SearchBox sbk_Focusable\" value=\"" + text1 + "\" />");
            Output.WriteLine("      </td>");
            Output.WriteLine("      <td style\"width:3%;text-align:center;\">" + inLanguage + "</td>");
            Output.WriteLine("      <td style=\"width:8%;\">");
            Output.WriteLine("        <select name=\"Dropdownlist1\" id=\"Dropdownlist1\" class=\"sbkAsav_DropDownList\" style=\"width:128px;\" >");

            add_drop_down_options(Output, dropDownValue1);

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

            Output.WriteLine("    <tr>");
            Output.WriteLine("      <td colspan=\"2\" style=\"text-align:right;\">");
            Output.WriteLine("        <select name=\"andOrNotBox1\" id=\"andOrNotBox1\" class=\"sbkAsav_AndOrNotBox\">");
            add_and_or_not_options(Output, andOrValue1);
            Output.WriteLine("        </select>");
            Output.WriteLine("      </td>");
            Output.WriteLine("      <td style=\"width:58%;\">");
            Output.WriteLine("        <input name=\"Textbox2\" type=\"text\" id=\"Textbox2\" class=\"sbkAsav_SearchBox sbk_Focusable\" value=\"" + text2 + "\" />");
            Output.WriteLine("      </td>");
            Output.WriteLine("      <td style\"width:3%;text-align:center;\">" + inLanguage + "</td>");
            Output.WriteLine("      <td style=\"width:8%;\">");
            Output.WriteLine("        <select name=\"Dropdownlist2\" id=\"Dropdownlist2\" class=\"sbkAsav_DropDownList\" style=\"width:128px;\" >");
            add_drop_down_options(Output, dropDownValue2);
            Output.WriteLine("        </select>");
            Output.WriteLine("      </td>");
            Output.WriteLine("    </tr>");

            Output.WriteLine("    <tr>");
            Output.WriteLine("      <td colspan=\"2\" style=\"text-align:right;\">");
            Output.WriteLine("        <select name=\"andOrNotBox2\" id=\"andOrNotBox2\" class=\"sbkAsav_AndOrNotBox\">");
            add_and_or_not_options(Output, andOrValue2);
            Output.WriteLine("        </select>");
            Output.WriteLine("      </td>");
            Output.WriteLine("      <td style=\"width:58%;\">");
            Output.WriteLine("        <input name=\"Textbox3\" type=\"text\" id=\"Textbox3\" class=\"sbkAsav_SearchBox sbk_Focusable\" value=\"" + text3 + "\" />");
            Output.WriteLine("      </td>");
            Output.WriteLine("      <td style\"width:3%;text-align:center;\">" + inLanguage + "</td>");
            Output.WriteLine("      <td style=\"width:8%;\">");
            Output.WriteLine("        <select name=\"Dropdownlist3\" id=\"Dropdownlist3\" class=\"sbkAsav_DropDownList\" style=\"width:128px;\">");
            add_drop_down_options(Output, dropDownValue3);
            Output.WriteLine("        </select>");
            Output.WriteLine("      </td>");
            Output.WriteLine("    </tr>");

            Output.WriteLine("    <tr>");
            Output.WriteLine("      <td colspan=\"2\" style=\"text-align:right;\">");
            Output.WriteLine("        <select name=\"andOrNotBox3\" id=\"andOrNotBox3\" class=\"sbkAsav_AndOrNotBox\">");
            add_and_or_not_options(Output, andOrValue3);
            Output.WriteLine("        </select>");
            Output.WriteLine("      </td>");
            Output.WriteLine("      <td style=\"width:58%;\">");
            Output.WriteLine("        <input name=\"Textbox4\" type=\"text\" id=\"Textbox4\" class=\"sbkAsav_SearchBox sbk_Focusable\" value=\"" + text4 + "\" />");
            Output.WriteLine("      </td>");
            Output.WriteLine("      <td style\"width:3%;text-align:center;\">" + inLanguage + "</td>");
            Output.WriteLine("      <td style=\"width:8%;\">");
            Output.WriteLine("        <select name=\"Dropdownlist4\" id=\"Dropdownlist4\" class=\"sbkAsav_DropDownList\" style=\"width:128px;\">");
            add_drop_down_options(Output, dropDownValue4);
            Output.WriteLine("        </select>");
            Output.WriteLine("      </td>");
            Output.WriteLine("    </tr>");

            // Show the year range data, if there are any years in this
            const string YEAR_RANGE = "Limit by Year";

            if (yearRange.Count > 0)
            {
                Output.WriteLine("    <tr style=\"height:50px;\">");
                Output.WriteLine("      <td style=\"text-align:right;\">" + YEAR_RANGE + ":</td>");
                Output.WriteLine("      <td>&nbsp;</td>");
                Output.WriteLine("      <td colspan=\"2\" style=\"text-align:left\">");

                Output.WriteLine("        <select name=\"YearDropDown1\" id=\"YearDropDown1\" class=\"sbkAsav_YearDropDown\">");
                //	Output.WriteLine("          <option value=\"ZZ\"> </option>");
                int currYear1 = RequestSpecificValues.Current_Mode.DateRange_Year1.HasValue ? RequestSpecificValues.Current_Mode.DateRange_Year1.Value : -1;
                if ((currYear1 != -1) && (!yearRange.Contains(currYear1)))
                {
                    Output.WriteLine("          <option selected=\"selected\" value=\"" + currYear1 + "\">" + currYear1 + "</option>");
                }
                if (currYear1 == -1)
                {
                    currYear1 = yearRange[0];
                }
                foreach (int thisYear in yearRange)
                {
                    if (thisYear == currYear1)
                    {
                        Output.WriteLine("          <option selected=\"selected\" value=\"" + thisYear + "\">" + thisYear + "</option>");
                    }
                    else
                    {
                        Output.WriteLine("          <option value=\"" + thisYear + "\">" + thisYear + "</option>");
                    }
                }
                Output.WriteLine("        </select>");

                Output.WriteLine("&nbsp; through &nbsp;");

                Output.WriteLine("        <select name=\"YearDropDown2\" id=\"YearDropDown2\" class=\"sbkAsav_YearDropDown\">");
                //	Output.WriteLine("          <option value=\"ZZ\"> </option>");
                int currYear2 = RequestSpecificValues.Current_Mode.DateRange_Year2.HasValue ? RequestSpecificValues.Current_Mode.DateRange_Year2.Value : -1;
                if ((currYear2 != -1) && (!yearRange.Contains(currYear2)))
                {
                    Output.WriteLine("          <option selected=\"selected\" value=\"" + currYear2 + "\">" + currYear2 + "</option>");
                }
                if (currYear2 == -1)
                {
                    currYear2 = yearRange[yearRange.Count - 1];
                }
                foreach (int thisYear in yearRange)
                {
                    if (thisYear == currYear2)
                    {
                        Output.WriteLine("          <option selected=\"selected\" value=\"" + thisYear + "\">" + thisYear + "</option>");
                    }
                    else
                    {
                        Output.WriteLine("          <option value=\"" + thisYear + "\">" + thisYear + "</option>");
                    }
                }
                Output.WriteLine("        </select>");

                Output.WriteLine("      </td>");
                Output.WriteLine("      <td style=\"text-align:right;\">");
                Output.WriteLine("        <span id=\"circular_progress\" class=\"hidden_progress\">&nbsp;</span> &nbsp; ");


                if (ViewBag.Hierarchy_Object.Children_Count > 0)
                {
                    Output.WriteLine("        <button name=\"searchButton\" id=\"searchButton\" class=\"sbk_SearchButton\" onclick=\"" + Search_Script_Action + ";return false;\">" + searchButtonText + "<img id=\"sbkAsav_ButtonArrow\" src=\"" + Static_Resources_Gateway.Button_Next_Arrow2_Png + "\" alt=\"\" /></button>");
                }
                else
                {
                    Output.WriteLine("        <button name=\"searchButton\" id=\"searchButton\" class=\"sbk_SearchButton\" onclick=\"" + Search_Script_Action + ";return false;\">" + searchButtonText + "<img id=\"sbkAsav_ButtonArrow\" src=\"" + Static_Resources_Gateway.Button_Next_Arrow2_Png + "\" alt=\"\" /></button>");
                }

                Output.WriteLine("      </td>");
            }
            else
            {
                Output.WriteLine("    <tr>");
                Output.WriteLine("      <td colspan=\"5\" style=\"text-align:right;\">");
                Output.WriteLine("        <span id=\"circular_progress\" class=\"hidden_progress\">&nbsp;</span> &nbsp; ");


                if (ViewBag.Hierarchy_Object.Children_Count > 0)
                {
                    Output.WriteLine("        <button name=\"searchButton\" id=\"searchButton\" class=\"sbk_SearchButton\" onclick=\"" + Search_Script_Action + ";return false;\">" + searchButtonText + "<img id=\"sbkAsav_ButtonArrow\" src=\"" + Static_Resources_Gateway.Button_Next_Arrow2_Png + "\" alt=\"\" /></button>");
                }
                else
                {
                    Output.WriteLine("        <button name=\"searchButton\" id=\"searchButton\" class=\"sbk_SearchButton\" onclick=\"" + Search_Script_Action + ";return false;\">" + searchButtonText + "<img id=\"sbkAsav_ButtonArrow\" src=\"" + Static_Resources_Gateway.Button_Next_Arrow2_Png + "\" alt=\"\" /></button>");
                }

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


            Output.WriteLine("    <tr>");
            Output.WriteLine("      <td colspan=\"2\" class=\"sbkAsav_SearchOptions\">" + searchOptions + "</span></td>");
            Output.WriteLine("      <td style=\"vertical-align:middle;text-align:left;\" id=\"sbkAsav_SearchHelp\"> &nbsp; &nbsp; <a href=\"" + RequestSpecificValues.Current_Mode.Base_URL + "help\" target=\"SEARCHHELP\" ><img src=\"" + RequestSpecificValues.Current_Mode.Base_URL + "design/skins/" + RequestSpecificValues.Current_Mode.Base_Skin_Or_Skin + "/buttons/help_button.jpg\" alt=\"HELP\" /></a></td>");
            Output.WriteLine("      <td colspan=\"2\">&nbsp;</td>");
            Output.WriteLine("    </tr>");
            Output.WriteLine("    <tr id=\"sbkAsav_SearchPrecision\">");
            Output.WriteLine("      <td colspan=\"5\">");
            Output.WriteLine("        <table>");
            Output.WriteLine("           <tr style=\"text-align:left;vertical-align:top;\">");
            Output.WriteLine("             <td style=\"width:120px;\">&nbsp;</td>");
            Output.WriteLine("             <td>" + precision + ": &nbsp; </td>");
            Output.WriteLine("             <td>");
            Output.WriteLine("               <input type=\"radio\" name=\"precision\" id=\"precisionContains\" value=\"contains\" /> <label for=\"precisionContains\">" + contains_exactly + "</label> <br />");
            Output.WriteLine("               <input type=\"radio\" name=\"precision\" id=\"precisionResults\" value=\"results\" checked=\"checked\" /> <label for=\"precisionResults\">" + contains_any_form + "</label> <br />");
            if (RequestSpecificValues.Current_Mode.Language == Web_Language_Enum.English)
            {
                Output.WriteLine("               <input type=\"radio\" name=\"precision\" id=\"precisionLike\" value=\"resultslike\" /> <label for=\"precisionLike\">" + CONTAINS_MEANING + "</label> ");
            }
            Output.WriteLine("             </td>");
            Output.WriteLine("           </tr>   ");
            Output.WriteLine("         </table>");
            Output.WriteLine("       </td>");
            Output.WriteLine("       </tr>");
            Output.WriteLine("  </table>");

            Output.WriteLine();
            Output.WriteLine("<!-- Focus on first search box -->");
            Output.WriteLine("<script type=\"text/javascript\">focus_element('Textbox1');</script>");
            Output.WriteLine();
        }