/* Initialize cycle */
var cycle = {
	init: function() {
		jQuery(".teaser-gallery").each(function(gallery_index) {
			var gallery_id = "teaser-gallery-" + gallery_index;
			jQuery(this).attr("id", gallery_id);
			jQuery(this).find(".teaser-gallery-overview").cycle({ 
			    fx:      'fade', 
			    speed:    1500, 
			    timeout:  4000,
			    pager:  jQuery(this).find('.teaser-gallery-thumbs'),
			    pagerEvent: 'mouseover',
			    pauseOnPagerHover: true,
			    pagerAnchorBuilder: function(idx, slide) {
			        return '#' + gallery_id + ' .teaser-gallery-thumbs li:eq(' + idx + ') a'; 
			    }
			});			
		});
	}
};

jQuery(document).ready(function() {
	cycle.init();
});
