(function ($) {
	
	$.expandable = function (options) {
		return $(this).each(function(){
		    $.expandable.impl.init(this, options)
		});
	};
	
	$.fn.expandable = function (options) {
		return $(this).each(function(){
		    $.expandable.impl.init(this, options)
		});
	};
	
	/*
	 * expandable default options
	 */
	$.expandable.defaults = {
	};
	
	$.expandable.impl = {
		
		/*
		 * expandable options
		 */
		opts: null,
		
		/*
		 * expandable helper
		 */
		helper: {},
		
		/*
		 * Initialize the expandable
		 */
		init: function (expandable, options) {
            
            var self = this;
            
            self.opts = $.extend({}, $.expandable.defaults, options);
            
            self.helper = $(expandable);
            
            self.helper.find('.expandable-body')
                .css('display', 'none')
                ;
                
            self.helper.find('.expandable-title')
                .css('cursor', 'pointer')
                .click(function(e){
                    e.preventDefault();
                    
                    if (!$(this).hasClass('active'))
                    {
                        $(this).addClass('active');
                        $(this).siblings('.expandable-body').css('display', 'block');
                    }
                    else
                    {
                        $(this).removeClass('active');
                        $(this).siblings('.expandable-body').css('display', 'none');
                    }
                    
                })
                ;
            
			return this;
		},
		
		/*
		 * Bind events
		 */
		bindEvents: function () {
            
            
            
		    return;
		}
		
	};
})(jQuery);