/***********
  visual.js
 ***********

Certain tricks, such as the common 'target="_blank"' to open pages in new
windows, are not valid XHTML 1.0.  The visInit() function is meant to
enable such features without sacrificing the validity of the original markup.

*/

function hasClass(element, className)
{
    var regexp = new RegExp("(^|\\s)" + className + "(\\s|$)");
    return regexp.test(element.className);
}

function visInit()
{
    var links = document.getElementsByTagName('A');
    for( var i=0; i < links.length; i++ )
    {
        if( hasClass( links[i], "externalLink" ) )
            links[i].setAttribute( "target", "_blank" );
    }
}

