// qAccordion for JQuery by CSantos (csantos@quilogy.com) 2009-nov-18 Bookmarkable accordion with Google Analytics
(function($){$.fn.extend({qAccordion:function(options){var opts=$.extend({},$.fn.qAccordion.defaults,options);return this.each(function(){$.each($(this).find('>li>div'),function(){$(this).hide();});$.each($(this).find('>li>a'),function(){$(this).click(function(e){activate(e.target);if(opts.setHash=='true'){location.hash=this.hash;};if(opts.pageTracker=='true'&&typeof(pageTracker)!='undefined'&&typeof(pageTracker._trackPageview)=='function'&&$(this).attr('rel')!=''){pageTracker._trackPageview($(this).attr('rel'));};return false;});});if(location.hash){var active=$(this).find('a[href='+location.hash+']')[0];if(active){activate(active);};};function activate(el){while($(el)&&$(el).get(0).tagName.toLowerCase()!='a'){el=$(el).parent();};$(el)['parent']('li').siblings().children('div').slideUp(opts.hideSpeed);$(el).siblings('div').slideToggle(opts.speed);$(el)['parent']('li').toggleClass(opts.activeClass).siblings().removeClass(opts.activeClass);}});}});$.fn.qAccordion.defaults={activeClass:'active',speed:'normal',hideSpeed:'normal',setHash:'false',pageTracker:'false'};})(jQuery);
