$(function() {
	$("a[rel=external]").attr("target", "_blank");

	if(!location.href.match(/^http/)){
		$("a[href$='/']").not("a[href^='http']").each( function(){
			$(this).attr('href', $(this).attr('href') + 'index.html');
		});
		$("a[href*='/#']").not("a[href^='http'],a[href$='.html']").each( function(){
			var n = $(this).attr('href').lastIndexOf("/#") + 1;
			$(this).attr('href', $(this).attr('href').substring(0, n) + 'index.html' + $(this).attr('href').substring(n));
		});
	}
});


