$("#betakorr").change(function () {
    $("#betakorr option:selected").each(function () {
        relid = $(this).attr('value');
        $("tr.korrlist").hide();
        $("tr.betalist").hide();
        $("#korr_" + relid + "").show();
        $("#beta_" + relid + "").show()
    })
}).trigger('change');
$("#outperformance").change(function () {
    $("#outperformance option:selected").each(function () {
        relid = $(this).attr('value');
        $("tr[rel='outperformances']").hide();
        $("#" + relid + "").show()
    })
}).trigger('change');
$('.Termintab').hover(function () {
    $(this).css({
        color: '#1876b3'
    })
}, function () {
    $(this).css({
        color: '#555'
    })
});
$("#TabUntTer").click(function () {
    $("#TabUntTer").css({
        "background-position": "0 0px"
    });
    $("#TabAllTer").css({
        "background-position": "-185px 0px"
    });
    $('#UntTerDiv').html($('#SpeicherDiv').html())
});
$("#TabAllTer").click(function () {
    $("#TabUntTer").css({
        "background-position": "0 -21px"
    });
    $("#TabAllTer").css({
        "background-position": "-185px -21px"
    });
    $('#SpeicherDiv').html($('#UntTerDiv').html());
    $('#UntTerDiv').html($('#AlleTermineDiv').html())
});
$(".CalButton").click(function () {
    $(".datepicker").datepicker('show')
});
$("#wocDiscount tr:odd").addClass("odd");
$("#privacy").removeClass();
$(".woceyecatcher #firstName,.cfd_leadform #firstName,.woceyecatcher #lastName,.cfd_leadform #lastName,.woceyecatcher #street,.cfd_leadform #street,.woceyecatcher #zipcode,.cfd_leadform #zipcode,.woceyecatcher #city,.cfd_leadform #city,.woceyecatcher #phone,.cfd_leadform #phone,.woceyecatcher #email,.cfd_leadform #email,.search-form .dsValue,.simple .dsValue").fieldtag();
$("#morerow > td, #lessrow > td").css({
    'border-bottom': 'none'
});
$("#moredatabutton").click(function () {
    $("#moreinfo, #realinfo, .hidewocs, #wocbutton").removeClass("hidden");
    $("#wocwaitbutton").removeClass("wocwaiting");
    $("#moredatabutton, #vorabinfo, #wocloadform").addClass("hidden");
    $("#zuklappen").css("display", "block");
    bn.checkpos();
    bn_wocform_cookie(1)
});
$("#zuklappen").click(function () {
    $("#moreinfo, #realinfo").addClass("hidden");
    $("#moredatabutton, #vorabinfo").removeClass("hidden");
    $("#zuklappen").css("display", "none");
    bn.checkpos();
    bn_wocform_cookie(0)
});
$("#outperformance").change(function () {
    $("#outperformance option:selected").each(function () {
        relid = $(this).attr('value');
        $("tr[rel=outperformances]").hide();
        $("#" + relid + "").show()
    })
}).trigger('change');
$("#outperformance").change(function () {
    $("#outperformance option:selected").each(function () {
        relid = $(this).attr('value');
        $("tr[rel='outperformances']").hide();
        $("#" + relid + "").show();
        $("#" + relid + " td.title").text('Outperformance (in %)')
    })
}).trigger('change');
$('#explanation2').addClass('hidden');
$('#explanation1').removeClass('hidden');
$('#explless').removeClass('hidden');
$('#explmore').click(function () {
    $('#explanation1').addClass('hidden');
    $('#explanation2').removeClass('hidden')
});
$('#explless').click(function () {
    $('#explanation2').addClass('hidden');
    $('#explanation1').removeClass('hidden')
});
$("#nameFigure1,#nameFigure2,#nameFigure3").live('change', function () {
    if ($(this).attr("id") == "nameFigure1") {
        var disableOption = $("#nameFigure1 option:selected").attr("value");
        $("#nameFigure2 option:disabled,#nameFigure3 option:disabled").removeAttr("disabled");
        $("#nameFigure2 option[value=" + disableOption + "],#nameFigure3 option[value=" + disableOption + "]").attr('disabled', 'disabled')
    } else if ($(this).attr("id") == "nameFigure2") {
        var disableOption = $("#nameFigure2 option:selected").attr("value");
        $("#nameFigure1 option:disabled,#nameFigure3 option:disabled").removeAttr("disabled");
        $("#nameFigure1 option[value=" + disableOption + "],#nameFigure3 option[value=" + disableOption + "]").attr('disabled', 'disabled')
    } else {
        var disableOption = $("#nameFigure3 option:selected").attr("value");
        $("#nameFigure1 option:disabled,#nameFigure2 option:disabled").attr("disabled", "disabled");
        $("#nameFigure1 option[value=" + disableOption + "],#nameFigure2 option[value=" + disableOption + "]").attr("disabled", "disabled")
    }
}).trigger('change');
$(".switch").live('click', function () {
    $(".searchCategories").toggle()
});
