/**
  * Delte a user group
  *
  */
 function DoDeleteusergroup()
 {
     //get a complete comma seperated list form id's ( database )
     $ids = JRequest::getVar('ids', '');
     $this->Filter($ids);
     $ids_a = explode(';', $ids);
     //create a array of ids
     $id = -1;
     //check what delete button is clicked
     foreach ($ids_a as $entryid) {
         $button = "delete_button_{$entryid}";
         if (isset($_REQUEST[$button])) {
             //we found the correct group
             $id = $entryid;
             break;
         }
     }
     if ($id == -1) {
         //something wrong
         $this->errorHandler->Alert(JText::_('BYJG_INTERNAL_ERROR'));
     }
     //load group by id and than delete it
     $g = new ByJGGroup();
     $g->init($id);
     $g->delete();
     //reload sms user  groups
     $this->user->_groups->reload();
     ByJGRedirect($this->CreateRedirectUrl('usergroup'));
 }