
var mapToggler = Class.create();
mapToggler.prototype = {
  status: null,
  map: null,
  id: null,
  active: null,
  duration: null,
  initialize: function(id){
    this.map = $(id);
    this.status = !(this.map.getStyle('display')=='none');
    this.id = id;
    this.active = true;
    this.duration = 1.0;
  },
  toggle: function(){
    if (this.active) {
      if(this.status){
        //this.map.setStyle({display:'none'});
        this.active = false;
        Effect.SlideUp(this.id, { duration: this.duration, afterFinishInternal: function(effect) {
            effect.element.hide().undoClipping();
            this.active = true;
            $('map_holder').setStyle({display:'none'});
            $('select_arrow').removeClassName('open');
          }.bind(this)
        });
        this.status = false;
      }else{
        this.active = false;
        $('map_holder').setStyle({display:'block'});
        Effect.SlideDown(this.id, { duration: this.duration, afterFinishInternal: function(effect) {
            effect.element.undoClipping();
            this.active = true;
            $('select_arrow').addClassName('open');
          }.bind(this)
        });
        //this.map.setStyle({display:'block'});
        this.status = true;
      }
    }
  }
};
