Example #1
0
        protected override void CreateChildControls()
        {
            _LinkButton               = new LinkButton();
            _LinkButton.ID            = "proplabel_linkbutton";
            _LinkButton.CssClass      = "propertylabel";
            _LinkButton.OnClientClick = "return false;";
            this.Controls.Add(_LinkButton);

            _Label          = new Label();
            _Label.ID       = "proplabel_label";
            _Label.CssClass = "propertylabel";
            this.Controls.Add(_Label);

            _ToolTip    = new RadToolTip();
            _ToolTip.ID = "proplabel_tooltip";
            _ToolTip.EnableEmbeddedSkins = false;
            _ToolTip.Skin = "ChemSW";
            this.Controls.Add(_ToolTip);

            _Check    = new CheckBox();
            _Check.ID = "proplabel_checkbox";
            this.Controls.Add(_Check);

            this.Controls.Add(new CswLiteralBr());

            base.CreateChildControls();
        }
Example #2
0
        protected void AddToolTip(string id, string helpText)
        {
            var imgHelp = new Image()
            {
                ID       = "help_" + id,
                ImageUrl = "/images/ico-question.png",
            };

            //string txt = "<table class='borderSoft'><tr><td>Parameter</td><td>Value</td></tr><tr><td>energy</td><td>123456</td></tr></table>";

            var rttHelp = new RadToolTip()
            {
                Text             = "<div style=\"font-size: 11px; line-height: 1.5em;\">" + helpText + "</div>",
                TargetControlID  = imgHelp.ID,
                IsClientID       = false,
                RelativeTo       = ToolTipRelativeDisplay.Element,
                Width            = 320,
                Height           = 160,
                Animation        = ToolTipAnimation.Fade,
                Position         = ToolTipPosition.MiddleRight,
                ContentScrolling = ToolTipScrolling.Auto,
                Skin             = "Metro",
                AutoCloseDelay   = 0
            };

            trStatusInfo.Controls.Add(new LiteralControl("<span style=\"float: right;\">"));
            trStatusInfo.Controls.Add(imgHelp);
            trStatusInfo.Controls.Add(new LiteralControl("</span>"));
            trStatusInfo.Controls.Add(rttHelp);
        }
Example #3
0
        // using this method on RowDataBound - CreateToolTip(rData, e.Row.ClientID);
        private void CreateToolTip(MetricTrac.Bll.PerformanceIndicator.Extend rData, string rowClientID)
        {
            RadToolTip rtt = new RadToolTip();

            rtt.Position        = ToolTipPosition.BottomCenter;
            rtt.Title           = rData.Name;
            rtt.TargetControlID = rowClientID;
            rtt.IsClientID      = true;
            rtt.Animation       = ToolTipAnimation.Slide;
            rtt.AutoCloseDelay  = 12000;
            rtt.Text            = "<table border=\"0\" cellpadding=\"2px\" cellspacing=\"0\" style=\"color:Gray;width:300px;\">" +
                                  "<tr><td class=\"GridHeader\">Description</td><td>" + (String.IsNullOrEmpty(rData.Description) ? "---" : rData.Description) + "</td>" +
                                  "<tr><td class=\"GridHeader\">Group->Category->Aspect</td><td>" + (String.IsNullOrEmpty(rData.GCAName) ? "---" : rData.GCAName) + "</td>" +
                                  "<tr><td class=\"GridHeader\">Sector</td><td>" + (String.IsNullOrEmpty(rData.SectorName) ? "---" : rData.SectorName) + "</td>" +
                                  "<tr><td class=\"GridHeader\">Requirement</td><td>" + (String.IsNullOrEmpty(rData.RequirementName) ? "---" : rData.RequirementName) + "</td>" +
                                  "<tr><td class=\"GridHeader\">Help Text</td><td>" + (String.IsNullOrEmpty(rData.Help) ? "---" : rData.Help) + "</td>" +
                                  "<tr><td colspan=\"2\"><span class=\"GridHeader\">Metrics</span><br />";


            /*List<MetricTrac.Bll.Metric.Extend> _Metrics = MetricTrac.Bll.Metric.List(rData.PerformanceIndicatorID);
             * if (_Metrics.Count > 0)
             * {
             *  rtt.Text += "<table border=\"0\" cellpadding=\"2px\" cellspacing=\"0\" style=\"color:Gray;\">";
             *  rtt.Text += "<tr style=\"background-color:Gray;color:White;\"><td>Category</td><td>Name</td><td>Input&nbsp;Unit&nbsp;of&nbsp;Measure</td><td>Output&nbsp;Unit&nbsp;of&nbsp;Measure</td><td>Collection&nbsp;Frequency</td><td>Description</td><tr>";
             *  foreach (MetricTrac.Bll.Metric.Extend m in _Metrics)
             *      rtt.Text += "<tr><td>" + m.MetricCategoryName + "</td><td>" + m.Name + "</td><td>" + m.InputUnitOfMeasureName + "</td><td>" + m.UnitOfMeasureName + "</td><td>" + m.FrequencyName + "</td><td>" + m.Notes + "</td></tr>";
             *  rtt.Text += "</table>";
             * }
             * else
             *  rtt.Text += "No assigned Metrics";
             * rtt.Text += "</td></tr></table>";*/
            pnlToolTips.Controls.Add(rtt);
        }
    // RadGrid
    protected void rg_leads_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
    {
        if (e.Item is GridDataItem)
        {
            GridDataItem item            = (GridDataItem)e.Item;
            String       temp_lead_id    = item["TempLeadID"].Text;
            RadTextBox   rtb_note        = (RadTextBox)item["Notes"].FindControl("tb_notes");
            RadTextBox   tb_linkedin_url = (RadTextBox)item["LinkedInURL"].FindControl("tb_linkedin_url");
            System.Web.UI.WebControls.Image img_notes = (System.Web.UI.WebControls.Image)item["Notes"].FindControl("img_notes");
            HiddenField hf_country = (HiddenField)item["Country"].FindControl("hf_country");

            // Bind country dropdown
            RadDropDownList dd_country = (RadDropDownList)item["Country"].FindControl("dd_country");

            String CountryToSet = hf_country.Value;
            if (CountryToSet == String.Empty && dd_default_country.Items.Count > 0 && dd_default_country.SelectedItem != null && dd_default_country.SelectedItem.Text != String.Empty)
            {
                CountryToSet = dd_default_country.SelectedItem.Text;
            }

            if (dd_country.Items.Count == 0)
            {
                BindCountryDropDown(dd_country, true, CountryToSet);
            }

            // Set expand direction of DropDown
            if (rg_leads.Items.Count > 7)
            {
                dd_country.ExpandDirection = DropDownListExpandDirection.Up;
            }

            if (rtb_note.Text.Trim() != String.Empty)
            {
                item["Notes"].CssClass = "GoodColourCell";
            }

            if (item["NextActionTypeID"].Text != "&nbsp;" && item["NextActionTypeID"].Text != "0")
            {
                item["Notes"].Attributes.Add("style", "border:solid 1px #9ac547;");
            }

            if (tb_linkedin_url.Text != String.Empty)
            {
                RadToolTip tip = new RadToolTip();
                tip.Text            = tb_linkedin_url.Text;
                tip.TargetControlID = tb_linkedin_url.ClientID;
                tip.IsClientID      = true;
                tip.RelativeTo      = ToolTipRelativeDisplay.Mouse;
                tip.Skin            = "Silk";
                tip.Sticky          = true;
                item["LinkedInURL"].Controls.Add(tip);
                tb_linkedin_url.Attributes.Add("style", "cursor:pointer;");
                tb_linkedin_url.ToolTip     = String.Empty;
                item["LinkedInURL"].ToolTip = String.Empty;
            }

            // Notes tooltip
            rttm.TargetControls.Add(img_notes.ClientID, temp_lead_id, true);
        }
    }
Example #5
0
    protected void RepeaterBudgetOwners_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {
        if (e.Item.DataItem == null)
        {
            return;
        }

        AccountBudgetLine line = (AccountBudgetLine)e.Item.DataItem;

        Label labelBudgetOwner = (Label)e.Item.FindControl("LabelChildBudgetOwner");

        labelBudgetOwner.Text = line.AccountOwner;

        HiddenField hiddenAccountId = (HiddenField)e.Item.FindControl("HiddenAccountId");

        hiddenAccountId.Value = line.AccountIdentity.ToString();

        RadToolTip toolTip = (RadToolTip)e.Item.FindControl("ToolTip");

        Controls_v4_PersonDetailPopup personDetail = (Controls_v4_PersonDetailPopup)toolTip.FindControl("PersonDetail");

        personDetail.PersonChanged += new EventHandler(PersonDetail_PersonChanged);

        if (!Page.IsPostBack && _authority != null)
        {
            personDetail.Authority = _authority;
            personDetail.Person    = line.Account.Owner;
            personDetail.Account   = line.Account;
        }

        // this.TooltipManager.TargetControls.Add(labelBudgetOwner.ClientID, line.AccountIdentity.ToString(), true);
    }
Example #6
0
        public static void AddToolTip(Control container, string id, string helpText)
        {
            var imgHelp = new Image()
            {
                ID       = "help_" + id,
                ImageUrl = "/images/ico-question.png",
            };

            var rttHelp = new RadToolTip()
            {
                Text             = "<div style=\"font-size: 11px; line-height: 1.5em;\">" + helpText + "</div>",
                TargetControlID  = imgHelp.ID,
                IsClientID       = false,
                RelativeTo       = ToolTipRelativeDisplay.Element,
                Width            = 320,
                Height           = 160,
                Animation        = ToolTipAnimation.Fade,
                Position         = ToolTipPosition.MiddleRight,
                ContentScrolling = ToolTipScrolling.Auto,
                Skin             = "Metro",
                AutoCloseDelay   = 0
            };

            container.Controls.Add(new LiteralControl("<span style=\"float: right;\">"));
            container.Controls.Add(imgHelp);
            container.Controls.Add(new LiteralControl("</span>"));
            container.Controls.Add(rttHelp);
        }
Example #7
0
        private void InitialiseControls()
        {
            RadNumericTextBox txt = new RadNumericTextBox();

            txt.ID   = "txtCampo";
            txt.Skin = "WebBlue";
            //txt.Culture = new System.Globalization.CultureInfo("Spanish (Argentina)");
            txt.MinValue = 0;
            txt.Value    = 0;
            txt.NumberFormat.DecimalSeparator = ".";
            txt.NumberFormat.GroupSeparator   = "";
            txt.Width = Unit.Percentage(90);

            //<telerik:RadNumericTextBox ID="txtCampo" runat="server" Skin="WebBlue" Culture="Spanish (Argentina)"
            //    ClientEvents-OnBlur="VerificarDatosCompletos" ClientEvents-OnKeyPress="ControlarEnter"
            //    MinValue="0" ClientEvents-OnError="ShowErrorCampo">
            //    <ClientEvents OnBlur="VerificarDatosCompletos" OnError="ShowErrorCampo"></ClientEvents>
            //    <NumberFormat DecimalSeparator="." GroupSeparator="" />
            //</telerik:RadNumericTextBox>


            RequiredFieldValidator req = new RequiredFieldValidator();

            req.ID = "reqCampo";
            req.ControlToValidate = "txtCampo";
            req.ErrorMessage      = "El campo marcado con * es obligatorio";
            req.ValidationGroup   = "ServerCampoNumerico";
            req.Text = "*";


            //<asp:RequiredFieldValidator ID="RequiredFieldValidatorCampo" runat="server" ControlToValidate="txtCampo"
            //    ErrorMessage="El campo marcado con * es obligatorio" ValidationGroup="Grupo1">*</asp:RequiredFieldValidator>


            RadToolTip toolTipCampo = new RadToolTip();

            toolTipCampo.Skin            = "Hay";
            toolTipCampo.ID              = "toolTipoCampo";
            toolTipCampo.Position        = ToolTipPosition.TopCenter;
            toolTipCampo.HideEvent       = ToolTipHideEvent.ManualClose;
            toolTipCampo.ShowEvent       = ToolTipShowEvent.FromCode;
            toolTipCampo.RelativeTo      = ToolTipRelativeDisplay.Element;
            toolTipCampo.TargetControlID = "txtCampo";
            toolTipCampo.Animation       = ToolTipAnimation.None;


            //<telerik:RadToolTip runat="server" ID="RadToolTip1" Skin="Hay" Position="TopCenter"
            //    ManualClose="false" ShowEvent="FromCode" RelativeTo="Element" TargetControlID="txtCampo"
            //    Animation="None">
            //</telerik:RadToolTip>


            this.Controls.Add(txt);
            this.Controls.Add(req);
            this.Controls.Add(toolTipCampo);
        }
Example #8
0
        private void CreateToolTip(string AssignedLocationName, string AssignedLocationsNames, string rowClientID)
        {
            RadToolTip rtt = new RadToolTip();

            rtt.Position        = ToolTipPosition.BottomCenter;
            rtt.Title           = AssignedLocationName;
            rtt.TargetControlID = rowClientID;
            rtt.IsClientID      = true;
            rtt.Animation       = ToolTipAnimation.Slide;
            rtt.AutoCloseDelay  = 12000;
            rtt.Text            = AssignedLocationsNames;
            pnlToolTips.Controls.Add(rtt);
        }
Example #9
0
    protected void RebindTooltips()
    {
        foreach (RepeaterItem repeaterItem in this.RepeaterBudgetOwners.Items)
        {
            HiddenField      hiddenAccountId = (HiddenField)repeaterItem.FindControl("HiddenAccountId");
            FinancialAccount child           = FinancialAccount.FromIdentity(Int32.Parse(hiddenAccountId.Value));
            RadToolTip       toolTip         = (RadToolTip)repeaterItem.FindControl("ToolTip");

            Controls_v4_PersonDetailPopup personDetail = (Controls_v4_PersonDetailPopup)toolTip.FindControl("PersonDetail");

            FinancialAccount account = FinancialAccount.FromIdentity(Int32.Parse(hiddenAccountId.Value));
            personDetail.Authority = _authority;
            personDetail.Person    = account.Owner;
            personDetail.Account   = account;
        }
    }
    protected void rptExhibitors_DataBound(object sender, RepeaterItemEventArgs e)
    {
        DataRowView drv = (DataRowView)e.Item.DataItem;

        if (Page.IsPostBack)
        {
            return;                             // only do this if there's a postback - otherwise, preserve ViewState
        }
        switch (e.Item.ItemType)
        {
        case ListItemType.Header:
            break;

        case ListItemType.Footer:
            break;

        case ListItemType.AlternatingItem:
            goto case ListItemType.Item;

        case ListItemType.Item:
            Image      imgLogo                = (Image)e.Item.FindControl("imgLogo");
            Label      lblExhibitorName       = (Label)e.Item.FindControl("lblExhibitorName");
            Label      lblBooths              = (Label)e.Item.FindControl("lblBooths");
            RadToolTip rppExhibitorBio        = (RadToolTip)e.Item.FindControl("rppExhibitorBio");
            var        hlExhibitorDescription = (HyperLink)e.Item.FindControl("hlExhibitorDescription");

            string imageID = Convert.ToString(drv["Logo"]);
            if (!string.IsNullOrWhiteSpace(imageID))
            {
                imgLogo.Visible  = true;
                imgLogo.ImageUrl = GetImageUrl(imageID);
            }

            lblExhibitorName.Text = Convert.ToString(drv["Name"]);
            lblBooths.Text        = Convert.ToString(drv["AssignedBooths"]);

            var bio = Convert.ToString(drv["Bio"]);

            if (!string.IsNullOrWhiteSpace(bio))
            {
                rppExhibitorBio.Text           = bio;
                hlExhibitorDescription.Visible = true;
            }

            break;
        }
    }
