$(document).ready(function() {
	// redefine Cycle's updateActivePagerLink function 
	$.fn.cycle.updateActivePagerLink = function(pager, currSlideIndex) { 
	    $(pager).find('li').removeClass('activeLI').filter('li:eq('+currSlideIndex+')').addClass('activeLI'); 
	}; 

	//slideshow
	$('#slideshow').cycle({
	    fx: 'scrollLeft',
	    delay: 5000,
		speed: 300,
		pager: '#slidenav', 
	    pagerAnchorBuilder: function(idx, slide) { 
	        return '<li><a href="#"><span>'+idx+'</span></a></li>'; 
	    }
	});
	
	//open external links in new window
	$('a').each(function() {
		if ($(this).attr('rel') == 'external') $(this).attr('target', '_blank');
	});
});

