

<!--

// ustawienia dla libor
var k2Multichart_flash;
var k2Multichart_file = '/_xml/CHF3m.xml';
var k2Multichart_endDate = new Date();
 k2Multichart_endDate.setDate(k2Multichart_endDate.getDate()-1)
 k2Multichart_endDate = getLastWorkingDay(k2Multichart_endDate);
var k2Multichart_startDate = new Date(k2Multichart_endDate);
 k2Multichart_startDate.setDate(getLastWorkingDay(k2Multichart_endDate.getDate()-28));
// lokalnie nadpisywana funkcja (zobacz:open_chart.js)
function k2Multichart_chartIsReady(name) { 
  k2Multichart_flash = document.getElementById(name);
  window.setTimeout('k2Multichart_sendProperties(k2Multichart_startDate, k2Multichart_endDate, k2Multichart_file)',100);
  return true;
}
$(document).ready(function(){
 var selection1 = document.forms['currency-form'].elements['currency'];
 var selection2 = document.forms['currency-form'].elements['period'];
  selection1.selectedIndex = 0; // CHF
  selection2.selectedIndex = 2; // 3m

initDatePicker();
  $('#chart-btn').click(function () {
   document.forms['currency-form'].onsubmit = function () { return false; }
   var from = $('.picker-from input[name=show-from]').val();
   var to = $('.picker-to input[name=show-to]').val();
   if (!(from.length > 0))
   {
    alert('Proszę wybrać datę początkową.');
    return false;
   }
   if (!(to.length > 0))
   {
    alert('Proszę wybrać datę końcową.');
    return false;
   }
   var file = '/_xml/'+selection1[selection1.selectedIndex].value+selection2[selection2.selectedIndex].value+'.xml';
   
   k2Multichart_sendProperties(from,to,file);
   return false;
  })


// init table 
$('.rating-table').tablesorter();
 $('.rating-table').bind('sortStart',function() { 
    $('.rating-table tbody tr').removeAttr('class');
    });
 $('.rating-table').bind('sortEnd',function() { 
        $('.rating-table tbody tr:odd').addClass('even');
    }); 
$('.rating-table tbody tr').find('td:eq(1)').each(function () {
 $(this).addClass('selectable');
 $(this).click(function () {
  var s = $(this).text();
  for (var i = 0; selection1.length > i; i++) {
   if (selection1[i].text == s) { 
    selection1.selectedIndex = i;
    selection2.selectedIndex = 2;
    $('#chart-btn').click();
   }
  }
 })
})
 })
//-->

