$(document).ready(function() {
    //MENU
    var navLiTotaal = $('ul.Nav > li').size();
    for (var i = 0; i < navLiTotaal; i++) {
        $('ul.Nav li').eq(i).addClass("listitem" + i);
    }
    //BROCHURES
    $('.brochureTopic h4').click(function() {
        var i = $('.brochureTopic h4').index(this);
        $('.brochureTopic .brochures').hide();
        $('.brochureTopic .brochures').eq(i).show();
        $('.brochureTopic h4').removeClass('active');
        $(this).addClass('active');
    });
    //FAQ
    $('.faq h4').click(function() {
        var i = $('.faq h4').index(this);
        $('.faq .faqAntwoord').hide();
        $('.faq .faqAntwoord').eq(i).show();
        $('.faq h4').removeClass('active');
        $(this).addClass('active');
    });
    //ZOEKVELD
    var defaultZoektext = ('Zoeken');
    $('.zoekveld').val(defaultZoektext);
    $('.zoekveld').focus(function() {
        var userInput = $(this).val();
        if (userInput == defaultZoektext) { $(this).val(''); }
    });
    $('.zoekveld').blur(function() {
        var userInput = $(this).val();
        if (userInput == '') { $(this).val(defaultZoektext); }
    });

    //FORMS

    $(".form input").labelify();

    //TellaFriend
    $('a.TellaFriend').click(function() {
        $(".ContentTellaFriend").toggle();
    });

    var tellaFriendSent = location.href.substring(location.href.lastIndexOf("#") + 1)
    if (tellaFriendSent != "" && tellaFriendSent == "TellaFriend")
        $(".ContentTellaFriend").show();

    //PRINT
    $('a.Print').click(function() {
        window.print();
        return false;
    });
});


function querySt(ji) {
    qs = window.location.search.substring(1);
    gy = qs.split("&");
    for (i = 0; i < gy.length; i++) {
        ft = gy[i].split("=");
        if (ft[0] == ji) {
            return ft[1];
        }
    }
}
