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

