
/* - nospam.js - */
function parseMailAdresses() {
	if (!document.getElementsByTagName) return;
	var allTags = new Array();
	allTags = document.getElementsByTagName('a');
	for (i = 0; i < allTags.length; i++) { 
		if (allTags[i].className == 'mail') {
			var view = allTags[i].innerHTML;
			view = view.replace(/[ ]*DOT[ ]*/g, '.');
			view = view.replace(/[ ]*AT[ ]*/g, '@');
			allTags[i].firstChild.data = view;
			if (!allTags[i].getAttribute('href')) {
				var mailto = document.createAttribute('href');
				mailto.nodeValue = 'mailto:' + view;
				allTags[i].setAttributeNode(mailto);
			} else {
                                var mailto = allTags[i].getAttribute('href');                               
                                mailto = mailto.replace(/[ ]*DOT[ ]*/g, '.');
                                mailto = mailto.replace(/[ ]*AT[ ]*/g, '@');
                                allTags[i].setAttribute('href', mailto);
                        }
		} else if (allTags[i].className == 'mailicon') {
			var view = allTags[i].firstChild.data;
			view = view.replace(/[ ]*DOT[ ]*/g, '.');
			view = view.replace(/[ ]*AT[ ]*/g, '@');
                        if (!allTags[i].getAttribute('href')) {
				var mailto = document.createAttribute('href');
				mailto.nodeValue = 'mailto:' + view;
				allTags[i].setAttributeNode(mailto);
			}
                        var icon = document.createElement("img");
                        var iconsrc = document.createAttribute('src');
                        iconsrc.nodeValue = 'mail_icon2.gif';
                        icon.setAttributeNode(iconsrc);
                        var iconalt = document.createAttribute('alt');
                        iconalt.nodeValue = 'Mail icon';
                        icon.setAttributeNode(iconalt);
                        allTags[i].replaceChild(icon, allTags[i].firstChild);
                }
	}
} 
