// Case SlideDown  
            
	$("#btn_cases").click(function () {
			if ($("#cases").is(":hidden")) {
			    	$("#cases").slideDown("slow");
			} else {
				$("#cases").slideUp();
				}
	});

// Case button

$(document).ready(function() {
    
    var images = [];
    
    images[0] = "img/btn_cases.png";
    images[1] = "img/btn_cases_ro.png";
    
    var loop;
    var i = 0;
        
        var image = this;
        loop = setInterval(function() {
            if (i < images.length - 1) {
                i++;
                $("#btn_cases").attr('src',images[i]);
            } else {
                i = 0;
                $("#btn_cases").attr('src',images[i]);
            }
        }, 2000);
    
});

// Empty input fields onclick

jQuery.fn.extend({
    emptyonclick: function(options) {
        return this.each(function() {
            new jQuery.EmptyOnClick(this, options);
        });
    }
});

jQuery.EmptyOnClick = function(element, options) {
    var defaultValue = $(element).val();
    
    $(element)

.bind("focus", function(e) {
        if(defaultValue == $(this).val())
            $(this).val('');

    })

.bind("blur", function(e) {
        if(!$(this).val()) {
            $(this).val(defaultValue);
        }
    });

    $("form:has(#"+element.id+")")

.bind('reset', function(e) {
        $(element).val(defaultValue);
        $(element).removeClass(options.changeClass);
    }) 

.bind('submit', function(e) {
        if($(element).val() == defaultValue)
            $(element).val('');
    });
};

                $(document).ready(function(){ 
                    $('textarea').emptyonclick();  
                });

// Logo bar

            
$(function () {

var counter = 0,
sections = $('#logos1, #logos2');

	function showLogos () {
		sections.hide() 
			.filter(function (index) { return index == counter % 2; }) 
			.show('fast'); 

		counter++;
	}; 

	showLogos();   

	setInterval(function () {
		showLogos(); 
	}, 10 * 1000);  

});

// Header

function onBefore() { 
	
	    $('#banner span').html('<h1>' + this.title + '</h1>'+ '<p>' + this.alt + '</p><a href="producten">Lees verder</a>');
		$('#banner span').hide().fadeIn('slow');
		Cufon.replace('h1');     
     };

	$(document).ready(function() {
	
		$('#banner').cycle({
		slideExpr: 'img',
		fx:      'fade',
		startingSlide: 1, 
		speed:    7000, 
		before:  onBefore
		});
	
		
	});

