function onAfterRender()
 {
     $db = JFactory::getDBO();
     if (JFactory::getApplication()->isAdmin()) {
         return;
     }
     if (JFactory::getApplication()->getCfg('sef') == 0) {
         return;
     }
     if (JRequest::getVar('tmpl') == 'component') {
         return;
     }
     if (JRequest::getVar('format', 'html') != 'html') {
         return;
     }
     $body = JResponse::getBody();
     $doc = new DomDocument("1.0");
     $doc->loadHTML($body);
     $xpath = new DomXPath($doc);
     $hrefs = $xpath->query("//a");
     foreach ($hrefs as $href) {
         $link = $href->getAttribute('href');
         if (JFactory::getURI()->isInternal($link) == false) {
             continue;
         }
         $link = substr($link, 1);
         if ($this->params->get('raw')) {
             $origurl = JoomSEF::_createUri(new JURI($link));
         } else {
             $origurl = JoomSEF::getNonSEFURL($link);
         }
         if (strlen($origurl)) {
             $href->setAttribute('class', 'link_tip');
             $href->setAttribute('title', $origurl);
         }
     }
     $body = $doc->saveHTML();
     JResponse::setBody($body);
 }