Example #11
0
        /// <summary>
        /// Handles the RowDataBound event of the gridviewTaskList control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="GridViewRowEventArgs"/> instance containing the event data.</param>
        protected void gridviewTaskList_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                /*The dynamic type enables the operations in which it occurs to bypass compile-time type checking.
                 * Instead, these operations are resolved at run time. */
                dynamic task = e.Row.DataItem as dynamic;

                Label lblItemDescription = (Label)e.Row.FindControl("lblItemDescription");
                Label lblTaskDescription = (Label)e.Row.FindControl("lblTaskDescription");

                RadToolTip toolTip1 = (RadToolTip)e.Row.FindControl("radToolTipLists1");
                RadToolTip toolTip2 = (RadToolTip)e.Row.FindControl("radToolTipLists2");

                ListView listViewTaskListToolTip1 = (ListView)e.Row.FindControl("listViewTaskListToolTip1");
                ListView listViewTaskListToolTip2 = (ListView)e.Row.FindControl("listViewTaskListToolTip2");

                lblItemDescription.Text = Support.TruncateString(task.itemBriefName, 22);
                lblTaskDescription.Text = Support.TruncateString(task.taskDescription, 50);

                int taskId = 0;
                taskId = (int)task.ItemBriefTaskId;
                //Style the text if task is already added to a list
                if (task.taskListId > 0)
                {
                    lblItemDescription.CssClass = "grayText";
                    lblTaskDescription.CssClass = "grayText"; //.Style.Add("color", "#C0C3C6");

                    var taskLists = this.GetBL <ItemBriefBL>().GetTaskList(taskId);

                    listViewTaskListToolTip1.DataSource = taskLists;
                    listViewTaskListToolTip1.DataBind();

                    listViewTaskListToolTip2.DataSource = taskLists;
                    listViewTaskListToolTip2.DataBind();
                }
                else
                {
                    toolTip1.Visible = false;
                    toolTip2.Visible = false;
                }
                HtmlImage imgNoEstimatedCost = (HtmlImage)e.Row.FindControl("imgNoEstimatedCost");
                imgNoEstimatedCost.Visible = (task.EstimatedCost == null);
            }
        }
 /// <summary>
 /// Configures the criteria header with values it needs from the containing control
 /// </summary>
 /// <param name="criteriaHeader">The criteria header control.</param>
 /// <param name="radToolTip1">The tool tip being setup for this criteria control.</param>
 public void ConfigureCriteriaHeader(CriteriaHeader criteriaHeader, RadToolTip radToolTip1)
 {
     _criteriaHeader = criteriaHeader;
     criteriaHeader.Text = Text;
     criteriaHeader.CriteriaName = CriteriaName;
     criteriaHeader.ToolTip = radToolTip1;
     criteriaHeader.ValueDisplayTemplateName = ValueDisplayTemplateName;
     criteriaHeader.Required = Required;
     var config = new CriteriaConfig()
                      {
                          //RestrictToSingleValue = RestrictToSingleValue,
                          RestrictValueCount = RestrictValueCount,
                          ValueDisplayTemplateName = ValueDisplayTemplateName,
                          ReadOnly = ReadOnly
     
                      };
     ScriptManager.RegisterStartupScript(this, typeof(string), CriteriaName + "_Config", "var " + CriteriaName + "_Config = " + new JavaScriptSerializer().Serialize(config) + ";", true);
 }
Example #13
0
        public MainForm()
        {
            InitializeComponent();

            //MessageBox.Show(userName);
            RadToolTip newToolTip = new RadToolTip();

            newToolTip.Show("A tooltip which appears at mouse position", 2000);

            isLoading = true;
            LoadrmccDatabase();
            LoadGrid();
            LoadDBAGrid();
            isLoading = false;

            gridTimer.Interval = 1000;
            gridTimer.Tick    += new EventHandler(Timer1_Tick);
            gridTimer.Enabled  = false;
        }
Example #14
0
    protected void gvJobs_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        DataRowView dr = (DataRowView)e.Row.DataItem;

        if (Page.IsPostBack)
        {
            return;                             // only do this if there's a postback - otherwise, preserve ViewState
        }
        switch (e.Row.RowType)
        {
        case DataControlRowType.Header:
            break;

        case DataControlRowType.Footer:
            break;



        case DataControlRowType.DataRow:
            HyperLink  hlMoreInfo = (HyperLink)e.Row.FindControl("hlMoreInfo");
            RadToolTip rttDetails = (RadToolTip)e.Row.FindControl("rttDetails");

            var comments = Convert.ToString(dr[msVolunteerJobOccurrence.FIELDS.Comments]);
            if (string.IsNullOrWhiteSpace(comments))
            {
                hlMoreInfo.Visible = false;
                return;
            }

            rttDetails.Text            = comments;
            rttDetails.TargetControlID = hlMoreInfo.ID;


            break;
        }
    }
