//Slider
function slideSwitch() {
    var $active = $('#slider_container IMG.active');

    if ( $active.length == 0 ) $active = $('#slider_container IMG:last');

    var $next =  $active.next().length ? $active.next()
        : $('#slider_container IMG:first');

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

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

$(function() {
    setInterval( "slideSwitch()", 5000 );
});
////////////////////////
//Smooth Scrolling
$(document).ready(function() {
       $('#menu a').click(function(event) {
        event.preventDefault();
        var link = this;
        $.smoothScroll({
          scrollTarget: link.hash
        });
      });
       $('#intro a').click(function(event) {
        event.preventDefault();
        var link = this;
        $.smoothScroll({
          scrollTarget: link.hash
        });
      });
 });
/////////// 
//Dynamic link highlight
$(document).ready(function() {
	
	$('a.one').click(function(){
	$('a.one').removeClass('clicked');
	$(this).addClass('clicked');
	window.location = $(this).attr('href');
	});
});
///////////
///////////resize
function checkWindowSize() {
    var width = $(window).width(),
    new_class = width > 1800 ? 'large' :
                width > 1250 ? 'medium' :
                width > 0 ? 'small' : '';

    $('#kemperink-containter').removeClass('large medium small').addClass(new_class);
}

$(window).resize(checkWindowSize); 
$(document).ready(checkWindowSize);


