$(document).ready(function() {	
	//NEW WINDOWS
	$("a[href*='http://']:not([href*='"+location.hostname+"'])").attr("target","_blank");
});

/* -------------------------------------- */
/*                 SLIDESHOW              */
/* -------------------------------------- */
//ADAPTED FROM http://jonraasch.com/blog/a-simple-jquery-slideshow
function slideSwitch() {
	//SET CURRENT
	var $active = ($('.active').length) ? $('.active') : $('.slideshow img.slide').first();
	$active.fadeIn(1500);
	$('.last').fadeOut(1500);
	
	//CHECK FOR CLASS TO LOOP OR JUST ONCE
	if ($active.attr('src')  == $('.slideshow img.slide').last().attr('src')) {
		if ($('.slideshow').hasClass('once')) {
			clearInterval(slideshowtimer);
		} else {
			//SET NEXT
			$('.slideshow img.slide').first().removeClass('last').addClass('active');
			$active.removeClass('active').addClass('last');
		}
	} else {
		//SET NEXT
		$active.next().removeClass('last').addClass('active');
		$active.removeClass('active').addClass('last');
	}

	//SET SLIDESHOW TO VISIBLE, REALLY ONLY THE FIRST TIME
	$('.slideshow img.slide').css('visibility','visible');
}
