protected void rbtnSelectType_SelectedIndexChanged(object sender, System.EventArgs e)
 {
     ResetState();
     //lbxSelectMessage.Items.Clear();
     switch (rbtnSelectType.SelectedValue)
     {
         case "group":
             try
             {
                 ddlMessageTarget.Items .Clear ();
                 ddlMessageTarget.Items .Add(new ListItem("--Select one--",zero));
                 int[] groupIDs = wrapper.ListGroupIDsWrapper();
                 Group[] groups=wrapper.GetGroupsWrapper(groupIDs);
                 foreach(Group gr in groups)
                 {
                     //if(!gr.groupName.EndsWith ("request"))
                     if ((gr.groupID > 0) && gr.GroupType.Equals(GroupType.REGULAR) && (!gr.groupName.Equals(Group.ROOT)) && (!gr.groupName.Equals(Group.SUPERUSER)) && (!gr.groupName.Equals(Group.NEWUSERGROUP)) && (!gr.groupName.Equals(Group.ORPHANEDGROUP)))
                         ddlMessageTarget.Items .Add(new ListItem(gr.groupName,gr.groupID.ToString()));
                 }
             }
             catch(Exception ex)
             {
                 string msg = "Exception: Cannot list groups. "+ex.Message+". "+ex.GetBaseException()+".";
                 lblResponse.Text = Utilities.FormatErrorMessage(msg);
                 lblResponse.Visible = true;
             }
             break;
         case "lab":
             try
             {
                 BrokerDB brokerDB = new BrokerDB();
                 ddlMessageTarget.Items .Clear ();
                 ddlMessageTarget.Items .Add(new ListItem("--Select one--",zero));
                 int[] labServerIDs = wrapper.ListLabServerIDsWrapper();
                 DbParameter param = FactoryDB.CreateParameter("@typeMask", ProcessAgentType.AgentType.LAB_SERVER,DbType.Int32);
                 IntTag[] labServers = brokerDB.GetIntTags("GetProcessAgentTagsByTypeMask", param);
                 foreach(IntTag ls in labServers)
                 {
                     if (ls.id > 0)
                         ddlMessageTarget.Items .Add(new ListItem(ls.tag,ls.id.ToString()));
                 }
             }
             catch(Exception ex)
             {
                 string msg = "Exception: Cannot list lab servers. "+ex.Message+"."+ex.GetBaseException()+".";
                 lblResponse.Text = Utilities.FormatErrorMessage(msg);
                 lblResponse.Visible = true;
             }
             break;
         case "system":
         {
             ddlMessageTarget.Items .Clear ();
             ddlMessageTarget.Items .Add("System");
             ddlMessageTarget.Items[0].Selected=true;
             BuildMsgListBox(SystemMessage.SYSTEM, 0, 0, 0);
         }
             break;
     }
 }