$(document).ready(function () {
	//Mini Cog sprite animation using Spritely plugin
	$('#intCog').sprite({fps: 16, no_of_frames: 3});
	

	var slides = $('.slide');
	var contentWidth = $('.slide').width();
	var currentPosition = 0;

		slides.click(function (e) {
			currentPosition = $(this).index();

			//Move the arrow thing move to the right, the 50 is the margin between the slide divs
			$('#portArrow').animate({
				'marginLeft' :  (contentWidth + 42 ) * (currentPosition)
			}, 200);


			//Show or hide the 4 items below based on which slide is clicked
				$('.portContent').fadeOut().delay(500);
				$('.portContent').eq($(this).index()).fadeIn();	
		});
	
	
		//Give any external link a target of '_blank'			
		$("a[href^='http://']").attr("target","_blank");
});
