(function() {
  var newMethods = {
	  accordion : function(options) {
		var defaults = {
			start:0,
			inTime:500,
			outTIme:500
		};
		var options = $nfc.extend(defaults, options);
		var inTime = options.inTime;
		var outTime = options.outTime;
		var start = options.start;
		var obj = $nfc(this);
		var items = $nfc(".wrap h3.parent", obj);
		var contents = items.next();
		var current = start;
		var duringSlide = 0;
		contents.each(function(i) {
			$nfc(".inwrap", contents).eq(i).animate({ marginTop:-contents.eq(i).height()+'px', opacity:0}, 0);
		});
		$nfc(".inwrap", contents).eq(start).animate({ marginTop:0+'px', opacity:1}, inTime);
		items.eq(start).parent().addClass('active');
		items.hover(function() {
			var index = items.index($nfc(this));
			if(index != current) {
				if(duringSlide == 0) {
					duringSlide = 1;
					items.eq(index).parent().addClass('active');
					$nfc(".inwrap", contents).eq(index).animate({ marginTop:0+'px', opacity:1}, inTime);
					$nfc(".inwrap", contents).eq(current).animate({ marginTop:-contents.eq(current).height()+'px', opacity:0}, outTime);
					items.eq(current).parent().removeClass('active');
					current = index;
					setTimeout(function() {
						duringSlide = 0;
					}, inTime);
				}
			}
		}, function() {
		 
		 
		});
	  }
  };
  jQuery.each(newMethods, function(i) {
    jQuery.fn[i] = this;
  });
})();