function linked_callout(class_name) {
/*  class_name = 'linked-callout';*/
/*  var items = document.getElementsByClassName(class_name);*/
  var items = $$('.'+class_name)
  items.each(function(item) {
    Event.observe(item,'mouseover',function() {
      Element.addClassName(this,class_name+"-hover");
    }.bind(item));
    Event.observe(item,'mouseout',function() {
      Element.removeClassName(this,class_name+"-hover");
    }.bind(item));
    Event.observe(item,'click',function(event) {
      var link = this.getElementsByTagName('a')[0];
      if (link.getAttribute('rel') == 'external') {
        window.open(link.href);
        Event.stop(event);
      } else {
        window.location = link.href;
      }
    }.bind(item));
  });
}

Event.observe(window, 'load', function() {
  linked_callout('linked-callout-full');
  linked_callout('linked-callout-medium');
  linked_callout('linked-callout-slim');
  linked_callout('linked-callout-inline');
});
