$(function() {
    
    $(".banner-carousel").jCarouselLite({
		auto: 0,
    	speed: 1200,
		circular: true,
        btnGo: [".banner-nav .first", ".banner-nav .second", ".banner-nav .third"],
		afterEnd:  function(a) {
			var activeClass = $(a[0]).attr('class');
			activeBannerNav($(".banner-nav a."+activeClass));
		}
    });
	
	$(".banner-nav a").click(function() {
		activeBannerNav($(this));
	});
	
	$(".banner-nav li a").focus(function(){
		$(this).blur();
	});
	if ($('.tooltiplink').length > 0) {
		$('.tooltiplink').each(function() {
			var text= $(this).attr('rel');
			simpletooltip(text, $(this));
		});
	}

});

activeBannerNav = function(el) {
	var newActive = $(el).parent();							  
	$(".banner-nav li").each(function() {
		$(this).removeClass('active');								  
	}); 
	$(newActive).addClass('active');	
	
}

simpletooltip = function(text, el) {
	$(el).simpletip({
		content: text,
		fixed: false,
		offset: [18,0],
		showEffect: "none",
		hideEffect: "none"
	})
	
}


