$(document).ready(function() { 
    
    //Lettertype van het menu en de sitemap in de footer vervangen
    Cufon.replace('ul#main-nav li a');
    Cufon.replace('#footer-nav > li > a');
    
    //Nieuwsberichten op de homepage even hoog maken, zodat de border mooi doorloopt.
    var highestCol = Math.max($('#nieuws .column:nth-child(1)').height(),$('#nieuws .column:nth-child(2)').height());
    $('#nieuws .column').height(highestCol);
    
    //Linker- en rechterkolom even hoog maken, zodat de border mooi doorloopt.
    var highestCol = Math.max($('#left-col').height(),$('#right-col').height());
    $('#left-col').height(highestCol);
    
    $('#nieuwsbrief-form_formCheck').val(Website.Config.sSwisFormCheck);
    
    $("#email").clearDefault();
    $("#instelling").clearDefault();
    $("#search-input").clearDefault();
    $("#search-input-large").clearDefault();
    
});

(function($){
    $.fn.clearDefault = function(){
        return this.each(function(){
            var default_value = $(this).val();
            $(this).focus(function(){
                if ($(this).val() == default_value){ 
                    $(this).val("");
                    $(this).css({
                        color: '#231F20',
                        fontStyle: 'normal'
                    });
                }
            });
            $(this).blur(function(){
                if ($(this).val() == ""){
                      $(this).val(default_value);  
                      $(this).css({
                        color: '#8F8F8F',
                        fontStyle: 'italic'
                    });
                }
                else{
                    $(this).css({
                        color: '#231F20',
                        fontStyle: 'normal'
                    });    
                } 
                
            });
        });
    };
})(jQuery);
