// ALL SCRIPTS THAT RUN ON PAGE LOAD
function setup() {
	
	// OUTBOUND LINKS OPEN IN A NEW WINDOW UNLESS EXPLICITLY TOLD OTHERWISE
	// FORCE SAME WINDOW: rel="self" in anchor
	// FORCE EXTERNAL WINDOW: rel="external" in anchor
	var domain = window.location+'';
	domain = domain.replace('//','');
	domain = domain.substring(domain.indexOf(':')+1,domain.indexOf('/'));
	if (!document.getElementsByTagName) return;
	var anchors = document.getElementsByTagName("a");
	for (var i=0; i<anchors.length; i++) {
		var URL = anchors[i].href;
		if ((URL.search(domain)===-1 && URL.search('http')!==-1 && anchors[i].rel !== 'self') || anchors[i].rel === 'external') anchors[i].target = "_blank";
	}
}

window.onload = setup;
