title: How to reset setTimeout
body: <p>i have this action after click:</p>
  
  <pre><code>  remote_top.on('click',function(){
          if (program_changer_block.css('display','block')){
              var g_timer = null;
              clearTimeout(g_timer);
              setTimeout(function(){
                  program_changer_block.fadeOut();
              }, 5100);
          }
          else if (program_changer_block.css('display','none')){
              setTimeout(function(){
                  program_changer_block.fadeIn();
              }, 300);
          }
     });
  </code></pre>
  
  <p>What i'm trying to do is clear timeout after each click. Now after some fast clicks my blocks hide after 5100ms calculated from the first click. How to restart this timeout after each click? Something is wrong, can you help me?</p>