$(document).ready(function(){

    reportNS.getFlexApp = function(appName) {

        if (navigator.appName.indexOf ("Microsoft") !=-1) {

            return window[appName];

        }
        else {

            return document[appName];

        }

    }

    reportNS.refreshChart = function(idx)
    {

        $('._'+idx).siblings().removeClass('active');
        $('._'+idx).addClass('active');

    //    var idx2 = idx.toLowerCase();

        reportNS.getFlexApp('indexChart').odswiez(idx);
        reportNS.idChart = idx;

        $('._ispagLink').attr('href',reportNS.reportLink[idx]);

        if ( reportNS.idChart == 'WIG20' ) {

            $('#chartdesc').html('');

        } else {

            $('#chartdesc').html('Dane opóźnione o 15 minut');

        }

    }



    reportNS.idChart = 'WIG20';
    $('._'+reportNS.idChart).addClass('active');


    t = setTimeout("reportNS.refreshChart('"+reportNS.idChart+"')",60000);
    //    reportNS.checkIndexes();


    if ( reportNS.idChart == 'WIG20' ) {

        $('#chartdesc').html('');

    }

});

