$(document).ready(function(){

	/**
	 * external links
	 * http://blog.decaf.de/2010/01/mark-external-links-and-open-in-new-windowtab-jquery/
	 *
	 * filters href != hostname or rel="external"
	 * adds .external to elements not containing img, div or mailto
	 * opens external links in new window/tab
	**/

	$('a, area').filter(function() {
		return this.hostname && (this.hostname).split(":")[0] !== (location.hostname).split(":")[0] || $(this).attr('rel') == 'external';
	})
	.not(':has(img, div, mailto)')
	.addClass('external')
	.end()
	.click(function(e) {
		open(this.href); 
		e.preventDefault();
	});


	$('#pic-full').anythingSlider({
   height					: 350,
   width					: 350,
   animationTime  : 600,
   buildNavigation: false,
   buildArrows    : false,
   toggleControls : true,
   startStopped   : true
	});

	$('#pic-next').click(function(){
		$('#pic-full').data('AnythingSlider').goForward();
	});

	$('#pic-previous').click(function(){
		$('#pic-full').data('AnythingSlider').goBack();
	});

	$('#pic-slider-container').jCarouselLite({
		btnNext: '#pic-next',
		btnPrev: '#pic-previous',
		speed: 600,
		start: ($('#pic-full li').size())-3
  });	


  $('.references').css('overflow', 'hidden');
  $(".references").scrollable({ 
  	vertical: true,
  	disabledClass: 'vh',
  	prev: '#references-previous',
  	next: '#references-next' 
  });	

});
