﻿$(document).ready(function() {
    $("#selectIndexChartDag").click(function() {
        SetQuoteChart($(this), 'today');
    });
    $("#selectIndexChartWeek").click(function() {
        SetQuoteChart($(this), 'week');
    });
    $("#selectIndexChartMaand").click(function() {
        SetQuoteChart($(this), 'month');
    });
    $("#selectIndexChartJaar").click(function() {
        SetQuoteChart($(this), 'year');
    });
    $("#selectIndexChart5Jaar").click(function() {
        SetQuoteChart($(this), '5year');
    });

    $("#toon_alle_fondsen").click(function() {
        $("#meer_fondsen").show();
        $("#toon_alle_fondsen").hide();
    });
});

// ================================================================================
// Summary : 
// ================================================================================
function SetQuoteChart(currentLi, period) {

    var url = $("#chartBaseUrl").val();
    var quoteId = $("#quoteId").val();

    $("#quoteChart")[0].src = url + "/ChartServer/chart.ashx?ctype=2&id=" + quoteId + "&daterange=" + period;

    currentLi.parent('li').siblings().removeClass('active');
    currentLi.parent('li').addClass('active');
}