function externalLinks()
{
	var hostname = window.location.hostname;
	var regularExCheck = new RegExp("^#|mailto:|(http|https)://" + hostname, "gi");
	var anchors = document.getElementsByTagName("a");	
	function check(obj){
		return (obj.className == "popup" || obj.className == "external" || (!obj.href.match(regularExCheck))) ? true : false;				
	}
	function set(obj){
		obj.target = "_blank";
		obj.className = "external";
		obj.title = (!obj.title ? obj.innerHTML + " (Externe link)" : obj.title + " (Externe link)");
	}
	for (var i=0;i<anchors.length;i++){
		if(check(anchors[i])){
			set(anchors[i]);
		}
	}
	function strpos (haystack, needle) {
		var i = (haystack+'').indexOf(needle,0);
		return i === -1 ? false : i;
	}
}

