Event.observe(window, 'load', init, false);

function init() {
  $('BodyBatteryHeartRate').focus();
  if ($('calc_now_button')) {
    Event.observe('calc_now_button', 'click', show_progress, false);
  }
}


function show_progress() {
 
  $('calc_now_button').hide();
  $('calculating').style.display='block';
  new PeriodicalExecuter(calc_now,4);

}


function calc_now() {
  $('body_battery_form').submit();
}
