var ProvniceHider = Class.create(
{
  initialize: function(el)
  {
    this.element = $(el);
    this.detail = this.element.next('.branches');
    this.element = this.element.wrap(new Element('a', {'class': 'province_link', href: ""}));

    this.element.observe('click', this.onClick.bindAsEventListener(this));
    this.detail.hide();
  },

  onClick: function(event)
  {
    this.detail.toggle();
    event.stop();
  }
});

document.observe('dom:loaded', function() {
  $$('h3.province').each(function(el) {
    new ProvniceHider(el);
  });
});

