private void helpNavigated(Document doc)
{
NodeList<Element> elements = doc.getElementsByTagName("a") ;
for (int i = 0; i < elements.getLength(); i++)
{
ElementEx a = (ElementEx) elements.getItem(i) ;
String href = a.getAttribute("href", 2) ;
if (href == null)
continue ;
if (href.contains(":") || href.endsWith(".pdf"))
{
// external links
AnchorElement aElement = a.cast();
aElement.setTarget("_blank") ;
}
else
{
// Internal links need to be handled in JavaScript so that
// they can participate in virtual session history. This
// won't have any effect for right-click > Show in New Window
// but that's a good thing.
a.setAttribute("onclick",
"window.parent.helpNavigate(this.href);return false") ;
}
}
String effectiveTitle = getDocTitle(doc);