(function($) {

	function expand(obj,options){
	
		var self = this;
		
		if(options.autohide){
			$(obj).find('.expand').hide();
			if(options.autoshow_plus){
				var anchor = $(obj).find('a:first');
				$("<span />").html(" <strong>+</strong>").appendTo(anchor);
			}
		}
		
		$(obj).find('a:first').click(function(e){		
		
		var anchor = this;
		
		e.preventDefault();
		
		var expand = $(obj).find('.expand');	
		if(expand){
			$(expand).slideToggle('medium', function(){
				if(options.autoshow_plus){
					if($(this).is(':visible')){
						$(anchor).find('span').html(' <strong>-</strong>');
					}else{
						$(anchor).find('span').html(' <strong>+</strong>');
					}
				}
			});
		}
		
		});
		
	}

	$.fn.expand = function(options) {
	
		options = $.extend({
			element: null,
			select: null,
			autohide: true,
			autoshow_plus: true,
			method: 'next',
			target: 'p.hide_list',
		}, options);
		
			
		return this.each(function(){
			var obj = $(this);
			/* Plugin Code Here */
			expand(obj,options);
		});
		
	
	}
	
})(jQuery);

