$(document).ready(function() {
	var root = $("div.projectScroll").scrollable({
		size: 1
		,clickable: false
		,speed: 700
		,prev: '#leftProjectScrollArrow'
		,next: '#rightProjectScrollArrow'
	})
	//.circular()
	// setup api
	window.api = root.scrollable();
	//api.setPage(0);
	var idx = 1;
	$("#currentPageNum").html(idx);
	$("#numPages").html(api.getPageAmount());
	captionText = $(".item:eq(0) .captionHidden").html();
	$("#captionContainer").html(captionText);
	api.onBeforeSeek(function() 
		{ 
			prevIdx = this.getPageIndex(); 
		});
	api.onSeek(function()
		{
			curIdx = api.getPageIndex();
			//numPages = api.getPageAmount();
			$("#numPages").html(api.getPageAmount());
			if (curIdx > prevIdx)
			{
				idx++;
			}
			else if (curIdx < prevIdx)
			{
				idx--;
			}
			$("#currentPageNum").html(idx);
			captionText = $(".item:eq(" + api.getPageIndex() + ") .captionHidden").html();
			$("#captionContainer").html(captionText);
		})
		$('a#coleyFlash').nyroModal({
			width: 510,
			height: 380,
			minWidth: 510,
			minHeight: 380,
			resizable: false
		});
		$('a#mrichFlash').nyroModal({
			width: 901,
			height: 375,
			minWidth: 900,
			minHeight: 369,
			resizable: false
		});
		$('a#alsFlash').nyroModal({
			width: 786,
			height: 495,
			minWidth: 784,
			minHeight: 480,
			resizable: false
		});
		$('a#unicaBrandFlash').nyroModal({
			width: 853,
			height: 484,
			minWidth: 852,
			minHeight: 479,
			resizable: false
		});
		$('a#lionFlash').nyroModal({
			width: 721,
			height: 235,
			minWidth: 720,
			minHeight: 230,
			resizable: false
		});
		$('a#shawmutAdvantageFlash').nyroModal({
			width: 751,
			height: 405,
			minWidth: 750,
			minHeight: 400,
			resizable: false
		});
		$('a#communicoFlash').nyroModal({
			width: 701,
			height: 415,
			minWidth: 700,
			minHeight: 410,
			resizable: false
		});
});

