function ovShow() {
    jQuery(this).children("div.overview_details").slideDown(180);
}
function ovHide() {
    jQuery(this).children("div.overview_details").slideUp(180);
}
function navShow() {
    jQuery(this).children("ul").slideDown(180);
}
function navHide() {
    jQuery(this).children("ul").slideUp(180);
}
function widgetOn() {
    jQuery('#widget-homepage li').removeClass('active');
    jQuery(this).addClass('active');
}
function widgetOut() {
}

jQuery( function() {

// Homepage
    jQuery("#widget-homepage li:first").addClass('active');
    jQuery("#widget-homepage li").hover(widgetOn, widgetOut);

// Homepage - IE6 needs a gentle push with a school bus.
    if (typeof document.body.style.maxHeight === "undefined") {
        jQuery('#widget-homepage li.active > img').css('display','block');
        jQuery("#widget-homepage li").hover(function(){
            jQuery('#widget-homepage li > img').hide();
            jQuery(this).children('img').show();
        });
    }

// First child workaround for IE
    if (jQuery.browser.msie) {
        jQuery('#navigation li:first').addClass('first_child');
        jQuery('.columns .column:first').addClass('first_child');
    }

// Forgot password slide-in
    jQuery("a#forgot_password").click( function() {
        jQuery("div#password_form").show(250);
    });

// Main Navigation
    // Disable non-js pulldown hover to avoid flicker
    jQuery("#navigation li").children("ul").hide();
    // Navigation menu pulley
    jQuery("#navigation li").hoverIntent(navShow,navHide);


// Table styles
    jQuery("table.table_default tbody tr:even").addClass("even");

// Search page
    jQuery("div.overview_details").hide();
    jQuery("div.overview_wide").hoverIntent(ovShow, ovHide);

    jQuery("div.filter_item_body li label").click( function() {
        jQuery(this).addClass('altered');
    });

    jQuery("#filter span[title]").each( function()
    {
        jQuery(this).tooltip({
            position: "top center",
            relative: true,
            predelay: 375,
            tip: "#tooltip",
            onBeforeShow: function() {
                var title = this.getTrigger().data('title');
                jQuery('#tooltip').empty().text(title);
            }
        });
    });
} );

Cufon.replace('h2.column_title, #newsletter_container legend, #nieuwsbrief legend, #sitemap h3');

var container;

jQuery('#footer a[rel]').hoverIntent(function() {
    container = jQuery(this).attr('rel');
    jQuery(container).fadeIn(250);
}, function() {});

jQuery('#footer a[rel]').click(function(e) {
    e.preventDefault();
    container = jQuery(this).attr('rel');
    jQuery(container).fadeIn(250);
});

jQuery('#newsletter_close').click(function() {
    jQuery(container).fadeOut(250);
});

// Send form (footer)
jQuery('#newsletter_container .button_ok').click(function(e) {
    e.preventDefault();

    jQuery.post(jQuery(container).find("form").attr('action'), {
        email: jQuery('#nieuwsbrief_email').val()
    }, function(data) {
        if(data.success == "true") {
            jQuery('#newsletter_container .form_field').hide();
            jQuery('#newsletter_container .error_field').hide();
            jQuery('#newsletter_container .success_field').show();
            //jQuery(container).fadeOut(250);
        } else {
            jQuery('#newsletter_container .error_field').show();
        }
    }, 'json');
});