// introduce some variables we need in the global scope for all functions
var aElm;

if (document.createElement && document.getElementsByTagName && document.getElementById) {
    function addEventSimple(obj,evt,fn) {
        if (obj.addEventListener)
            obj.addEventListener(evt,fn,false);
        else if (obj.attachEvent)
            obj.attachEvent('on'+evt,fn);
    }
    addEventSimple(window,'load',setEvent);
}

function setEvent() {
    var aContainer = document.getElementById('nieuwsbrievenOverzicht');
    var aList = aContainer.getElementsByTagName('a');
    for (i=0;i<aList.length;i++) {
        aElm = aList[i];
        aElm.onclick = popup;
    }
}
function popup(e) {
    var thisElm = this;
    var newWindow = window.open(thisElm,'popupNieuwsbrief','width=870,height=660,scrollbars=yes,resizable=yes');
    if (window.focus) {
        newWindow.focus()
    }
    if (e && e.preventDefault) {
        // W3C standard
        e.preventDefault();
    }
    else {
        e = window.event;
        //  Microsoft’s way
        e.returnValue = false;
    }
}
