SalonShower = function(code) {
  this.code = code;
  
  this.codes = {
    ablock: 1,
    ldom: 2,
    vishn: 3,
    brysov: 4
  }    
}

SalonShower.prototype = {
  show: function() {
    this.getFlash().hide();
    this.getFakeTitle().effect('puff', { percent: 600 }, 1500, this.onShowSalon.createDelegate(this));
  },
  
  getFlash: function() {
    return $('.salon_flash', this.getEl());
  },
  
  getFakeTitle: function() {
    return $('.fake_title', this.getEl());
  },
  
  getSalonId: function() {
    return this.codes[this.code];
  },
  
  getEl: function() {
    return $('#salon_' + this.getSalonId());
  },
  
  onShowSalon: function() {
    location.href = '/salon/' + this.getSalonId() + '/';
  }
}

function show_salon(code) {
  var shower = new SalonShower(code);
  shower.show();
}
