//BEG external link redirect
//finds any link that is leaving the site and handles it appropriately; for now it just makes it open in a blank page but this leaves room for expansion later.
$(function(){	
	$('a').each(function(){
		var thisRef = $(this).attr('href');				 
		
		//cludge
		if(!thisRef) return;
		
		//external link, just open in a new page
		if(thisRef.substr(0,1) != '/' && thisRef.substr(0,1) != '#' && thisRef.substr(0,24) != 'http://www.stratcom.mil/'){
			$(this).attr('target','_blank');
			return;
		}
		//if not linking to a file
		if(thisRef.substr(thisRef.length-4,1) == '.'){
			return;
		}
	});
	
	//remove links to the current page in the content area
	var thisLoc = location.href.substr(23);
	$('#bt_content_container').find('a').each(function(){
		if($(this).attr('href') == thisLoc){
			$(this).replaceWith($(this).html());
		}												   
	});
});
//END external link redirect