/// <summary> Returns a built collection viewer matching request </summary>
        /// <param name="SearchType"> Type of search from the current http request </param>
        /// <param name="Current_Aggregation"> Current item aggregation object </param>
        /// <param name="Current_Mode"> Mode / navigation information for the current request </param>
        /// <param name="Current_User"> Currently logged on user, if there is one </param>
        /// <returns> Collection viewer that extends the <see cref="abstractAggregationViewer"/> class. </returns>
        public static abstractAggregationViewer Get_Viewer(Search_Type_Enum SearchType, Item_Aggregation Current_Aggregation, SobekCM_Navigation_Object Current_Mode, User_Object Current_User)
        {
            switch (SearchType)
            {
                case Search_Type_Enum.Advanced:
                    return new Advanced_Search_AggregationViewer(Current_Aggregation, Current_Mode);

                case Search_Type_Enum.Basic:
                    if ((Current_Aggregation.Front_Banner_Image(Current_Mode.Language ).Length > 0) && (Current_Aggregation.Highlights.Count > 0))
                    {
                        return new Rotating_Highlight_Search_AggregationViewer(Current_Aggregation, Current_Mode);
                    }
                    return new Basic_Search_AggregationViewer(Current_Aggregation, Current_Mode);

                case Search_Type_Enum.Full_Text:
                    return new Full_Text_Search_AggregationViewer(Current_Aggregation, Current_Mode);

                case Search_Type_Enum.Newspaper:
                    return new Newspaper_Search_AggregationViewer(Current_Aggregation, Current_Mode);

                case Search_Type_Enum.Map:
                    return new Map_Search_AggregationViewer(Current_Aggregation, Current_Mode);

                case Search_Type_Enum.dLOC_Full_Text:
                    return new dLOC_Search_AggregationViewer(Current_Aggregation, Current_Mode);

                default:
                    return null;
            }
        }
        /// <summary> Returns a built collection viewer matching request </summary>
        /// <param name="ViewType"> Aggregation view type </param>
        /// <param name="Current_Aggregation"> Current item aggregation object </param>
        /// <param name="Current_Mode"> Mode / navigation information for the current request </param>
        /// <returns> Collection viewer that extends the <see cref="abstractAggregationViewer"/> class. </returns>
        public static abstractAggregationViewer Get_Viewer(Item_Aggregation.CollectionViewsAndSearchesEnum ViewType, Item_Aggregation Current_Aggregation, SobekCM_Navigation_Object Current_Mode )
        {
            switch (ViewType)
            {
                case Item_Aggregation.CollectionViewsAndSearchesEnum.Advanced_Search:
                    return new Advanced_Search_AggregationViewer(Current_Aggregation, Current_Mode);

                case Item_Aggregation.CollectionViewsAndSearchesEnum.Basic_Search:
                    string frontBannerImage = Current_Aggregation.Front_Banner_Image(Current_Mode.Language);
                    if ((frontBannerImage.Length > 0) && (Current_Aggregation.Highlights.Count > 0))
                    {
                        return new Rotating_Highlight_Search_AggregationViewer(Current_Aggregation, Current_Mode);
                    }
                    return new Basic_Search_AggregationViewer(Current_Aggregation, Current_Mode);

                case Item_Aggregation.CollectionViewsAndSearchesEnum.FullText_Search:
                    return new Full_Text_Search_AggregationViewer(Current_Aggregation, Current_Mode );

                case Item_Aggregation.CollectionViewsAndSearchesEnum.No_Home_Search:
                    return new No_Search_AggregationViewer();

                case Item_Aggregation.CollectionViewsAndSearchesEnum.Newspaper_Search:
                    return new Newspaper_Search_AggregationViewer(Current_Aggregation, Current_Mode);

                case Item_Aggregation.CollectionViewsAndSearchesEnum.Map_Search:
                    return new Map_Search_AggregationViewer(Current_Aggregation, Current_Mode);

                case Item_Aggregation.CollectionViewsAndSearchesEnum.dLOC_FullText_Search:
                    return new dLOC_Search_AggregationViewer(Current_Aggregation, Current_Mode);

                default:
                    return null;
            }
        }
        /// <summary> Returns a built collection viewer matching request </summary>
        /// <param name="SearchType"> Type of search from the current http request </param>
        /// <param name="Current_Aggregation"> Current item aggregation object </param>
        /// <param name="Current_Mode"> Mode / navigation information for the current request </param>
        /// <param name="Current_User"> Currently logged on user, if there is one </param>
        /// <returns> Collection viewer that extends the <see cref="abstractAggregationViewer"/> class. </returns>
        public static abstractAggregationViewer Get_Viewer(Search_Type_Enum SearchType, Item_Aggregation Current_Aggregation, SobekCM_Navigation_Object Current_Mode, User_Object Current_User)
        {
            switch (SearchType)
            {
                case Search_Type_Enum.Advanced:
                    if ( Current_Aggregation.Views_And_Searches.Contains(Item_Aggregation.CollectionViewsAndSearchesEnum.Advanced_Search_YearRange))
                        return new Advanced_Search_YearRange_AggregationViewer(Current_Aggregation, Current_Mode);
                    return new Advanced_Search_AggregationViewer(Current_Aggregation, Current_Mode);

                case Search_Type_Enum.Basic:
                    Item_Aggregation_Front_Banner frontBannerImage = Current_Aggregation.Front_Banner_Image(Current_Mode.Language);
                    if ((frontBannerImage != null ) && (Current_Aggregation.Highlights.Count > 0))
                    {
                        return new Rotating_Highlight_Search_AggregationViewer(Current_Aggregation, Current_Mode);
                    }
                    return new Basic_Search_AggregationViewer(Current_Aggregation, Current_Mode);

                case Search_Type_Enum.Full_Text:
                    return new Full_Text_Search_AggregationViewer(Current_Aggregation, Current_Mode);

                case Search_Type_Enum.Newspaper:
                    return new Newspaper_Search_AggregationViewer(Current_Aggregation, Current_Mode);

                case Search_Type_Enum.Map:
                    return new Map_Search_AggregationViewer(Current_Aggregation, Current_Mode);

                case Search_Type_Enum.Map_Beta:
                    return new Map_Search_AggregationViewer_Beta(Current_Aggregation, Current_Mode);

                case Search_Type_Enum.dLOC_Full_Text:
                    return new dLOC_Search_AggregationViewer(Current_Aggregation, Current_Mode);

                default:
                    return null;
            }
        }
        /// <summary> Constructor for a new instance of the Basic_Search_AggregationViewer class </summary>
        /// <param name="Current_Aggregation"> Current item aggregation object </param>
        /// <param name="Current_Mode"> Mode / navigation information for the current request</param>
        public Rotating_Highlight_Search_AggregationViewer(Item_Aggregation Current_Aggregation, SobekCM_Navigation_Object Current_Mode)
            : base(Current_Aggregation, Current_Mode)
        {
            // Determine the sub text to use
            const string SUB_CODE = "s=";
            Sharing_Buttons_HTML = String.Empty;

            // Save the search term
            if (currentMode.Search_String.Length > 0)
            {
                textBoxValue = currentMode.Search_String;
            }

            // Determine the complete script action name
            Display_Mode_Enum displayMode = currentMode.Mode;
            Aggregation_Type_Enum aggrType = currentMode.Aggregation_Type;
            Search_Type_Enum searchType = currentMode.Search_Type;
            currentMode.Mode = Display_Mode_Enum.Results;
            currentMode.Search_Type = Search_Type_Enum.Basic;
            currentMode.Search_Precision = Search_Precision_Type_Enum.Inflectional_Form;
            string search_string = currentMode.Search_String;
            currentMode.Search_String = String.Empty;
            currentMode.Search_Fields = String.Empty;
            arg2 = String.Empty;
            arg1 = currentMode.Redirect_URL();
            currentMode.Aggregation_Type = Aggregation_Type_Enum.Browse_Info;
            currentMode.Info_Browse_Mode = "all";
            browse_url = currentMode.Redirect_URL();
            currentMode.Info_Browse_Mode = String.Empty;
            currentMode.Aggregation_Type = Aggregation_Type_Enum.Home;
            if ((!currentMode.Show_Selection_Panel) || (Current_Aggregation.Children_Count == 0))
            {
                scriptActionName = "basic_search_sobekcm('" + arg1 + "', '" + browse_url + "')";
             }
            else
            {
                scriptActionName = "basic_select_search_sobekcm('" + arg1 + "', '" + SUB_CODE + "')";
                arg2 = SUB_CODE;
             }
            currentMode.Mode = displayMode;
            currentMode.Aggregation_Type = aggrType;
            currentMode.Search_Type = searchType;
            currentMode.Search_String = search_string;

            // Get the front banner
            frontBannerInfo = Current_Aggregation.Front_Banner_Image(currentMode.Language);
        }