Toggler = Class.create(Abstract, {
	initialize: function (container, options) {
	
		this.container = $(container);
		
		this.options = Object.extend({
			togglerClassName: 	'toggle',
			contentClassName: 	'content',
			duration: 			0.3
			}, options || {})
	
		this.container.select('.' + this.options.contentClassName).invoke('hide');		
		this.container.select('.' + this.options.togglerClassName).invoke('observe', 'click', this.click.bind(this));	
		},
		
	click: function (event) {
		event.stop();		
		var toggler = event.findElement('.' + this.options.togglerClassName);
		
		var content = toggler.next('.' + this.options.contentClassName);
	
		if (!this.running) {
			this.running = true;
			if (content.visible()) {
				new Effect.BlindUp(content, {	
					duration: 	this.options.duration,
					queue: 		'end',
					afterFinish: this.stop.bind(this)
					})							
				} else {
					new Effect.BlindDown(content, {	
						duration: 	this.options.duration,
						queue: 		'end',
						afterFinish: this.stop.bind(this)
						})				
					}
			}
		},
		
	stop: function () {
		this.running = false;
		}
	});