/*
 * jquery email antispam
 * Written 2007 by sunfish
 */
 
function mail(a,b) {
	parent.location = 'mailto:'+a+'@'+b;
	return false;
} 

$(document).ready(function(){		

		// email adress antispam - needs jquery
		// eg. write in html info<span> |at| </span>naturkooperation.org
	$("#content p:contains('| at |'),td:contains('| at |')").each(function(){
		//alert($(this).html());
		var filter = /([a-zA-Z0-9_\.\-]+)(<span> \| at \| <\/span>)([a-zA-Z0-9_\-\.]+\.[a-zA-Z]{2,3})/ig;
		var link = "<a onclick=\"mail('$1','$3')\" class=\"email\">$1<span>@</span>$3</a>";
		$(this).html($(this).html().replace(filter, link));	
	});
	
	
   $("#content a[href$=.pdf]").addClass("pdf");
	
		// open external links with target _blank	
	$("#content a[href$=.pdf], #content a[href^=http]").click(function(){ 																		 
		this.target = "_blank";
	});	
	
								
});