$(window).load(function() {
    $(".featured").each(function(i) {
        $(this).delay(i * 800).fadeIn();
    });
});

$(document).ready(function() {

    if ($('h3.trigger').length > 0) {
        $('h3.trigger').click(function() {
            if ($(this).hasClass('open')) {
                $(this).removeClass('open');
                $(this).addClass('close');
                $(this).next().slideDown(1000);
                return false;
            } else {
                $(this).removeClass('close');
                $(this).addClass('open');
                $(this).next().slideUp(1000);
                return false;
            }
        });
    }

});

$(function() {

    $("nav.dropdown li").hover(function() {

        $(this).addClass("hover");
        $('ul:first', this).css('visibility', 'visible');

    }, function() {

        $(this).removeClass("hover");
        $('ul:first', this).css('visibility', 'hidden');

    });

    $("nav.dropdown li ul li:has(ul)").find("a:first").append(" È ");

});

$(document).ready(function() {
    $('.slideshow').cycle({
        fx: 'fade',
        random: true,
        cleartypeNoBg: true
    });
});

$(function() {
    $('a[rel*=external]').click(function() {
        window.open(this.href);
        return false;
    });
});

$(document).ready(function() {
    $("#contact_form").validationEngine('attach');
});
