
function ShowEmail(user, domain, anchor) {
	var OutText = '';
	OutText += '<a href="mailto:' + user + '@' + domain + '">';
	if (anchor != '') OutText += anchor;
	else OutText += user + '@' + domain;
	OutText  += '</a>';
	document.write(OutText);
}

function outside(user, domain, anchor) {
	var OutText = '';
	OutText += '<a href="http://' + user + '.' + domain + '" rel="external">';
	if (anchor != '') OutText += anchor;
	else OutText += user + '.' + domain;
	OutText  += '</a>';
	document.write(OutText);
}
	
function init() {
    createExternalLinks();
}

function createExternalLinks() {
    if(document.getElementsByTagName) {
        var anchors = document.getElementsByTagName('a');
        for(var i=0; i<anchors.length; i++) {
            var anchor = anchors[i];
            if(anchor.getAttribute("href") && anchor.getAttribute('rel')=='external') {
                anchor.target = '_blank';
                var title = anchor.title;
/*                var title = anchor.title + ' (opens in new window)'; */
                anchor.title = title;
            }
        }
    }
}

function addEvent(obj, evType, fn){
    if(obj.addEventListener){
        obj.addEventListener(evType, fn, false);
        return true;
    } else if (obj.attachEvent){
        var r = obj.attachEvent('on'+evType, fn);
        return r;
    } else {
        return false;
    }
}

addEvent(window, "load", init);
