function ToggleTabs() {

	this.block = false;
	this.linksContainer = false;

	this.classSelected = 'button select';
	this.classNotSelected = 'button';
}

ToggleTabs.prototype.AttachObject = function(blockId, oClick) {

	this.linksContainer = $(oClick).parent();
	this.block = $('#' + blockId).get(0);

	if(!this.block || !this.linksContainer)
		return false;

	return true;
}

ToggleTabs.prototype.Load = function(blockId, oClick, id, oType, type, tab) {

	if(!this.AttachObject(blockId, oClick))
		return false;

	$(this.block).load('/php/get_tab.php', {
		id: id,
		object_type: oType,
		content_type: type,
		tab: tab
	}, function() {
		oToggleTabs.ChangeTabStyle(oClick);
	});

	return false;
}

ToggleTabs.prototype.ChangeTabStyle = function(oClick) {

	$('li', $(this.block).parent()).each(function() {
		// пропускаем пустой li
		if(!$('span.hidden', this).length)
			$(this).attr('class', oClick == this ? 'select' : '');
	});

}