function pageNearBottom() {
	if ($(window).scrollTop() + $(window).height() > $(document).height() - $('#footer').height()) {
		return true;
	} else {
		return false;
	}
}

$(function() {
	$('.newProductsSlider div:first').show();
	
    setInterval(function(){
      $('.newProductsSlider div:first-child').fadeOut('slow')
         .next('.newProductsSliderElement:first').fadeIn('slow')
         .end().appendTo('.newProductsSlider');}, 
      3000);
});

function slideSwitch() {
	
	$('#beeld img').css('visibility', 'visible');
    var $active = $('#beeld img.active');

    if ( $active.length == 0 ) $active = $('#beeld img:last');

    var $next =  $active.next().length ? $active.next() : $('#beeld img:first');

    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 2500, function() {
            $active.removeClass('active last-active');
        });
}

$(function() {
	if($('#beeld img').length > 1)
	{
		setInterval( "slideSwitch()", 5000 );
	}
	
	$('#logo').click(function(){
		location.href = $('base:first').attr('href');
	});
});
