/* -------------------------------------------------------------------

	Kunstmaan - LIJN
	UZ BRUSSEL
	
	This JavaScript file collects all general functions used
	throughout the site, as well as some smaller specific
	functions.

------------------------------------------------------------------- */

$(document).ready(function(){
//...
	$("#content .dienstenlijst .row div a.info").hover(function(){
		$(this).addClass("hover");},
		function(){
			$(this).removeClass("hover");
		});
	$(".consultation .what a").click(function(e){
		e.preventDefault();
		$(this).parent().parent().toggleClass("consulting");
		});
});

jQuery(function() {
    jQuery(".carousel").jCarouselLite({
        auto: 5000,
		speed: 1000,
		visible: 1,
		btnGo:
    [".externalControl .b1", ".externalControl .b2",
    ".externalControl .b3", ".externalControl .b4"],
	afterEnd: function(a){
		var ul = jQuery(this);
		var left = ul.css('left');
		left = left.substring(0, left.length - 2);
		left = parseInt(left);
		var liWidth = ul.children('li').css('width');
		liWidth = liWidth.substring(0, liWidth.length - 2);
		liWidth = parseInt(liWidth) + 18;
		var index = left/(-liWidth);
		var number = ul.children().size() -2;
		//if (index < 1) { index = number; }
		if (index > number) { index = 1; }
		var activeItem = index;
		jQuery("#banner_news_acts .externalControl button").removeClass("on");
		jQuery("#banner_news_acts .externalControl button.b"+activeItem).addClass('on');
		}
    });
});


