/// <summary> Adds the banner to the response stream from either the html web skin
        /// or from the current item aggreagtion object, depending on flags in the web skin object </summary>
        /// <param name="Output"> Stream to which to write the HTML for the banner </param>
        /// <param name="Banner_Division_Name"> Name for the wrapper division around the banner </param>
        /// <param name="Hierarchy_Object"> Current item aggregation object to display </param>
        /// <param name="HTML_Skin"> HTML Web skin which controls the overall appearance of this digital library </param>
        /// <param name="CurrentMode"> Mode / navigation information for the current request</param>
        /// <remarks> This is called by several html subwriters that otherwise tell this class to suppress writing the banner </remarks>
        public static void Add_Banner(TextWriter Output, string Banner_Division_Name, SobekCM_Navigation_Object CurrentMode, SobekCM_Skin_Object HTML_Skin, Item_Aggregation Hierarchy_Object)
        {
            Output.WriteLine("<!-- Write the main collection, interface, or institution banner -->");
            if ((HTML_Skin != null) && (HTML_Skin.Override_Banner))
            {
                Output.WriteLine(HTML_Skin.Banner_HTML);
            }
            else
            {
                string url_options = CurrentMode.URL_Options();
                if (url_options.Length > 0)
                    url_options = "?" + url_options;

                if ((Hierarchy_Object != null) && (Hierarchy_Object.Code != "all"))
                {
                    Output.WriteLine("<div id=\"sbkAhs_BannerDiv\"><a alt=\"" + Hierarchy_Object.ShortName + "\" href=\"" + CurrentMode.Base_URL + Hierarchy_Object.Code + url_options + "\"><img id=\"mainBanner\" src=\"" + CurrentMode.Base_URL + Hierarchy_Object.Banner_Image(CurrentMode.Language, HTML_Skin) + "\" alt=\"\" /></a></div>");
                }
                else
                {
                    if ((Hierarchy_Object != null) && (Hierarchy_Object.Banner_Image(CurrentMode.Language, HTML_Skin).Length > 0))
                    {
                        Output.WriteLine("<div id=\"sbkAhs_BannerDiv\"><a href=\"" + CurrentMode.Base_URL + url_options + "\"><img id=\"mainBanner\" src=\"" + CurrentMode.Base_URL + Hierarchy_Object.Banner_Image(CurrentMode.Language, HTML_Skin) + "\" alt=\"\" /></a></div>");
                    }
                    else
                    {
                        string skin_url = CurrentMode.Base_Design_URL + "skins/" + CurrentMode.Skin + "/";
                        Output.WriteLine("<div id=\"sbkAhs_BannerDiv\"><a href=\"" + CurrentMode.Base_URL + url_options + "\"><img id=\"mainBanner\" src=\"" + skin_url + "default.jpg\" alt=\"\" /></a></div>");
                    }
                }
            }
            Output.WriteLine();
        }