// Makes all links with rel=ext open in a new window
function makeExternalLinks() {

    if(document.getElementsByTagName) {

        var as = document.getElementsByTagName('a');

        for(var i=0;i < as.length; i++) {
           var thisTag = as[i];
            
           if(thisTag.getAttribute('href') && thisTag.getAttribute('rel') == "external") {
                
                thisTag.target = "_blank";
            }
            
            if(thisTag.getAttribute('href') && thisTag.getAttribute('rel') == "pop") {
                            
                            thisTag.href= "javascript:disclaimWin('http://miranda.hemscott.com/legal/cust_disclaim.htm')";
            }
        }
    }
}

// api_addEvent() 
// Gets around the problem of having multiple onload handlers
// http://www.onlinetools.org/articles/unobtrusivejavascript/chapter4.html
// http://www.quirksmode.org/js/events_advanced.html

function api_addEvent(obj, evType, fn) { 

    // W3C type of event registration model
    if (obj.addEventListener) { 
        obj.addEventListener(evType, fn, false); 
        return true; 

    // MS event registration model 
    } else if (obj.attachEvent) { 
        return obj.attachEvent("on"+evType, fn); 
    
    // Bad browsers that can't do either
    } else { 
        return false; 
    } 
}


api_addEvent(window, 'load', makeExternalLinks);


function disclaimWin(page) {
         OpenWin = this.open(page, "CtrlWindow", "toolbar=no,menubar=no,height=505,width=658,location=no,scrollbars=yes,resizable=no,status=no,left=100,top=100");
}