    $(window).load(function() {
        $('#slider').nivoSlider({
        effect: 'fade',
        directionNav: false,
        controlNav: false,
        pauseTime: 3000,
        pauseOnHover: false
        });
    });
    
    
    
    
    
$(document).ready(function() {


	if($('.AFcheck').attr('checked'))
	{
	$('#meer').show();
	}
  
  $('.meer').change(function() {
  
 		
 		if($('.AFcheck').attr('checked'))
 		{
 			$('#meer').slideDown();
 		} else
 		{
 			$('#meer').hide();
 		}
  
  })
  
  
  
   $('.resultaat h5').live('click', function () {
            if ($(this).hasClass('current')) {
                $(this).removeClass('current');
                $(this).parent().children('p').hide();
            } else {
            	
                $(this).addClass('current');
                $(this).parent().children('p').show();
            }
        });
   
   
   
   
if($('.zoeken').length){

    var options = {
      	serviceUrl: '/winkels/zoeken',
      	width: 300,
      	deferRequestBy: 0, //miliseconds
      	maxHeight:400,
      	width:580,
      	zIndex: 9999,
      	noCache: false //set to true, to disable caching
    };
		a1 = $('.zoekveld').autocomplete(options);
		
		
	
	
	
		$(".zoekveld").focus(function() {
	if( this.value == this.defaultValue ) {
		this.value = "";
	}
}).blur(function() {
	if( !this.value.length ) {
		this.value = this.defaultValue;
	}
});
	
	
		$('#submitZoek').click( function(e) {
		
		$waarde = $('.zoekveld').val();
		
		window.location.href = ("/winkels/"+$waarde);
		
		
		e.preventDefault()
		})
		
		
		
		
		
		
		
		
};



(function($){
 
    $.fn.shuffle = function() {
 
        var allElems = this.get(),
            getRandom = function(max) {
                return Math.floor(Math.random() * max);
            },
            shuffled = $.map(allElems, function(){
                var random = getRandom(allElems.length),
                    randEl = $(allElems[random]).clone(true)[0];
                allElems.splice(random, 1);
                return randEl;
           });
 
        this.each(function(i){
            $(this).replaceWith($(shuffled[i]));
        });
 
        return $(shuffled);
 
    };
 
})(jQuery);


$('#slider img').shuffle();
   
   
    
});
