$(document).ready(function() {


var api = $("div.scrollable").scrollable({
		size: 1,
		easing: 'swing',
		speed: 1,
		vertical: true,
		item: '.item'
		}).navigator({
			globalNav: true,
			navi: '.scrollnav',
			indexed: true,
			api: true
			});


	api.onStart(function() {
		api.getConf().speed = 1000;

		return false;
	});
	
	var active = $('input#activemonth').val();
	api.move(active-1);
	
	api.onSeek(function() { 
		//beim laden höhe anpassen animiert
		var divid = this.getPageIndex()+1; 
		var height = $('#markttermine_'+divid).height()+3;
		$('div.scrollable').animate({ height : height + 'px' }, 1000);
	});

	if($("div.scroll").length){
	var gal = $("div.scroll").scrollable({
		size: 1,
		easing: 'swing',
		speed: 1500,
		items: '.galitems',
		item: '.galimg',
		loop: true
		
		}).circular({api: true});
		// register a callback function 
		gal.onStart(function() { 
		 gal.getConf().clickable = false;
		 gal.getConf().item = '.dddd';
		 return false;
		});
		gal.onSeek(function() { 
		 gal.getConf().clickable = true;
		 gal.getConf().item = '.galimg';
		 return false;
		});	}

});

