/* Standards compliant new window opening, courtesy of Kevin Yank
 * at SitePoint.  
 * http://www.sitepoint.com/article/standards-compliant-world/
 */

function open_new_windows() {
    /* If our browser doesn't support our features, do nothing. */

    if ( !document.getElementsByTagName ) { return; }

    var anchors = document.getElementsByTagName('a');

    for (var i=0; i < anchors.length; i++) {

        var anchor = anchors[i];

        if ( 
            anchor.getAttribute("href") &&
            anchor.getAttribute("class") == "new_window"
        ) {
            anchor.target = "_blank";
        }
    }
}

/* Schedule our code to run when the page finishes loading */

var oldOnLoad=window.onload;

if (typeof window.onload != 'function') {
    window.onload = function() { open_new_windows(); };
}
else{
    window.onload = function() { oldOnLoad(); open_new_windows(); };
}
