public void LanguageDropDown_Changed(object sender, EventArgs e)
        {
            BaseLocale locale = null;

            locale = Locales.FindLocaleByName(this.LanguageDropDown.SelectedValue);

            ((TBWebPage)this.Page).Locale = locale;

            //NOTE: this is not a good solution to the Singleton pattern
            DynamicEdit.ResetFirst();
            DynamicEditPage.ResetFirst();

            Response.Redirect(Request.Url.AbsoluteUri, true);
        }
        public void CheckFlags()
        {
            //handle flag clicks
            //NOTE: this has been handled by GET to allow for Googlebots to search
            if (Request["lang"] != null)
            {
                switch (Request["lang"])
                {
                case "en":
                    ((TBWebPage)this.Page).Locale = Locales.America;
                    break;

                case "pt":
                    ((TBWebPage)this.Page).Locale = Locales.Brazil;
                    break;

                case "ja":
                    ((TBWebPage)this.Page).Locale = Locales.Japan;
                    break;

                case "es":
                    ((TBWebPage)this.Page).Locale = Locales.Peru;
                    break;
                }


                string uri = Request.Url.AbsoluteUri;

                uri = System.Text.RegularExpressions.Regex.Replace(uri, "lang=..", "");

                //NOTE: this is not a good solution to the Singleton pattern
                DynamicEdit.ResetFirst();
                DynamicEditPage.ResetFirst();

                //redirect with the new language
                Response.Redirect(uri, true);
            }
        }