/**
  Dropdown navigation
  Author: Oli Matthews
**/
(function($){
  jQuery.fn.tagToggler = function(settings) {
    return this.each(function(){
      
      var metaBox = $(this);
      var toggler = metaBox.find('.tagToggler');
      var tags = metaBox.find('.tags');
      var tagState = 'closed';
      
      tags.slideUp();
      
      toggler.click(function(){
        if (tagState == 'closed') {
          tags.slideDown();
          $(this).addClass('tagOpen');
          tagState = 'open';
        } else {
          tags.slideUp();
          $(this).removeClass('tagOpen');
          tagState = 'closed';
        };
      });
      
      
      
    });
  };
})(jQuery);

jQuery(document).ready(function(){
  jQuery('.meta').tagToggler();
});