var wireExternalLinks = function () {
	$("a[href^=http]").each(function () {
		if($(this).attr('href').indexOf('http://' + location.hostname) != 0) {
			$(this).attr('target', '_blank');
		}
	});
	
	$('a[href$=.pdf]').each(function () {
		$(this).attr('target', '_blank');
	});
};

var wireTertiaryNavHoverEffects = function () {
	var	INDENT = 10,
			TRANSITION = 125;
			
	var animation = function (element, toggle_on) {
		element.animate({
			'padding-left': (toggle_on ? INDENT : 0)
		}, TRANSITION);
	};
	
	$('.tertiary.with-images li[class!=current]').hover(
		function () { animation($(this), true); }, // hover in
		function () { animation($(this), false); } // hover out
	);
};

$(document).ready(function() {
	wireExternalLinks();
	wireTertiaryNavHoverEffects();
});

