(function($){
	jQuery.fn.simpleaccordian = function(settings) {
		var s = jQuery.extend({
			speed: 300,
			startIndex: 0
		}, settings);
		
		
		return $(this).each(function(){
			var active = null;
			var inited = null;
			
			$(this).children().click(function(){
				$this = $(this);
				var ret = false;

				// if it's open, then let events bubble down to the links 
				if ($this.hasClass('active')){
					ret = true;
				}

				if (inited){
					$this.addClass('active').slideDown(s.speed);
				} else {
					$this.addClass('active').show();
				}
				$this.find('.top6_info').slideDown(s.speed);
				if (active && active.find('.num').text() != $this.find('.num').text()){
					active.removeClass('active');
					active.find('.top6_info').slideUp(s.speed);
				}
				active = $this;
				inited = true;
				return ret;
			});
			$(this).children().eq(s.startIndex).click();
			return this;
		});
	};
})(jQuery);

