
/* - carousel.js - */
// http://www.servicestyrelsen.dk/portal_javascripts/carousel.js?original=1
jQuery(function($){var resizeCarousel=function(carousel,scrollable,elems){var base_height=Math.max.apply(null,$(elems).map(function(){return $(this).height()}).get());$(elems).height(base_height);var scrollable_height=$(elems).eq(0).outerHeight(true);$(scrollable).height(scrollable_height);var outer_height=$(scrollable).outerHeight(true)+$(".navi").outerHeight(true);var $carousel=$(carousel)};$(".toolBar").hide();var carousels=$(".carousel");carousels.each( function(i){var carousel=this;var scrollable=$(this).find(".scrollable").eq(0);var elems=$(scrollable).find('.tileItem');if(elems.length<2) $(scrollable).removeClass("scrollable");scrollable_width=$(scrollable).width();for(i=0;i<elems.length;i++){$(elems[i]).css({width:scrollable_width})};setTimeout(function(){resizeCarousel(carousel,scrollable,elems)},0);$(scrollable).find("img").load(function(event){resizeCarousel(carousel,scrollable,elems)})})
var ap=(carousels.length==1)?true:false;var api=$("div.scrollable").scrollable({size:1,clickable:false,circular:true,loop:true}).autoscroll({autoplay:ap,steps:1,interval:13000}).navigator({indexed:true,api:true});$(".carousel").hover(
function(){$(this).find(".toolBar").eq(0).slideToggle('fast').show()},
function(){$(this).find(".toolBar").eq(0).slideToggle('fast').hide()})})

