$(document).ready(function() {

	$('#billboard').before('<div id="slide-nav">').cycle({
	    fx: 'fade',
	    pager: '#slide-nav',
	    pause: 1,
	    speed: 600,
	    timeout: 8000
	});

	// Add a .before class to the element previous to .here
	$('#side-nav').find('.here').prev().addClass('before');

	// Open external links in new window
	var a = new RegExp('/' + window.location.host + '/');
	$('a').each(function() {
	   if(!a.test(this.href)) {
	       $(this).click(function(event) {
	           event.preventDefault();
	           event.stopPropagation();
	           window.open(this.href, '_blank');
	       });
	   }
	});

	 $("table#lodges").tablesorter({ sortList: [[1,0]] });

}); // end doc ready
