$(document).ready(function(){
	$('a.external,a[href$=.pdf],a[href$=.doc]').attr('target','_blank'); /* add target="_blank" to pdf links & links with class external */
	window.makeMailLinks?makeMailLinks():null;
	$('.fadelink').click(function(){
	/*	window.alert('This is the part where the endorsement form shows. Coming soon!');*/
		var link = $(this).attr('href');
	 	$('#links, #footer, #content').fadeOut('slow',function(){
			$('#content').load(link,{ 'show': 'chunk' },function(){$('#content').fadeIn();});
			});
	 	//$('#content').fadeOut();
	 	
		return false;
			});
	});
/* <span class="email">x (at) x.com</span> becomes <a href="x@x.com">x@x.com</a> 
* this is an anti-spam measure
*/
function makeMailLinks(){
		$('span.email').each(function(){
			var theAddress = $(this).text().replace(/ \(at\) /, "@");
			$(this).replaceWith($('<a href="mailto:'+theAddress+'">'+theAddress+'</a>'));
			});
	}

