$(document).ready(function() {
	var height = $("#item1").height();

	if (height < 248)
		height = 248;

	$("#flowpanes").animate({'height':  height}, 0);

	// select #flowplanes and make it scrollable. use circular and navigator plugins
	$("#flowpanes").scrollable({size: 1, onBeforeSeek: function(object, index){
		var newIndex = index + (index+1);
		
		if (newIndex > 5) {
			newIndex = 1;
		}

		var h = $("#item" + newIndex).height();
		if (h < 248) 
			h = 248;
		$("#flowpanes").animate({'height': h}, 400);
	}}).navigator({

		// select #flowtabs to be used as navigator
		navi: "#flowtabs",

		// select A tags inside the navigator to work as items (not direct children)
		naviItem: 'a',

		// assign "current" class name for the active A tag inside navigator
		activeClass: 'current'

	});
});
