/**
 * Created by JetBrains PhpStorm.
 * User: codesign
 * Date: 4/26/11
 * Time: 10:16 AM
 * To change this template use File | Settings | File Templates.
 */
function accordian(answer, question) {
    if (!answer.length && !question.length) {
        return;
    }
    answer.hide();
    question.click(function() {
        question.removeClass("current");
        answer.not(":hidden").slideUp('slow');
        var current = $(this);
        $(this).next().not(":visible").slideDown('slow', function() {
            current.addClass("current");
        });
    });
}

function accordianCalculator(answer, question) {

//    question.toggleClass("active").next().slideToggle("slow");
    question.toggleClass("active");
    sbheight = $('#deinpreis').height();
    $('#sidebar .sbdeinpreis').height(sbheight);
    return false;
}

$(document).ready(function() {
    accordian($("dl.faqlist dd"), $("dl.faqlist dt"));

//    accordian($("#calculator #rebatetable table"), $("#calculator #rebatetable h3"));
//    $("#calculator #rebatetable table").hide();
//    $("#calculator #rebatetable table").addClass("invisible");
});


