/// <summary>
        /// Load Favicon from Current Portal Home Directory
        /// </summary>
        private void LoadFavIcon()
        {
            if (!File.Exists(Path.Combine(this.curPortalSettings.HomeDirectoryMapPath, "favicon.ico")))
            {
                return;
            }

            var faviconUrl = Path.Combine(this.curPortalSettings.HomeDirectory, "favicon.ico");

            var objLink = new HtmlGenericSelfClosing("link");

            objLink.Attributes["rel"] = "shortcut icon";
            objLink.Attributes["href"] = faviconUrl;

            this.favicon.Controls.Add(objLink);
        }
        /// <summary>
        /// Register the java scripts and CSS
        /// </summary>
        /// <param name="e">
        /// The Event Args.
        /// </param>
        protected override void OnPreRender(EventArgs e)
        {
            var jqueryScriptLink = new HtmlGenericControl("script");

            jqueryScriptLink.Attributes["type"] = "text/javascript";
            jqueryScriptLink.Attributes["src"] = "//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js";

            this.favicon.Controls.Add(jqueryScriptLink);

            var jqueryUiScriptLink = new HtmlGenericControl("script");

            jqueryUiScriptLink.Attributes["type"] = "text/javascript";
            jqueryUiScriptLink.Attributes["src"] = "//ajax.googleapis.com/ajax/libs/jqueryui/1/jquery-ui.min.js";

            this.favicon.Controls.Add(jqueryUiScriptLink);

            var notificationScriptLink = new HtmlGenericControl("script");

            notificationScriptLink.Attributes["type"] = "text/javascript";
            notificationScriptLink.Attributes["src"] = this.ResolveUrl("js/jquery.notification.js");

            this.favicon.Controls.Add(notificationScriptLink);

            var optionsScriptLink = new HtmlGenericControl("script");

            optionsScriptLink.Attributes["type"] = "text/javascript";
            optionsScriptLink.Attributes["src"] = this.ResolveUrl("js/Options.js");

            this.favicon.Controls.Add(optionsScriptLink);

            var objCssLink = new HtmlGenericSelfClosing("link");

            objCssLink.Attributes["rel"] = "stylesheet";
            objCssLink.Attributes["type"] = "text/css";
            objCssLink.Attributes["href"] = "//ajax.googleapis.com/ajax/libs/jqueryui/1/themes/blitzer/jquery-ui.css";

            this.favicon.Controls.Add(objCssLink);

            var notificationCssLink = new HtmlGenericSelfClosing("link");

            notificationCssLink.Attributes["rel"] = "stylesheet";
            notificationCssLink.Attributes["type"] = "text/css";
            notificationCssLink.Attributes["href"] = this.ResolveUrl("css/jquery.notification.css");

            this.favicon.Controls.Add(notificationCssLink);

            var optionsCssLink = new HtmlGenericSelfClosing("link");

            optionsCssLink.Attributes["rel"] = "stylesheet";
            optionsCssLink.Attributes["type"] = "text/css";
            optionsCssLink.Attributes["href"] = this.ResolveUrl("css/Options.css");

            this.favicon.Controls.Add(optionsCssLink);

            base.OnPreRender(e);
        }
        /// <summary>
        /// Register JavaScripts and CSS
        /// </summary>
        /// <param name="e">
        /// The Event Args.
        /// </param>
        protected override void OnPreRender(EventArgs e)
        {
            this.LoadFavIcon();

            var jqueryScriptLink = new HtmlGenericControl("script");

            jqueryScriptLink.Attributes["type"] = "text/javascript";
            jqueryScriptLink.Attributes["src"] = "//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js";

            this.favicon.Controls.Add(jqueryScriptLink);

            var jqueryUiScriptLink = new HtmlGenericControl("script");

            jqueryUiScriptLink.Attributes["type"] = "text/javascript";
            jqueryUiScriptLink.Attributes["src"] = "//ajax.googleapis.com/ajax/libs/jqueryui/1/jquery-ui.min.js";

            this.favicon.Controls.Add(jqueryUiScriptLink);

            var jqueryImageSliderScriptLink = new HtmlGenericControl("script");

            jqueryImageSliderScriptLink.Attributes["type"] = "text/javascript";
            jqueryImageSliderScriptLink.Attributes["src"] = this.ResolveUrl("js/jquery.ImageSlider.js");

            this.favicon.Controls.Add(jqueryImageSliderScriptLink);

            var jqueryImageResizerScriptLink = new HtmlGenericControl("script");

            jqueryImageResizerScriptLink.Attributes["type"] = "text/javascript";
            jqueryImageResizerScriptLink.Attributes["src"] = this.ResolveUrl("js/jquery.cropzoom.js");

            this.favicon.Controls.Add(jqueryImageResizerScriptLink);

            var jqueryCropZoomScriptLink = new HtmlGenericControl("script");

            jqueryCropZoomScriptLink.Attributes["type"] = "text/javascript";
            jqueryCropZoomScriptLink.Attributes["src"] = this.ResolveUrl("js/jquery.ImageResizer.js");

            this.favicon.Controls.Add(jqueryCropZoomScriptLink);

            var jqueryPageMetodScriptLink = new HtmlGenericControl("script");

            jqueryPageMetodScriptLink.Attributes["type"] = "text/javascript";
            jqueryPageMetodScriptLink.Attributes["src"] = this.ResolveUrl("js/jquery.pagemethod.js");

            this.favicon.Controls.Add(jqueryPageMetodScriptLink);

            var jqueryFileUploadScriptLink = new HtmlGenericControl("script");

            jqueryFileUploadScriptLink.Attributes["type"] = "text/javascript";
            jqueryFileUploadScriptLink.Attributes["src"] = this.ResolveUrl("js/jquery.fileupload.comb.min.js");

            this.favicon.Controls.Add(jqueryFileUploadScriptLink);

            var objCssLink = new HtmlGenericSelfClosing("link");

            objCssLink.Attributes["rel"] = "stylesheet";
            objCssLink.Attributes["type"] = "text/css";
            objCssLink.Attributes["href"] = "//ajax.googleapis.com/ajax/libs/jqueryui/1/themes/blitzer/jquery-ui.css";

            this.favicon.Controls.Add(objCssLink);

            this.GetSelectedImageOrLink();

            base.OnPreRender(e);
        }