// static
void LLInventoryView::toggleVisibility()
{
	S32 count = sActiveViews.count();
	if (0 == count)
	{
		showAgentInventory(TRUE);
	}
	else if (1 == count)
	{
		if (sActiveViews.get(0)->getVisible())
		{
			sActiveViews.get(0)->close();
			gSavedSettings.setBOOL("ShowInventory", FALSE);
		}
		else
		{
			showAgentInventory(TRUE);
		}
	}
	else
	{
		// With more than one open, we know at least one
		// is visible.

		// Close all the last one spawned.
		S32 last_index = sActiveViews.count() - 1;
		sActiveViews.get(last_index)->close();
	}
}
// static
void LLInventoryView::toggleVisibility()
{
	S32 count = sActiveViews.size();
	if (0 == count)
	{
		// We're using the inventory, possibly for the first time.
		LLFirstUse::useInventory();
		showAgentInventory(TRUE);
	}
	else if (1 == count)
	{
		if (sActiveViews.at(0)->getVisible())
		{
			sActiveViews.at(0)->close();
			gSavedSettings.setBOOL("ShowInventory", FALSE);
		}
		else
		{
			showAgentInventory(TRUE);
		}
	}
	else
	{
		// With more than one open, we know at least one
		// is visible.

		// Close all the last one spawned.
		S32 last_index = sActiveViews.size() - 1;
		sActiveViews.at(last_index)->close();
	}
}