Example #15
0
 void lblErrorMessage_MouseEnter(object sender, EventArgs e)
 {
     _longErrorTooltip = new RadToolTip();
     _longErrorTooltip.Show(LongErrorMessage);
 }
    protected void gvSessions_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        EventManifestSession session = (EventManifestSession)e.Row.DataItem;

        if (Page.IsPostBack)
        {
            return; // only do this if there's a postback - otherwise, preserve ViewState
        }
        switch (e.Row.RowType)
        {
        case DataControlRowType.Header:
            break;

        case DataControlRowType.Footer:
            break;



        case DataControlRowType.DataRow:
            msSessionTimeSlot timeSlot              = timeslots.Where(x => x.ID == session.TimeSlotID).FirstOrDefault();
            CheckBox          cbRegister            = (CheckBox)e.Row.FindControl("cbRegister");
            TextBox           tbQuantity            = (TextBox)e.Row.FindControl("tbQuantity");
            RadioButton       rbRegister            = (RadioButton)e.Row.FindControl("rbRegister");
            DropDownList      ddlFee                = (DropDownList)e.Row.FindControl("ddlFee");
            Label             lblPrice              = (Label)e.Row.FindControl("lblPrice");
            RadToolTip        rtpSessionDescription = (RadToolTip)e.Row.FindControl("rtpSessionDescription");
            Label             lblSessionName        = (Label)e.Row.FindControl("lblSessionName");

            lblSessionName.Text         = session.SessionName;
            rtpSessionDescription.Title = session.SessionName;
            rtpSessionDescription.Text  = session.SessionDescription;

            if (session.RegistrationMode == EventRegistrationMode.Ticketed)
            {
                tbQuantity.Visible = true;
            }
            else
            if (session.TimeSlotID == null || (timeSlot != null && timeSlot.AllowMultipleSessions))
            {
                // use checkboxes
                cbRegister.Visible = true;
                rbRegister.Visible = false;
            }
            else
            {
                rbRegister.Visible = true;
                rbRegister.Checked = session.SessionID == null;         // select the "do not register" option by default
                string groupName = Formats.GetSafeFieldName(session.TimeSlotID);

                // hack to work around ASP.NET RadioButtons in repeater controls bug
                // http://www.codeguru.com/csharp/csharp/cs_controls/custom/article.php/c12371/
                rbRegister.GroupName = groupName;
                string script = string.Format(
                    "SetUniqueRadioButton('gvSessions.*{0}',this)", groupName);
                rbRegister.Attributes.Add("onclick", script);

                cbRegister.Visible = false;
            }

            if (session.Fees != null)
            {
                // MS-1587 - add where filter
                // MS-5481 - only show session fees that are flagged to be sold online
                foreach (var fee in session.Fees.Where(x => x.IsEligible && x.SellOnline))
                {
                    // let's show the fee w/o the session name
                    string name = string.Format("{0} - {1}", fee.ProductName.Replace(session.SessionName + " - ", "")
                                                ,
                                                !string.IsNullOrWhiteSpace(fee.DisplayPriceAs) ? fee.DisplayPriceAs : fee.Price.ToString("C"));
                    ddlFee.Items.Add(new ListItem(name, fee.ProductID));
                }

                if (session.DefaultFee != null)
                {
                    ddlFee.SelectedValue = session.DefaultFee;
                }

                if (ddlFee.Items.Count == 1)     // just show the dang label
                {
                    ddlFee.Visible   = false;
                    lblPrice.Visible = true;

                    //MS-1587
                    //Since there's one item in the list there must be one fee where IsEligible == true
                    // MS-5481 - only show session fees that are flagged to be sold online
                    EventRegistrationProductInfo erpi = session.Fees.Single(x => x.IsEligible && x.SellOnline);

                    lblPrice.Text = !string.IsNullOrWhiteSpace(erpi.DisplayPriceAs) ? erpi.DisplayPriceAs : erpi.Price.ToString("C");
                }

                // MS-5023 If all session fees are ineligible, then hide drop-down box,
                // disable the session row and show wording with explanations
                if (ddlFee.Items.Count == 0)
                {
                    ddlFee.Visible   = false;
                    lblPrice.Visible = true;
                    lblPrice.Text    = "No eligible fees";
                    e.Row.Enabled    = false;
                }
            }
            else
            {
                ddlFee.Visible   = false;
                lblPrice.Visible = false;
            }

            if (session.Ineligible)       // can't select this
            {
                rbRegister.Enabled = cbRegister.Enabled = tbQuantity.Enabled
                                                              = ddlFee.Enabled = false;
                ddlFee.Visible   = false;
                lblPrice.Visible = true;
                lblPrice.Text    = "INELIGIBLE";
            }

            // If this is a Registration Edit, reactivate the selected Sessions and select them
            if (targetRegistration != null)
            {
                bool highlightRow = false;
                if (session.SessionID == null)
                {
                    // For "No Selection" uncheck if there is a selected session
                    var sessionList = ((GridView)sender).DataSource as List <EventManifestSession>;
                    foreach (var sessionManifest in sessionList)
                    {
                        var sessionReg = currentSessions.Select("Event = '" + sessionManifest.SessionID + "'");
                        if (sessionReg.Length > 0)
                        {
                            rbRegister.Checked = false;
                            break;
                        }
                    }

                    // If we leave selected, highlight it
                    highlightRow = rbRegister.Checked;
                }
                else
                {
                    var sessionReg = currentSessions.Select("Event = '" + session.SessionID + "'");
                    if (sessionReg.Length > 0)
                    {
                        // Hide the Fee \ Price info
                        lblPrice.Visible = true;
                        var price = sessionReg[0]["Price"] as decimal?;
                        if (price.HasValue)
                        {
                            lblPrice.Text = string.Format("{0:C}", price.Value);
                        }

                        // Make sure that the line has a Product ID
                        ddlFee.Visible = false;
                        if (ddlFee.Items.Count == 0)
                        {
                            ddlFee.Items.Add(Convert.ToString(sessionReg[0]["Fee"]));
                        }

                        // Make sure row is enabled
                        e.Row.Enabled = true;

                        // Select this row
                        if (session.RegistrationMode == EventRegistrationMode.Ticketed)
                        {
                            tbQuantity.Text = sessionReg.Length.ToString();
                        }
                        else if (session.TimeSlotID == null || (timeSlot != null && timeSlot.AllowMultipleSessions))
                        {
                            cbRegister.Checked = true;
                        }
                        else
                        {
                            rbRegister.Checked = true;
                        }

                        // Hightlight the row
                        highlightRow = true;
                    }
                }

                if (highlightRow)
                {
                    e.Row.CssClass = "hlte";

                    var altStyle = ((GridView)sender).AlternatingRowStyle.CssClass;
                    if (!string.IsNullOrEmpty(altStyle) && e.Row.RowIndex % 2 == 1)
                    {
                        e.Row.CssClass += " " + altStyle;
                    }
                }
            }

            break;
        }
    }
    //protected void UpdatePanel2_Load(object sender, EventArgs e)
    //{
    //    HttpCookie cookie = Request.Cookies["BrowserDate"];
    //    Data dat = new Data(DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")));
    //    RadScheduler2.DataSource = dat.GetData("SELECT A.Header, AC.AdID, AC.DateTimeStart AS Start, AC.DateTimeEnd AS [End] FROM Ads A, Ad_Calendar AC WHERE A.Ad_ID=AC.AdID AND A.User_ID=" + Session["User"].ToString());
    //    RadScheduler2.DataBind();
    //    UpdatePanel2.Update();
    //}
    protected void RadScheduler2_AppointmentCreated(object sender, AppointmentCreatedEventArgs e)
    {
        HttpCookie cookie = Request.Cookies["BrowserDate"];
        Data dat = new Data(DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")));
        DataSet ds = dat.GetData("SELECT A.Header, AC.AdID, AC.DateTimeStart AS Start, A.Featured, AC.DateTimeEnd AS [End] FROM Ads A, Ad_Calendar AC WHERE A.Ad_ID=AC.AdID AND A.User_ID=" + Session["UserToUse"].ToString());
        DataView dv = new DataView(ds.Tables[0], "AdID=" + e.Appointment.ID, "", DataViewRowState.CurrentRows);

        if (dv.Count > 0)
        {
            e.Appointment.ToolTip = "";
            RadToolTip newToolTip = new RadToolTip();
            newToolTip.Text = "<div style=\"padding: 10px;display: block; width: 200px;\" id=\"div" + e.Appointment.ID + "\"><a href=\"" + dat.MakeNiceName(e.Appointment.Subject) + "_" +
                e.Appointment.ID.ToString() + "_Ad\" class=\"AddLink\">" +
                e.Appointment.Subject + "</a>" +
                "<br/><br/>Start: " + dv[0]["Start"].ToString() +
                "<br/>End: " + dv[0]["End"].ToString() +
                "<br/><br/><br/><a href=\"javascript:OpenAdMsg('" +
                e.Appointment.ID + "');\"><img title=\"Send info to friends\" alt=\"Send info to friends\" style=\"padding-right: 5px;border: none;\" " +
                "src=\"NewImages/Envelope.png\" /></a><a href=\"javascript:OpenRadDeleteAd('div" + e.Appointment.ID + "', '" +
                e.Appointment.ID + "');\"\"><img style=\"border: none;\" title=\"Turn ad off.\" alt=\"Turn ad off.\" src=\"NewImages/DeleteCircle.png\" /></a></div>";

            if (bool.Parse(dv[0]["Featured"].ToString()))
            {
                e.Appointment.BorderColor = System.Drawing.Color.DarkOrange;
                e.Appointment.BorderStyle = BorderStyle.Solid;
            }

            newToolTip.TargetControlID = e.Appointment.ClientID;
            newToolTip.IsClientID = true;
            newToolTip.HideEvent = ToolTipHideEvent.ManualClose;
            newToolTip.Animation = ToolTipAnimation.None;
            newToolTip.Position = ToolTipPosition.MiddleRight;
            newToolTip.ShowEvent = ToolTipShowEvent.OnClick;
            newToolTip.Skin = "Sunset";
            ToolTipPanel2.Controls.Add(newToolTip);
        }
    }
    protected void RadScheduler1_AppointmentCreated(object sender, AppointmentCreatedEventArgs e)
    {
        HttpCookie cookie = Request.Cookies["BrowserDate"];
        Data dat = new Data(DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")));

        char[] delim = { ';' };
        string[] tokens = e.Appointment.ID.ToString().Split(delim);

        string aptmntID = tokens[0];
        string reOcurrID = tokens[1];
        string switchOn = tokens[2];

        DataView dv = new DataView();

        switch (switchOn)
        {
            case "1":
                dv = dat.GetDataDV("SELECT EO.DateTimeStart AS Start, EO.DateTimeEnd AS " +
                "[End], E.Header, E.ID, E.Address, V.Name FROM Venues V, User_Calendar UC, Events E, " +
                "Event_Occurance EO WHERE E.Venue=V.ID AND EO.EventID=E.ID AND UC.EventID=E.ID AND UC.UserID=" +
                Session["UserToUse"].ToString() + " AND E.ID=" + aptmntID + " AND EO.ID=" + reOcurrID);
                break;
            case "2":
                dv = dat.GetDataDV("SELECT EO.DateTimeStart AS Start, EO.DateTimeEnd AS " +
                "[End], E.Name, E.ID, EO.City + ' ' +EO.State + ' '+EO.Zip AS Address, E.Content FROM GroupEvent_Members UC, GroupEvents E, " +
                "GroupEvent_Occurance EO WHERE EO.GroupEventID=E.ID AND UC.GroupEventID=E.ID AND UC.UserID=" +
                Session["UserToUse"].ToString() + " AND E.ID=" + aptmntID + " AND EO.ID=" + reOcurrID);
                break;
            case "3":
                dv = dat.GetDataDV("SELECT EO.DateTimeStart AS Start, EO.DateTimeEnd AS " +
                "[End], E.Name, E.ID, EO.City + ' ' +EO.State + ' '+EO.Zip AS Address, E.Content FROM User_GroupEvent_Calendar UC, GroupEvents E, " +
                "GroupEvent_Occurance EO WHERE EO.GroupEventID=E.ID AND UC.GroupEventID=E.ID AND UC.UserID=" +
                Session["UserToUse"].ToString() + " AND E.ID=" + aptmntID + " AND EO.ID=" + reOcurrID);
                break;
            default: break;
        }

        if (dv.Count > 0)
        {
            e.Appointment.ToolTip = "";
            RadToolTip newToolTip = new RadToolTip();

            string addThis = "";
            string content = "";
            if (Session["UserToUse"].ToString() == Session["User"].ToString() && switchOn == "1")
            {
                addThis = "<a href=\"javascript:OpenRad('div" + aptmntID + "', '" +
                aptmntID + "', '" + switchOn + "', 'na');\"><img title=\"Send info to friends\" alt=\"Send info to friends\" style=\"border: none;padding-right: 5px;\" " +
                "src=\"NewImages/Envelope.png\" /></a><a href=\"javascript:OpenCommunication('div" + aptmntID + "', '" +
                aptmntID + "');\"><img style=\"border: none;padding-right: 5px;\" title=\"Set communication on/off for this event.\" alt=\"Set communication on/off for this event.\" src=\"NewImages/EventComment.png\" /></a>" +
                "<a href=\"javascript:OpenRadDelete('div" + aptmntID + "', '" +
                aptmntID + "', '" + switchOn + "', 'na');\"><img style=\"border: none;padding-right: 5px;\" title=\"Delete event from your calendar\" alt=\"Delete event from your calendar\" " +
                "src=\"NewImages/DeleteCircle.png\" /></a><a href=\"javascript:OpenAlarm('div" + aptmntID + "', '" +
                aptmntID + "', '" + reOcurrID + "');\"><img style=\"border: none;\" title=\"Set Reminder for this event\" alt=\"Set Reminder for this event\" " +
                "src=\"NewImages/Alarm.png\" /></a>";
            }

            if (Session["UserToUse"].ToString() == Session["User"].ToString() && switchOn != "1")
            {
                addThis = "<a href=\"javascript:OpenRad('divG" + aptmntID + "', '" +
                aptmntID + "', '" + switchOn + "', '" + reOcurrID + "');\"><img title=\"Send info to friends\" " +
                "alt=\"Send info to friends\" style=\"border: none;padding-right: 5px;\" " +
                "src=\"NewImages/Envelope.png\" /></a>" +
                "<a href=\"javascript:OpenRadDelete('divG" + aptmntID + "', '" +
                aptmntID + "', '" + switchOn + "', '" + reOcurrID + "');\"><img style=\"border: none;\" title=\"Delete " +
                "event from your calendar\" alt=\"Delete event from your calendar\" " +
                "src=\"NewImages/DeleteCircle.png\" /></a>";
            }

            if (switchOn == "1")
            {
                newToolTip.Text = "<div style=\"padding: 10px;display: block; width: 200px;\" id=\"div" + aptmntID +
                    "\"><a href=\"" + dat.MakeNiceName(dv[0]["Header"].ToString()) + "_" +
                    aptmntID + "_Event\" class=\"AddLink\">" +
                    dat.BreakUpString(dv[0]["Header"].ToString(), 20) + "</a>" +
                    "<br/><br/>" + dv[0]["Name"].ToString() +
                    "<br/>" + e.Appointment.Start.ToShortTimeString() +
                    "<br/>" + dv[0]["Address"].ToString() +
                    "<br/><br/><br/>" + addThis + "</div>";
            }

            newToolTip.TargetControlID = e.Appointment.ClientID;
            newToolTip.IsClientID = true;
            newToolTip.HideEvent = ToolTipHideEvent.ManualClose;
            newToolTip.Animation = ToolTipAnimation.None;
            newToolTip.Position = ToolTipPosition.MiddleRight;
            newToolTip.ShowEvent = ToolTipShowEvent.OnClick;
            newToolTip.Skin = "Sunset";
            ToolTipPanel.Controls.Add(newToolTip);
        }
    }
    protected void rg_features_ItemDataBound(object sender, GridItemEventArgs e)
    {
        if (e.Item is GridNestedViewItem)
        {
            GridNestedViewItem nested_item = (GridNestedViewItem)e.Item;
            String             feat_cpy_id = ((HiddenField)nested_item.FindControl("hf_feat_cpy_id")).Value;
            System.Web.UI.HtmlControls.HtmlIframe iframe = ((System.Web.UI.HtmlControls.HtmlIframe)nested_item.FindControl("if_ltmpl"));
            if (dd_issue.Items.Count > 0 && dd_issue.SelectedItem != null)
            {
                iframe.Attributes.Add("src", "trackeradvertiserlist.aspx?feat_cpy_id=" + feat_cpy_id + "&issue_name=" + dd_issue.SelectedItem.Text);
                //src='<%#: String.Format(("trackeradvertiserlist.aspx?feat_cpy_id={0}"), Eval("feat_cpy_id")) %>' // for aspx
                iframe.Attributes.Add("onload", "resizeIframe(this);");
            }
        }
        else if (e.Item is GridDataItem)
        {
            GridDataItem item   = (GridDataItem)e.Item;
            String       cpy_id = item["feat_cpy_id"].Text;

            // View Company
            LinkButton lb = (LinkButton)item["Feature"].FindControl("lb_view_cpy");
            lb.OnClientClick = "radopen('trackercompanycontacteditor.aspx?cpy_id=" + Server.UrlEncode(cpy_id) + "&cpy_type=f&issue=" + Server.UrlEncode(dd_issue.SelectedItem.Text) + "', 'rw_ss_editor'); return false;";
            lb.Text          = Server.HtmlEncode(Util.TruncateText(Server.HtmlDecode(lb.Text), 30));

            if (item["Region"].Text == "&nbsp;")
            {
                item.Display = false;
                //item.Attributes.Add("style", "background-color:#363636; height:20px !important;");
                //item.CssClass = "bottomLine " + (item.ItemIndex % 2 == 0 ? "rgRow" : "rgAltRow");
                //div.RadGrid tr.bottomLine td {
                //border-bottom: 1px solid red;
                //}
            }

            //// Completeness Indicators (for widget/brochure/twitter etc)
            //String[] Indications = new String[] { "Widget", "Brochure", "Infographics", "WebCopy", "SampleTweets"};
            //foreach (String i in Indications)
            //{
            //    ImageButton imbtn_s = (ImageButton)item[i].FindControl("imbtn_"+i);
            //    HtmlGenericControl div = (HtmlGenericControl)item[i].FindControl("div_" + i);
            //    ram.AjaxSettings.AddAjaxSetting(div, div); // ajaxify the div
            //    if (imbtn_s.CommandName == "Y")
            //        imbtn_s.ImageUrl = "~/images/smartsocial/ico_tick.png";
            //    else
            //        imbtn_s.ImageUrl = "~/images/smartsocial/ico_cross.png";
            //}

            // Shared Indicators
            String[] ShareIndications = new String[] { "twitter", "facebook", "linkedin", "website", "other" };
            foreach (String i in ShareIndications)
            {
                ImageButton        imbtn_s = (ImageButton)item[i].FindControl("imbtn_so_" + i);
                HtmlGenericControl div     = (HtmlGenericControl)item[i].FindControl("div_so_" + i);
                ram.AjaxSettings.AddAjaxSetting(div, div); // ajaxify the div
                if (imbtn_s.CommandName == "1")
                {
                    imbtn_s.ImageUrl = "~/images/smartsocial/ico_tick.png";
                }
                else
                {
                    imbtn_s.ImageUrl = "~/images/smartsocial/ico_cross.png";
                }
            }

            // Truncate writer
            int   WriterTrunc = 8;
            Label lbl_editor  = (Label)item["Editor"].FindControl("lbl_editor");
            if (lbl_editor.Text != String.Empty && lbl_editor.Text.Length > WriterTrunc)
            {
                RadToolTip rtt_editor = (RadToolTip)item["Editor"].FindControl("rtt_editor");
                lbl_editor.Text = HttpUtility.HtmlEncode(Util.TruncateText(HttpUtility.HtmlDecode(lbl_editor.Text), WriterTrunc));
            }

            // Truncate/tooltip mags
            int   MagTrunc = 10;
            Label lbl_rm   = (Label)item["RegionMag"].FindControl("lbl_rm");
            if (lbl_rm.Text != String.Empty && lbl_rm.Text.Length > MagTrunc)
            {
                RadToolTip rtt_rm = (RadToolTip)item["RegionMag"].FindControl("rtt_rm");
                lbl_rm.Text = HttpUtility.HtmlEncode(Util.TruncateText(HttpUtility.HtmlDecode(lbl_rm.Text), MagTrunc));
            }

            Label lbl_sm = (Label)item["SectorMag"].FindControl("lbl_sm");
            if (lbl_sm.Text != String.Empty && lbl_sm.Text.Length > MagTrunc)
            {
                RadToolTip rtt_sm = (RadToolTip)item["SectorMag"].FindControl("rtt_sm");
                lbl_sm.Text = HttpUtility.HtmlEncode(Util.TruncateText(HttpUtility.HtmlDecode(lbl_sm.Text), MagTrunc));
            }

            // Notes
            RadButton          rb_ss_notes = (RadButton)item["Notes"].FindControl("rb_ss_notes");
            HtmlGenericControl div_notes   = (HtmlGenericControl)item["Notes"].FindControl("div_notes");
            RadTextBox         tb_ss_notes = (RadTextBox)div_notes.FindControl("tb_ss_notes");
            tb_ss_notes.ClientEvents.OnBlur = "function(sender, args){ $find('" + rb_ss_notes.ClientID + "').click(); }";
            ram.AjaxSettings.AddAjaxSetting(rb_ss_notes, div_notes); // ajaxify the div

            //// Case Studies
            //int CSTrunc = 16;
            //for (int i = 1; i < 6; i++)
            //{
            //    String UnqName = "cs" + i;
            //    if (item[UnqName].Text != "&nbsp;" && item[UnqName].Text.Length >= CSTrunc)
            //        Util.AddRadToolTipToRadGridCell(item[UnqName], true, CSTrunc);
            //}

            //// Notes tooltip
            //if (item["SSNotes"].Text != "&nbsp;")
            //    Util.AddRadToolTipToRadGridCell(item["SSNotes"], false, 0, "#dcfadc");

            // Add smartsocial button
            String SmartSocialPageParamID = item["SSParam"].Text;

            if (SmartSocialPageParamID != "&nbsp;" && dd_issue.Items.Count > 0 && dd_issue.SelectedItem != null)
            {
                //item["Feature"].BackColor = Color.FromName("#dcfadc");

                ImageButton imbtn_smartsocial = new ImageButton();
                //imbtn_smartsocial.ToolTip = "View the SMARTsocial profile for this feature.";
                imbtn_smartsocial.ImageUrl = "~/images/smartsocial/ico_logo_alpha.png";
                imbtn_smartsocial.Height   = 16;
                imbtn_smartsocial.Width    = 16;
                imbtn_smartsocial.Style.Add("margin-left", "2px");
                imbtn_smartsocial.Style.Add("border-bottom", "solid 1px green;");

                // Set language param
                String language = String.Empty;
                if (dd_region.Items.Count > 0 && dd_region.SelectedItem != null)
                {
                    switch (dd_region.SelectedItem.Text)
                    {
                    case "Brazil": language = "&l=p"; break;

                    case "Latin America": language = "&l=s"; break;
                    }
                }

                imbtn_smartsocial.OnClientClick = "window.open('/dashboard/smartsocial/project.aspx?ss=" + SmartSocialPageParamID +
                                                  language + "&iss=" + dd_issue.SelectedItem.Text + "','_newtab'); return false;";
                item["SSProfile"].Controls.Add(imbtn_smartsocial);

                RadToolTip rtt_view_ss = (RadToolTip)item["SSProfile"].FindControl("rtt_ss_view");
                rtt_view_ss.TargetControlID = imbtn_smartsocial.ClientID;
            }
        }
    }
    protected void RadScheduler1_AppointmentCreated(object sender, AppointmentCreatedEventArgs e)
    {
        HttpCookie cookie = Request.Cookies["BrowserDate"];
        Data dat = new Data(DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")));

        DateTime timeEvent = DateTime.Parse(e.Appointment.ID.ToString());

        string dateStart = timeEvent.Month.ToString() + "/" + timeEvent.Day.ToString() + "/" + timeEvent.Year.ToString();

        DataView dv = dat.GetDataDV("SELECT *, GEO.ID AS GEOID FROM GroupEvents GE, GroupEvent_Occurance " +
            "GEO WHERE GE.ID=GEO.GroupEventID AND CONVERT(NVARCHAR,MONTH(GEO.DateTimeStart)) + '/' + " +
            "CONVERT(NVARCHAR,DAY(GEO.DateTimeStart)) + '/' +" +
            "CONVERT(NVARCHAR,YEAR(GEO.DateTimeStart)) = '" + dateStart + "' AND GE.GroupID=" + Request.QueryString["ID"].ToString());

        RadToolTip newToolTip = new RadToolTip();
        DateTime dt = new DateTime();
        string replaceIt = "";
        string content = "";
        newToolTip.Text = "<div style=\"display: block; width: 500px; color: #cccccc;\">";
        foreach (DataRowView row in dv)
        {
            dt = DateTime.Parse(row["DateTimeStart"].ToString());
            content = row["Content"].ToString();

            if (content.Length > 400)
            {
                content = content.Substring(0, 400) + "... <a href=\"" + dat.MakeNiceName(row["Name"].ToString()) +
                    "_" + row["GEOID"].ToString() + "_" +
                 row["GroupEventID"].ToString() + "_GroupEvent\" class=\"AddUnderLink\">Read More</a>";
            }

            replaceIt = dt.Month.ToString() + "/" + dt.Day.ToString() + "/" + dt.Year.ToString();
            newToolTip.Text += "<a href=\"" + dat.MakeNiceName(row["Name"].ToString()) + "_" +
                row["GEOID"].ToString() + "_" +
                 row["GroupEventID"].ToString() + "_GroupEvent\" class=\"AddUnderLink\" >" +
                dat.BreakUpString(row["Name"].ToString(), 50) + "</a>" +
                "<br/>" + row["DateTimeStart"].ToString().Replace(replaceIt, "") + " - " +
                row["DateTimeEnd"].ToString().Replace(replaceIt, "") + "<br/>" + content + "<br/><br/>";
        }
        newToolTip.Text += "</div>";
        newToolTip.TargetControlID = e.Appointment.ClientID;
        newToolTip.IsClientID = true;
        newToolTip.HideEvent = ToolTipHideEvent.ManualClose;
        newToolTip.Animation = ToolTipAnimation.None;
        newToolTip.Position = ToolTipPosition.MiddleLeft;
        newToolTip.ShowEvent = ToolTipShowEvent.OnClick;
        newToolTip.Skin = "Black";
        newToolTip.Width = 520;
        ToolTipPanel.Controls.Add(newToolTip);
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        HttpCookie cookie = Request.Cookies["BrowserDate"];
        if (cookie == null)
        {
            cookie = new HttpCookie("BrowserDate");
            cookie.Value = DateTime.Now.ToString();
            cookie.Expires = DateTime.Now.AddDays(22);
            Response.Cookies.Add(cookie);
        }
        Literal lit = new Literal();
        lit.Text = "<script src=\"http://maps.google.com/maps?file=api&amp;v=2&amp;sensor=false&amp;key=ABQIAAAAjjoxQtYNtdn3Tc17U5-jbBR2Kk_H7gXZZZniNQ8L14X1BLzkNhQjgZq1k-Pxm8FxVhUy3rfc6L9O4g\" type=\"text/javascript\"></script>";
        Master.HEAD_TAG.Controls.Add(lit);
        Data dat = new Data(DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")));
        string command = "";
        try
        {
            DataView dvGroup = dat.GetDataDV("SELECT * FROM GroupEvents WHERE ID=" + Request.QueryString["ID"].ToString());
            DataView dvRealGroup = dat.GetDataDV("SELECT * FROM Groups WHERE ID=" +
                dvGroup[0]["GroupID"].ToString());

            string groupID = dvRealGroup[0]["ID"].ToString();

            #region Take Care of Style
            ColorAa_1.Style.Add("background-color", "#" + dvGroup[0]["ColorA"].ToString());
            ColorAb_1.Style.Add("background-color", "#" + dvGroup[0]["ColorA"].ToString());
            ColorAa_1.Style.Add("color", "#" + dvGroup[0]["TextA"].ToString());

            ColorAa_2.Style.Add("background-color", "#" + dvGroup[0]["ColorA"].ToString());
            ColorAb_2.Style.Add("background-color", "#" + dvGroup[0]["ColorA"].ToString());
            ColorAa_2.Style.Add("color", "#" + dvGroup[0]["TextA"].ToString());

            ColorAa_3.Style.Add("background-color", "#" + dvGroup[0]["ColorA"].ToString());
            ColorAb_3.Style.Add("background-color", "#" + dvGroup[0]["ColorA"].ToString());
            ColorAa_3.Style.Add("color", "#" + dvGroup[0]["TextA"].ToString());

            ColorBa_1.Style.Add("background-color", "#" + dvGroup[0]["ColorB"].ToString());
            ColorBb_1.Style.Add("background-color", "#" + dvGroup[0]["ColorB"].ToString());
            ColorBa_1.Style.Add("color", "#" + dvGroup[0]["TextB"].ToString());

            //ColorBa_2.Style.Add("background-color", "#" + dvGroup[0]["ColorB"].ToString());
            //ColorBb_2.Style.Add("background-color", "#" + dvGroup[0]["ColorB"].ToString());
            //ColorBa_2.Style.Add("color", "#" + dvGroup[0]["TextB"].ToString());

            ColorBa_3.Style.Add("background-color", "#" + dvGroup[0]["ColorB"].ToString());
            ColorBb_3.Style.Add("background-color", "#" + dvGroup[0]["ColorB"].ToString());
            ColorBa_3.Style.Add("color", "#" + dvGroup[0]["TextB"].ToString());

            ColorBa_4.Style.Add("background-color", "#" + dvGroup[0]["ColorB"].ToString());
            ColorBb_4.Style.Add("background-color", "#" + dvGroup[0]["ColorB"].ToString());
            ColorBa_4.Style.Add("color", "#" + dvGroup[0]["TextB"].ToString());

            MapLabels.Style.Add("color", "#" + dvGroup[0]["TextA"].ToString() + " !important");
            #endregion

            command = "SELECT * FROM GroupEvent_Occurance WHERE ID=" + Request.QueryString["O"].ToString();
            DataView dvEvent = dat.GetDataDV(command);

            if (dvEvent.Count == 0)
            {
                command = "SELECT * FROM GroupEvent_Occurance WHERE GroupEventID=" +
                    Request.QueryString["ID"].ToString();
                dvEvent = dat.GetDataDV(command);
                if (dvEvent.Count > 0)
                {
                    Response.Redirect(dat.MakeNiceName(dvGroup[0]["Name"].ToString()) + "_" + dvEvent[0]["ID"].ToString() + "_" + Request.QueryString["ID"].ToString() + "_GroupEvent");
                }
                else
                {
                    Response.Redirect(dat.MakeNiceName(dvRealGroup[0]["Name"].ToString()) +
                        "_" + dvRealGroup[0]["ID"].ToString() + "_Group");
                }
            }

            DateAndTimeLabel.Text = dvEvent[0]["DateTimeStart"].ToString() + " -- " + dvEvent[0]["DateTimeEnd"].ToString();

            GroupLabel.Text = dvRealGroup[0]["Header"].ToString();
            GroupLabel.NavigateUrl = dat.MakeNiceName(dvRealGroup[0]["Header"].ToString()) + "_" + dvRealGroup[0]["ID"].ToString() + "_Group";
            Page.Title = dvGroup[0]["Name"].ToString() + " | Hippo Group Event";

            if (!IsPostBack)
            {
                Session["RedirectTo"] = Request.Url.AbsoluteUri;
            }

            string country = dat.GetDataDV("SELECT * FROM Countries WHERE country_id=" + dvEvent[0]["Country"].ToString())[0]["country_name"].ToString();

            Literal liter = new Literal();
            liter.Text = "<link type=\"text/css\" href=\"Rads.css\" rel=\"stylesheet\" />";
            Page.Header.Controls.Add(liter);

            bool isMember = false;
            #region Take care of user types
            if (Session["User"] != null)
            {
                #region Take care of Share with friends and Share though email and Flag
                LoggedInPanel.Visible = true;

                ShareFriends.THE_TEXT = "Share this with a friend";
                ShareFriends.RE_LABEL = "Re: " + Session["UserName"].ToString() +
                    " would like to share the group event '\"" + dat.BreakUpString(dvGroup[0]["Name"].ToString(), 14) +
                    "\"' with you.";
                ShareFriends.TYPE = "ge";
                ShareFriends.ID = int.Parse(Request.QueryString["ID"].ToString());

                string descrip = dvGroup[0]["Content"].ToString();
                if (descrip.Length > 200)
                    descrip = descrip.Substring(0, 200) + "...";

                Session["messageEmail"] = "Group Event Name: <a href=\"http://hippohappenings.com/" +
                    dat.MakeNiceName(dat.BreakUpString(dvGroup[0]["Name"].ToString(), 14)) + "_" +
                    Request.QueryString["O"].ToString() + "_" +
                    Request.QueryString["ID"].ToString() + "_GroupEvent\">" +
                            dat.BreakUpString(dvGroup[0]["Name"].ToString(), 14) + "</a><br/><br/> " +
                            descrip;
                Session["FlagID"] = Request.QueryString["ID"].ToString();
                Session["FlagType"] = "GE";
                Session["ReOccurID"] = Request.QueryString["O"].ToString();

                DataView dvMember = dat.GetDataDV("SELECT * FROM Group_Members WHERE GroupID=" +
                    dvGroup[0]["GroupID"].ToString() + " AND MemberID=" + Session["User"].ToString());
                PostMessageID.Attributes.Add("onclick", "OpenMess('" + Request.QueryString["ID"].ToString() +
                    "', '" + Request.QueryString["O"].ToString() + "')");
                #endregion

                switch (dvGroup[0]["EventType"].ToString())
                {
                    case "1":
                        PrivateLabel.Text = "Public Event";
                        break;
                    case "2":
                        PrivateLabel.Text = "Private Event";
                        break;
                    case "3":
                        PrivateLabel.Text = "Exclusive Event";
                        break;
                    default: break;
                }

                DataView dvGoingMember = dat.GetDataDV("SELECT * FROM GroupEvent_Members WHERE GroupEventID=" +
                        Request.QueryString["ID"].ToString() + " AND Accepted='True' AND ReoccurrID=" +
                        Request.QueryString["O"].ToString());
                dvGoingMember.RowFilter = "UserID=" + Session["User"].ToString();

                //if it's a public event
                if(dvGroup[0]["EventType"].ToString() == "1")
                    dvGoingMember = dat.GetDataDV("SELECT * FROM User_GroupEvent_Calendar WHERE GroupEventID=" +
                        Request.QueryString["ID"].ToString() + " AND ReoccurrID=" +
                        Request.QueryString["O"].ToString());

                dvGoingMember.RowFilter = "UserID=" + Session["User"].ToString();

                AreGoingPanel.Visible = false;
                RegistrationEndedPanel.Visible = false;
                GoingPanel.Visible = true;

                if (dvGoingMember.Count > 0)
                {
                    AreGoingPanel.Visible = true;
                    RegistrationEndedPanel.Visible = false;
                    GoingPanel.Visible = false;
                }
                else
                {
                    dvGoingMember.RowFilter = "";
                    if (dvGroup[0]["RegType"].ToString() == "2")
                    {
                        if (dvGroup[0]["RegNum"] != null)
                        {
                            if (dvGroup[0]["RegNum"].ToString().Trim() != "")
                            {
                                if (dvGoingMember.Count >= int.Parse(dvGroup[0]["RegNum"].ToString()))
                                {
                                    AreGoingPanel.Visible = false;
                                    RegistrationEndedPanel.Visible = true;
                                    GoingPanel.Visible = false;
                                }
                                else
                                {
                                    AreGoingPanel.Visible = false;
                                    RegistrationEndedPanel.Visible = false;
                                    GoingPanel.Visible = true;
                                }
                            }

                            if (dvGroup[0]["RegDeadline"] != null)
                            {
                                if (dvGroup[0]["RegDeadline"].ToString().Trim() != "")
                                {
                                    if (DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")) >
                                        DateTime.Parse(dvGroup[0]["RegDeadline"].ToString()))
                                    {
                                        AreGoingPanel.Visible = false;
                                        RegistrationEndedPanel.Visible = true;
                                        GoingPanel.Visible = false;
                                    }
                                }
                            }
                        }

                        if (dvGroup[0]["RegDeadline"] != null)
                        {
                            if (dvGroup[0]["RegDeadline"].ToString().Trim() != "")
                            {
                                if (DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")) >
                                    DateTime.Parse(dvGroup[0]["RegDeadline"].ToString()))
                                {
                                    AreGoingPanel.Visible = false;
                                    RegistrationEndedPanel.Visible = true;
                                    GoingPanel.Visible = false;
                                }
                            }
                        }
                    }
                    else
                    {
                        DataView dvInvitedMember = dat.GetDataDV("SELECT * FROM GroupEvent_Members WHERE GroupEventID=" +
                        Request.QueryString["ID"].ToString() + " AND ReoccurrID=" +Request.QueryString["O"].ToString());

                        DataView dvMember2 = dat.GetDataDV("SELECT * FROM Group_Members WHERE GroupID=" +
                            groupID + " AND MemberID=" + Session["User"].ToString());

                        if (dvGroup[0]["EventType"].ToString() == "2")
                        {
                            if (dvMember2.Count > 0)
                            {
                                AreGoingPanel.Visible = false;
                                RegistrationEndedPanel.Visible = false;
                                GoingPanel.Visible = true;
                            }
                            else
                            {
                                AreGoingPanel.Visible = false;
                                RegistrationEndedPanel.Visible = false;
                                GoingPanel.Visible = false;
                            }
                        }
                        else if (dvGroup[0]["EventType"].ToString() == "3")
                        {
                            dvInvitedMember.RowFilter = "UserID=" + Session["User"].ToString();
                            if (dvInvitedMember.Count > 0)
                            {
                                AreGoingPanel.Visible = false;
                                RegistrationEndedPanel.Visible = false;
                                GoingPanel.Visible = true;
                            }
                            else
                            {
                                AreGoingPanel.Visible = false;
                                RegistrationEndedPanel.Visible = false;
                                GoingPanel.Visible = false;
                            }
                        }
                        else
                        {
                            AreGoingPanel.Visible = false;
                            RegistrationEndedPanel.Visible = false;
                            GoingPanel.Visible = true;
                        }

                    }
                }

                if (dvMember.Count > 0)
                {
                    isMember = true;
                    if (bool.Parse(dvMember[0]["SharedHosting"].ToString()))
                    {
                        Session["isHost"] = true;
                        HostHeaderPanel.Visible = true;
                        MemberHeaderPanel.Visible = false;
                        //if is host, take care of host options
                        LinkButton1.Attributes.Add("onclick", "window.location='EnterGroupEvent.aspx?ID=" + Request.QueryString["ID"].ToString() + "&GroupID=" + dvGroup[0]["GroupID"].ToString() + "&O=" + Request.QueryString["O"].ToString() + "';");
                        LinkButton2.Attributes.Add("onclick", "window.location='EnterGroupEvent.aspx?copy=true&ID=" + Request.QueryString["ID"].ToString()  + "&GroupID=" + dvGroup[0]["GroupID"].ToString() + "';");
                        Label1.Attributes.Add("onclick", "OpenSendMess('" + Request.QueryString["ID"].ToString() + "')");
                        Label3.Attributes.Add("onclick", "OpenParticipants('" + Request.QueryString["ID"].ToString() +
                            "', '" + Request.QueryString["O"].ToString() + "')");
                        Label2.Attributes.Add("onclick", "OpenGroupEventDelete('" + Request.QueryString["ID"].ToString() +
                            "', '" + Request.QueryString["O"].ToString() + "')");
                    }
                    else
                    {
                        Session["isHost"] = false;
                        Session["isMember"] = true;
                        HostHeaderPanel.Visible = false;
                        MemberHeaderPanel.Visible = true;
                    }
                    PostMessagePanel.Visible = true;
                }
                else
                {
                    Session["isHost"] = false;
                    Session["isMember"] = false;
                    HostHeaderPanel.Visible = false;
                    MemberHeaderPanel.Visible = false;
                    PostMessagePanel.Visible = false;
                }
            }
            else
            {
                Session["isHost"] = false;
                Session["isMember"] = false;
                HostHeaderPanel.Visible = false;
                MemberHeaderPanel.Visible = false;
                PostMessagePanel.Visible = false;
            }
            #endregion

            #region Members
            string members = "";
            string friendImg = "";
            string strFill = "";
            string title = "";
            string description = "";
            string mem = "";
            FillMembers();
            #endregion

            #region Stuff we need
            DataView dvStuff = dat.GetDataDV("SELECT * FROM GroupEvent_StuffNeeded WHERE GroupEventID=" +
                Request.QueryString["ID"].ToString());
            if (dvStuff.Count > 0)
                StuffsPanel.Visible = true;
            CheckBox check;
            DataView dvUserID;
            bool userNotGrabbed = false;

            bool isStuffCheckable = bool.Parse(dvGroup[0]["StuffNeededCheckable"].ToString());

            foreach (DataRowView row in dvStuff)
            {
                userNotGrabbed = false;
                if (row["UserID"] == null)
                {
                    userNotGrabbed = true;
                }
                else
                {
                    if (row["UserID"].ToString() == "")
                        userNotGrabbed = true;
                    else
                    {
                        //if (isMember)
                        //{
                        if (isStuffCheckable)
                        {
                            dvUserID = dat.GetDataDV("SELECT * FROM Users WHERE User_ID=" + row["UserID"].ToString());
                            string addthis = "";

                            if (Session["User"] != null)
                            {
                                if (row["UserID"].ToString() == Session["User"].ToString())
                                {
                                    addthis = "<div style=\"float: left;\"><img style=\"cursor: pointer;\" name=\"remove the user\" src=\"image/X.png\" onclick=\"RemoveStuffUser('" + row["ID"].ToString() +
                                    "');\" onmouseout=\"this.src = 'image/X.png';\" " +
                                    "onmouseover=\"this.src = 'image/XSelected.png';\" /></div>";
                                }
                            }
                            lit = new Literal();
                            lit.ID = "lit" + row["ID"].ToString();
                            lit.Text = "<div class=\"topDiv\" width=\"400px\" style=\"padding-top: 5px;\"><div style=\"float: left;\"><ul style=\"font-weight: bold;padding: 0; margin: 0; color: #" + dvGroup[0]["TextA"].ToString() + " !important;padding-left: 22px;\"><li><span style=\"color: #" + dvGroup[0]["TextA"].ToString() + " !important; font-size: 14px;\"><div style=\"float: left;\">" + row["StuffNeeded"].ToString() +
                                " -- </div><div style=\"float: left;padding-left: 5px;\"><div style=\"float: left;\"><div style=\"height: 19px; background-position: left; background-repeat: no-repeat; background-image: url(images/UserNameLeft.png); " +
                                "padding-left: 4px;\"><div style=\"height: 19px; background-repeat: no-repeat; background-position: right; " +
                                "background-image: url(images/UserNameRight.png); " +
                                "padding-right: 4px;\"><div style=\"height: 19px; background-repeat: repeat-x; " +
                                "background-image: url(images/UserNameMiddle.png);\"><a style=\"float: left;padding-bottom: 0px;\" href=\"" + dvUserID[0]["UserName"].ToString() + "_Friend\" class=\"AddLink\">" +
                                    dvUserID[0]["UserName"].ToString() + "</a></div></div></div></div></div></span></li></ul></div>" + addthis + "</div>";
                            StuffWeNeedPanel.Controls.Add(lit);
                        }
                        else
                        {
                            lit = new Literal();
                            lit.ID = "lit" + row["ID"].ToString();
                            lit.Text = "<div class=\"topDiv\" width=\"400px\" style=\"padding-top: 5px;\">"+
                                "<div style=\"float: left;\"><ul style=\"font-weight: bold;padding: 0; margin: 0; "+
                                "color: #" + dvGroup[0]["TextA"].ToString() + " !important;padding-left: 22px;\">"+
                                "<li><span style=\"color: #" + dvGroup[0]["TextA"].ToString() + " !important; "+
                                "font-size: 14px;\"><div style=\"float: left;\">" + row["StuffNeeded"].ToString() +
                                "</div></span></li></ul></div></div>";
                            StuffWeNeedPanel.Controls.Add(lit);
                        }
                        //}
                    }
                }

                if (isMember)
                {
                    if (userNotGrabbed)
                    {
                        if (isStuffCheckable)
                        {
                            check = new CheckBox();
                            check.ID = "check" + row["ID"].ToString();
                            check.Text = row["StuffNeeded"].ToString();
                            check.AutoPostBack = true;
                            check.CheckedChanged += new EventHandler(StuffGrabbed);
                            check.ForeColor = System.Drawing.ColorTranslator.FromHtml("#" + dvGroup[0]["TextB"].ToString());
                            check.Font.Size = 14;

                            lit = new Literal();
                            lit.Text = "<div width=\"400px\">";

                            StuffWeNeedPanel.Controls.Add(lit);
                            StuffWeNeedPanel.Controls.Add(check);

                            lit = new Literal();
                            lit.Text = "</div>";
                            StuffWeNeedPanel.Controls.Add(lit);
                        }
                        else
                        {
                            lit = new Literal();
                            lit.Text = "<div width=\"400px\" style=\"padding-top: 5px;\"><ul style=\"font-weight: bold;padding: 0; margin: 0; color: #" +
                                dvGroup[0]["TextB"].ToString() + " !important;padding-left: 22px;\"><li><span style=\" color: #" +
                                dvGroup[0]["TextB"].ToString() + " !important; font-size: 14px;\">" + row["StuffNeeded"].ToString() +
                                "</span></li></ul></div>";
                            StuffWeNeedPanel.Controls.Add(lit);
                        }
                    }
                }
                else
                {
                    if (userNotGrabbed)
                    {
                        lit = new Literal();
                        lit.Text = "<div width=\"400px\" style=\"padding-top: 5px;\"><ul style=\"font-weight: bold;padding: 0; margin: 0; color: #" +
                            dvGroup[0]["TextB"].ToString() + " !important;padding-left: 22px;\"><li><span style=\" color: #" +
                            dvGroup[0]["TextB"].ToString() + " !important; font-size: 14px;\">" + row["StuffNeeded"].ToString() +
                            "</span></li></ul></div>";
                        StuffWeNeedPanel.Controls.Add(lit);
                    }
                }
            }
            #endregion

            DataView dvUser = dat.GetDataDV("SELECT * FROM Users WHERE User_ID=" + dvGroup[0]["UserID"].ToString());

            HostLabel.Text = dvUser[0]["UserName"].ToString();
            HostLabel.NavigateUrl = HostLabel.Text + "_Friend";
            EventName.Text = dvGroup[0]["Name"].ToString();

            #region Event Message Board
            DataView dvMessages = dat.GetDataDV("SELECT *, GM.ID AS MessageID FROM GroupEventMessages GM, Users U WHERE GM.GroupEventID=" +
                Request.QueryString["ID"].ToString() + " AND GM.UserID=U.User_ID");
            DataView dvSticky = dat.GetDataDV("SELECT *, GM.ID AS MessageID FROM GroupEventMessages GM, Group_Members M, Users U WHERE GM.GroupEventID=" +
                Request.QueryString["ID"].ToString() + " AND GM.UserID=U.User_ID and M.GroupID=" +
                dvGroup[0]["GroupID"].ToString() + " AND M.MemberID=U.User_ID AND M.SharedHosting='True' AND GM.isSticky='True'");
            members = "";
            friendImg = "";
            strFill = "";
            description = "";

            string stickyID = "";

            if (dvSticky.Count > 0)
            {
                dvSticky.Sort = "DatePosted DESC";

                stickyID = dvSticky[0]["MessageID"].ToString();

                if (System.IO.File.Exists(Server.MapPath(".") + "\\UserFiles\\" + dvSticky[0]["UserName"].ToString() +
                            "\\Profile\\" + dvSticky[0]["ProfilePicture"].ToString()))
                {
                    friendImg = "UserFiles/" + dvSticky[0]["UserName"].ToString() + "/Profile/" + dvSticky[0]["ProfilePicture"].ToString();
                    strFill = "";
                }
                else
                {
                    friendImg = "image/noAvatar_50x50_small.png";
                    strFill = "onmouseover=\"this.src='NewImages/noAvatar_50x50_smallhover.png'\"" +
                        "onmouseout=\"this.src='image/noAvatar_50x50_small.png'\" ";
                }
                string imgLit = "";
                if (Session["User"] != null)
                {
                    if (Session["User"].ToString() == dvSticky[0]["User_ID"].ToString())
                    {
                        imgLit = "<div style=\"float: right;\"><img style=\"cursor: pointer;\" name=\"remove stickyness\" src=\"image/X.png\" onclick=\"OpenRemoveSticky('" + Request.QueryString["ID"].ToString() +
                            "', '" + stickyID + "', '"+Request.QueryString["O"].ToString()+"');\" onmouseout=\"this.src = 'image/X.png';\" " +
                            "onmouseover=\"this.src = 'image/XSelected.png';\" /></div>";
                    }
                }

                members = imgLit + "<div style=\"border-bottom: solid 1px #1b1b1b;float: left; clear: both; padding-left: 3px; padding-top: 5px;\"><a target='_blank' href=\"" + dvSticky[0]["UserName"].ToString() + "_Friend\"><img " + strFill +
                    " style=\" border: 0;float: left;padding-right: 7px; padding-bottom: 2px;\" " +
                                "src=\"" + friendImg + "\" width=\"50px\" height=\"50px\" /></a><div style=\"float: left;\"><div style=\"height: 19px; background-position: left; background-repeat: no-repeat; background-image: url(images/UserNameLeft.png); " +
                                "padding-left: 4px;\"><div style=\"height: 19px; background-repeat: no-repeat; background-position: right; " +
                                "background-image: url(images/UserNameRight.png); " +
                                "padding-right: 4px;\"><div style=\"height: 19px; background-repeat: repeat-x; " +
                                "background-image: url(images/UserNameMiddle.png);\"><a style=\"float: left;padding-bottom: 0px;\" href=\"" + dvSticky[0]["UserName"].ToString() + "_Friend\" class=\"AddLink\">" +
                                dvSticky[0]["UserName"].ToString() +
                                "</a></div></div></div></div><span class=\"MemberTitle\" style=\"color: #" + dvGroup[0]["TextB"].ToString() + " !important;\">&nbsp;-&nbsp;Posted On: " +
                                dvSticky[0]["DatePosted"].ToString().Trim() +
                                "</span> - <span style=\"color: #ff6b09; font-size: 30px;font: bold;\">!</span>" +
                                "<span class=\"MemberDescription\" style=\"color: #" + dvGroup[0]["TextB"].ToString() + " !important;\">&nbsp;&nbsp;" + dvSticky[0]["Content"].ToString() +
                                "</span><span style=\"font: bold;color: #ff6b09; font-size: 30px;\">!</span></div>";

                StickyMessageLiteral.Text = members;
            }

            members = "";

            if (stickyID != "")
            {
                dvMessages.RowFilter = "MessageID <> " + stickyID;
            }

            if (dvMessages.Count == 0)
            {
                lit = new Literal();
                lit.Text = "<div class=\"EventMemberDescription\" style=\"color: #" + dvGroup[0]["TextB"].ToString() + " !important;\">No messages have been posted for this group.</div>";
                MessagesPanel.Controls.Add(lit);
            }
            else
            {
                dvMessages.Sort = "DatePosted DESC";
                foreach (DataRowView row in dvMessages)
                {
                    if (System.IO.File.Exists(Server.MapPath(".") + "\\UserFiles\\" + row["UserName"].ToString() +
                                "\\Profile\\" + row["ProfilePicture"].ToString()))
                    {
                        friendImg = "UserFiles/" + row["UserName"].ToString() + "/Profile/" + row["ProfilePicture"].ToString();
                        strFill = "";
                    }
                    else
                    {
                        friendImg = "image/noAvatar_50x50_small.png";
                        strFill = "onmouseover=\"this.src='NewImages/noAvatar_50x50_smallhover.png'\"" +
                            "onmouseout=\"this.src='image/noAvatar_50x50_small.png'\" ";
                    }

                    description = "<span class=\"MemberDescription\" style=\"color: #" + dvGroup[0]["TextB"].ToString() + " !important;\">&nbsp;&nbsp;" + row["Content"].ToString().Trim() + "</span>";

                    members += "<div style=\"float: left; clear: both; padding-left: 3px; padding-top: 5px;\"><a target='_blank' href=\"" + row["UserName"].ToString() + "_Friend\"><img " + strFill +
                        " style=\" border: 0;float: left;padding-right: 7px; padding-bottom: 2px;\" " +
                                    "src=\"" + friendImg + "\" width=\"50px\" height=\"50px\" /></a><div style=\"float: left;\"><div style=\"height: 19px; background-position: left; background-repeat: no-repeat; background-image: url(images/UserNameLeft.png); " +
                                "padding-left: 4px;\"><div style=\"height: 19px; background-repeat: no-repeat; background-position: right; " +
                                "background-image: url(images/UserNameRight.png); " +
                                "padding-right: 4px;\"><div style=\"height: 19px; background-repeat: repeat-x; " +
                                "background-image: url(images/UserNameMiddle.png);\"><a style=\"float: left;padding-bottom: 0px;\" href=\"" + row["UserName"].ToString() + "_Friend\" class=\"AddLink\">" +
                                    row["UserName"].ToString() + "</a></div></div></div></div><span class=\"MemberTitle\" style=\"color: #" + dvGroup[0]["TextB"].ToString() + " !important;\">&nbsp;-&nbsp;Posted On: " + row["DatePosted"].ToString().Trim() + "</span> - " + description + "</div>";
                }

                lit = new Literal();
                lit.Text = members;
                MessagesPanel.Controls.Add(lit);
            }
            #endregion

            #region Take care of Groupings
            DataView dvGroupings = dat.GetDataDV("SELECT * FROM GroupEvent_Groupings WHERE GroupEventID=" + Request.QueryString["ID"].ToString());
            DataView dvGroupingMembers = dat.GetDataDV("SELECT * FROM GroupEvent_UserGroupings GG, Users U "+
                "WHERE GG.UserID=U.User_ID AND GG.GroupEventID=" + Request.QueryString["ID"].ToString());

            if (dvGroupings.Count > 0)
            {
                string headerStr = "";
                string usersStr = "";
                GroupingLabel.Text = "Groupings";
                Telerik.Web.UI.RadToolTip tip;
                foreach (DataRowView row in dvGroupings)
                {
                    lit = new Literal();
                    lit.Text = "<div style=\"float: left; padding-bottom: 10px;\">";
                    GroupingPanel.Controls.Add(lit);

                    Label lab = new Label();
                    lab.Text = row["GroupingName"].ToString();
                    lab.CssClass = "AddWhiteLink";
                    lab.ID = "tooltip" + row["ID"].ToString();

                    GroupingPanel.Controls.Add(lab);

                    tip = new RadToolTip();
                    tip.Text = "<div class=\"EventDiv\"><label>" + row["GroupingDescription"].ToString() + "</label></div>";
                    tip.TargetControlID = lab.ClientID;
                    tip.IsClientID = true;
                    tip.ManualClose = true;
                    tip.Position = ToolTipPosition.MiddleRight;
                    tip.RelativeTo = ToolTipRelativeDisplay.Element;
                    tip.Skin = "Black";
                    tip.Width = 200;
                    tip.ShowEvent = ToolTipShowEvent.OnClick;
                    GroupingPanel.Controls.Add(tip);

                    lit = new Literal();
                    lit.Text = "<br/>";
                    GroupingPanel.Controls.Add(lit);

                    dvGroupingMembers.RowFilter = "GroupingID=" + row["ID"].ToString();

                    headerStr = "";
                    foreach (DataRowView row2 in dvGroupingMembers)
                    {
                        friendImg = "";
                        strFill = "";
                        if (System.IO.File.Exists(Server.MapPath(".") + "\\UserFiles\\" + row2["UserName"].ToString() +
                                    "\\Profile\\" + row2["ProfilePicture"].ToString()))
                        {
                            friendImg = "UserFiles/" + row2["UserName"].ToString() + "/Profile/" +
                                row2["ProfilePicture"].ToString();
                            strFill = "";
                        }
                        else
                        {
                            friendImg = "image/noAvatar_50x50_small.png";
                            strFill = "onmouseover=\"this.src='NewImages/noAvatar_50x50_smallhover.png'\"" +
                                "onmouseout=\"this.src='image/noAvatar_50x50_small.png'\" ";
                        }

                        headerStr += "<div style=\"float: left; clear: both; padding-left: 3px; padding-top: 5px;\"><a target='_blank' href=\"" + row2["UserName"].ToString() + "_Friend\"><img " + strFill +
                            " style=\" border: 0;float: left;padding-right: 7px; padding-bottom: 2px;\" " +
                                        "src=\"" + friendImg + "\" title=\"" + row2["UserName"].ToString() +
                                        "\" name=\"" + row2["UserName"].ToString() +
                                        "\" width=\"50px\" height=\"50px\" /></a></div><br/>";
                    }
                    headerStr += "</div>";

                    lit = new Literal();
                    lit.Text = headerStr;
                    GroupingPanel.Controls.Add(lit);
                }
            }
            else
            {
                MembersPanel.Width = 435;
            }
            #endregion

            //other details

            DescriptionLiteral.Text = "<div style=\"color: White; font-size: 18px;padding-bottom: 3px;border-bottom: solid 1px #" + dvGroup[0]["ColorA"].ToString() + ";\" " +
                    ">Our Event Details</div>";

            if (dvGroup[0]["Agenda"] != null)
            {
                if (dvGroup[0]["Agenda"].ToString().Trim() != "")
                {
                    AgendaLiteral.Text = MakeAgenda(dvGroup[0]["Agenda"].ToString()).Replace("color: #cccccc;", "color: #" + dvGroup[0]["TextB"].ToString() + ";");
                    AgendaPanel.Visible = true;
                }
                else
                    AgendaPanel.Visible = false;
            }
            else
            {
                AgendaPanel.Visible = false;
            }

            //TagCloud.THE_ID = int.Parse(Request.QueryString["ID"].ToString());

            GroupDescriptionLabel.Text = dvGroup[0]["Content"].ToString();

            HostLabel.Text = dvUser[0]["UserName"].ToString();

            #region Take care of map
            HttpCookie cookie2 = new HttpCookie("addressParameterName");
            cookie2.Value = dvGroup[0]["Name"].ToString();
            cookie2.Expires = DateTime.Now.AddDays(22);
            Response.Cookies.Add(cookie2);
            bool isVenue = false;
            string address = "";

            if (dvEvent[0]["VenueID"] != null)
            {
                if (dvEvent[0]["VenueID"].ToString().Trim() != "")
                {
                    DataView dvVenue = dat.GetDataDV("SELECT * FROM Venues WHERE ID=" + dvEvent[0]["VenueID"].ToString());
                    NameOfPlaceLabel.Text = dvVenue[0]["Name"].ToString() + "<br />";
                    address = dat.GetAddress(dvVenue[0]["Address"].ToString(), dvVenue[0]["Country"].ToString() != "223");
                    isVenue = true;

                    Address1Label.Text = address;

                    Address2Label.Visible = false;

                    CityStateZipLabel.Text = dvVenue[0]["City"].ToString() + ", " +
                    dvVenue[0]["State"].ToString() + " " + dvVenue[0]["Zip"].ToString();
                }
                else
                    NameOfPlaceLabel.Visible = false;

            }
            else
                NameOfPlaceLabel.Visible = false;

            if (!isVenue)
            {
                if (dvEvent[0]["Country"].ToString() == "223")
                {
                    address = dvEvent[0]["StreetNumber"].ToString() + " " + dvEvent[0]["StreetName"].ToString() +
                        " " + dvEvent[0]["StreetDrop"].ToString();
                }
                else
                {
                    address = dvEvent[0]["Location"].ToString();
                }
            }

            cookie2 = new HttpCookie("addressParameter");
            cookie2.Value = address + " " + dvEvent[0]["City"].ToString() + " " + dvEvent[0]["State"].ToString() +
                " " + dvEvent[0]["Zip"].ToString() + " " + country;
            cookie2.Expires = DateTime.Now.AddDays(22);
            Response.Cookies.Add(cookie2);

            lit = new Literal();
            lit.Text = "<script src=\"http://maps.google.com/maps?file=api&amp;v=2&amp;sensor=false&amp;key=ABQIAAAAjjoxQtYNtdn3Tc17U5-jbBR2Kk_H7gXZZZniNQ8L14X1BLzkNhQjgZq1k-Pxm8FxVhUy3rfc6L9O4g\" type=\"text/javascript\"></script>";
            Page.Header.Controls.Add(lit);

            Master.BodyTag.Attributes.Add("onload", "initialize();");
            Master.BodyTag.Attributes.Add("onunload", "GUnload()");

            if (!isVenue)
            {
                if (dvEvent[0]["Country"].ToString() == "223")
                    Address1Label.Text = dvEvent[0]["StreetNumber"].ToString() + " " +
                        dvEvent[0]["StreetName"].ToString() + " " + dvEvent[0]["StreetDrop"].ToString();
                else
                    Address1Label.Text = dvEvent[0]["Location"].ToString();

                if (dvEvent[0]["AptName"].ToString().Trim() != "")
                {
                    Address2Label.Text = dvEvent[0]["AptName"].ToString() + " " +
                        dvEvent[0]["AptNo"].ToString() + "<br/>";
                }
                else
                    Address2Label.Visible = false;

                CityStateZipLabel.Text = dvEvent[0]["City"].ToString() + ", " +
                    dvEvent[0]["State"].ToString() + " " + dvEvent[0]["Zip"].ToString();
            }

            #endregion

            #region Take care of images and youtube
            char[] delim4 = { ';' };

            DataView dsSlider = dat.GetDataDV("SELECT * FROM GroupEvent_Slider_Mapping WHERE GroupEventID=" + Request.QueryString["ID"].ToString());
            if (dsSlider.Count > 0)
            {
                char[] delim = { '\\' };
                char[] delim3 = { '.' };

                for (int i = 0; i < dsSlider.Count; i++)
                {
                    string caption = "";
                    if (dsSlider[i]["Caption"] != null)
                    {
                        if (dsSlider[i]["Caption"].ToString().Trim() != "")
                        {
                            caption = "<div class=\"CaptionText\">" + dsSlider[i]["Caption"].ToString().Trim() + "</div>";
                        }
                    }
                    string[] tokens = dsSlider[i]["PictureName"].ToString().Split(delim3);

                    //dsSlider.RowFilter = "RealPictureName='" + tokens[0] + "." + tokens[1] + "'";
                    if (tokens.Length >= 2)
                    {
                        if (tokens[1].ToUpper() == "JPG" || tokens[1].ToUpper() == "JPEG" || tokens[1].ToUpper() == "GIF" || tokens[1].ToUpper() == "PNG")
                        {
                            System.Drawing.Image image = System.Drawing.Image.FromFile(MapPath(".") +
                                "\\GroupEventFiles\\" + Request.QueryString["ID"].ToString() + "\\Slider\\" + dsSlider[i]["PictureName"].ToString());

                            int width = 400;
                            int height = 250;

                            int newHeight = 0;
                            int newIntWidth = 0;

                            //if image height is less than resize height
                            if (height >= image.Height)
                            {
                                //leave the height as is
                                newHeight = image.Height;

                                if (width >= image.Width)
                                {
                                    newIntWidth = image.Width;
                                }
                                else
                                {
                                    newIntWidth = width;

                                    double theDivider = double.Parse(image.Width.ToString()) / double.Parse(newIntWidth.ToString());
                                    double newDoubleHeight = double.Parse(newHeight.ToString());
                                    newDoubleHeight = double.Parse(height.ToString()) / theDivider;
                                    newHeight = (int)newDoubleHeight;
                                }
                            }
                            //if image height is greater than resize height...resize it
                            else
                            {
                                //make height equal to the requested height.
                                newHeight = height;

                                //get the ratio of the new height/original height and apply that to the width
                                double theDivider = double.Parse(image.Height.ToString()) / double.Parse(newHeight.ToString());
                                double newDoubleWidth = double.Parse(newIntWidth.ToString());
                                newDoubleWidth = double.Parse(image.Width.ToString()) / theDivider;
                                newIntWidth = (int)newDoubleWidth;

                                //if the resized width is still to big
                                if (newIntWidth > width)
                                {
                                    //make it equal to the requested width
                                    newIntWidth = width;

                                    //get the ratio of old/new width and apply it to the already resized height
                                    theDivider = double.Parse(image.Width.ToString()) / double.Parse(newIntWidth.ToString());
                                    double newDoubleHeight = double.Parse(newHeight.ToString());
                                    newDoubleHeight = double.Parse(image.Height.ToString()) / theDivider;
                                    newHeight = (int)newDoubleHeight;
                                }
                            }

                            Literal literal4 = new Literal();
                            literal4.Text = "<div style=\"width: 400px; height: 250px;background-color: black;\">" +
                                "<img align=\"middle\" style=\"cursor: default; margin-left: " +
                                ((400 - newIntWidth) / 2).ToString() + "px; margin-top: " +
                                ((250 - newHeight) / 2).ToString() + "px;\" height=\"" + newHeight +
                                "px\" width=\"" + newIntWidth + "px\" height=\"" + height.ToString() + "px\" width=\"" + width.ToString() +
                                "px\" src=\"" + "GroupEventFiles/" + Request.QueryString["ID"].ToString() + "/Slider/" + dsSlider[i]["PictureName"].ToString() +
                                "\" /></div>" + caption;
                            Telerik.Web.UI.RadRotatorItem r4 = new Telerik.Web.UI.RadRotatorItem();
                            r4.Controls.Add(literal4);
                            Rotator1.Items.Add(r4);
                        }
                    }
                    else
                    {
                        Literal literal3 = new Literal();
                        literal3.Text = "<div class=\"topDiv\"><div style=\"float:left;background-color: black;\"><object width=\"400\" height=\"250\"><param  name=\"wmode\" value=\"opaque\" ></param><param name=\"movie\" value=\"http://www.youtube.com/v/" + dsSlider[i]["PictureName"].ToString() +
                            "\"></param><param name=\"allowFullScreen\" value=\"true\"></param><embed wmode=\"opaque\" src=\"http://www.youtube.com/v/" + dsSlider[i]["PictureName"].ToString() +
                            "\" type=\"application/x-shockwave-flash\" allowfullscreen=\"true\" width=\"400\" height=\"250\"></embed></object></div>" + caption + "</div>";
                        Telerik.Web.UI.RadRotatorItem r3 = new Telerik.Web.UI.RadRotatorItem();
                        r3.Controls.Add(literal3);
                        Rotator1.Items.Add(r3);
                    }
                }
            }

            if (Rotator1.Items.Count == 0)
                RotatorPanel.Visible = false;
            else
            {
                RotatorPanel.Visible = true;
                if (Rotator1.Items.Count == 1)
                {
                    RotatorPanel.CssClass = "HiddeButtons";
                }
            }
            #endregion

            //Digg
            DiggLiteral.Text = "<table style=\"padding-top: 5px;\"> " +
                           " <tr>" +
                               " <td valign=\"bottom\" style=\"padding-right: 0px;\">" +
                                 "   <a name=\"fb_share\" type=\"button\" href=\"http://www.facebook.com/sharer.php\">Share</a><script src=\"http://static.ak.fbcdn.net/connect.php/js/FB.Share\" type=\"text/javascript\"></script>" +
                                "</td>" +
                                "<td valign=\"bottom\" style=\"padding-right: 0px;\">" +
                                "    <a style=\"border: 0; padding: 0; margin: 0;\" id=\"TweeterA\" title=\"Click to send this page to Twitter!\" target=\"_blank\" rel=\"nofollow\"><img style=\"border: 0; padding: 0; margin: 0;\" src=\"http://twitter-badges.s3.amazonaws.com/twitter-a.png\" alt=\"Share on Twitter\"/></a>" +
                                "</td>" +
                                "<td valign=\"bottom\">" +
                                  "  <a href=\"javascript:void(window.open('http://www.myspace.com/Modules/PostTo/Pages/?u='+encodeURIComponent(document.location.toString()),'ptm','height=450,width=440').focus())\">" +
                                       " <img src=\"http://cms.myspacecdn.com/cms/ShareOnMySpace/small.png\" border=\"0\" alt=\"Share on MySpace\" />" +
                                  "  </a>" +
                                "</td>" +
                                "<td><a alt=\"Digg it!\" class=\"DiggThisButton DiggIcon\" id=\"dibbButt\"" +
                            "href='http://digg.com/submit?phase=2&url=" + "http://" +
                            Request.Url.Authority + "/" +
                            dat.MakeNiceName(dvGroup[0]["Name"].ToString()) +
                            "_" + Request.QueryString["ID"].ToString() + "_GroupEvent" +
                            "' target=\"_blank\">Digg</a> </td>" +
                                "<td>" +
                                   " <a href=\"http://delicious.com/save\" onclick=\"window.open('http://delicious.com/save?v=5&noui&jump=close&url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title), 'delicious','toolbar=no,width=550,height=550'); return false;\">" +
                                   "     <img border=\"0\" src=\"http://static.delicious.com/img/delicious.small.gif\" height=\"10\" width=\"10\" alt=\"Delicious\" />" +
                                   " </a>" +
                                "</td>" +
                               " <td>" +
                               "      <script src=\"http://www.stumbleupon.com/hostedbadge.php?s=4\"></script>" +
                               " </td>" +
                           " </tr>" +
                        "</table>";
        }
        catch (Exception ex)
        {
            ErrorLabel.Text = ex.ToString() + "<br/>" + command;
        }
    }
Example #22
0
 void lblErrorMessage_MouseEnter(object sender, EventArgs e)
 {
     _longErrorTooltip = new RadToolTip();
     _longErrorTooltip.Show(LongErrorMessage);
 }
Example #23
0
 private void DisplayLinkStatus(Boolean isValidStatus, String invalidBallColor, String validLinkText, String invalidLinkText, Image statusImage, HyperLink statusLink, RadToolTip statusTooltip, String statusTooltipText, String configurationName, String methodName)
 {
     if (isValidStatus)
     {
         statusImage.ImageUrl = "~/images/green-ball.gif";
         statusLink.Text = validLinkText;
     }
     else
     {
         statusImage.ImageUrl = "~/images/" + invalidBallColor + "-ball.gif";
         statusLink.Text = invalidLinkText;
     }
     if ((statusTooltip != null) && (statusTooltipText != null))
         statusTooltip.Text = Server.HtmlEncode(statusTooltipText).Replace("\n", "<br />");
     statusLink.NavigateUrl = "#";
     statusLink.Attributes["onclick"] = "window.radopen('Configuration.aspx?c=" + configurationName + "&d=" + methodName + "'); return false;";
 }
    protected void GetSavedSearchAds()
    {
        HttpCookie cookie = Request.Cookies["BrowserDate"];
        if (cookie == null)
        {
            cookie = new HttpCookie("BrowserDate");
            cookie.Value = DateTime.Now.ToString();
            cookie.Expires = DateTime.Now.AddDays(22);
            Response.Cookies.Add(cookie);
        }
        AdSearchesPanel.Controls.Clear();
        Data dat = new Data(DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")));
        DataSet dsSearches = dat.GetData("SELECT * FROM SavedAdSearches AS SAS, Countries C WHERE SAS.Country=C.country_id AND SAS.UserID="+Session["User"].ToString()+" ORDER BY SAS.ID");
        DataView dvSearches = new DataView(dsSearches.Tables[0], "", "", DataViewRowState.CurrentRows);
        bool isAlt = false;
        if (dvSearches.Count > 0)
        {

            Literal beginningTable2 = new Literal();
            beginningTable2.Text = "<table style=\"margin-top: 20px; margin-bottom: 50px;border-style: "+
                "solid; border-collapse: collapse; border-color: #121010; border-width: 2px; width: 800px;\">"+
                "<tr><th width=\"350px\"><label>Search Specifications</label></th><th "+
                "valign=\"middle\"><table><tr><td><label>Active Search </label></td><td>";

            Literal beginningTable = new Literal();
            beginningTable.Text = "</td></tr></table></th><th><table><tr><td><label>Ad Number to Send </label></td><td>";
            Literal b4 = new Literal();
            b4.Text = "</td></tr></table></th><th><label>Remove</label></th></tr>";
            string criteria = "";
            bool hasSearches = false;
            Image img = new Image();
            img.CssClass = "HelpImage";
            img.ImageUrl = "~/image/helpIcon.png";
            img.ID = "QuestionMark1";

            RadToolTip tip = new RadToolTip();
            tip.Text = "<label style=\"color: #cccccc;\"> An active search will " +
                "periodically send you emails when new featrued ads are posted on Hippo Happenings " +
                "that fit your search criteria.</label>";
            tip.Skin = "Black";
            tip.Width = 200;
            tip.ManualClose = true;
            tip.ShowEvent = ToolTipShowEvent.OnClick;
            tip.Position = ToolTipPosition.MiddleRight;
            tip.RelativeTo = ToolTipRelativeDisplay.Element;
            tip.TargetControlID = "QuestionMark1";

            Image img2 = new Image();
            img2.CssClass = "HelpImage";
            img2.ImageUrl = "~/image/helpIcon.png";
            img2.ID = "QuestionMark2";

            RadToolTip tip2 = new RadToolTip();
            tip2.Text = "<label style=\"color: #cccccc;\"> When your search is active"+
                ", this number tells us how many featured ads to gather before sending out the email. For example, if you select \"20\", "+
                "we will wait until there are 20 featured ads matching your search criteria before sending you an email with the ads."+
               " [You could potentially be waiting a long time for 20 ads to gather in our system.] "+
                "If you select \"1\", we will send you an email every time someone posts a featured ad that matches your search criteria.</label>";
            tip2.Skin = "Black";
            tip2.Width = 200;
            tip2.ManualClose = true;
            tip2.ShowEvent = ToolTipShowEvent.OnClick;
            tip2.Position = ToolTipPosition.MiddleRight;
            tip2.RelativeTo = ToolTipRelativeDisplay.Element;
            tip2.TargetControlID = "QuestionMark2";

            AdSearchesPanel.Controls.Add(beginningTable2);
            AdSearchesPanel.Controls.Add(img);
            AdSearchesPanel.Controls.Add(tip);
            AdSearchesPanel.Controls.Add(beginningTable);
            AdSearchesPanel.Controls.Add(img2);
            AdSearchesPanel.Controls.Add(tip2);
            AdSearchesPanel.Controls.Add(b4);
            for (int i = 0; i < dvSearches.Count; i++)
            {
                beginningTable = new Literal();
                criteria = "";
                if(dvSearches[i]["Keywords"] != null)
                    if (dvSearches[i]["Keywords"].ToString().Trim() != "")
                    {
                        criteria += "Keywords: " + dvSearches[i]["Keywords"].ToString().Trim();
                    }
                if (dvSearches[i]["State"] != null)
                    if (dvSearches[i]["State"].ToString().Trim() != "")
                    {
                        criteria += " | State: " + dvSearches[i]["State"].ToString().Trim();
                    }
                if (dvSearches[i]["Country"] != null)
                    if (dvSearches[i]["Country"].ToString().Trim() != "")
                    {
                        criteria += " | Country: " + dvSearches[i]["country_name"].ToString().Trim();
                    }
                if (dvSearches[i]["City"] != null)
                    if (dvSearches[i]["City"].ToString().Trim() != "")
                    {
                        criteria += " | City: " + dvSearches[i]["City"].ToString().Trim();
                    }

                if (dvSearches[i]["Zip"] != null)
                    if (dvSearches[i]["Zip"].ToString().Trim() != "")
                    {
                        char[] delim = { ';' };
                        string[] tokens = dvSearches[i]["Zip"].ToString().Trim().Split(delim);

                        criteria += " | Zip: " + tokens[1].Trim();
                    }

                if (dvSearches[i]["Radius"] != null)
                    if (dvSearches[i]["Radius"].ToString().Trim() != "")
                    {
                        criteria += " | Radius: " + dvSearches[i]["Radius"].ToString().Trim();
                    }

                DataSet dsCats = dat.GetData("SELECT * FROM SavedAdSearches_Categories SSC, AdCategories AC WHERE SSC.SearchID="+
                    dvSearches[i]["ID"].ToString()+" AND SSC.CategoryID=AC.ID");
                DataView dvCates = new DataView(dsCats.Tables[0], "", "", DataViewRowState.CurrentRows);

                if (dvCates.Count > 0)
                {
                    if(criteria != "")
                        criteria += "<br/>";
                    criteria += "categories: ";
                    for (int j = 0; j < dvCates.Count; j++)
                    {
                        criteria += dvCates[j]["Name"].ToString();

                        if (j + 1 != dvCates.Count)
                        {
                            criteria += ", ";
                        }
                    }
                }

                if (criteria != "")
                {
                    string classA = "isAlt";
                    string classB = "AddGreyLinkAlt";
                    if (!isAlt)
                    {
                        classA = "notAlt";
                        classB = "AddGreyLink";
                        isAlt = true;
                    }
                    else
                    {
                        isAlt = false;
                    }

                    beginningTable.Text += "<tr class=\"" + classA + "\"><td><a class=\"" + classB +
                        "\" href=\"AdSearch.aspx?search=" + dvSearches[i]["ID"].ToString() + "\">" +
                        criteria + "</a></td><td align=\"center\">";
                    AdSearchesPanel.Controls.Add(beginningTable);
                    hasSearches = true;
                    bool live = false;
                    if (dvSearches[i]["Live"] != null)
                        if (dvSearches[i]["Live"].ToString().Trim() != "")
                        {
                            live = bool.Parse(dvSearches[i]["Live"].ToString().Trim().ToString());
                            CheckBox check = new CheckBox();
                            check.Checked = live;
                            check.AutoPostBack = true;
                            check.Attributes.Add("value", dvSearches[i]["ID"].ToString());
                            check.CheckedChanged += new EventHandler(check_CheckedChanged);
                            AdSearchesPanel.Controls.Add(check);
                        }

                    beginningTable = new Literal();
                    beginningTable.Text = "</td><td align=\"center\">";
                    AdSearchesPanel.Controls.Add(beginningTable);

                    Literal b2 = new Literal();
                    b2.Text = "</td><td align=\"center\">";

                    if (live)
                    {
                        string numAds = dvSearches[i]["NumAdsInEmail"].ToString().Trim().ToString();
                        DropDownList drop = new DropDownList();
                        drop.Width = 50;
                        drop.ID = "drop" + dvSearches[i]["ID"].ToString();
                        drop.Items.Add(new ListItem("1", "1;" + dvSearches[i]["ID"].ToString()));
                        drop.Items.Add(new ListItem("5", "5;" + dvSearches[i]["ID"].ToString()));
                        drop.Items.Add(new ListItem("10", "10;" + dvSearches[i]["ID"].ToString()));
                        drop.Items.Add(new ListItem("20", "20;" + dvSearches[i]["ID"].ToString()));
                        drop.SelectedValue = numAds + ";" + dvSearches[i]["ID"].ToString();
                        drop.AutoPostBack = true;
                        drop.SelectedIndexChanged += new EventHandler(drop_SelectedIndexChanged);

                        AdSearchesPanel.Controls.Add(drop);
                    }
                    else
                    {
                        Literal b3 = new Literal();
                        b3.Text = "---";
                        b3.ID = "lit" + dvSearches[i]["ID"].ToString();
                        AdSearchesPanel.Controls.Add(b3);
                    }

                    AdSearchesPanel.Controls.Add(b2);

                    LinkButton link = new LinkButton();
                    link.Text = "Remove";
                    link.CssClass = "AddGreyLink";
                    link.CommandArgument = dvSearches[i]["ID"].ToString();
                    link.Click += new EventHandler(removeAdSearch);

                    AdSearchesPanel.Controls.Add(link);

                    beginningTable = new Literal();
                    beginningTable.Text = "</td></tr>";

                    AdSearchesPanel.Controls.Add(beginningTable);
                }

            }

            beginningTable = new Literal();

            if (!hasSearches)
            {

                beginningTable.Text += "<tr><td colspan=\"3\"><label>You have no saved ad searches. </label></td></tr></table>";
            }
            else
            {
                beginningTable.Text += "</table>";
            }

            AdSearchesPanel.Controls.Add(beginningTable);
        }
        else
        {
            Literal lit = new Literal();
            lit.Text = "<table style=\"margin-top: 20px; margin-bottom: 50px;border-style: solid; border-collapse: collapse; border-color: #121010; border-width: 2px; width: 800px;\">";
            lit.Text += "<tr><td colspan=\"2\"><label>You have no saved ad searches. </label></td></tr></table>";

            AdSearchesPanel.Controls.Add(lit);
        }
    }
        private HtmlGenericControl CreateHeaderDiv(Criterion criterion)
        {
            var containerDiv = new HtmlGenericControl("div");

            var headerDiv = new HtmlGenericControl("div");
            headerDiv.Attributes["class"] = "criteriaHeaderDiv";

            var headerDivLbl = new HtmlGenericControl("div");
            headerDivLbl.Attributes["class"] = "left";

            var headerDivExpand = new HtmlGenericControl("div");
            headerDivExpand.Attributes["class"] = "right";

            var adjustedID = StripString(criterion.Key);

            headerDivExpand.ID = "expand_" + adjustedID;
            headerDivExpand.Style.Add("overflow", "hidden");

            var requiredAsterik = "";

            // Add tooltip
            if (!criterion.Locked && (criterion.UIType != UIType.None))
            {
                var tooltip = new RadToolTip
                {
                    Height = 55,
                    Width = 205,
                    TargetControlID = headerDivExpand.ID,
                    Position = ToolTipPosition.MiddleRight,
                    RelativeTo = ToolTipRelativeDisplay.Element,
                    HideEvent = ToolTipHideEvent.Default,
                    AutoCloseDelay = 20000,
                    Skin = "Black",
                    ShowEvent = ToolTipShowEvent.OnClick,
                    EnableShadow = true
                };

                var contentChunk = new HtmlGenericControl("div");
                contentChunk.Style.Add("position", "relative");

                if (criterion.IsRequired) //BJC - 6/11/2012: If this criterion object is required
                {
                    requiredFields.Value += criterion.Key + ","; //Add Key to the requiredFields hidden input value.
                    requiredAsterik = "<span style=\"font-weight:bold;color:#F00;\">*</span>";
                }

                // Add appropriate control to tooltip
                switch (criterion.UIType)
                {
                    case UIType.DropDownList:
                        var cmb = CreateDropDownList(criterion, adjustedID);

                        if (criterion.Object != null && criterion.ReportStringVal != null)
                        {
                            var selectedItemIndex = cmb.FindItemIndexByValue(adjustedID + "_" + criterion.ReportStringVal, true);
                            if (selectedItemIndex > 0) cmb.SelectedIndex = selectedItemIndex;
                            if (requiredFieldsSelected.Value.IndexOf(criterion.Key) == -1)
                            {
                                requiredFieldsSelected.Value += criterion.Key + ",";
                            }
                        }

                        contentChunk.Controls.Add(new HtmlGenericControl("div") { InnerText = criterion.Header });
                        contentChunk.Controls.Add(cmb);

                        tooltip.Attributes["dropDownListID"] = cmb.ID;
                        tooltip.OnClientShow = "onClientShowToolTipDropDownList";

                        break;

                    //case UIType.RadioButton:
                    //    {
                    //        var radioButtons = new RadButton()
                    //        {
                    //            ID = "RadRadioButtonCriteriaRadioButtonList",
                    //            GroupName = criterion.Key,
                    //            ToggleType = ButtonToggleType.Radio,
                    //            //AutoPostBack = false,
                    //            //OnClientToggleStateChanged = "OnClientToggleStateChanged"

                    //        };

                    //        if (criterion.DataSource == null)
                    //        {
                    //            radioButtons.ToggleStates.Add(new RadButtonToggleState("No data supplied", string.Format(adjustedID + "_" + "0")));
                    //        }
                    //        else
                    //        {
                    //            radioButtons.ToggleStates.Add(new RadButtonToggleState("All", string.Format(adjustedID + "_" + "0")));


                    //            foreach (DataRow row in ((DataTable)criterion.DataSource).Rows)
                    //            {
                    //                var rbItem = new RadButtonToggleState(row[criterion.DataTextField].ToString(),
                    //                                                      adjustedID + "_" +
                    //                                                      row[criterion.DataValueField]);

                    //                radioButtons.ToggleStates.Add(rbItem);
                    //            }
                    //        }

                    //        contentChunk.Controls.Add(new System.Web.UI.HtmlControls.HtmlGenericControl("div") { InnerText = criterion.Header });
                    //        contentChunk.Controls.Add(radioButtons);


                    //        break;
                    //    }

                    case UIType.CheckBoxList:
                        {
                            tooltip.Width = (criterion.ChildDataSource != null) ? 450 : 205;

                            var listBox = this.CreateCheckBoxList(criterion, adjustedID);
                            tooltip.Attributes.Add("lstBoxID", listBox.ClientID);

                            tooltip.OnClientShow = "setListBoxMaxHeight";

                            if (criterion.Object != null && criterion.ReportStringVal != null)
                            {
                                if (requiredFieldsSelected.Value.IndexOf(criterion.Key) == -1)
                                {
                                    requiredFieldsSelected.Value += criterion.Key + ",";
                                }
                            }

                            contentChunk.Controls.Add(new HtmlGenericControl("div") { InnerText = criterion.Header });
                            contentChunk.Controls.Add(listBox);

                            if (!string.IsNullOrEmpty(criterion.ChildHeader))
                            {
                                tooltip.OnClientShow = "TooltipOnClientShow_DisplayChildCheckboxItems";
                                tooltip.Attributes["ParentListID"] = "RadCombobBoxCriteriaCheckBoxList";
                                tooltip.Attributes["ChildListID"] = "RadCombobBoxCriteriaCheckBoxList2";

                                listBox.Attributes.Add("ChildCheckBoxList", "RadCombobBoxCriteriaCheckBoxList2");

                                var listBox2 = new RadListBox
                                {
                                    ID = "RadCombobBoxCriteriaCheckBoxList2",
                                    AutoPostBack = false,
                                    CheckBoxes = true,
                                    Skin = "Vista",
                                    OnClientItemChecked = "onItemChecked"
                                };

                                foreach (DataRow row in ((DataTable)criterion.ChildDataSource).Rows)
                                {
                                    var listBoxValue = string.Format("{0}_{1}", adjustedID, StripString(row[criterion.ChildDataValueField].ToString()));
                                    var listBoxItem = new RadListBoxItem(row[criterion.ChildDataTextField].ToString(), listBoxValue);
                                    listBoxItem.Attributes["parentValue"] = string.Format("{0}_{1}", adjustedID, StripString(row[criterion.ChildDataParentField].ToString()));
                                    listBoxItem.Attributes["checkBoxID"] = string.Format("{0}_RadCombobBoxCriteriaCheckBoxList2_CheckBox", listBoxValue);

                                    Criterion tempCriterion = null;
                                    foreach (Criterion c in Criteria.CriterionList)
                                    {
                                        if (c.Key == listBoxValue)
                                        {
                                            tempCriterion = c;
                                            break;
                                        }
                                    }

                                    if (tempCriterion != null)
                                    {
                                        listBoxItem.Checked = !tempCriterion.Empty;
                                    }

                                    listBox2.Items.Add(listBoxItem);
                                }

                                contentChunk.Controls.Add(new HtmlGenericControl("span") { InnerText = criterion.ChildHeader });
                                contentChunk.Controls.Add(listBox2);
                            }

                            break;
                        }

                    case UIType.TextBox:
                        {
                            var textBox = CreateTextBox(criterion, adjustedID);

                            if (criterion.Object != null && criterion.ReportStringVal != null)
                            {
                                if (requiredFieldsSelected.Value.IndexOf(criterion.Key) == -1)
                                {
                                    requiredFieldsSelected.Value += criterion.Key + ",";
                                }
                            }

                            contentChunk.Controls.Add(new HtmlGenericControl("div") { InnerText = criterion.Header });
                            contentChunk.Controls.Add(textBox);

                            tooltip.OnClientShow = "onClientShowToolTipTextBox";
                            tooltip.Attributes["textBoxID"] = textBox.ID;

                            break;
                        }

                    case UIType.DatePicker:
                        {
                            tooltip.Width = 330;

                            var startCriterion = Criteria.CriterionList.Find(c => c.Header == criterion.Header && c.IsHeader == false && c.Key.Contains("Start"));
                            var endCriterion = Criteria.CriterionList.Find(c => c.Header == criterion.Header && c.IsHeader == false && c.Key.Contains("End"));

                            var wrapperDiv = CreateDatePicker(adjustedID, startCriterion, endCriterion);

                            if (criterion.Object != null && criterion.ReportStringVal != null)
                            {
                                if (requiredFieldsSelected.Value.IndexOf(criterion.Key) == -1)
                                {
                                    requiredFieldsSelected.Value += criterion.Key + ",";
                                }
                            }

                            contentChunk.Controls.Add(new HtmlGenericControl("div") { InnerText = criterion.Header });
                            contentChunk.Controls.Add(wrapperDiv);

                            break;
                        }

                    case UIType.AssessmentTextSearch:
                        {
                            tooltip.Width = 400;

                            var wrapperDiv = new System.Web.UI.HtmlControls.HtmlGenericControl("div");
                            wrapperDiv.Style.Add("width", "350px");

                            var textBox = new RadTextBox
                            {
                                ID = "RadTextBoxAssessmentTextSearch",
                                AutoPostBack = false,
                                Skin = "Vista"
                            };

                            textBox.ClientEvents.OnBlur = "onInputBlur";
                            textBox.Attributes["updateMessageHeader"] = adjustedID;
                            textBox.Attributes["comboBoxDivID"] = "cmbBoxDiv";

                            //ADD DIV TO contentChunk
                            var textBoxDiv = new System.Web.UI.HtmlControls.HtmlGenericControl("div") { ID = "textBoxDiv" };
                            textBoxDiv.Controls.Add(textBox);


                            var textSearchCmb = new Telerik.Web.UI.RadComboBox
                            {
                                ID = "RadComboBoxAssessmentTextSearch",
                                AutoPostBack = false,
                                MarkFirstMatch = true,
                                AllowCustomText = false,
                                ZIndex = 8005,
                                OnClientSelectedIndexChanged = "onSelectedIndexChanged",
                                Skin = "Vista"
                            };
                            textSearchCmb.Attributes["textBoxDivID"] = "textBoxDiv";


                            if (criterion.Object != null)
                            {
                                var textSearchObjectArray = criterion.Object.ToString().Split(':');
                                textBox.Text = textSearchObjectArray[1].Trim();

                                var selectedItemIndex = textSearchCmb.FindItemIndexByText(textSearchObjectArray[0].Trim(), true);

                                textSearchCmb.SelectedIndex = selectedItemIndex;

                                if (requiredFieldsSelected.Value.IndexOf(criterion.Key) == -1)
                                {
                                    requiredFieldsSelected.Value += criterion.Key + ",";
                                }
                            }

                            var textSearchCmbDiv = new System.Web.UI.HtmlControls.HtmlGenericControl("div") { ID = "cmbBoxDiv" };
                            textSearchCmbDiv.Controls.Add(textSearchCmb);

                            if (criterion.DataSource == null)
                            {
                                textSearchCmb.Items.Add(new RadComboBoxItem("No data supplied", adjustedID + "_" + "0"));
                            }
                            else
                            {
                                foreach (DataRow row in ((DataTable)criterion.DataSource).Rows)
                                {
                                    textSearchCmb.Items.Add(new RadComboBoxItem(row[criterion.DataTextField].ToString(), adjustedID + "_" + row[criterion.DataValueField]));
                                }
                            }

                            contentChunk.Controls.Add(new System.Web.UI.HtmlControls.HtmlGenericControl("div") { InnerText = criterion.Header });

                            var wrapperDivLeft = new System.Web.UI.HtmlControls.HtmlGenericControl("div");
                            wrapperDivLeft.Style.Add("float", "left");
                            wrapperDivLeft.Style.Add("width", "149px");
                            wrapperDivLeft.Controls.Add(textBoxDiv);

                            var wrapperDivRight = new System.Web.UI.HtmlControls.HtmlGenericControl("div");
                            wrapperDivRight.Style.Add("float", "right");
                            wrapperDivRight.Style.Add("width", "149px");
                            wrapperDivRight.Controls.Add(textSearchCmbDiv);

                            wrapperDiv.Controls.Add(wrapperDivLeft);
                            wrapperDiv.Controls.Add(wrapperDivRight);

                            contentChunk.Controls.Add(wrapperDiv);

                            break;
                        }

                    case UIType.Demographics:
                        {
                            tooltip.Width = 390;

                            contentChunk.Controls.Add(new HtmlGenericControl("div") { InnerText = criterion.Header });
                            contentChunk.Controls.Add(CreateDemographics(criterion, adjustedID));

                            break;
                        }

                    case UIType.RTI:
                        {
                            contentChunk.Controls.Add(new HtmlGenericControl("div") { InnerText = criterion.Header });
                            contentChunk.Controls.Add(CreateRTI(criterion, adjustedID));

                            break;
                        }
                }

                tooltip.Controls.Add(contentChunk);
                headerDiv.Controls.Add(tooltip);
            }

            if (criterion.Locked == false)
            {
                headerDivExpand.Controls.Add(new Image { ImageUrl = "~/Images/commands/expand_bubble.png", Width = 16, Height = 16 });
            }
            else if (FirstTimeLoaded)
            {
                criterion.ReportStringVal = criterion.DefaultValue;
            }

            headerDivLbl.InnerHtml = criterion.Header + ":" + requiredAsterik;

            headerDiv.Controls.Add(headerDivLbl);
            headerDiv.Controls.Add(headerDivExpand);

            var updateMessageDiv = new System.Web.UI.HtmlControls.HtmlGenericControl("div");
            updateMessageDiv.Attributes["class"] = "criteriaUpdateMessageDiv";
            updateMessageDiv.Attributes["id"] = adjustedID + "_updateMessage";

            containerDiv.Controls.Add(headerDiv);
            containerDiv.Controls.Add(updateMessageDiv);

            return containerDiv;
        }
    protected void RadScheduler1_AppointmentCreated(object sender, AppointmentCreatedEventArgs e)
    {
        HttpCookie cookie = Request.Cookies["BrowserDate"];
        string venueID = Request.QueryString["ID"].ToString();

        char[] delim = { ';' };
        string[] tokens = e.Appointment.ID.ToString().Split(delim);

        string aptmntID = tokens[0];
        string reOcurrID = tokens[2];
        string switchOn = tokens[1];

        Data dat = new Data(DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")));
        DateTime dateNow = DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":"));

        DataSet ds = dat.GetData("SELECT DATEADD(minute,450,EO.DateTimeStart)  AS Start, DATEADD(minute,450,EO.DateTimeEnd)  AS [End], E.Header, " +
            "E.ID, E.Address, V.Name FROM Venues V, Events E, Event_Occurance EO WHERE E.Venue=V.ID AND " +
            "EO.EventID=E.ID AND V.ID=" + venueID);
        DataView dv = new DataView(ds.Tables[0], "ID=" + aptmntID, "", DataViewRowState.CurrentRows);

        e.Appointment.ToolTip = "";
        RadToolTip newToolTip = new RadToolTip();
        string address = "";

        DateTime date = e.Appointment.Start;

        newToolTip.Text = "<div width=\"250px\" id=\"divE" + aptmntID + "\"><a href=\"" +
            dat.MakeNiceName(e.Appointment.Subject) + "_" +
                    aptmntID + "_Event\" class=\"NavyLink12\">" +
                    dat.BreakUpString(e.Appointment.Subject, 20) + "</a>" +
                    "<br/>" + date.ToShortTimeString();

        if (Session["User"] != null)
        {
            DataView dvUser = dat.GetDataDV("SELECT * FROM User_Calendar WHERE UserID=" +
                Session["User"].ToString() + " AND EventID=" + aptmntID);

            newToolTip.Text += "<br/><a href=\"javascript:OpenRad2('divE" + aptmntID + "','" +
                aptmntID + "', 'E', " + reOcurrID + ");\"><img title=\"Send info to friends\" alt=\"Send info to " +
                "friends\" style=\"border: none;\" " +
                "src=\"image/Envelope.png\" /></a>";
            string addText = "";
            if (dvUser.Count > 0)
            {
                e.Appointment.BackColor = System.Drawing.Color.Yellow;
                newToolTip.Text = "<span style=\"color: orange;\">Event is in your calendar</span>" +
                    newToolTip.Text + "</div>";
            }
            else
            {

                newToolTip.Text += "<a style=\"text-decoration: none;\" " +
                    "href=\"javascript:AddToCalendar('divE" + aptmntID + "','" +
                aptmntID + "', 'E');\"><img style=\"padding-bottom: 4px; border: 0;\" " +
                "title=\"Add to Calendar\" alt=\"Add to Calendar\" " +
                "src=\"image/CalendarIcon.png\" /></a></div>";
            }
        }
        else
            newToolTip.Text += "</div>";

        newToolTip.TargetControlID = e.Appointment.ClientID;
        newToolTip.IsClientID = true;
        newToolTip.ManualClose = true;
        newToolTip.HideEvent = ToolTipHideEvent.ManualClose;
        newToolTip.Animation = ToolTipAnimation.None;
        newToolTip.AutoCloseDelay = 100000000;
        newToolTip.HideDelay = 1000000;
        newToolTip.ShowEvent = ToolTipShowEvent.OnClick;
        newToolTip.Position = ToolTipPosition.MiddleRight;
        newToolTip.Width = 250;
        newToolTip.Skin = "Sunset";
        ToolTipPanel.Controls.Add(newToolTip);
    }
    protected void RadScheduler1_AppointmentCreated(object sender, AppointmentCreatedEventArgs e)
    {
        try
        {
            HttpCookie cookie = Request.Cookies["BrowserDate"];
            Data dat = new Data(DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")));

            char[] delim = { ';' };
            string[] calendarKeys = e.Appointment.ID.ToString().Split(delim);
            bool isGroup = bool.Parse(calendarKeys[0]);
            string EID = calendarKeys[1];
            string reoccurrID = calendarKeys[2];
            bool isVenue = false;
            DataView dvE = new DataView();
            DataView dvV = new DataView();

            DataView dvCountry = new DataView();

            string theDate = "";
            string eventLink = "";
            string venueStr = "";
            string address = "";
            string country = "";

            string eventColumnTitle = "";

            if (isGroup)
            {
                eventColumnTitle = "Name";
                country = dat.GetDataDV("SELECT * FROM Countries C, GroupEvent_Occurance GEO WHERE GEO.ID=" +
                        reoccurrID + " AND C.country_id=GEO.Country ")[0]["country_2_code"].ToString();

                dvE = dat.GetDataDV("SELECT * FROM GroupEvents E, GroupEvent_Occurance EO WHERE EO.ID=" + reoccurrID +
                    " and EO.GroupEventID=E.ID AND E.ID=" + EID);

                if (dvE[0]["VenueID"] != null)
                {
                    if (dvE[0]["VenueID"].ToString() != "")
                    {
                        isVenue = true;
                        dvV = dat.GetDataDV("SELECT * FROM Venues WHERE ID=" + dvE[0]["VenueID"].ToString());
                        venueStr = "<span style=\"color: #98cb2a; " +
                                            "font-weight: bold;text-decoration: underline; " +
                                            " cursor: pointer;\" onclick=\"CloseWindow(\'" + "../" +
                                            dat.MakeNiceName(dvV[0]["Name"].ToString()) + "_" +
                                            dvV[0]["ID"].ToString() + "_Venue" + "\');\">" +
                                            dvV[0]["Name"].ToString().Replace("'",
                                            " ").Replace("(", " ").Replace(")", " ") + "</span><br/>";
                    }

                }
                eventLink = dat.MakeNiceName(dvE[0]["Name"].ToString()) + "_" + reoccurrID + "_" +
                                        dvE[0]["ID"].ToString() + "_GroupEvent";

                if (!isVenue)
                {
                    if (dvE[0]["Country"].ToString() == "223")
                    {
                        address = dvE[0]["StreetNumber"].ToString() + " " + dvE[0]["StreetName"].ToString() +
                            " " + dvE[0]["StreetDrop"].ToString();
                    }
                    else
                    {
                        address = dvE[0]["Location"].ToString();
                    }
                }
                else
                {
                    address = dat.GetAddress(dvV[0]["Address"].ToString(),
                                dvV[0]["Country"].ToString() != "223").Trim();
                }

                address = address.Trim() + " " + dvE[0]["City"].ToString() + " " + dvE[0]["State"].ToString() +
                    " " + dvE[0]["Zip"].ToString() + " " + country;
            }
            else
            {
                eventColumnTitle = "Header";
                dvE = dat.GetDataDV("SELECT * FROM Events E, Event_Occurance EO WHERE EO.ID=" + reoccurrID +
                    " and EO.EventID=E.ID AND E.ID=" + EID);
                dvV = dat.GetDataDV("SELECT * FROM Venues WHERE ID=" + dvE[0]["Venue"].ToString());

                dvCountry = dat.GetDataDV("SELECT * FROM countries WHERE country_id=" + dvE[0]["Country"].ToString());
                country = dvCountry[0]["country_2_code"].ToString();
                if (country.ToLower() == "us")
                {
                    try
                    {
                        address = dat.GetAddress(dvV[0]["Address"].ToString(), false);
                    }
                    catch (Exception ex1)
                    {
                        address = "";
                    }
                }
                else
                {
                    address = dat.GetAddress(dvV[0]["Address"].ToString(), true);
                }
                address = address.Trim().Replace("'", "''").Replace("(", " ").Replace(")", " ") + " " +
                                        dvV[0]["City"].ToString().Replace("'", " ").Replace("(", " ").Replace(")", " ") + " " +
                                        dvV[0]["State"].ToString().Replace("'", " ").Replace("(", " ").Replace(")", " ") + " " +
                                        dvV[0]["Zip"].ToString().Replace("'", " ").Replace("(", " ").Replace(")", " ") + " " +
                                        country.Replace("'", " ").Replace("(", " ").Replace(")", " ");
                eventLink = dat.MakeNiceName(dvE[0]["Header"].ToString()) + "_" +
                                        dvE[0]["ID"].ToString() + "_Event";
                venueStr = "<span style=\"color: #98cb2a; " +
                                        "font-weight: bold;text-decoration: underline; " +
                                        " cursor: pointer;\" onclick=\"CloseWindow(\'" + "../" +
                                        dat.MakeNiceName(dvV[0]["Name"].ToString()) + "_" +
                                        dvV[0]["ID"].ToString() + "_Venue" + "\');\">" +
                                        dvV[0]["Name"].ToString().Replace("'",
                                        " ").Replace("(", " ").Replace(")", " ") + "</span><br/>";
            }

            theDate = dvE[0]["DateTimeStart"].ToString();
            RadToolTip newToolTip = new RadToolTip();

            newToolTip.Text = "<div class='AddLink' style=\"width: 200px;color: #cccccc; font-weight: normal;\">" +
                "<div style=\"color: #1fb6e7; font-weight: bold; text-decoration: " +
                "underline; float: left; cursor: pointer;\" onclick=\"CloseWindow('" + "../" +
                                        eventLink + "');\">" +
                                        dvE[0][eventColumnTitle].ToString().Replace("'", " ").Replace("(",
                                        " ").Replace(")", " ") + "</div><br/>on "+theDate+"<br/>at " + venueStr + address + "</div>";

            newToolTip.TargetControlID = e.Appointment.ClientID;
            newToolTip.IsClientID = true;
            newToolTip.HideEvent = ToolTipHideEvent.ManualClose;
            newToolTip.Animation = ToolTipAnimation.None;
            newToolTip.Position = ToolTipPosition.MiddleRight;
            newToolTip.ShowEvent = ToolTipShowEvent.OnClick;
            newToolTip.Skin = "Black";
            newToolTip.ID = isGroup.ToString() + EID + reoccurrID;
            ToolTipPanel.Controls.Add(newToolTip);
            if (Session["SelectToolTip"] != null)
            {
                if (Session["SelectToolTip"].ToString() == isGroup.ToString() + EID + reoccurrID)
                {
                    newToolTip.Show();
                    Session["SelectToolTip"] = null;
                }
            }
        }
        catch (Exception ex)
        {
            ErrorLabel.Text = ex.ToString();
        }
    }