public function setAjax($flag) {
        $this->_ajax = $flag;
        $class = $this->getAttrib('class');
        if ($flag && !preg_match('/(^|\s)ajax($|\s)/', $class)) {
            $class .= ' ajax';
        } else {
            $class = preg_replace('/(^|\s)(ajax)($|\s)/', '$1$3', $class);
        }
        $this->setAttrib('class', $class);
        return $this;
    }