if (typeof YHAccordion == 'undefined') {
var YHAccordion = function (
uid,
duration,
display,
trigger,
opacity,
alwaysHide,
initialDisplayFx
) {
this.uid = uid;
this.duration =duration;
this.display = display;
this.trigger = trigger;
this.opacity = opacity;
this.alwaysHide = alwaysHide;
this.initialDisplayFx = initialDisplayFx;

window.addEvent('domready', function() {
this.go();
}.bind(this));
return this;
};

YHAccordion.prototype.go = function () {
this.accordion = new Fx.Accordion (
   $$('#acWrapper_' + this.uid + ' .acToggle'), 
   $$('#acWrapper_' + this.uid + ' .acStretchOut'
  ), {
   duration:this.duration,
   display:this.display,
   trigger:this.trigger,
   opacity:this.opacity,
   alwaysHide:this.alwaysHide,
   initialDisplayFx:this.initialDisplayFx,
   onActive: function (el) {$(el).addClass ("active");},
   onBackground: function (el) {$(el).removeClass ("active");}
   });
};

YHAccordion.prototype.display = function (i) {
this.accordion.display (i);
}
}
