} else {
            $session->set('shoutboxtries', '1');
        }
    }
    $rand1 = mt_rand(0, 10);
    $rand2 = mt_rand(0, 10);
    $total = intval($rand1 + $rand2);
    $mode = JRequest::getCmd('mode');
    if (!$ipaccess) {
        switch ($mode) {
            case 'addshout':
                if (empty($homepage)) {
                    echo $sbid;
                    modShoutboxHelper::addShout($sbid, $name, $url, $text, $tag, $delshouts, $user_calc, $user_Control, $params);
                }
                break;
            case 'delshout':
                if ($maydelete) {
                    modShoutboxHelper::delShout($shoutid);
                }
                break;
        }
        list($list, $lastid, $time) = modShoutboxHelper::getShouts($sbid, $shouts, $params);
    }
    //JHTML::_('behavior.mootools');
    $module_base = JURI::base() . 'modules/mod_shoutbox/';
    $doc =& JFactory::getDocument();
    $doc->addStyleSheet($module_base . 'css/mod_shoutbox.css');
    $doc->addScript($module_base . 'js/shoutbox.js');
    require JModuleHelper::getLayoutPath('mod_shoutbox');
}