protected function _renderStyle($style, $link, $attribs = array())
    {
        //get the correct URL
        if ($link) {
            $style = pick($this->getService('com:base.template.asset')->getURL($style), $style);
        }

        //if ajax try to get the content of the file
        if (AnRequest::type() == 'AJAX') {
            if ($link) {
                $file = $this->getService('com:base.template.asset')->getFilePath($style);
                if ($file) {
                    $style = file_get_contents($file);
                    $link = false;
                }
            }

            return parent::_renderStyle($style, $link, $attribs);
        }

        $document = AnService::get('anahita:document');

        if($link) {
            return $document->addStyleSheet($style, 'text/css', null, $attribs);
        } else {
            return $document->addStyleDeclaration($style);
        }
    }