(function($) {
		  
	$.fn.toggler = function(o) {
		return this.each(function() {
			new $.toggler(this, o) ;
		}) ;
	} ;
	
	$.toggler = function (e, o) {
		o = o || {} ;
		this.speed = o.speed || 200 ; // durée en ms
		this.handler = $(e) ; // élément cliquable
		this.toggled = $('#'+o.id) ; // élément mouvant
		
		if (o.init == 'show')
		{
			this.handler.addClass('handler open') ;
			this.toggled.show() ;
		}
		else
		{
			this.handler.addClass('handler close') ;
			this.toggled.hide() ;
		}
		this.handler.click(function(ev) {
			ev.preventDefault() ;
			this.handler.toggleClass('open close') ;
			this.toggled.slideToggle(this.speed) ;
		}.bind(this)) ;
		
	} ;
	
	$.toggler.fn = $.toggler.prototype = {
        toggler: '1.0'
    } ;
	
 	$.toggler.fn.extend = $.toggler.extend = $.extend ;
	
})(jQuery) ;

