﻿$(document).ready(function () {

    //Hide (Collapse) the toggle containers on load
    $(".toggle_cnt").hide();

    //Add an arrow-image to h2.trigger on horsensvandintranet and on FAQBoxes on horsensvand
    $("h2.trigger").addClass("triggerArrow");
    $(".horsensvand h2.faq").addClass("triggerArrow");

    //Switch the "Open" and "Close" state per click - for FAQContentBoxes
    $("h2.faq").click(function () {
        if ($(this).next('.toggle_cnt:visible').length > 0) {
            $(this).removeClass("active");
            $(this).next(".toggle_cnt").slideUp("fast");
        } else {
            $(this).parent().find('.active').removeClass("active");
            $(this).parent().find(".toggle_cnt").slideUp("fast");
            $(this).addClass("active");
            $(this).next(".toggle_cnt").slideDown("fast");
        }
        return false;
    });
});
