var FaqView = BaseView.extend({
    init: function(){
        this._super();
        this.current_faq = null;
        
        $('.box_text > p, .seta_txt').hide();
        $('.box_text h3 a').bind('click', $.proxy(this.on_click, this));
    },
    on_click: function(e){
        e.preventDefault();
        this.last_faq = this.current_faq;
        this.current_faq = $(e.currentTarget).parent().next();
        

        if(this.current_faq.hasClass('selected')){
            this.close();
        } else {
            this.close();
            this.animate();
            this.current_faq.addClass('selected');
        }
    },
    animate: function(){
        var h = this.current_faq.height();
        var el = this.current_faq;
        
        this.current_faq.slideDown(function(){
            $('.seta_txt', el).fadeIn();
        });
    },
    close: function(){
        if(this.last_faq === null) { return; }
        
        $('.box_text > p').slideUp().removeClass('selected');
        $('.seta_txt').hide();
        $('.box_text h3 a').removeClass('selected');
    }
});
