/**	 
 *
 * Usage:
 *
 *	 // Init element with slideshow, using the default options.
 *	 $(selector).slideshow({assets: asset_object}, height: 420);
 *
 */
(function($) {

	/*
		Constants
	*/
	
	PLUGIN_NAME = 'accordion';	// TODO: Rename this plugin!
	standard_width = 80;
	active_width = 295;

	/*
		Private methods
	*/
	
	function resize($this, el) {
		$($this).children("li").each(function() {
			if (this === el) {
				$(this).animate({'width': active_width});
			} else {
				$(this).animate({'width': standard_width});
			}
		})
	}
	
	function createInteractions($this) {
		$($this).children("li").each(function() {
			$(this).hover(function() {
				resize($this, this);
			})
		});
	};

	/*
		Public methods
	*/

	var publicMethods = {
		init: function(options) {return this.each(function() {
			var opts  = $.extend({}, $.fn[PLUGIN_NAME].defaults, options);
			var $this = $(this);
					
			var data  = $this.data(PLUGIN_NAME);
			if (!data) {
				$this.data(PLUGIN_NAME, {
					opts : opts
				});
			};
			
			createInteractions($this);
			
		})}

	};

	/*
		Initialization
	*/
	
	$.fn[PLUGIN_NAME] = function(method) {
		if (publicMethods[method]) {
			return publicMethods[method].apply(
				this,
				Array.prototype.slice.call(arguments, 1)
			);
		}
		else if (typeof method == 'object' || !method) {
			return publicMethods.init.apply(this, arguments);
		}
		else {
			$.error('Method ' + method + ' does not exist on jQuery.' + PLUGIN_NAME);
		}
	};

	/*
		Default optsion
	*/
	
	$.fn[PLUGIN_NAME].defaults = {
	};
})(jQuery);
