/**
 * @author Gregor Aisch, Dave Gööck, Christian Zozmann
 * @publisher webvariants GbR
 * @website http://www.webvariants.de/
 * @contact info - webvariants - de
 * 
 * This script uses the prototype xor jQuery library. It must be loaded before this file is loaded.
 * You can find prototype from http://www.prototypejs.org/
 * and jquery at http://jquery.com/
 */

function replaceMailToLink(e){
	var a = document.createElement('a');
	for (var c=0; c<e.childNodes.length; c++) 
			if (e.childNodes[c].nodeType == 3) a.innerHTML += e.childNodes[c].nodeValue;
	a.href = 'mailto:'+a.innerHTML;
	e.parentNode.replaceChild(a, e);
}

if (typeof jQuery!="undefined") {
	$(document).ready(function() {
		$('span.mapson').mouseover(function() {
			replaceMailToLink(this);
		});
	});
}
else if (typeof Prototype!="undefined") {
	document.observe('dom:loaded', function() {
		$$('span.mapson').each(function(e) {
			e.observe('mouseover', function(event) {
				replaceMailToLink(e);
			})
		});		
	});
}
