(function($){ 
     $.fn.extend({  
         accordion: function() {       
            return this.each(function() {
				if($(this).data('accordiated'))
					return false;									
				$.each($(this).find('.accordion, .accordionItem>.accordionContentWrap'), function(){
					$(this).data('accordiated', true);
					$(this).hide();					
				});
				
				$.each($(this).find('a'), function(){					
					$(this).click(function(e){
						activate(e.target);
						return void(0);
					});
				});
				
				$.each($(this).find('a .event_type'), function(){					
					$(this).click(function(e){
						$(this).parent().click();
					});
				});
				
				var active = false;
				if(location.hash)
					active = $(this).find('a[href=' + location.hash + ']')[0];
				
				if(active){
					activate(active, 'toggle','parents');
					$(active).parents().show();
				}
				
				function activate(el,effect,parents){
					$(el)[(parents || 'parent')]('.accordionItem').toggleClass('active').siblings().removeClass('active').children('.accordion, .accordionContentWrap').slideUp('fast');
					$(el).siblings('.accordion, .accordionContentWrap')[(effect || 'slideToggle')]((!effect)?'fast':null);
				}
				
				// show item upon page load
				if ($('.accordionItem').is('.active')) {
				}else{
					$('.showFirst').show();
					$('.showFirst').parent().addClass('active');
					active = true;
				 }
				
            });
        } 
    }); 
})(jQuery);