  var $name = document.getElementById('$name');

  $name.addEventListener('changestate', function(event) {
    var message = '';

    switch (event.state) {
      case 'initial':
        message = 'Pull to refresh';
        break;
      case 'preaction':
        message = 'Release';
        break;
      case 'action':
        message = 'Loading...';
        break;
    }

    $name.innerHTML = message;
  });

  $name.onAction = function(done) {
    setTimeout($name_done, 1000);
  };


function $name_action() {



}
  
  
function $name_done (){



}