jQuery(function($) {
	$.footnoteLinks();
	$('.projects #content .aside')
		.append( $('<a class="prev">&uarr; Prev</a>') )
		.append( $('<a class="next">&darr; More</a>') )
	var api = $('.projects #content .aside .scrollable')
	  .scrollable({
			next: '.aside .next', 
	    prev: '.aside .prev',
			loop: true,
	    vertical:true,
			size: 10,
			api: true
		});

	$('.projects #content .aside .scrollable .items > div').each(function (index, domEle) {
		if ($(this).is(".active")) {
	  	api.setPage(parseInt(parseFloat(index)/10));
			return false;
		}
	});

	if ( $('#content .figure:first img').length > 1 ) {
		$('#content .figure:first')
			.append( $('<a id="prev" href=""></a>').click(function(){return false;}) )
			.append( $('<a id="next" href=""></a>').click(function(){return false;}) )
			.cycle({
				timeout:       8000,  // milliseconds between slide transitions (0 to disable auto advance) 
			  speed:         1000,  // speed of the transition (any valid fx speed value) 
			  next:          '#next',  // id of element to use as click trigger for next slide 
			  prev:          '#prev',  // id of element to use as click trigger for previous slide 
			  height:       '283px', // container height 
			  sync:          1,     // true if in/out transitions should occur simultaneously 
			  pause:         true,     // true to enable "pause on hover" 
			  slideExpr:     'img'  // expression for selecting slides (if something other than all children is required)     
			});
	};
});