Event.addBehavior({

  "li.thumbnail a:click" : function() {
    $$('li.thumbnail').invoke('removeClassName', 'current');
    this.up('li').addClassName('current');
    var selected_thumbnail_id = this.href.split('#')[1];
    $$('div.bio').invoke('hide');
    $(selected_thumbnail_id).show();
    return false;
  },
  
  "li.pain a:click" : function() {
    $$('li.pain').invoke('removeClassName', 'current');
    this.up('li').addClassName('current');
    var selected_thumbnail_id = this.href.split('#')[1];
    $$('div.pain_details').invoke('hide');
    $(selected_thumbnail_id).show();
    return false;
  }

});

Event.onReady(function() {
  if ($$('div.bio').first() && document.location.hash && $$(document.location.hash)) {
    $$('li.thumbnail').invoke('removeClassName', 'current');
    $$('div.bio').invoke('removeClassName', 'current');
    $$(document.location.hash).invoke('addClassName', 'current');
    $$(document.location.hash+"_thm").invoke('addClassName', 'current');
  }
  $$('div.pain_details').invoke('hide');
  $$('div.pain_details.current').invoke('show');
  $$('div.bio').invoke('hide');
  $$('div.bio.current').invoke('show');
});