void LLFloaterAvatarPicker::chkcards()
{
	if(init_cards == FALSE)
	{
		LLPanel* active_panel = childGetVisibleTab("ResidentChooserTabs");

		if(active_panel == getChild<LLPanel>("CallingCardsPanel"))
		{
			init_cards = TRUE;
			/*<inventory_panel allow_multi_select="false" border="true" bottom_delta="-117"
			     follows="left|top|right|bottom" height="110" left="10" mouse_opaque="true"
			     name="InventoryPanel" sort_order="AvatarPickerSortOrder" width="115" />*/
			LLRect rect = active_panel->getRect();
			rect.mLeft += 10;
			rect.setLeftTopAndSize(rect.mLeft,rect.mTop,rect.getWidth(),110);
			LLInventoryPanel* panel = new LLInventoryPanel("InventoryPanel", "AvatarPickerSortOrder",
								 rect, &gInventory,
								 FALSE, active_panel);
			panel->setFollowsAll();
			panel->reshape(rect.getWidth(), rect.getHeight());
			panel->postBuild();
			active_panel->addChild(panel);
			LLInventoryPanel* inventory_panel = getChild<LLInventoryPanel>("InventoryPanel");
			inventory_panel->setFilterTypes(0x1 << LLInventoryType::IT_CALLINGCARD);
			inventory_panel->setFollowsAll();
			inventory_panel->setShowFolderState(LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS);
			inventory_panel->openDefaultFolderForType(LLAssetType::AT_CALLINGCARD);
			inventory_panel->setSelectCallback(LLFloaterAvatarPicker::onCallingCardSelectionChange, this);
		}
	}
}
LLView* LLInventoryPanel::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory)
{
	LLInventoryPanel* panel;

	std::string name("inventory_panel");
	node->getAttributeString("name", name);

	BOOL allow_multi_select = TRUE;
	node->getAttributeBOOL("allow_multi_select", allow_multi_select);

	LLRect rect;
	createRect(node, rect, parent, LLRect());

	std::string sort_order(INHERIT_SORT_ORDER);
	node->getAttributeString("sort_order", sort_order);

	panel = new LLInventoryPanel(name, sort_order,
								 rect, &gInventory,
								 allow_multi_select, parent);

	panel->initFromXML(node, parent);

	panel->postBuild();

	return panel;
}