$.fn.dtab = function() {
	var _as = this.find('a');

	if (_as.length == 0)
		return this;

	this.addClass('dtab');
	_as.bind('dtabHide', function() {
		$(this).removeClass('active');
		$($(this).attr('href')).hide();
	}).focus(function() {
		$(this).blur();
	}).click(function() {
		$(this).addClass('active');
		$($(this).attr('href')).show();
		_as.not($(this)).trigger('dtabHide');
		return false;
	}).each(function() {
		$($(this).attr('href')).addClass('dtab-contents');
	});

	$(_as.get(0)).click();
	return this;
}

