// qAccordion for JQuery by CSantos (carmela.santos@aspect.com) 2010-may-22 Bookmarkable accordion with Google Analytics asynchronous script support
(function($){$.fn.extend({qAccordion:function(options){var opts=$.extend({},$.fn.qAccordion.defaults,options);return this.each(function(){$.each($(this).find('>li '+opts.tabcontent),function(){$(this).hide();});$.each($(this).find('>li '+opts.tablink),function(){$(this).click(function(e){activate(e.target);if(opts.setHash=='true'){location.hash=this.hash;};if(opts.pageTracker=='true'&&typeof(_gaq)!='undefined'&&typeof(_gaq.push)=='function'&&$(this).attr('rel')!=''){_gaq.push(['_trackEvent',opts.pageTrackerCategory,'View',$(this).attr('rel')]);};opts.onAfterClick.call(this);return false;});});if(location.hash){var active=$(this).find('a[href='+location.hash+']')[0];if(active){activate(active);};};function activate(el){if($(el).attr('tagName').toLowerCase()!='a'){el=$(el).closest('a');};var listItem=$(el).closest('li');$(listItem).siblings().children(opts.tabcontent).slideUp(opts.hideSpeed);$(listItem).children(opts.tabcontent).slideToggle(opts.speed);$(listItem).toggleClass(opts.activeClass).siblings().removeClass(opts.activeClass);}});}});$.fn.qAccordion.defaults={activeClass:'active',speed:'normal',hideSpeed:'normal',setHash:'false',pageTracker:'false',pageTrackerCategory:'accordion',tabcontent:'div',tablink:'a',onAfterClick:function(){}};})(jQuery);
