How would i abstract this code to block clicks while any animation is active?

How would i abstract this code to block clicks while any animation is active?

I am using #cover to cover up the clickable divs while an animation is active.  Using  $("#cover").hide(); /  $("#cover").show();  It is working.  But I would like to do this for any animation that plays.  Is there a way to abstract this code for any animated div?

  1.         $(".clsStartUpNode").click(function() {
  2. $("#StartUpPosition div").not("#StartUpMainNode, #" + $divID).fadeOut(300); // fade out all starting nodes except center (CES) node
  3. $("#StartUpMainNode").stop().animate( {left:22}, function() { 
  4. $("#StartUpMainNode").hide();
  5. $("#NodeMain").show(); //after that finishes, fade in the main CES node
  6. });
  7. $("#" + $divID).stop().animate( {left:152, top: 145},  function() { 
  8. $("#" + $divID).hide();
  9. $("#NodeTwo").show(); //fade in the node clicked
  10. $.displaySubNodes($nodeID, 1)
  11. $("#cover").hide();
  12. });
  13. }  
  14. });
I have tried using :animated.  However, it only shows the cover div, and doesn't hide it once an animation completes.  it works in the code above because the hide code is in the animation callback.
  1. if ( $('div').is(':animated') ) {
  2. $('#cover').show();
  3. if( !$('div').is(':animated')){
  4. $("#cover").hide();
  5.         }
Thank you!