QuickSale.Faqs = function(){
	var that;
	
	return {
		init: function(){
			that = this;
			jQuery('.faq_q a').each(function(i){
				var faqId = /faq_q_([0-9]+)/.exec(jQuery(this).attr('id'));
				if(faqId[1]){
					jQuery(this).click(function(){
						that.toggleAnswer(faqId[1]);
					});
				}
			});
		},
		
		toggleAnswer: function(aId){
			var targetAnswer = jQuery('#faq_a_'+aId);
			jQuery('.faq_a').each(function(i){
				if(jQuery(this).attr('id') != ('faq_a_'+aId) ){
					jQuery(this).slideUp("fast");
				}
			});
			if(targetAnswer.css('display') != 'none'){
				targetAnswer.slideUp("fast");
			} else {
				targetAnswer.slideDown("fast");
			}	
		}
	}
}();
