/*
 * STARTUP SCRIPTS 
 */
 
// Initialize on document ready
$(function() {
	// Boilerplate carousel
	$('.carousel').each(function () {
		var c = new netr.Carousel($(this), {
			itemsPerPage: 1,
			startPage: 0,
			addPager: true,
			// item parameter is first item of page
			pagerFormat: function (carousel, pageIndex, item) {
				return '<a href="' + item.find('a:first').attr('href') + '"><span>' + item.find('img:first').attr('alt') + '</span></a>';
			},
			showPageCounter: false,
			callbacks: {}
		});
		// Vertically center navigation
		c.elements.container.css('minheight', c.elements.nav.outerHeight());
		c.elements.nav.css('top', Math.max(0, (c.elements.container.height() - c.elements.nav.outerHeight()) / 2));
		
	});
});
