/* ----------------------------------------------- Author: Stuart Kaplan Usage: This file handles the user interactions for the About Us FAQ page. Last Updated: 03/04/2008 ------------------------------------------------ */ /** * @classDescription aboutUsFaq_class * @constructor */ function aboutUsFaq_class() { this.init(); } /** * @method init */ aboutUsFaq_class.prototype.init = function() { this.activeItem = null; this.items = WSDOM.Element.parseSelector('DIV.questionAndAnswer'); this.attachEvents(); } /** * @method attachEvents */ aboutUsFaq_class.prototype.attachEvents = function() { if (this.items) { for (var i = 0; i < this.items.length; i++) { WSDOM.Events.add( { element: this.items[i], context: this, type: 'click', handler: this.showOrHideAnswer } ); } } } /** * @method showOrHideAnswer */ aboutUsFaq_class.prototype.showOrHideAnswer = function(e, el) { el.blur(); // Otherwise, Firefox will put the focus back on the e.cancel(); if (WSDOM.Element.hasClass(el, 'active')) { WSDOM.Element.removeClass(el, 'active'); } else { if (this.activeItem) { WSDOM.Element.removeClass(this.activeItem, 'active'); } WSDOM.Element.addClass(el, 'active'); this.activeItem = el; } } var aboutUsJS = new aboutUsFaq_class();