(function($)
{
	var lofAccordionCount = 1;
	$.fn.lofAccordion = function(options)
	{
		var options = $.extend(
							{
								startIndex: 0,
								hiddenAll: false,
								duration:1000,
								interval: 1000,
								effect: 'easeInOutExpo',
								event: 'click', /*click | mouseover*/
							}, options);
		return this.each(function(){
			var lofAccordion = $(this);
			//$( lofAccordion ).find('.acc_container').hide(); /*Hide/close all containers*/
			if( !options.hiddenAll ){
				$( lofAccordion ).find('.acc_trigger').eq( options.startIndex ).addClass('active').next().slideDown( options.duration, options.effect ); /*Add "active" class to first trigger, then show/open the immediate next container*/
			}
			$( lofAccordion ).find('.acc_trigger').bind( options.event, function(){
				if( $(this).next().is(':hidden') ) { /*if immediate next container is closed...*/
					$('.acc_trigger').removeClass('active').next().slideUp( options.duration, options.effect ); /*Remove all "active" state and slide up the immediate next container*/
					$(this).toggleClass('active').next().slideDown( options.duration, options.effect ); /*Add "active" state to clicked trigger and slide down the immediate next container*/
				}
				else{
					$('.acc_trigger').removeClass('active').next().slideUp( options.duration, options.effect ); /*Remove all "active" state and slide up the immediate next container*/
				}
				return false; /*Prevent the browser jump to the link anchor*/
			});
			lofAccordionCount++;
		});
	}
})(jQuery);
		
