/*
 * jQuery accordion plugin
 *
 * Fier Concept & Design B.V. Utrecht
 * Auteur: G. Stevens
 *
 * versie: 0.2 -  april 2010
 * 
*/

jQuery.fn.accordion = function(options) {
	var defaults = {	};  
	// Extend our default options with those provided.
	var opts = jQuery.extend(defaults, options);
	
	// Make all of the answer sections hide when the DOM is ready
	jQuery(this).find(".item").hide();
	// Toggle answer section click event
    jQuery(this).find("h3").click(function() {
		// Icons
		 if (jQuery(this).next('div.item').is(':hidden')) 
			jQuery(this)
				.find('img')
				.attr('src', 'images/icon_acc_close.png');
		else
			jQuery(this).find('img')
				.attr('src', 'images/icon_acc_open.png'); 									  
				
		 // Slide effect							 
		 jQuery(this).next('div.item').slideToggle('fast')
			.siblings('div:visible').slideUp('fast');		 	
		 
		 jQuery(this).siblings('.open').find('img').attr('src', 'images/icon_acc_open.png');		 		 
		 
		 // Color of H3
		 jQuery(this).addClass('open')
			.siblings('.open').removeClass('open');
    });
}
