﻿Cufon.replace('#introtekst h1, #introtekst h2, .eyecatcher h2, .newsitem .titel, .paginatitel, #subtopmenucontainer #subtopmenu', { fontFamily: 'SchulbuchNord' });

$(document).ready(function () {
    $('.buttonBehavior').css({ "cursor": "pointer" });
    $('.buttonBehavior').click(function () {
        window.location = $("a:first", this).attr("href");
    });

    $('#menu li:not(ul li ul li)').hover(function () {
        if ($(this).hasClass('active')) {
        } else {
            $('a:first', this).css({ "background-color": "#191819" });
            $('#menu .active a:first').css({ "background-color": "#e10808" });
        }

        $('ul', this).css({ "display": "block" });
    }, function () {
        if ($(this).hasClass('active')) {
        } else {
            $('a:not(ul li ul li a)', this).css({ "background-color": "#e10808" });
            $('#menu .active a:not(ul li ul li a)').css({ "background-color": "#191819" });
        }

        $('ul', this).css({ "display": "none" });
    });

    $('#menu li:not(ul li ul li)').each(function () {
        if ($('ul', this).size() > 0) {
            $('a:not(ul li ul li a)', this).append('<img src="images/menudownarrow.png" alt="" />');
        }
    });

    if ($('#backgroundcontainer div.images img').size() > 1) {
        $('#backgroundcontainer div.images').cycle({
            fx: 'fade',
            timeout: 6000
        });
    }

    var taalisopen = true
    $('#currentlang').click(function () {
        if (taalisopen == true) {
            $('#langselector').fadeIn('fast');
            taalisopen = false;
        }
        else {
            $('#langselector').fadeOut('fast');
            taalisopen = true;
        }
    }); 

});

$(window).load(function () {
    $('.newsimg').each(function () {
        if ($(this).width() > $('.newsitem').width()) {
            $(this).css({ "width": $('.newsitem').width() + "px", "height": "auto" });
        }
    });
});
