loadNews = function() {
    var timer = setInterval(showDiv, 15000);
    var counter = 2;

    $('#news-1').show();
    $('#news-2').hide();
    $('#news-3').hide();
    $('li.news-preview-tab a:first').addClass('active');
    $('li.news-preview-tab a').click(function() {
        var lastTabView = $('.active').attr('href');
        var currentTabView = $(this).attr('href');
        clearInterval(timer);
        timer = setInterval(showDiv, 15000);
        $(lastTabView).fadeOut('fast',
                               function() {
                                    $(currentTabView).fadeTo('slow', 1);
                                });
        $('li.news-preview-tab a').removeClass('active');
        $(this).addClass('active');
    	counter = parseInt($(this).attr('id').substring(6)) + 1;
    });

    function showDiv() {
    	news_nr = $(".news-preview-tab").size();
	if (counter == news_nr + 1)
	    counter = 1;
	$('#entry-' + counter).click()
    } 
}

