local TraceFrame = DEFAULT_CHAT_FRAME;

DBCS_debug = 0;	-- 2 pour le debug 0 pour les clients

DBCS_extract_nb_max = 100000;	--95000;	--85000;	--80000;	--75000;	--70000;

local DBCS_corps_screen_wow_build;
local DBCS_corps_screen_wow_build_live = 13623;

_, DBCS_corps_screen_wow_build, _, _ = GetBuildInfo();
DBCS_corps_screen_wow_build = tonumber(DBCS_corps_screen_wow_build);

--Texture:SetRotation(angle [,cx, cy]) - This is simply a shorthand for the appropriate 8 argument SetTexCoord rotation (in C++ so it's fast) 
--?? = GetUnitPitch("unit") 
--?? = GetUnitSpeed("unit") 

--	local race, fileName = UnitRace(unit);

--/script DBcorps_ListMob_Envoyer_vers_cms();

--/script DBcorpsFrame.SetTop = 0
--/script DBcorpsFrame.SetPoint("CENTER",0,0);
--/script DEFAULT_CHAT_FRAME:AddMessage(DBcorpsFrame:GetTop());

--/script DBcorps_ListObjets_inconnu_ds_DBmobs_Update();
--/script DBcorps_ListObjets_inconnu_ds_DBquetes_Update();

--DBCORPS_SUBFRAMES = { "DBcorpsFrame_MobsFrame", "DBcorpsFrame_ObjetsFrame", "DBcorpsFrame_MobFrame", "DBcorpsFrame_ObjetFrame", "DBcorpsFrame_QuetesFrame", "DBcorpsFrame_ConnaissanceBeteFrame", "DBcorpsFrame_Suivi" };
if ( DBCS_prog_serveur == 0 ) then
	DBCORPS_SUBFRAMES = { "DBcorpsFrame_MobsFrame", "DBcorpsFrame_ObjetsFrame", "DBcorpsFrame_MobFrame", "DBcorpsFrame_ObjetFrame", "DBcorpsFrame_QuetesFrame", "DBcorpsFrame_Quetes2Frame", "DBcorpsFrame_ConnaissanceBeteFrame", "DBcorpsFrame_SuiviFrame", "DBcorpsFrame_HDVFrame", "DBcorpsFrame_HDV_stats_Frame", "DBcorpsFrame_PNJFrame", "DBcorpsFrame_HDV_histo_Frame" };
else
	DBCORPS_SUBFRAMES = { "DBcorpsFrame_MobsFrame", "DBcorpsFrame_ObjetsFrame", "DBcorpsFrame_MobFrame", "DBcorpsFrame_ObjetFrame", "DBcorpsFrame_QuetesFrame", "DBcorpsFrame_Quetes2Frame", "DBcorpsFrame_ConnaissanceBeteFrame", "DBcorpsFrame_SuiviFrame", "DBcorpsFrame_HDVFrame", "DBcorpsFrame_HDV_stats_Frame", "DBcorpsFrame_PNJFrame", "DBCS_spell_frFR_Frame_SpellsFrame", "DBcorpsFrame_HDV_histo_Frame" };
end

DBCORPS_SCREEN_LOADED = 0;

DBCORPS_MOBS_LISTE = {};
DBCORPS_MOBS_LISTE_nb = 0;
DBCORPS_MOBS_LISTE_ordre = "salaire";
DBCORPS_MOBS_LISTE_sens = "DESC";
DBCORPS_MOBS_TRI = nil;
DBCORPS_MOBS_TypeRegion_select = nil;

DBCORPS_OBJETS_LISTE = {};
DBCORPS_OBJETS_LISTE_nb = 0;
DBCORPS_OBJETS_LISTE_ordre = "rarity";
--DBCORPS_OBJETS_LISTE_ordre = "t48";
DBCORPS_OBJETS_LISTE_sens = "DESC";
DBCORPS_OBJETS_TRI = nil;
DBCORPS_OBJETS_CRITERES = {};

DBCORPS_MOB_LISTE = {};
DBCORPS_MOB_LISTE_nb = 0;
DBCORPS_MOB_LISTE_ordre = "rarity";
DBCORPS_MOB_LISTE_sens = "DESC";
DBCORPS_MOB_TRI = nil;
DBCORPS_MOB_CRITERES = {};

DBCORPS_OBJET_LISTE = {};
DBCORPS_OBJET_LISTE_nb = 0;
DBCORPS_OBJET_LISTE_ordre = "pctdrop";
DBCORPS_OBJET_LISTE_sens = "DESC";
DBCORPS_OBJET_TRI = nil;
DBCORPS_OBJET_CRITERES = {};

DBCORPS_QUETES_LISTE = {};
DBCORPS_QUETES_LISTE_nb = 0;
DBCORPS_QUETES_LISTE_ordre = "nivconseil";
DBCORPS_QUETES_LISTE_sens = "ASC";
DBCORPS_QUETES_TRI = nil;
DBCORPS_QUETES_CRITERES = {};

DBCORPS_QUETES2_LISTE = {};
DBCORPS_QUETES2_LISTE_nb = 0;
DBCORPS_QUETES2_LISTE_ordre = "nivconseil";
DBCORPS_QUETES2_LISTE_sens = "ASC";
DBCORPS_QUETES2_TRI = nil;
DBCORPS_QUETES2_CRITERES = {};

DBCORPS_ConnaissanceBete_LISTE = {};
DBCORPS_ConnaissanceBete_LISTE_nb = 0;
DBCORPS_ConnaissanceBete_LISTE_ordre = "nommob";
DBCORPS_ConnaissanceBete_LISTE_sens = "ASC";
DBCORPS_ConnaissanceBete_TRI = nil;
DBCORPS_ConnaissanceBete_CRITERES = {};

DBCORPS_Suivi_LISTE = {};
DBCORPS_Suivi_LISTE_nb = 0;

DBCORPS_PNJ_LISTE = {};
DBCORPS_PNJ_LISTE_nb = 0;
DBCORPS_PNJ_LISTE_ordre = "numPNJ";
DBCORPS_PNJ_LISTE_sens = "ASC";
DBCORPS_PNJ_TRI = nil;
DBCORPS_PNJ_CRITERES = {};
DBCORPS_PNJ_TypeRegion_select = nil;

local DBCS_MINIMAP_X = 90;
local DBCS_MINIMAP_Y = 0;

DBCS_InCity = false;

local DBCS_salaireskin;

DBCS_setsnom_choix = 0;

--if ( DBCS_debug == 0 ) then
--	DBCS_salaireskin = 0;
--else
	DBCS_salaireskin = 1;
--end
--DBCS_afficher_new_objets = true;
--DBCS_afficher_new_quetes = true;

local DBCS_listeicone_minerai = {};
local DBCS_listeicone_minerai_max = 0;
local DBCS_listeicone_minerai_minimap_max = 0;
local DBCS_listeicone_plante = {};
local DBCS_listeicone_plante_max = 0;
local DBCS_listeicone_plante_minimap_max = 0;
local DBCS_listeicone_coffre = {};
local DBCS_listeicone_coffre_max = 0;
local DBCS_listeicone_coffre_minimap_max = 0;
local DBCS_listeicone_banc = {};
local DBCS_listeicone_banc_max = 0;
local DBCS_listeicone_banc_minimap_max = 0;
local DBCS_listeicone_artefact = {};
local DBCS_listeicone_artefact_max = 0;
local DBCS_listeicone_artefact_minimap_max = 0;
local DBCS_listeicone_rare = {};
local DBCS_listeicone_rare_max = 0;
local DBCS_listeicone_rare_minimap_max = 0;
local DBCS_memo_region_region = "";
local DBCS_memo_region_scale = 0;
local DBCS_memo_region_xoffset = 0;
local DBCS_memo_region_yoffset = 0;

-- gestion du multiple essai de lire les objets MAJ
DBCS_extract_nb = 0;
DBCS_extract_nb_save = 0;
DBCS_extract_nb_MAJ = false;

function DBcorps_init()

local sval;

	if ( DBCORPS_SCREEN_LOADED == 0 ) then
		DBcorps_ListMobs_Trier();
		_G["DBcorpsFrame_MobsFrame_Criteres_Salaireskin"]:SetChecked(1);
		--if ( DBCS_debug == 0 ) then
			--_G["DBcorpsFrame_MobsFrame_Criteres_Salaireskin_Libelle"]:Hide();
			--_G["DBcorpsFrame_MobsFrame_Criteres_Salaireskin"]:Hide();
		--end
		DBcorpsFrame_ObjetsFrame_Criteres_Bar:Hide();
		DBcorpsFrame_ObjetsFrame_Criteres_Bar:SetMinMaxValues(0,100);
		DBcorpsFrame_ObjetsFrame_Criteres_Bar:SetValue(0);
--/script DBcorpsFrame_ObjetsFrame_Criteres_Bar:SetValue(75);
		DBcorps_ListObjets_Trier();
		DBcorps_ListMob_Trier();
		DBcorps_ListObjet_Trier();
		--if ( DBQS ) then
		DBcorpsFrame_QuetesFrame_Criteres_MAJ:Hide();
		_G["DBcorpsFrame_QuetesFrame_Criteres_Encours"]:SetChecked(1);
		DBcorps_ListQuetes_Trier();
		if ( DBquetes2 ) then
			DBcorps_ListQuetes2_Trier();
		end
		if ( DBCS_HDV_exist ) then
			DBcorps_ListHDV_Trier();
			DBcorps_ListHDV_stats_Trier();
		end
		--end
		DBcorps_ListConnaissanceBete_Trier();
		DBcorps_ListPNJ_Trier();
		sval = "creature/kiljaeden/kiljaeden.m2";
		DBcorpsFrame_PNJFrame_Liste_Button1_Model:SetModel(sval);
		DBcorpsFrame_PNJFrame_Liste_Button2_Model:SetModel(sval);
		DBcorpsFrame_PNJFrame_Liste_Button3_Model:SetModel(sval);
		DBcorpsFrame_PNJFrame_Liste_Button4_Model:SetModel(sval);
		DBcorpsFrame_PNJFrame_Liste_Button5_Model:SetModel(sval);
		DBcorpsFrame_PNJFrame_Liste_Button6_Model:SetModel(sval);
		DBcorpsFrame_PNJFrame_Liste_Button7_Model:SetModel(sval);
		DBcorpsFrame_PNJFrame_Liste_Button8_Model:SetModel(sval);
		DBcorpsFrame_PNJFrame_Liste_Button9_Model:SetModel(sval);
		DBcorpsFrame_PNJFrame_Liste_Button10_Model:SetModel(sval);

--		DBcorpsFrame_PNJFrame_Liste_ScrollFrame:EnableMouseWheel(true);
--							<OnMouseWheel>
--								DBcorps_PNJ_ScrollFrameTemplate_OnMouseWheel(self, delta);
--							</OnMouseWheel>

--if ( DBCS_debug > 1 ) then
--TraceFrame:AddMessage("DBcorps_init 1");
--end
		DBcorps_ShowSubFrame(1);
--if ( DBCS_debug > 1 ) then
--TraceFrame:AddMessage("DBcorps_init 2");
--end
		PanelTemplates_SetTab(DBcorpsFrame, 1);
--if ( DBCS_debug > 1 ) then
--TraceFrame:AddMessage("DBcorps_init 3");
--end
		DBCORPS_SCREEN_LOADED = 1;
	end
--if ( DBCS_debug > 1 ) then
--TraceFrame:AddMessage("DBcorps_init 4");
--end
	ShowUIPanel(DBcorpsFrame);
	DBcorps_PNJ_Scroll_Update();
--if ( DBCS_debug > 1 ) then
--TraceFrame:AddMessage("DBcorps_init 5");
--end

end

function DBCS_calculer_jours_de_sauvegarde()

local a,b;
local tablo;
local i;
local sdate;

	tablo = {};
	for a, _ in pairs(DBCC) do
		if ( type(DBCC[a]) == "table" ) then
			for b, _ in pairs(DBCC[a]) do
				if ( b == "OP" or b == "OP1" or b == "OI" or b == "OI2" or b == "OC" ) then
				else
					if ( type(DBCC[a][b]) == "table" ) then
						tablo[b] = 0;
					end
				end
			end
		end
	end
	i = 0;
	for sdate, _ in pairs(tablo) do
		i = i + 1 ;
	end
	tablo = nil;
	--if ( i > 30 ) then
	if ( i > 30 ) then
		DBcorpsFrame_Mobs_purgeafaire:SetText("Il est temps d'envoyer votre fichier de sauvegarde, "..i.." jours dans la base. ( voir le bouton PURGE )");
		DBcorpsFrame_Mobs_purgeafaire:SetTextColor(1,0,0);		-- rouge
	else
		DBcorpsFrame_Mobs_purgeafaire:SetText(nil);
	end

end

function DBCS_affichermob(snommob,sregion,blistesort)

	if ( blistesort == nil ) then
		blistesort = false;
	end
	DBCORPS_MOB_CRITERES.nommob = snommob;
	DBCORPS_MOB_CRITERES.numregion = sregion;
	DBCORPS_MOB_CRITERES.detail = DBmobs_Detail(DBCORPS_MOB_CRITERES.nommob,DBCORPS_MOB_CRITERES.numregion,DBCS_salaireskin);
	DBcorpsFrame_MobFrame_Criteres_ListeSpell:Hide();
	if ( DBCORPS_MOB_CRITERES.detail ) then
		DBcorps_ListMob_Criteres();
		DBCORPS_MOB_LISTE = DBmobs_Objets(DBCORPS_MOB_CRITERES);
		DBCORPS_MOB_LISTE_nb = table.getn(DBCORPS_MOB_LISTE);
		_G["DBcorpsFrame_MobFrame_Criteres_Elements"]:SetText(DBCORPS_MOB_LISTE_nb.." \195\169l\195\169ments trouv\195\169s.")
		DBcorps_ListMob_Trier();
		DBcorpsFrame_MobFrame_Liste_ScrollFrameScrollBar:SetValue(0);
		DBcorps_Mob_Scroll_Update();
		--if ( DBCORPS_MOB_LISTE_nb > 0 ) then
			DBcorps_init();
			PanelTemplates_SetTab(DBcorpsFrame, 3);
			DBcorps_ShowSubFrame(3);
		--else
		--	PlaySound("igQuestFailed");
		--	if ( blistesort == true ) then
		--	end
		--end
	else
		PlaySound("igQuestFailed");
	end

end

function DBCS_Minimap_OnEnter(self)

local x,y;

	GameTooltip:SetOwner(self, "ANCHOR_BOTTOMLEFT");
	GameTooltip:AddLine("DBCS "..DBCS_VERSION1.."."..DBCS_VERSION2.."."..DBCS_VERSION3);
	----DBQS_NUMVERSION
	--if ( DBQS ) then
	--	GameTooltip:AddLine("DBQS "..DBQS_NUMVERSION1.."."..DBQS_NUMVERSION2.."."..DBQS_NUMVERSION3);
	--end
	--CMS_VERSION
	if ( CMS_VERSION1 ) then
		GameTooltip:AddLine("CMS "..CMS_VERSION1.."."..CMS_VERSION2.."."..CMS_VERSION3);
	end
	if ( DBCS_debug > 1 ) then
		x,y = DBCS_position100_x(3,1);
	else
		x,y = DBCS_position100(1);
	end
	GameTooltip:AddLine("\nVous etes a "..( GetRealZoneText() or "").." en x = "..x..", y = "..y);
	GameTooltip:Show();
end
function DBCS_Minimap_DragStart(self)
	self:SetScript("OnUpdate", DBCS_Minimap_DragUpdate);
end
function DBCS_Minimap_DragStop(self)
	DBCS_Minimap_Button:UnlockHighlight();
	self:SetScript("OnUpdate", nil);
end
function DBCS_Minimap_DragUpdate()
	-- Thanks to Gello for making this a ton shorter
	DBCS_Minimap_Button:LockHighlight();
	local curX, curY = GetCursorPosition();
	local mapX, mapY = Minimap:GetCenter();
	local x, y;
	--if ( IsShiftKeyDown() ) then
	--	y = math.pow( math.pow(curY - mapY * Minimap:GetEffectiveScale(), 2) + math.pow(mapX * Minimap:GetEffectiveScale() - curX, 2), 0.5) - 70;
	--	y = min( max( y, -30 ), 30 );
	--end
	x = math.deg(math.atan2( curY - mapY * Minimap:GetEffectiveScale(), mapX * Minimap:GetEffectiveScale() - curX ));
	DBCS_Minimap_Position(x,y);
end

--/script DBCS_Minimap_Position(90,0)
function DBCS_Minimap_Position(x,y)
	if ( x or y ) then
		--if ( LootLinkState and not LootLinkState.options ) then
		--	LootLinkState.options = {};
		--end
		if ( x ) then
			if ( x < 0 ) then
				x = x + 360;
			end
			--LootLinkState.options.x = x;
		end
		if ( y ) then
			--LootLinkState.options.y = y;
		end
	end
	--if ( LootLinkState and LootLinkState.options ) then
	--	x, y = LootLinkState.options.x, LootLinkState.options.y
	--end
	--if ( LootLinkOptionsFrame:IsVisible() ) then
	--	LLO_MinimapPos:SetValue( x or LLO_MINIMAP_X );
	--	LLO_MinimapOffset:SetValue( y or LLO_MINIMAP_Y );
	--end
	if ( DBCS_config == nil ) then
		DBCS_config = {};
	end
	if ( DBCS_config.positionminimap == nil ) then
		DBCS_config.positionminimap = {};
	end
	DBCS_config.positionminimap.x = x;
	DBCS_config.positionminimap.y = y;
	DBCS_Minimap_Button:SetPoint("TOPLEFT","Minimap","TOPLEFT",53-((80+(y or DBCS_MINIMAP_Y))*cos(x or DBCS_MINIMAP_X)),((80+(y or DBCS_MINIMAP_Y))*sin(x or DBCS_MINIMAP_X))-55);
end

function DBcorps_ShowSubFrame(indice)

	_G["DBcorpsFrame_Mobs_purgeafaire"]:Hide();
	_G["DBcorpsFrame_Objets_new_Libelle"]:Hide();
	_G["DBcorpsFrame_Objets_new"]:Hide();
	_G["DBcorpsFrame_Quetes_new_Libelle"]:Hide();
	_G["DBcorpsFrame_Quetes_new"]:Hide();
	_G["DBcorpsFrame_HDV_stats_Libelle"]:Hide();
	_G["DBcorpsFrame_HDV_stats"]:Hide();
	_G["DBcorpsFrame_Objet_afficher_mobs_Libelle"]:Hide();
	_G["DBcorpsFrame_Objet_afficher_mobs"]:Hide();
	for index, value in pairs(DBCORPS_SUBFRAMES) do
		if ( index == indice ) then
			_G[value]:Show();
			if ( indice == 1 ) then
				_G["DBcorpsFrame_Mobs_purgeafaire"]:Show();
			elseif ( indice == 2 ) then
				_G["DBcorpsFrame_Objets_new_Libelle"]:Show();
				_G["DBcorpsFrame_Objets_new"]:Show();
			elseif ( indice == 4 ) then
				_G["DBcorpsFrame_Objet_afficher_mobs_Libelle"]:Show();
				_G["DBcorpsFrame_Objet_afficher_mobs"]:Show();
			elseif ( indice == 5 ) then
				_G["DBcorpsFrame_Quetes_new_Libelle"]:Show();
				_G["DBcorpsFrame_Quetes_new"]:Show();
			elseif ( indice == 6 ) then
				_G["DBcorpsFrame_Quetes_new_Libelle"]:Show();
				_G["DBcorpsFrame_Quetes_new"]:Show();
			elseif ( indice == 9 ) then
				_G["DBcorpsFrame_HDV_stats_Libelle"]:Show();
				_G["DBcorpsFrame_HDV_stats"]:Show();
			elseif ( indice == 10 ) then
				_G["DBcorpsFrame_HDV_stats_Libelle"]:Show();
				_G["DBcorpsFrame_HDV_stats"]:Show();
			elseif ( indice == 11 ) then
				DBcorps_PNJ_Scroll_Update();
			end
		else
			if ( _G[value] ) then
				_G[value]:Hide();
			end
		end	
	end

end

function DBcorpsFrameTab_OnClick(self,indice)

	if ( not indice ) then
		indice = self:GetID();
	end

	DBcorps_ShowSubFrame(indice);

end

function DBcorps_ListMobs_Purge_OnEnter(self)

local smessage;

	GameTooltip:SetOwner(self, "ANCHOR_RIGHT");
	smessage = "";
	smessage = smessage.."Une fois par mois ( ou quand vous le d\195\169sirez )";
	smessage = smessage.."\nJe vous conseilles de remonter vos donn\195\169es sauvegard\195\169es";
	smessage = smessage.."\nPour que je puisse les int\195\169grer \195\160 la base disponible sur le net";
	smessage = smessage.."\n\nMANIPULATION A FAIRE SANS ETRE CONNECT\195\169";
	smessage = smessage.."\n\nPour cela, allez sur la page : http://wow.freehackers.org/EnvoiDBCS/";
	smessage = smessage.."\n\nUne fois le fichier bien envoy\195\169, vous pourrez le(s) supprimer ( .lua ou ( .lua et .zip ) )";
	smessage = smessage.."\n\nSi vous ne le faites jamais, votre sauvegarde grossira et ralentira votre connexion/d\195\169connexion";
	
	
	--smessage = "Cette action vide la base de sauvegarde /wow/WTF/Account/nomdetoncompte/SavedVariables/DBcorps.lua";
	--smessage = smessage.."\n\nCe fichier contient tous les enregistrements en temps reel recuperes";
	--smessage = smessage.."\net constitu une image de votre base mobs";
	--smessage = smessage.."\n\nJe vous conseilles de sauvegarder ce fichier une fois par mois/semaine ainsi que :";
	--smessage = smessage.."\n\nDBHC.lua ds ce meme repertoire : cest la base historique des quetes terminees par chaque perso";
	--smessage = smessage.."\nDBmobs.lua ds ce meme repertoire : cest la base mobs et objets/mob ( disponible sur le site curse )";
	--smessage = smessage.."\nDBobjets.lua ds ce meme repertoire : cest votre base objets ( disponible sur le site curse )";
	--smessage = smessage.."\nDBquetes.lua ds ce meme repertoire : cest votre base quetes existantes ( disponible sur le site curse )";
	--smessage = smessage.."\n\npour les sauvegarder :";
	--smessage = smessage.."\n\nil suffit de copier/coller ces fichiers ds le meme repertoire";
	--smessage = smessage.."\net de les renommer du genre : \"Copie de DBmobs.lua\" en DBmobs_sav01.lua";
	--smessage = smessage.."\n\nSi vous voulez garder des copies, faites la purge aussitot la connexion";
	--smessage = smessage.."\n\nVous pouvez aussi simplement renommer le fichier DBcorps.lua";
	--smessage = smessage.."\nWOW en creera un vide a votre prochaine connexion";
	--smessage = smessage.."\n";
	GameTooltip:AddLine(smessage);
	GameTooltip:Show();

end

function DBCS_SmallDenominationTemplate_OnClick(inumobjet)

local itemName;
local itemLink;
local activewindow;

	if ( ChatEdit_GetActiveWindow ) then
		activewindow = ChatEdit_GetActiveWindow();
	else
		activewindow = ChatFrameEditBox;
	end
	
	itemName, itemLink, _, _, _, _, _, _, _, _ = GetItemInfo("item:"..inumobjet..":0:0:0:0:0:0:0:0:0:0");
	if ( itemName ) then
		if ( IsShiftKeyDown() and activewindow and activewindow:IsVisible() ) then
			if ( itemLink ) then
				activewindow:Insert(itemLink);
			else
				activewindow:Insert(DBobjets_GetItemLink(inumobjet,"0:0:0:0:0:0:0:0:0:0",0));
			end
		elseif ( IsControlKeyDown() ) then
			DressUpItemLink("item:"..inumobjet..":0:0:0:0:0:0:0:0:0:0");
		end
	else
	end


end

function DBCS_SmallDenominationTemplate_OnEnter(self,inumobjet)

local itemName;
local itemLink;

--if ( DBCS_debug > 1 ) then
--TraceFrame:AddMessage("inumobjet = "..(inumobjet or ""));
--end
	GameTooltip:SetOwner(self, "ANCHOR_RIGHT");
	if ( inumobjet > 0 ) then
		itemName, itemLink, _, _, _, _, _, _, _, _ = GetItemInfo("item:"..inumobjet..":0:0:0:0:0:0:0:0:0:0");
		if ( itemName ) then
			--GameTooltip:SetMerchantCostItem(self.index, self.item);
			GameTooltip:SetHyperlink("item:"..inumobjet);
		else
			DBOS_SetHyperlink(inumobjet);
		end
	else
		--GameTooltip:SetCurrencyToken(DBCS_bons_monnaies[inumobjet*(-1)].num);
		--GameTooltip:SetCurrencyToken(inumobjet*(-1));
		--GameTooltip:AddLine(inumobjet);
		GameTooltip:AddLine(DBCS_bons_monnaies[inumobjet*(-1)].name);
	end
	GameTooltip:Show();

end

function DBcorps_ListObjets_Item_OnClick(self,button)

local link;
local itemName,itemLink;
local index = self:GetParent():GetID() + FauxScrollFrame_GetOffset(DBcorpsFrame_ObjetsFrame_Liste_ScrollFrame);
local numobjet,numcourt2;
local activewindow;

	if ( ChatEdit_GetActiveWindow ) then
		activewindow = ChatEdit_GetActiveWindow();
	else
		activewindow = ChatFrameEditBox;
	end

	numobjet = DBCORPS_OBJETS_LISTE[index][1];
	numcourt2 = DBCORPS_OBJETS_LISTE[index][2];
	if ( DBCORPS_OBJETS_LISTE[index][5] == "i" ) then
		--link = "item:"..numobjet..":"..numcourt2;
		link = DBobjets_link_dboa_OnClick(numobjet);
		if ( link == nil ) then
			link = "item:"..numobjet..":"..numcourt2;
		end
		itemName, itemLink, _, _, _, _, _, _, _, _ = GetItemInfo(link);
		if ( itemName ) then
			if( button == "LeftButton" ) then
				if ( IsShiftKeyDown() and activewindow and activewindow:IsVisible() ) then
					if ( IsAltKeyDown() ) then
						activewindow:Insert(DBobjets_GetItemLink(numobjet,numcourt2,0));
					else
						--_, itemLink, _, _, _, _, _, _, _, _ = GetItemInfo(link);
						if ( itemLink ) then
							activewindow:Insert(itemLink);
						else
							activewindow:Insert(DBobjets_GetItemLink(numobjet,numcourt2,0));
						end
					end
				elseif ( IsControlKeyDown() ) then
					--DressUpItemLink(DBobjets_GetItemLink(numobjet,numcourt2));
					DressUpItemLink("item:"..numobjet..":0:0:0:0:0:0:0:0:0:0");
				end
			elseif( button == "RightButton" ) then
			end
		else
			if ( button == "LeftButton" ) then
				if ( IsShiftKeyDown() and activewindow and activewindow:IsVisible() ) then
					if ( IsAltKeyDown() ) then
						activewindow:Insert(DBobjets_GetItemLink(numobjet,numcourt2,0));
					else
						activewindow:Insert("["..DBCORPS_OBJETS_LISTE[index][3].."]");
					end
				elseif ( IsAltKeyDown() ) then
					--SetItemRef("item:"..numobjet..":"..numcourt2); -- peut faire déco
					--SetItemRef(link); -- peut faire déco
					--GameTooltip:SetOwner(self, "ANCHOR_RIGHT");
if ( DBCS_debug > 1 ) then
TraceFrame:AddMessage("je force "..link.." = "..DBobjets_GetItemLink(numobjet,numcourt2));
end
					GameTooltip:Hide();
					GameTooltip:SetOwner(self, "ANCHOR_RIGHT");
					GameTooltip:SetHyperlink(link);
					GameTooltip:Show();
					--GameTooltip:Hide();
					DBobjets_initobjet(numobjet,0,0);
					DBcorps_Objets_Scroll_Update();
					--GameTooltip:Show();
					--DBcorps_ListObjets_Item_OnEnter(index);
					--DBOS_extract_lignes(numobjet);
					--DBcorps_ListObjets_Item_OnEnter(index);
				--elseif ( IsControlKeyDown() ) then
				--	--DressUpItemLink(DBobjets_GetItemLink(numobjet,numcourt2));
				--	DressUpItemLink("item:"..numobjet..":0:0:0:0:0:0:0:0:0:0");
				end
			end
		end
	else
		link = "enchant:"..numobjet;
		itemName = "";
		if( button == "LeftButton" ) then
			if ( IsShiftKeyDown() and activewindow and activewindow:IsVisible() ) then
				activewindow:Insert(DBOS_getlinkitem(DBOS_enchant[numobjet][1],numobjet,6,"e"));
			end
		elseif( button == "RightButton" ) then
		end
	end

end

function DBcorps_ListMob_Item_OnClick(self,button)

local link;
local itemName, itemLink;
local index = self:GetParent():GetID() + FauxScrollFrame_GetOffset(DBcorpsFrame_MobFrame_Liste_ScrollFrame);
local numobjet,numcourt2;
local activewindow;

	if ( ChatEdit_GetActiveWindow ) then
		activewindow = ChatEdit_GetActiveWindow();
	else
		activewindow = ChatFrameEditBox;
	end

	numobjet = DBCORPS_MOB_LISTE[index][1];
	numcourt2 = DBCORPS_MOB_LISTE[index][2];
	if ( DBCORPS_MOB_LISTE[index][5] == "i" ) then
		--link = "item:"..numobjet..":"..numcourt2;
		link = DBobjets_link_dboa_OnClick(numobjet);
	else
		link = "enchant:"..numobjet..":"..numcourt2;
	end
	itemName, itemLink = GetItemInfo(link);
	if ( itemName or DBCORPS_MOB_LISTE[index][5] == "e" ) then
		if( button == "LeftButton" ) then
			if( IsShiftKeyDown() and activewindow and activewindow:IsVisible() ) then
				if ( DBCORPS_MOB_LISTE[index][5] == "i" ) then
					--ChatFrameEditBox:Insert(DBobjets_GetItemLink(numobjet,numcourt2));
					--ChatFrameEditBox:Insert(itemLink);
					activewindow:Insert(DBobjets_GetItemLink(numobjet,numcourt2,0));
				else
					activewindow:Insert(DBOS_getlinkitem(DBOS_enchant[numobjet][1],numobjet,6,"e"));
				end
			end
			if( IsControlKeyDown() and DBCORPS_MOB_LISTE[index][5] == "i" ) then
				--DressUpItemLink(DBobjets_GetItemLink(numobjet,numcourt2));
				DressUpItemLink("item:"..numobjet..":0:0:0:0:0:0:0:0:0:0");
			end
		elseif( button == "RightButton" ) then
		end
	else
		if ( IsAltKeyDown() and DBCORPS_MOB_LISTE[index][5] == "i" ) then
			if ( button == "LeftButton" ) then
				--SetItemRef("item:"..numobjet..":"..numcourt2); -- peut faire déco
				--SetItemRef(link); -- peut faire déco
				--GameTooltip:SetOwner(self, "ANCHOR_RIGHT");
				GameTooltip:SetHyperlink(link);
				DBOS_extract_lignes(numobjet);
			end
		elseif( button == "LeftButton" ) then
			if ( IsShiftKeyDown() and activewindow and activewindow:IsVisible() ) then
				if ( IsAltKeyDown() ) then
					activewindow:Insert(DBobjets_GetItemLink(numobjet,numcourt2,0));
				else
					activewindow:Insert(DBCORPS_MOB_LISTE[index][3]);
				end
			elseif( IsControlKeyDown() and DBCORPS_MOB_LISTE[index][5] == "i" ) then
				--DressUpItemLink(DBobjets_GetItemLink(numobjet,numcourt2));
				DressUpItemLink("item:"..numobjet..":0:0:0:0:0:0:0:0:0:0");
			end
		end
	end

end

function DBcorps_ListObjet_Item_OnClick(self,button)

local link;
local itemName,itemLink;
local numobjet,numcourt2;
local activewindow;
local tobjet = nil;

	if ( ChatEdit_GetActiveWindow ) then
		activewindow = ChatEdit_GetActiveWindow();
	else
		activewindow = ChatFrameEditBox;
	end

	if ( DBCORPS_OBJET_CRITERES.numobjet == nil ) then
		return nil;
	end
	numobjet = DBCORPS_OBJET_CRITERES.numobjet;
	numcourt2 = DBCORPS_OBJET_CRITERES.numcourt2;
	--link = "item:"..numobjet..":"..numcourt2;
	link = DBobjets_link_dboa_OnClick(numobjet);
	itemName, itemLink = GetItemInfo(link);
	if ( itemName ) then
		if( button == "LeftButton" ) then
			if( IsShiftKeyDown() and activewindow and activewindow:IsVisible() ) then
				--ChatFrameEditBox:Insert(DBobjets_GetItemLink(numobjet,numcourt2));
				--ChatFrameEditBox:Insert(itemLink);
				activewindow:Insert(DBobjets_GetItemLink(numobjet,numcourt2,0));
			end
			if( IsControlKeyDown() ) then
				--DressUpItemLink(DBobjets_GetItemLink(numobjet,numcourt2));
				DressUpItemLink("item:"..numobjet..":0:0:0:0:0:0:0:0:0:0");
			end
		elseif( button == "RightButton" ) then
		end
	else
		if ( IsShiftKeyDown() and activewindow and activewindow:IsVisible() ) then
			if ( IsAltKeyDown() ) then
				activewindow:Insert(DBobjets_GetItemLink(numobjet,numcourt2,0));
			else
				tobjet = DBobjets_numobjet_tableau_lire(numobjet);
				tobjet = DBobjets_numobjet_tableau_lire_t;
				if ( tobjet ) then
					activewindow:Insert(tobjet[1]);
				end
			end
		end
	end

end

function DBcorps_ListObjets_Item_OnEnter(self,index)

local link;
local itemName;

	--if ( IsControlKeyDown() ) then
	--	ShowInspectCursor();
	--else
	--	ResetCursor();
	--end
	GameTooltip:SetOwner(self, "ANCHOR_RIGHT");
	if ( DBCORPS_OBJETS_LISTE[index][5] == "i" ) then
		----DBcorpsFrame_Tooltip:SetHyperlink("item:"..DBCORPS_OBJETS_LISTE[index][1]);
		--link = "item:"..DBCORPS_OBJETS_LISTE[index][1]..":"..DBCORPS_OBJETS_LISTE[index][2];
		link = DBobjets_link_dboa_OnEnter(DBCORPS_OBJETS_LISTE[index][1]);
		itemName = GetItemInfo(link);
	else
		link = "enchant:"..DBCORPS_OBJETS_LISTE[index][1];
		itemName = "";
	end
	if ( IsControlKeyDown() and IsAltKeyDown() and ( DBCORPS_OBJETS_LISTE[index][5] == "i" ) ) then
		DBOS_SetHyperlink(DBCORPS_OBJETS_LISTE[index][1]);
	else
		if ( itemName ) then
			--if ( IsControlKeyDown() ) then
			--	ShowInspectCursor();
			--else
			--	ResetCursor();
			--end
			GameTooltip:SetHyperlink(link);
		else
			DBOS_SetHyperlink(DBCORPS_OBJETS_LISTE[index][1]);
		end
	end

end

function DBcorps_ListMob_Item_OnEnter(self,index)

local link;
local itemName;

	if ( DBCORPS_MOB_LISTE[index][5] == "i" ) then
		--DBcorpsFrame_Tooltip:SetHyperlink("item:"..DBCORPS_MOB_LISTE[index][1]);
		--link = "item:"..DBCORPS_MOB_LISTE[index][1]..":"..DBCORPS_MOB_LISTE[index][2];
		link = DBobjets_link_dboa_OnEnter(DBCORPS_MOB_LISTE[index][1]);
		GameTooltip:SetOwner(self, "ANCHOR_RIGHT");
		itemName = GetItemInfo(link);
		if ( itemName ) then
			GameTooltip:SetHyperlink(link);
			GameTooltip:Show();
		else
			DBOS_SetHyperlink(DBCORPS_MOB_LISTE[index][1]);
		end
	else
		link = "enchant:"..DBCORPS_MOB_LISTE[index][1]..":"..DBCORPS_MOB_LISTE[index][2];
		GameTooltip:SetOwner(self, "ANCHOR_RIGHT");
		GameTooltip:SetHyperlink(link);
		GameTooltip:Show();
	end

end

function DBcorps_ListObjet_Item_OnEnter(self)

local link;
local itemName;

	if ( DBCORPS_OBJET_CRITERES.numobjet == nil ) then
		return nil;
	end
	--DBcorpsFrame_Tooltip:SetHyperlink("item:"..DBCORPS_OBJET_CRITERES.numobjet);
	--link = "item:"..DBCORPS_OBJET_CRITERES.numobjet..":"..DBCORPS_OBJET_CRITERES.numcourt2;
	link = DBobjets_link_dboa_OnEnter(DBCORPS_OBJET_CRITERES.numobjet);
--TraceFrame:AddMessage("DBcorps_ListObjet_Item_OnEnter link = "..link);
	GameTooltip:SetOwner(self, "ANCHOR_RIGHT");
	itemName = GetItemInfo(link);
	if ( itemName ) then
		GameTooltip:SetHyperlink(link);
	else
		DBOS_SetHyperlink(DBCORPS_OBJET_CRITERES.numobjet);
	end

end

function DBcorps_Afficherworldmap_element(snumregion,snomelement,sxy,sdelim1,sdelim2)		--périmé

if ( InCombatLockdown() ) then
	return nil;
end

local i1;
local i2;
local inummap;
local i;
local iwidth;
local iheight;
local iposdeb;
local iposfin;
local smot;
local ipos;
local x;
local y;
local oframe;
local ochamp;

	i1,i2 = DB_indexregionbynum(snumregion);
	inummap = DBCS_RegionData[i1][i2].nummap;
	if ( inummap > 0 or DBCS_RegionData[i1][i2].repertoire ) then
		--ToggleWorldMap();
		ToggleFrame(WorldMapFrame);
		if ( inummap > 0 ) then
			--SetMapZoom(i1,inummap);	--20121031
		else
			--WorldMapFrameTexture1
			--WorldMapFrameTexture12
			--texName = "Interface\\WorldMap\\"..mapFileName.."\\"..mapFileName..dungeonLevel.."_"..i;
			--texName = "Interface\\WorldMap\\"..mapFileName.."\\"..mapFileName..i;
			--_G["WorldMapDetailTile"..i]:SetTexture(texName);
			for i = 1 , 12 do
				--_G["WorldMapFrameTexture"..i]:SetTexture("Interface\\WorldMap\\"..(DBCS_RegionData[i1][i2].repertoire).."\\"..(DBCS_RegionData[i1][i2].fichier)..i);
				_G["WorldMapDetailTile"..i]:SetTexture("Interface\\WorldMap\\"..(DBCS_RegionData[i1][i2].repertoire).."\\"..(DBCS_RegionData[i1][i2].fichier)..i);
			end
			for i = 1 , NUM_WORLDMAP_POIS do
				_G["WorldMapFramePOI"..i]:Hide();
			end
			for i = 1 , NUM_WORLDMAP_OVERLAYS do
				_G["WorldMapOverlay"..i]:Hide();
			end
		end
		DBCS_initcarte();
		for i = 1 , DBCS_map_onclick_imax do
			_G["DBcorpsMap_worldfra"..i]:Hide();
			_G["DBcorpsMap_worldtex"..i]:Hide();
		end
		iwidth = WorldMapDetailFrame:GetWidth();
		iheight = WorldMapDetailFrame:GetHeight();
		iposdeb = 1;
		iposfin = 0;
		i = 0;
		while ( iposfin ) do
			iposfin = strfind(sxy,sdelim1,iposdeb);
			if ( iposfin ) then
				smot = strsub(sxy,iposdeb,iposfin-1);
				iposdeb = iposfin + 1;
				sxy = strsub(sxy,iposdeb);
				iposdeb = 1;
				ipos = strfind(smot,sdelim2);
				if ( ipos ) then
					i = i + 1;
					x = tonumber(strsub(smot,1,ipos-1));
					y = tonumber(strsub(smot,ipos+1));
					if ( i > DBCS_map_onclick_imax ) then
						-- createframe
						oframe = CreateFrame("Button","DBcorpsMap_worldfra"..i,WorldMapDetailFrame);
						oframe:SetWidth(10);
						oframe:SetHeight(10);
						oframe:CreateTexture("DBcorpsMap_worldtex"..i);
						DBCS_map_onclick_imax = i;
					else
						oframe = _G["DBcorpsMap_worldfra"..i];
					end
					oframe:Hide();
					oframe.toolTip = snomelement;
					oframe:SetPoint("CENTER",WorldMapDetailFrame,"TOPLEFT",((x/100)*iwidth),-((y/100)*iheight));
					oframe:SetScript("OnEnter",DBCS_DBcorpsMap_worldtex_OnEnter);
					oframe:SetScript("OnLeave",DBCS_DBcorpsMap_worldtex_OnLeave);
					oframe:SetFrameLevel(WorldMapPlayer:GetFrameLevel() + 1);
					oframe:SetFrameStrata("FULLSCREEN_DIALOG");	--	TOOLTIP");
					ochamp = _G["DBcorpsMap_worldtex"..i];
					ochamp:Hide();
					ochamp:SetHeight(10);
					ochamp:SetWidth(10);
					ochamp:SetTexture("Interface/Icons/INV_Misc_QuestionMark");
					ochamp:SetPoint("CENTER",0,0);
					ochamp:Show();
					oframe:Show();
				end
			end
		end
	end

end

function DBcorps_Mobs_Scroll_Update()

--if ( InCombatLockdown() ) then
--	return nil;
--end

	local i,j;
	local offset = FauxScrollFrame_GetOffset(DBcorpsFrame_MobsFrame_Liste_ScrollFrame);
	local button,buttonName;
	local itemName;
	local itemNivMin;
	local tablo;
	local nommob,numregion;
	local stype,srep,sgenre,snom,sblp;
	local smodele;

	FauxScrollFrame_Update(DBcorpsFrame_MobsFrame_Liste_ScrollFrame, DBCORPS_MOBS_LISTE_nb, 10, 32);

	for i = 1 , 10 do
		j = offset + i;
		buttonName = "DBcorpsFrame_MobsFrame_Liste_Button"..i;
		button = _G[buttonName];
		if ( j > DBCORPS_MOBS_LISTE_nb ) then
			button:Hide();
		else
			button:Show();
			nommob = DBCORPS_MOBS_LISTE[j][1];
			numregion = DBCORPS_MOBS_LISTE[j][2];
			tablo = DBmobs_Detail(nommob,numregion,DBCS_salaireskin);
			itemName = _G[buttonName.."_Name"];
			itemName:SetText(nommob);
			itemNivmin = _G[buttonName.."_Nivmin"];
			if ( tablo and tablo.nivmin ) then
				itemNivmin:SetText(tablo.nivmin);
				if ( tablo.nivmin == 0 ) then
					itemNivmin:SetText(nil);
				end
			else
				itemNivmin:SetText(nil);
			end
			itemNivmax = _G[buttonName.."_Nivmax"];
			if ( tablo and tablo.nivmax ) then
				itemNivmax:SetText(tablo.nivmax);
				if ( tablo.nivmax == 0 ) then
					itemNivmax:SetText(nil);
				end
			else
				itemNivmax:SetText(nil);
			end
			itemClasse = _G[buttonName.."_Classe"];
			itemClasse:SetText(tablo.classe);
			itemFamille = _G[buttonName.."_Famille"];
			itemFamille:SetText(tablo.famille);
			itemType = _G[buttonName.."_Type"];
			itemType:SetText(tablo.type);
			itemNbcorps = _G[buttonName.."_Nbcorps"];
			itemNbcorps:SetText(tablo.nbcorps);
			itemNbskin = _G[buttonName.."_Nbskin"];
			itemNbskin:SetText(tablo.nbskin);
			if ( tablo and tablo.nbskin and tablo.nbskin == 0 ) then
				itemNbskin:SetText(nil);
			end
			itemSalaire = _G[buttonName.."_Salaire"];
			--if ( DBCORPS_MOBS_LISTE[j][4] and DBCORPS_MOBS_LISTE[j][4] == 0 ) then
				itemSalaire:SetText(nil);
			--else
			--	itemSalaire:SetText(DBCORPS_MOBS_LISTE[j][4]);
			--end
			itemSalaire = _G[buttonName.."_SalaireMoney"];
			if ( DBCORPS_MOBS_LISTE[j][4] == nil or DBCORPS_MOBS_LISTE[j][4] == 0 ) then
				itemSalaire:Hide();
			else
				itemSalaire:Show();
				--DBCS_MoneyFrame_Update(itemSalaire:GetName(), DBCORPS_MOBS_LISTE[j][4]);
				DBCS_MoneyFrame_Update(itemSalaire:GetName(), DBCORPS_MOBS_LISTE[j][4]);
			end
			itemSalairepct = _G[buttonName.."_Salairepct"];
			if ( ( DBCORPS_MOBS_LISTE[j][4] and DBCORPS_MOBS_LISTE[j][4] == 0 ) or ( DBCORPS_MOBS_LISTE[j][5] == nil ) ) then
				itemSalairepct:SetText(nil);
			else
				itemSalairepct:SetText(DBCORPS_MOBS_LISTE[j][5].."%");
			end
			itemNomregion = _G[buttonName.."_Nomregion"];
			itemNomregion:SetText(DB_nomregionbynum(numregion));
			itemName = _G[buttonName.."_Modele"];
			itemName:Hide();
			--if ( DBCS_MVW_exist == true ) then
				stype,srep,sgenre,snom,sblp,_ = DBmobs_MVW_detail_modele(nommob,numregion);
				if ( stype ) then
					smodele = "";
					--smodele = smodele..srep.."/";
					--if ( sgenre ) then
					--	smodele = smodele..sgenre.."/";
					--end
					smodele = smodele..snom..".m2";
					itemName:SetText(smodele);
					itemName:Show();
				end
			--else
			--end
			itemName = _G[buttonName.."_Nummob"];
			itemName:SetText(tablo.nummob);
		end
	end

end

function DBcorps_ListMobs_Item_Modele_OnEnter(self)

local iindex;
local snommob;
local snumregion;
local stype,srep,sgenre,snom,sblp;
local smodele;

	iindex = self:GetParent():GetID() + FauxScrollFrame_GetOffset(DBcorpsFrame_MobsFrame_Liste_ScrollFrame);

	snommob = DBCORPS_MOBS_LISTE[iindex][1];
	snumregion = DBCORPS_MOBS_LISTE[iindex][2];

	stype,srep,sgenre,snom,sblp,_ = DBmobs_MVW_detail_modele(snommob,snumregion);
	if ( stype ) then
		smodele = "";
		smodele = smodele..stype.."/";
		smodele = smodele..srep.."/";
		if ( sgenre ) then
			smodele = smodele..sgenre.."/";
		end
		smodele = smodele..snom..".m2";
		GameTooltip:SetOwner(self, "ANCHOR_RIGHT");
		GameTooltip:AddLine(smodele);
		GameTooltip:Show();
	end

end

function DBcorps_ListMobs_Item_Modele_OnClick(self)

local iindex;
local snommob;
local snumregion;
local stype,srep,sgenre,snom,sblp;
local smodele;
local inummodele;
local inumcreature;

	if ( DBCS_MVW_exist == true ) then
		iindex = self:GetParent():GetID() + FauxScrollFrame_GetOffset(DBcorpsFrame_MobsFrame_Liste_ScrollFrame);

		snommob = DBCORPS_MOBS_LISTE[iindex][1];
		snumregion = DBCORPS_MOBS_LISTE[iindex][2];

		stype,srep,sgenre,snom,sblp,inumcreature = DBmobs_MVW_detail_modele(snommob,snumregion);
		if ( inumcreature ) then
			DBCS_MVW_afficher_mobs_model(inumcreature);
			DBCS_Model_Viewer_numcreature = inumcreature;
			DBCS_Model_Viewer_creature_afficher();
		else
			if ( stype ) then
				ShowUIPanel(DBCS_Model_Viewer_DressUpFrame);
				DBCS_Model_Viewer_DressUpFrameModel_Player_OnClick();
				smodele = "";
				smodele = smodele..srep;
				if ( sgenre ) then
					smodele = smodele.."/"..sgenre;
				end
				DBCS_MVW_afficher_modele_blp(stype,smodele,snom..".m2",nil,nil);
			end
		end
--[[
		if ( stype ) then
			DBCS_Model_Viewer_Model_OnShow();
			if ( stype == "character" ) then
				--smodele = stype.."/"..srep.."/"..sgenre.."/"..snom..".m2";
			DBCS_Model_Viewer_Model_OnShow();
				smodele = "";
				smodele = smodele..stype.."/";
				smodele = smodele..srep.."/";
				if ( sgenre ) then
					smodele = smodele..sgenre.."/";
				end
				smodele = smodele..snom..".m2";
				DBCS_MVW_affichermodele_m2(srep,snom,smodele,inumcreature);
			elseif ( stype == "creature" ) then
				inummodele = DBCS_MVW_recherche_nummodele(srep,snom);
				if ( inummodele ) then
					ShowUIPanel(DBCS_Model_Viewer_DressUpFrame);
					DBCS_MVW_affichermodele(inummodele,false,inumcreature);
				else
					ShowUIPanel(DBCS_Model_Viewer_DressUpFrame);
					smodele = "";
					smodele = smodele..stype.."/";
					smodele = smodele..srep.."/";
					if ( sgenre ) then
						smodele = smodele..sgenre.."/";
					end
					smodele = smodele..snom..".m2";
					DBCS_MVW_affichermodele_m2(srep,snom,smodele,inumcreature);
				end
				--smodele = stype.."/"..srep.."/"..snom..".m2";
			end
		end
--]]
	end

end

function DBCS_AltCurrencyFrame_Update(frameName, texture, cost)

	local iconWidth;
	local button = _G[frameName];
	local buttonTexture = _G[frameName.."Texture"];
	button:SetText(cost);
	buttonTexture:SetTexture(texture);
	if ( button.pointType == HONOR_POINTS ) then
		iconWidth = 24;
		buttonTexture:SetPoint("LEFT", _G[frameName.."Text"], "RIGHT", -1, -6);
	else
		iconWidth = MONEY_ICON_WIDTH_SMALL;
		buttonTexture:SetPoint("LEFT", _G[frameName.."Text"], "RIGHT", 0, 0);
	end
	buttonTexture:SetWidth(iconWidth);
	buttonTexture:SetHeight(iconWidth);
	button:SetWidth(button:GetTextWidth() + MONEY_ICON_WIDTH_SMALL);

end


function DBCS_MerchantFrame_UpdateAltCurrency(frameName,tablo)

--			[70]	bprixspécial						0 ou 1
--			[71]	sdatemajprix						"20071124"
--			[72]	iprix								>0 ou nil
--													local factionGroup = UnitFactionGroup("player");
--			[73]	ihonneur							>0 ou nil;		"Interface\\TargetingFrame\\UI-PVP-"	+	factionGroup
--			[74]	iarene							>0 ou nil;		"Interface\\PVPFrame\\PVP-ArenaPoints-Icon"
--			[75]	stex1								"29434:10"
--			[76]	stex2								"32572:1"
--			[77]	stex3								"32569:50"

local button;
local factionGroup;
local pointsTexture;
local sobjet;
local inumobjet;
local inb;
local ipos;
local tobjet = nil;

	button = _G[frameName.."Points"];
	-- update Alt Currency Frame with pointsValues
--TraceFrame:AddMessage("tablo.t73 : "..(tablo.t73 or ""));
--TraceFrame:AddMessage("tablo.t74 : "..(tablo.t74 or ""));
	if ( tablo.t73 and tablo.t73 ~= 0 ) then
		factionGroup = UnitFactionGroup("player");
		if ( factionGroup ) then
			pointsTexture = "Interface\\TargetingFrame\\UI-PVP-"..factionGroup;
		end
		button.pointType = HONOR_POINTS;
		--button.numobjet = -1;
		AltCurrencyFrame_Update(frameName.."Points", pointsTexture, tablo.t73);
		button:Show();
	elseif ( tablo.t74 and tablo.t74 ~= 0 ) then
		button.pointType = ARENA_POINTS;
		--button.numobjet = -2;
		AltCurrencyFrame_Update(frameName.."Points", "Interface\\PVPFrame\\PVP-ArenaPoints-Icon", tablo.t74);
		button:Show();
	else
		button:Hide();
	end

	button = _G[frameName.."Item1"];
	sobjet = tablo.t75;
	if ( sobjet ) then
		ipos = strfind(sobjet,":");
		if ( ipos ) then
			inumobjet = tonumber(strsub(sobjet,1,ipos-1));
			button.numobjet = inumobjet;
			inb = tonumber(strsub(sobjet,ipos+1));
			pointsTexture = nil;
			--for i = 1 , table.getn(DBCS_bons_objets) do
			--	if ( DBCS_bons_objets[i].numobjet == inumobjet ) then
			--		pointsTexture = DBCS_bons_objets[i].texture;
			--	end
			--end
			if ( inumobjet < 0 ) then
				pointsTexture = "interface/icons/"..DBCS_bons_monnaies[inumobjet*(-1)].texture;
			end
			if ( pointsTexture == nil ) then
				tobjet = DBobjets_numobjet_tableau_lire(inumobjet);
				tobjet = DBobjets_numobjet_tableau_lire_t;
				if ( tobjet and tobjet[8] ) then
					pointsTexture = tobjet[8];
				end
			end
			AltCurrencyFrame_Update(frameName.."Item1", pointsTexture, inb);
			--if ( i > 1 ) then
			--	button:SetPoint("LEFT", frameName.."Item"..i-1, "RIGHT", 4, 0);
			if ( ( tablo.t73 and tablo.t73 > 0 )  or ( tablo.t74 and tablo.t74 > 0 ) ) then
				button:SetPoint("LEFT", frameName.."Points", "RIGHT", 4, 0);
			else
				button:SetPoint("LEFT", frameName.."Points", "LEFT", 0, 0);	
			end
			button:Show();
		end
		button = _G[frameName.."Item2"];
		sobjet = tablo.t76;
		if ( sobjet ) then
			ipos = strfind(sobjet,":");
			if ( ipos ) then
				inumobjet = tonumber(strsub(sobjet,1,ipos-1));
				button.numobjet = inumobjet;
				inb = tonumber(strsub(sobjet,ipos+1));
				pointsTexture = nil;
				--for i = 1 , table.getn(DBCS_bons_objets) do
				--	if ( DBCS_bons_objets[i].numobjet == inumobjet ) then
				--		pointsTexture = DBCS_bons_objets[i].texture;
				--	end
				--end
				if ( pointsTexture == nil ) then
					tobjet = DBobjets_numobjet_tableau_lire(inumobjet);
					tobjet = DBobjets_numobjet_tableau_lire_t;
					if ( tobjet and tobjet[8] ) then
						pointsTexture = tobjet[8];
					end
				end
				AltCurrencyFrame_Update(frameName.."Item2", pointsTexture, inb);
				button:SetPoint("LEFT", frameName.."Item1", "RIGHT", 4, 0);
				button:Show();
			end
			button = _G[frameName.."Item3"];
			sobjet = tablo.t77;
			if ( sobjet ) then
				ipos = strfind(sobjet,":");
				if ( ipos ) then
					inumobjet = tonumber(strsub(sobjet,1,ipos-1));
					button.numobjet = inumobjet;
					inb = tonumber(strsub(sobjet,ipos+1));
					pointsTexture = nil;
					--for i = 1 , table.getn(DBCS_bons_objets) do
					--	if ( DBCS_bons_objets[i].numobjet == inumobjet ) then
					--		pointsTexture = DBCS_bons_objets[i].texture;
					--	end
					--end
					if ( pointsTexture == nil ) then
						tobjet = DBobjets_numobjet_tableau_lire(inumobjet);
						tobjet = DBobjets_numobjet_tableau_lire_t;
						if ( tobjet and tobjet[8] ) then
							pointsTexture = tobjet[8];
						end
					end
					AltCurrencyFrame_Update(frameName.."Item3", pointsTexture, inb);
					button:SetPoint("LEFT", frameName.."Item2", "RIGHT", 4, 0);
					button:Show();
				end
			else
				_G[frameName.."Item3"]:Hide();
			end
		else
			_G[frameName.."Item2"]:Hide();
			_G[frameName.."Item3"]:Hide();
		end
	else
		_G[frameName.."Item1"]:Hide();
		_G[frameName.."Item2"]:Hide();
		_G[frameName.."Item3"]:Hide();
	end
end


function DBcorps_Objets_Scroll_Update()

	local i,j;
	local offset = FauxScrollFrame_GetOffset(DBcorpsFrame_ObjetsFrame_Liste_ScrollFrame);
	local button,buttonName;
	local itemName;
	local numobjet,numcourt2;
	local tablo;
	local r,g,b,hex;
	local s_TypeSType;
	local s_Equiploc;
	local a;

	FauxScrollFrame_Update(DBcorpsFrame_ObjetsFrame_Liste_ScrollFrame, DBCORPS_OBJETS_LISTE_nb, 10, 32);

	for i = 1 , 10 do
		j = offset + i;
		buttonName = "DBcorpsFrame_ObjetsFrame_Liste_Button"..i;
		button = _G[buttonName];
		button:Hide();
		if ( j > DBCORPS_OBJETS_LISTE_nb ) then
			--button:Hide();
		else
			numobjet = DBCORPS_OBJETS_LISTE[j][1];
			numcourt2 = DBCORPS_OBJETS_LISTE[j][2];
			if ( DBCORPS_OBJETS_LISTE[j][5] == "i" ) then
				tablo = DBOS_detail(numobjet,numcourt2);
				if ( tablo.nomobjet ) then
					tablo.nomobjet = DBCORPS_OBJETS_LISTE[j][3];
				end
			else
				tablo = {};
				tablo.nomobjet = DBCORPS_OBJETS_LISTE[j][3];
				tablo.texture = "Interface/Icons/INV_Wand_01";
				tablo.rarity = 6;
				tablo.minlevel = nil;
				tablo.prix = nil;
			end
			if ( tablo ) then
			else
				tablo = {};
			end
			itemName = _G[buttonName.."_Item_IconTexture"];
			itemName:Hide();
			itemName:SetTexture("Interface/Icons/INV_Misc_QuestionMark");
			itemName:SetTexture(tablo.texture);
			itemName:Show();
			itemName = _G[buttonName.."_Nomobjet"];
			itemName:SetText(tablo.nomobjet);
			if ( tablo.rarity ) then
				r,g,b,hex = GetItemQualityColor(tablo.rarity);
				itemName:SetTextColor(r, g, b);
			end
			itemName = _G[buttonName.."_Nivreel"];
			itemName:SetText(tablo.level);
			itemName = _G[buttonName.."_Niveau"];
			itemName:SetText(tablo.minlevel);
			itemName = _G[buttonName.."_Numobjet"];
			itemName:SetText(numobjet);
			if ( DBCORPS_OBJETS_LISTE[j][5] == "i" ) then
				--blanc = objet visualisable et linkable
				--jaune = objet visualisable mais pas linkable
				--orange = objet non visualisable mais linkable
				--rouge = objet non visualisable ni linkable
				a, _, _, _, _, _, _, _, _, _ = GetItemInfo(numobjet);
				if ( a ) then
					if ( DBOT_linkable ) then
						if ( DBOT_linkable_objet_linkable(numobjet) == true ) then
							--blanc
							itemName:SetTextColor(1,1,1);		-- blanc
						else
							--jaune
							itemName:SetTextColor(1,1,0);		-- jaune
						end
					else
						itemName:SetTextColor(1,1,1);		-- blanc
					end
				else
					if ( DBOT_linkable ) then
						if ( DBOT_linkable_objet_linkable(numobjet) == true ) then
							--orange
							itemName:SetTextColor(1,0.5,0);		-- orange
						else
							--rouge
							itemName:SetTextColor(1,0,0);		-- rouge
						end
					else
						itemName:SetTextColor(1,0,0);		-- rouge
					end
				end
			else
				itemName:SetTextColor(1,1,1);		-- blanc
			end
			if ( tablo.t70 and tablo.t70 == 1 ) then
				_G[buttonName.."_AltCurrencyFrameItem1"]:Hide();
				_G[buttonName.."_AltCurrencyFrameItem2"]:Hide();
				_G[buttonName.."_AltCurrencyFrameItem3"]:Hide();
				if ( tablo.t72 and tablo.t72 > 0 ) then
					DBCS_MerchantFrame_UpdateAltCurrency(buttonName.."_AltCurrencyFrame", tablo);
					MoneyFrame_Update(buttonName.."_MoneyFrame", tablo.t72);
					_G[buttonName.."_AltCurrencyFrame"]:ClearAllPoints();
					_G[buttonName.."_AltCurrencyFrame"]:SetPoint("LEFT", _G[buttonName.."_MoneyFrame"]:GetName(), "RIGHT", -14, 0);
					_G[buttonName.."_AltCurrencyFrame"]:Show();
					_G[buttonName.."_MoneyFrame"]:Show();
				else
					DBCS_MerchantFrame_UpdateAltCurrency(buttonName.."_AltCurrencyFrame", tablo);
					_G[buttonName.."_AltCurrencyFrame"]:ClearAllPoints();
					_G[buttonName.."_AltCurrencyFrame"]:SetPoint("LEFT", buttonName.."_MoneyFrame", "LEFT", 0, 0);
					_G[buttonName.."_MoneyFrame"]:Hide();
					_G[buttonName.."_AltCurrencyFrame"]:Show();
				end
			else
				_G[buttonName.."_AltCurrencyFrame"]:Hide();
				_G[buttonName.."_MoneyFrame"]:Hide();
			end
			itemName = _G[buttonName.."_PrixMoney"];
			if ( tablo.coffre and tablo.coffre == 1 ) then
				isalaire, _ = DBmobs_Salaire(tablo.nomobjet,"0");
				if ( isalaire and isalaire > 0 ) then
					itemName:Show();
					MoneyFrame_Update(itemName:GetName(), isalaire);
				else
					itemName:Hide();
				end
			else
				if ( tablo.prix == nil or tablo.prix == 0 ) then
					itemName:Hide();
				else
					itemName:Show();
					MoneyFrame_Update(itemName:GetName(), tablo.prix);
				end
			end
			itemName = _G[buttonName.."_TypeSType"];
			s_TypeSType = "";
			if ( tablo.type ) then
				s_TypeSType = s_TypeSType..tablo.type;
			end
			if ( tablo.subtype ) then
				s_TypeSType = s_TypeSType.."/"..tablo.subtype;
			end
			itemName:SetText(s_TypeSType);
			itemName = _G[buttonName.."_Equiploc"];
			s_Equiploc = "";
			if ( tablo.equiploc ) then
				s_Equiploc = s_Equiploc..tablo.equiploc;
			end
			itemName:SetText(s_Equiploc);
			button:Show();
		end
	end
	
end

function DBcorps_Mob_Scroll_Update()

	local i,j;
	local offset = FauxScrollFrame_GetOffset(DBcorpsFrame_MobFrame_Liste_ScrollFrame);
	local button,buttonName;
	local itemName;
	local numobjet,numcourt2;
	local pctdrop;
	local tablo;
	local r,g,b,hex;
	local s_TypeSTypeEquiploc;

	FauxScrollFrame_Update(DBcorpsFrame_MobFrame_Liste_ScrollFrame, DBCORPS_MOB_LISTE_nb, 10, 32);

	for i = 1 , 10 do
		j = offset + i;
		buttonName = "DBcorpsFrame_MobFrame_Liste_Button"..i;
		button = _G[buttonName];
		if ( j > DBCORPS_MOB_LISTE_nb ) then
			button:Hide();
		else
			button:Show();
			numobjet = DBCORPS_MOB_LISTE[j][1];
			numcourt2 = DBCORPS_MOB_LISTE[j][2];
			if ( DBCORPS_MOB_LISTE[j][5] == "i" ) then
				tablo = DBOS_detail(numobjet,numcourt2);
			else
				tablo = {};
				tablo.nomobjet = DBCORPS_MOB_LISTE[j][3];
				tablo.texture = "Interface\\Icons\\INV_Wand_01";
				tablo.rarity = 6;
				tablo.minlevel = nil;
				tablo.level = nil;
				tablo.prix = nil;
			end
			itemName = _G[buttonName.."_Item_IconTexture"];
			if ( tablo and tablo.texture ) then
				itemName:SetTexture("Interface/Icons/INV_Misc_QuestionMark");
				itemName:SetTexture(tablo.texture);
			else
				itemName:SetTexture("");
			end
			itemName = _G[buttonName.."_Nomobjet"];
			if ( tablo and tablo.nomobjet ) then
				itemName:SetText(tablo.nomobjet);
				r,g,b,hex = GetItemQualityColor(tablo.rarity);
				itemName:SetTextColor(r, g, b);
			else
				itemName:SetText("");
			end
			itemName = _G[buttonName.."_Niveau"];
			if ( tablo and tablo.minlevel ) then
				itemName:SetText(tablo.minlevel);
			else
				itemName:SetText("");
			end
			itemName = _G[buttonName.."_Nivreel"];
			if ( tablo and tablo.level ) then
				itemName:SetText(tablo.level);
			else
				itemName:SetText("");
			end
			itemName = _G[buttonName.."_Pctdrop"];
			pctdrop = DBCORPS_MOB_LISTE[j][4];
			if ( pctdrop == nil ) then
				itemName:SetText(pctdrop);
			else
				itemName:SetText(format("%.2f",pctdrop));
			end
			itemName = _G[buttonName.."_Numobjet"];
			itemName:SetText(numobjet);
			if ( DBCORPS_MOB_LISTE[j][5] == "i" ) then
				a, _, _, _, _, _, _, _, _, _ = GetItemInfo(numobjet);
				if ( a ) then
					if ( DBOT_linkable ) then
						--if ( DBOT_linkable[DBCS_serveur] and DBOT_linkable[DBCS_serveur]["objets"] and DBOT_linkable[DBCS_serveur]["objets"][numobjet] == 0 ) then
						if ( DBOT_linkable_objet_linkable(numobjet) == true ) then
							itemName:SetTextColor(1,1,1);		-- blanc
						else
							itemName:SetTextColor(1,0.5,0);		-- orange
						end
					else
						itemName:SetTextColor(1,1,1);		-- blanc
					end
				else
					itemName:SetTextColor(1,0,0);		-- rouge
				end
			else
				itemName:SetTextColor(1,1,1);		-- blanc
			end
			if ( tablo and tablo.t70 and tablo.t70 == 1 ) then
				_G[buttonName.."_AltCurrencyFrameItem1"]:Hide();
				_G[buttonName.."_AltCurrencyFrameItem2"]:Hide();
				_G[buttonName.."_AltCurrencyFrameItem3"]:Hide();
				if ( tablo.t72 and tablo.t72 > 0 ) then
					DBCS_MerchantFrame_UpdateAltCurrency(buttonName.."_AltCurrencyFrame", tablo);
					MoneyFrame_Update(buttonName.."_MoneyFrame", tablo.t72);
					_G[buttonName.."_AltCurrencyFrame"]:ClearAllPoints();
					_G[buttonName.."_AltCurrencyFrame"]:SetPoint("LEFT", _G[buttonName.."_MoneyFrame"]:GetName(), "RIGHT", -14, 0);
					_G[buttonName.."_AltCurrencyFrame"]:Show();
					_G[buttonName.."_MoneyFrame"]:Show();
				else
					DBCS_MerchantFrame_UpdateAltCurrency(buttonName.."_AltCurrencyFrame", tablo);
					_G[buttonName.."_AltCurrencyFrame"]:ClearAllPoints();
					_G[buttonName.."_AltCurrencyFrame"]:SetPoint("LEFT", buttonName.."_MoneyFrame", "LEFT", 0, 0);
					_G[buttonName.."_MoneyFrame"]:Hide();
					_G[buttonName.."_AltCurrencyFrame"]:Show();
				end
			else
				_G[buttonName.."_AltCurrencyFrame"]:Hide();
				_G[buttonName.."_MoneyFrame"]:Hide();
			end
			itemName = _G[buttonName.."_PrixMoney"];
			if ( tablo == nil or tablo.prix == nil or tablo.prix == 0 ) then -- 
				itemName:Hide();
			else
				itemName:Show();
				MoneyFrame_Update(itemName:GetName(), tablo.prix);
			end
			itemName = _G[buttonName.."_TypeSTypeEquiploc"];
			s_TypeSTypeEquiploc = "";
			if ( tablo ) then
				if ( tablo.type ) then
					s_TypeSTypeEquiploc = s_TypeSTypeEquiploc..tablo.type;
				end
				if ( tablo.subtype ) then
					s_TypeSTypeEquiploc = s_TypeSTypeEquiploc.."/"..tablo.subtype;
				end
				if ( tablo.equiploc ) then
					s_TypeSTypeEquiploc = s_TypeSTypeEquiploc.."/"..tablo.equiploc;
				end
			end
			itemName:SetText(s_TypeSTypeEquiploc);
		end
	end
	
end

function DBcorps_Objet_Scroll_Update()

local i,j;
local offset = FauxScrollFrame_GetOffset(DBcorpsFrame_ObjetFrame_Liste_ScrollFrame);
local button,buttonName;
local itemName;
--local itemNivMin;
local tablo;
local nommob,numregion;

	StaticPopup_Hide("DBCS_STATICPOPUPDIALOG_SUPPRIMERLOOT");

	FauxScrollFrame_Update(DBcorpsFrame_ObjetFrame_Liste_ScrollFrame, DBCORPS_OBJET_LISTE_nb, 10, 32);

	for i = 1 , 10 do
		j = offset + i;
		buttonName = "DBcorpsFrame_ObjetFrame_Liste_Button"..i;
		button = _G[buttonName];
		if ( j > DBCORPS_OBJET_LISTE_nb ) then
			button:Hide();
		else
			button:Show();
			nommob = DBCORPS_OBJET_LISTE[j][1];
			numregion = DBCORPS_OBJET_LISTE[j][2];
			tablo = DBmobs_Detail(nommob,numregion,DBCS_salaireskin);
			itemName = _G[buttonName.."_Nommob"];
			itemName:SetText(nommob);
			itemName = _G[buttonName.."_Nivmin"];
			itemName:SetText(tablo.nivmin);
			if ( tablo.nivmin ) then
				if ( tablo.nivmin == 0 ) then
					itemName:SetText(nil);
				end
			end
			itemName = _G[buttonName.."_Nivmax"];
			itemName:SetText(tablo.nivmax);
			if ( tablo.nivmax ) then
				if ( tablo.nivmax == 0 ) then
					itemName:SetText(nil);
				end
			end
			itemName = _G[buttonName.."_Classe"];
			itemName:SetText(tablo.classe);
			itemName = _G[buttonName.."_Type"];
			itemName:SetText(tablo.type);
			itemName = _G[buttonName.."_Famille"];
			itemName:SetText(tablo.famille);
			itemName = _G[buttonName.."_Pctdrop"];
			if ( DBCORPS_OBJET_LISTE[j][3] == nil ) then
				itemName:SetText("");
			else
				itemName:SetText(format("%.2f",DBCORPS_OBJET_LISTE[j][3]));
			end
			itemName = _G[buttonName.."_Nbcorps"];
			itemName:SetText(tablo.nbcorps);
			itemName = _G[buttonName.."_Nbskin"];
			itemName:SetText(tablo.nbskin);
			if ( tablo.nbskin ) then
				if ( tablo.nbskin == 0 ) then
					itemName:SetText(nil);
				end
			end
			itemName = _G[buttonName.."_Nomregion"];
			itemName:SetText(DB_nomregionbynum(numregion));
			--itemName:SetText(DBCS_Region_nom_region(numregion));
			itemName = _G[buttonName.."_Nummob"];
			itemName:SetText(tablo.nummob);
		end
	end

end

function DBcorps_ConnaissanceBete_Scroll_Update()

	local i,j;
	local offset = FauxScrollFrame_GetOffset(DBcorpsFrame_ConnaissanceBeteFrame_Liste_ScrollFrame);
	local button,buttonName;
	local itemObjet;
	local tablo;
	local snommob,snumregion,iniveau,sclasse,stype,sfamille,idmin,idmax,iarmure,ipdv,stechnique;

	FauxScrollFrame_Update(DBcorpsFrame_ConnaissanceBeteFrame_Liste_ScrollFrame, DBCORPS_ConnaissanceBete_LISTE_nb, 10, 32);

	for i = 1 , 10 do
		j = offset + i;
		buttonName = "DBcorpsFrame_ConnaissanceBeteFrame_Liste_Button"..i;
		button = _G[buttonName];
		if ( j > DBCORPS_ConnaissanceBete_LISTE_nb ) then
			button:Hide();
		else
			button:Show();
			snommob = DBCORPS_ConnaissanceBete_LISTE[j][1];
			snumregion = DBCORPS_ConnaissanceBete_LISTE[j][2];
			iniveau = DBCORPS_ConnaissanceBete_LISTE[j][3];
			sclasse = DBCORPS_ConnaissanceBete_LISTE[j][4];
			stype = DBCORPS_ConnaissanceBete_LISTE[j][5];
			sfamille = DBCORPS_ConnaissanceBete_LISTE[j][6];
			idmin = DBCORPS_ConnaissanceBete_LISTE[j][7];
			idmax = DBCORPS_ConnaissanceBete_LISTE[j][8];
			iarmure = DBCORPS_ConnaissanceBete_LISTE[j][9];
			ipdv = DBCORPS_ConnaissanceBete_LISTE[j][10];
			sdomptable = DBCORPS_ConnaissanceBete_LISTE[j][11];
			stechnique = DBCORPS_ConnaissanceBete_LISTE[j][12];
			itemObjet = _G[buttonName.."_Name"];
			itemObjet:SetText(snommob);
			if ( sdomptable ) then
				if ( sdomptable == "1" ) then
					itemObjet:SetTextColor(0,1,0);		-- vert
				else
					itemObjet:SetTextColor(1,0,0);		-- rouge
				end
			else
				itemObjet:SetTextColor(1,1,1);		-- blanc
			end
			itemObjet = _G[buttonName.."_Niveau"];
			itemObjet:SetText(iniveau);
			if ( iniveau ) then
				if ( iniveau == 0 ) then
					itemObjet:SetText(nil);
				end
			end
			itemObjet = _G[buttonName.."_Classe"];
			itemObjet:SetText(sclasse);
			itemObjet = _G[buttonName.."_Famille"];
			itemObjet:SetText(sfamille);
			itemObjet = _G[buttonName.."_Dmin"];
			itemObjet:SetText(idmin);
			if ( idmin ) then
				if ( idmin == 0 ) then
					itemObjet:SetText(nil);
				end
			end
			itemObjet = _G[buttonName.."_Dmax"];
			itemObjet:SetText(idmax);
			if ( idmax ) then
				if ( idmax == 0 ) then
					itemObjet:SetText(nil);
				end
			end
			itemObjet = _G[buttonName.."_Armure"];
			itemObjet:SetText(iarmure);
			if ( iarmure ) then
				if ( iarmure == 0 ) then
					itemObjet:SetText(nil);
				end
			end
			if ( sdomptable and sdomptable == "1" ) then
				itemObjet:SetTextColor(0,1,0);		-- vert
			else
				itemObjet:SetTextColor(1,0,0);		-- rouge
			end
			itemObjet = _G[buttonName.."_Pdv"];
			itemObjet:SetText(ipdv);
			if ( ipdv ) then
				if ( ipdv == 0 ) then
					itemObjet:SetText(nil);
				end
			end
			itemObjet = _G[buttonName.."_Technique"];
			itemObjet:SetText(stechnique);
			itemObjet = _G[buttonName.."_Nomregion"];
			itemObjet:SetText(DB_nomregionbynum(snumregion));
		end
	end

end

function DBcorps_PNJ_Scroll_Update()

local i,j,k,l;
local offset = FauxScrollFrame_GetOffset(DBcorpsFrame_PNJFrame_Liste_ScrollFrame);
local button,buttonName;
local inumPNJ;
local itemName_NumPNJ;
local itemName_NomPNJ;
local itemName_NomSKIN;
local itemName_NomBLP;
local itemModel;
local sval;
local sval_tableau;
local sval_type;
local sval_rep;
local sval_skin;
local sval_blp;
local sval_blp2;
local sval_blp2_tableau;
local sval_blp2_tableau_blp;
local sval_blp2_tableau_blp_i;
local sval_b;
local smot_milieu;
local ilen;
local smot_tout;
local snom;
local sregion;
local inivcarte;
local btrouve;
local itemName_Type2;
local itemName_Region_0;
local itemName_Region_1;

	FauxScrollFrame_Update(DBcorpsFrame_PNJFrame_Liste_ScrollFrame, DBCORPS_PNJ_LISTE_nb, 10, 32);

	for i = 1 , 10 do
		j = offset + i;
		buttonName = "DBcorpsFrame_PNJFrame_Liste_Button"..i;
		button = _G[buttonName];
		if ( j > DBCORPS_PNJ_LISTE_nb ) then
			button:Hide();
		else
			button:Show();
			inumPNJ = DBCORPS_PNJ_LISTE[j][1];
			itemName_SPELL = _G[buttonName.."_SPELL"];
			if ( DBCS_mobs_spell and DBCS_mobs_spell[inumPNJ] ) then
				itemName_SPELL:Show();
			else
				itemName_SPELL:Hide();
			end
			itemName_NumPNJ = _G[buttonName.."_NumPNJ"];
			itemName_NumPNJ:SetText(inumPNJ);
			itemName_NomPNJ = _G[buttonName.."_NomPNJ"];
			if ( DBmobs_Local and DBmobs_Local[inumPNJ] and DBmobs_Local[inumPNJ][1] ) then
				itemName_NomPNJ:SetText(DBmobs_Local[inumPNJ][1][1]);
			else
				itemName_NomPNJ:SetText(nil);
			end
			itemModel = _G[buttonName.."_Model"];
			itemModel:SetModel("creature/kiljaeden/kiljaeden.m2");
			itemModel:ClearModel();
			--if ( DBCS_Model_Viewer_numcreature ) then
				_G[buttonName.."_Model_button"]:Hide();
			--end
			itemName_NomSKIN = _G[buttonName.."_NomSKIN"];
			itemName_NomBLP = _G[buttonName.."_NomBLP"];
			if ( DBCS_mobs_model and DBCS_mobs_model[inumPNJ] and DBCS_mobs_model[inumPNJ][1] ) then
				sval = DBCS_mobs_model[inumPNJ][1]["model"];
				sval = string.gsub(sval,"\\","/");
				itemName_NomSKIN:SetText(sval);
--TraceFrame:AddMessage("model = "..(sval or ""));
				--itemModel:SetModel(sval);
				itemName_NomBLP:SetText(DBCS_mobs_model[inumPNJ][1]["blp"]);
			else
				itemName_NomSKIN:SetText(nil);
				itemName_NomBLP:SetText(nil);
			end
--TraceFrame:AddMessage("inumPNJ = "..(inumPNJ or ""));
			smot_milieu = format("%X",inumPNJ);
			ilen = strlen(smot_milieu);
			--if ( DBCS_corps_screen_wow_build > DBCS_corps_screen_wow_build_live ) then
				smot_tout = "unit:0xF53"..strrep("0",5-ilen)..smot_milieu.."00000000:bla";
			--else
			--	smot_tout = "unit:0xF53"..strrep("0",7-ilen)..smot_milieu.."000000:bla";
			--end
			DBcorpsFrame_Tooltip4TextLeft1:SetText(nil);
			DBcorpsFrame_Tooltip4:SetOwner(WorldFrame,"ANCHOR_NONE");
			DBcorpsFrame_Tooltip4:SetHyperlink(smot_tout);
			snom = DBcorpsFrame_Tooltip4TextLeft1:GetText();
			itemModel:SetPosition(0,0,0);
			if ( snom ) then
				--DBCS_Model_Viewer_DressUpFrame_Target_Model:SetCreature(inumPNJ);
				itemModel:SetCreature(inumPNJ);
				itemName_NomSKIN:SetTextColor(1,1,1);		-- blanc
				--if ( DBCS_Model_Viewer_numcreature ) then
					_G[buttonName.."_Model_button"]:Show();
				--end
				if ( DBCS_Model_Viewer_numcreature ) then
					DBCS_MVW_model_setposition_display(itemModel);
				end
				--if ( DBCS_MVW_position_tableau ) then
					--sval = itemModel:GetModel();
					--if ( type(sval) == "string" ) then
					--	sval = string.gsub(sval,"\\","/");
					--	if ( DBCS_MVW_position_tableau[sval] ) then
					--		itemModel:SetPosition(DBCS_MVW_position_tableau[sval]["z"],DBCS_MVW_position_tableau[sval]["x"],DBCS_MVW_position_tableau[sval]["y"]);
					--	end
					--end
				--end
			else
				if ( DBCS_mobs_model and DBCS_mobs_model[inumPNJ] and DBCS_mobs_model[inumPNJ][1] ) then
					sval = DBCS_mobs_model[inumPNJ][1]["model"];
					sval = string.lower(sval);
					sval = string.gsub(sval,"\\","/");
--TraceFrame:AddMessage("DBcorps_PNJ_Scroll_Update sval = "..sval);
					sval_tableau = { strsplit("/",sval) };
					sval_type = sval_tableau[1];
--TraceFrame:AddMessage("DBcorps_PNJ_Scroll_Update sval_type = "..sval_type);
					sval_rep = "";
					for k = 2 , table.getn(sval_tableau) - 1 do
						sval_rep = sval_rep..sval_tableau[k];
						if ( k < table.getn(sval_tableau) - 1 ) then
							sval_rep = sval_rep.."/";
						end
					end
--TraceFrame:AddMessage("DBcorps_PNJ_Scroll_Update sval_rep = "..sval_rep);
					sval_skin = sval_tableau[table.getn(sval_tableau)];
					sval_skin = strsub(sval_skin,1,strlen(sval_skin)-3);
--TraceFrame:AddMessage("DBcorps_PNJ_Scroll_Update sval_skin = "..sval_skin);
					if ( DBCS_mobs_model[inumPNJ][1]["blp"] ) then
						sval_blp = DBCS_mobs_model[inumPNJ][1]["blp"];
					else
						sval_blp = "@@";
					end
					sval_tableau = { strsplit("@",sval_blp) };
					sval_blp = "";
					for k = 1 , 3 do
						if ( sval_tableau[k] ) then
							sval_blp = sval_blp..sval_tableau[k];
						end
						if ( k < 3 ) then
							sval_blp = sval_blp.."@";
						end
					end
--TraceFrame:AddMessage("DBcorps_PNJ_Scroll_Update sval_blp = "..sval_blp);
					sval_b = false;
					if ( DBCS_mobs_model[inumPNJ][1]["display"] ) then
						itemModel:SetPosition(0,0,0);
						itemModel:SetModelScale(1);
						itemModel:SetDisplayInfo(DBCS_mobs_model[inumPNJ][1]["display"]);
						if ( DBCS_Model_Viewer_numcreature ) then
							DBCS_MVW_model_setposition_display(itemModel);
						end
						sval_b = true;
					else
						if ( DBCS_Model_Viewer_numcreature ) then
							if ( DBCS_model_data_creature_par_skin2[sval_type] and DBCS_model_data_creature_par_skin2[sval_type][sval_rep] and DBCS_model_data_creature_par_skin2[sval_type][sval_rep][sval_skin] ) then
								sval_b = true;
								if ( DBCS_model_data_creature_par_skin2[sval_type][sval_rep][sval_skin][sval_blp] and DBCS_mobs_model[inumPNJ][1]["blp"] ) then
									itemModel:SetPosition(0,0,0);
									itemModel:SetModelScale(1);
									l = 0;
									for k , _ in pairs(DBCS_model_data_creature_par_skin2[sval_type][sval_rep][sval_skin][sval_blp]) do
										l = k;
										--l = l + 1;
										--if ( l == 1 ) then
										--	itemModel:SetDisplayInfo(k);
										--end
									end
									itemModel:SetDisplayInfo(l);
								else
									sval_blp2_tableau_blp_i = 0;
									sval_blp2_tableau_blp = {};
									l = 0;
									for sval_blp2, _ in pairs(DBCS_model_data_creature_par_skin2[sval_type][sval_rep][sval_skin]) do
--TraceFrame:AddMessage("DBcorps_PNJ_Scroll_Update sval_blp2 = "..sval_blp2);
										l = l + 1;
										if ( l == 1 ) then
											sval_blp = sval_blp2;
										end
										sval_blp2_tableau = { strsplit("@",sval_blp2) };
										if ( sval_blp2_tableau[1] == sval_tableau[1] ) then
											sval_blp2_tableau_blp_i = sval_blp2_tableau_blp_i + 1;
											sval_blp2_tableau_blp[sval_blp2_tableau_blp_i] = sval_blp2;
											if ( sval_blp2_tableau_blp_i == 1 ) then
												sval_blp = sval_blp2;
											end
											if ( sval_blp2 == "@@" ) then
											else
												sval_blp = sval_blp2;
											end
										end
									end
									itemModel:SetPosition(0,0,0);
									itemModel:SetModelScale(1);
									l = 0;
									for k , _ in pairs(DBCS_model_data_creature_par_skin2[sval_type][sval_rep][sval_skin][sval_blp]) do
										l = k;
										--l = l + 1;
										--if ( l == 1 ) then
										--	itemModel:SetDisplayInfo(k);
										--end
									end
									itemModel:SetDisplayInfo(l);
								end
								if ( DBCS_Model_Viewer_numcreature ) then
									DBCS_MVW_model_setposition_display(itemModel);
								end
								--sval = itemModel:GetModel();
								--if ( type(sval) == "string" ) then
								--	sval = string.gsub(sval,"\\","/");
								--	if ( DBCS_MVW_position_tableau_display_info[sval] ) then
								--		itemModel:SetPosition(DBCS_MVW_position_tableau_display_info[sval]["z"],DBCS_MVW_position_tableau_display_info[sval]["x"],DBCS_MVW_position_tableau_display_info[sval]["y"]);
								--	end
								--end
							end
						end
					end
					if ( sval_b == false ) then
						itemModel:SetModel(sval);
						if ( DBCS_mobs_model[inumPNJ][1]["blp"] ) then
							DBmobsPNJ_Combo_t_init_afficher(itemModel,sval,DBCS_mobs_model[inumPNJ][1]["blp"]);
						end
						if ( DBCS_MVW_position_tableau ) then
							DBCS_MVW_model_setposition_display(itemModel);
							--sval = itemModel:GetModel();
							--if ( type(sval) == "string" ) then
							--	sval = string.gsub(sval,"\\","/");
							--	if ( DBCS_MVW_position_tableau[sval] ) then
							--		itemModel:SetPosition(DBCS_MVW_position_tableau[sval]["z"],DBCS_MVW_position_tableau[sval]["x"],DBCS_MVW_position_tableau[sval]["y"]);
							--	end
							--end
						end
					end
					--if ( DBCS_Model_Viewer_numcreature ) then
						_G[buttonName.."_Model_button"]:Show();
					--end
				end
				itemName_NomSKIN:SetTextColor(1,0.5,0);		-- orange
			end
			itemName_Type2 = _G[buttonName.."_Type2"];
			if ( DBCS_mobs_detail and DBCS_mobs_detail[inumPNJ] ) then
				if ( DBCS_mobs_detail[inumPNJ][3] ) then
					if ( DBCS_mobs_detail_tableau_type[DBCS_mobs_detail[inumPNJ][3]] ) then
						itemName_Type2:SetText(DBCS_mobs_detail_tableau_type[DBCS_mobs_detail[inumPNJ][3]]);
					else
						itemName_Type2:SetText(DBCS_mobs_detail[inumPNJ][3]);
					end
				else
					itemName_Type2:SetText(nil);
				end
				if ( DBCS_mobs_detail[inumPNJ][1] ) then
					if ( DBCS_mobs_detail[inumPNJ][1][0] ) then
						_G[buttonName.."_Diff_0"]:Show();
					else
						_G[buttonName.."_Diff_0"]:Hide();
					end
					if ( DBCS_mobs_detail[inumPNJ][1][1] ) then
						_G[buttonName.."_Diff_1"]:Show();
					else
						_G[buttonName.."_Diff_1"]:Hide();
					end
					if ( DBCS_mobs_detail[inumPNJ][1][2] ) then
						_G[buttonName.."_Diff_2"]:Show();
					else
						_G[buttonName.."_Diff_2"]:Hide();
					end
					if ( DBCS_mobs_detail[inumPNJ][1][3] ) then
						_G[buttonName.."_Diff_3"]:Show();
					else
						_G[buttonName.."_Diff_3"]:Hide();
					end
					if ( DBCS_mobs_detail[inumPNJ][1][4] ) then
						_G[buttonName.."_Diff_4"]:Show();
					else
						_G[buttonName.."_Diff_4"]:Hide();
					end
				else
					_G[buttonName.."_Diff_0"]:Hide();
					_G[buttonName.."_Diff_1"]:Hide();
					_G[buttonName.."_Diff_2"]:Hide();
					_G[buttonName.."_Diff_3"]:Hide();
					_G[buttonName.."_Diff_4"]:Hide();
				end
--	[4]	=	domptable : ( nil = inconnu, 0 = indomptable, 1 = domptable, 2 = exotique
				if ( DBCS_mobs_detail[inumPNJ][4] ) then
					_G[buttonName.."_Domptable"]:Show();
					if ( DBCS_mobs_detail[inumPNJ][4] == 0 ) then
						_G[buttonName.."_Domptable"]:SetText("X");
					elseif ( DBCS_mobs_detail[inumPNJ][4] == 1 ) then
						_G[buttonName.."_Domptable"]:SetText("1");
					elseif ( DBCS_mobs_detail[inumPNJ][4] == 2 ) then
						_G[buttonName.."_Domptable"]:SetText("2");
					else
						_G[buttonName.."_Domptable"]:Hide();
					end
				else
					_G[buttonName.."_Domptable"]:Hide();
				end
			else
				itemName_Type2:SetText(nil);
				_G[buttonName.."_Diff_0"]:Hide();
				_G[buttonName.."_Diff_1"]:Hide();
				_G[buttonName.."_Diff_2"]:Hide();
				_G[buttonName.."_Diff_3"]:Hide();
				_G[buttonName.."_Diff_4"]:Hide();
				_G[buttonName.."_Domptable"]:Hide();
			end
--	if ( DBCS_mobs_locs[inumpnj][sregion][inivcarte][imode] == nil ) then
			itemName_Region_0 = _G[buttonName.."_Region_0"];
			_G[buttonName.."_Liste_Region_0"]:Hide();
			itemName_Region_1 = _G[buttonName.."_Region_1"];
			_G[buttonName.."_Liste_Region_1"]:Hide();
			itemName_Region_0:SetText(nil);
			itemName_Region_1:SetText(nil);
			itemName_Region_0_Dropdown = _G[buttonName.."_Liste_Region_0"];
			if ( DBCS_mobs_locs and DBCS_mobs_locs[inumPNJ] ) then
				-- à modifier pour afficher le nom de la région qui a le + de locs
				btrouve = false;
				for sregion , _ in pairs(DBCS_mobs_locs[inumPNJ]) do
					if ( btrouve == false ) then
						for inivcarte , _ in pairs(DBCS_mobs_locs[inumPNJ][sregion]) do
							if ( btrouve == false and DBCS_mobs_locs[inumPNJ][sregion][inivcarte][0] ) then
								btrouve = true;
								itemName_Region_0:SetText(DBCS_Region_nom_region(sregion));
								_G[buttonName.."_Liste_Region_0"]:Show();
								--UIDropDownMenu_Initialize(itemName_Region_0_Dropdown, DBcorps_PNJ_Liste_Region_0_Initialize(inumPNJ));
							end
						end
					end
				end
				btrouve = false;
				for sregion , _ in pairs(DBCS_mobs_locs[inumPNJ]) do
					if ( btrouve == false ) then
						for inivcarte , _ in pairs(DBCS_mobs_locs[inumPNJ][sregion]) do
							if ( btrouve == false and DBCS_mobs_locs[inumPNJ][sregion][inivcarte][1] ) then
								btrouve = true;
								itemName_Region_1:SetText(DBCS_Region_nom_region(sregion));
								_G[buttonName.."_Liste_Region_1"]:Show();
								--UIDropDownMenu_Initialize(itemName_Region_0_Dropdown, DBcorps_PNJ_Liste_Region_0_Initialize(inumPNJ));
							end
						end
					end
				end
			else
			end
		end
	end

end

function DBcorps_PNJ_ScrollFrameTemplate_OnMouseWheel(self, value, scrollBar)

	scrollBar = scrollBar or _G[self:GetName().."ScrollBar"];
	if ( value > 0 ) then
		--scrollBar:SetValue(scrollBar:GetValue() - (scrollBar:GetHeight() / 2));
		scrollBar:SetValue(scrollBar:GetValue() - 32);
	else
		--scrollBar:SetValue(scrollBar:GetValue() + (scrollBar:GetHeight() / 2));
		scrollBar:SetValue(scrollBar:GetValue() + 32);
	end

end

--/script DBcorps_ListMob_Envoyer_vers_cms();
function DBcorps_ListMob_Envoyer_vers_cms()

local sdate,slead,stime;
local i;
local DBCS_mob;

	sdate = DBCS_date();
	slead = DBCS_joueur;
	stime = DBCS_time();
	DBCS_mob = {};
	DBCS_mob.time = GetTime();
if ( DBCS_debug > 1 ) then
TraceFrame:AddMessage("DBcorps_ListMob_Envoyer_vers_cms "..DBCORPS_MOB_CRITERES.nommob);
end
	DBCS_mob.name = DBCORPS_MOB_CRITERES.nommob;
	DBCS_mob.level = DBCORPS_MOB_CRITERES.detail.nivmin;
	DBCS_mob.classe = DBCORPS_MOB_CRITERES.detail.classe;
	DBCS_mob.famille = DBCORPS_MOB_CRITERES.detail.famille;
	DBCS_mob.type = DBCORPS_MOB_CRITERES.detail.type;
	DBCS_mob.plusmob = DBCORPS_MOB_CRITERES.detail.plusmob;
	DBCS_mob.nbloot = DBCORPS_MOB_LISTE_nb;
	DBCS_mob.loot = {};
	DBCS_mob.numzone = DBCORPS_MOB_CRITERES.numregion;
	DBCS_mob.x = 0;
	DBCS_mob.y = 0;
	for i = 1, DBCS_mob.nbloot do
		DBCS_mob.loot[i] = {};
		DBCS_mob.loot[i].numobjet = DBCORPS_MOB_LISTE[i][1];
		DBCS_mob.loot[i].numcourt2 = DBCORPS_MOB_LISTE[i][2];
		DBCS_mob.loot[i].nb = 0;
	end
	if ( DBCS_CMS_numcanalCMS > 0 ) then
		DBmobs_envoyermob(DBCS_getlocale,sdate,slead,stime,DBCS_mob.name,DBCS_mob.numzone,DBCS_mob.x,DBCS_mob.y,DBCS_mob.level,DBCS_mob.classe,DBCS_mob.famille,DBCS_mob.type,DBCS_mob.plusmob,0,0,DBCS_mob.nbloot);
	end
	for i = 1, DBCS_mob.nbloot do
		if ( DBCS_CMS_numcanalCMS > 0 ) then
			DBmobs_envoyerloot(DBCS_getlocale,sdate,slead,stime,i,DBCS_mob.loot[i].numobjet,DBCS_mob.loot[i].numcourt2,DBCS_mob.loot[i].nb);
		end
	end

end

function DBcorps_ListMob_Criteres()

local element_base;
local element;

	element_base = "DBcorpsFrame_MobFrame_Criteres_";

	element = _G[element_base.."Nommob"];
	element:SetText(DBCORPS_MOB_CRITERES.nommob);
	element = _G[element_base.."Nivmin"];
	element:SetText(DBCORPS_MOB_CRITERES.detail.nivmin);
	element = _G[element_base.."Nivmax"];
	element:SetText(DBCORPS_MOB_CRITERES.detail.nivmax);
	element = _G[element_base.."Classe"];
	element:SetText(DBCORPS_MOB_CRITERES.detail.classe);
	element = _G[element_base.."Type"];
	element:SetText(DBCORPS_MOB_CRITERES.detail.type);
	element = _G[element_base.."Famille"];
	element:SetText(DBCORPS_MOB_CRITERES.detail.famille);
	element = _G[element_base.."Region"];
	element:SetText(DB_nomregionbynum(DBCORPS_MOB_CRITERES.numregion));
	element = _G[element_base.."Nbcorps"];
	element:SetText(DBCORPS_MOB_CRITERES.detail.nbcorps);
	element = _G[element_base.."Nbskin"];
	element:SetText(DBCORPS_MOB_CRITERES.detail.nbskin);
	element = _G[element_base.."SalaireMoney"];
	if ( DBCORPS_MOB_CRITERES.detail.salaire ) then
		element:Show();
		MoneyFrame_Update(element:GetName(), DBCORPS_MOB_CRITERES.detail.salaire);
	else
		element:Hide();
	end
	--DBcorpsFrame_MobFrame_Criteres_Modele_IconTexture:SetTexture("interface/cursor/unableinspect.blp");
	--DBcorpsFrame_MobFrame_Criteres_Modele_IconTexture:Hide();
	DBcorpsFrame_MobFrame_Criteres_Modele:Hide();
	if ( DBCS_MVW_exist == true and DBCORPS_MOB_CRITERES.detail ) then
		stype,_,_,_,_,_ = DBmobs_MVW_detail_modele(DBCORPS_MOB_CRITERES.nommob,DBCORPS_MOB_CRITERES.numregion);
		if ( stype ) then
			--DBcorpsFrame_MobFrame_Criteres_Modele_IconTexture:SetTexture("interface/cursor/inspect.blp");
			--DBcorpsFrame_MobFrame_Criteres_Modele_IconTexture:Show();
			DBcorpsFrame_MobFrame_Criteres_Modele:Show();
		end
	end
	if ( DBCS_mobs_spell and DBMS[DBCORPS_MOB_CRITERES.nommob] and DBMS[DBCORPS_MOB_CRITERES.nommob][DBCORPS_MOB_CRITERES.numregion] and DBMS[DBCORPS_MOB_CRITERES.nommob][DBCORPS_MOB_CRITERES.numregion][29] and DBCS_mobs_spell[DBMS[DBCORPS_MOB_CRITERES.nommob][DBCORPS_MOB_CRITERES.numregion][29]] ) then
		DBcorpsFrame_MobFrame_Criteres_ListeSpell:Show();
	end

end

function DBcorps_ListMobs_Select(self)

local button = self;
local i = button:GetID();
local stype;

	i = i + FauxScrollFrame_GetOffset(DBcorpsFrame_MobsFrame_Liste_ScrollFrame);
	DBCORPS_MOB_CRITERES.nommob = DBCORPS_MOBS_LISTE[i][1];
	DBCORPS_MOB_CRITERES.numregion = DBCORPS_MOBS_LISTE[i][2];
	DBCORPS_MOB_CRITERES.detail = DBmobs_Detail(DBCORPS_MOBS_LISTE[i][1],DBCORPS_MOBS_LISTE[i][2],DBCS_salaireskin);
	DBcorpsFrame_MobFrame_Criteres_ListeSpell:Hide();
	DBcorps_ListMob_Criteres();

	DBCORPS_MOB_LISTE = DBmobs_Objets(DBCORPS_MOB_CRITERES);
	DBCORPS_MOB_LISTE_nb = table.getn(DBCORPS_MOB_LISTE);

	_G["DBcorpsFrame_MobFrame_Criteres_Elements"]:SetText(DBCORPS_MOB_LISTE_nb.." \195\169l\195\169ments trouv\195\169s.")
	DBcorps_ListMob_Trier();

	DBcorpsFrame_MobFrame_Liste_ScrollFrameScrollBar:SetValue(0);
	DBcorps_Mob_Scroll_Update();

	--if ( DBCORPS_MOB_LISTE_nb > 0 ) then

		PanelTemplates_SetTab(DBcorpsFrame, 3);
		DBcorps_ShowSubFrame(3);

	--end

end

function DBcorps_ListMob_Item_Modele_OnEnter(self)

local stype,srep,sgenre,snom,sblp;
local smodele;

	stype,srep,sgenre,snom,sblp,_ = DBmobs_MVW_detail_modele(DBCORPS_MOB_CRITERES.nommob,DBCORPS_MOB_CRITERES.numregion);
	if ( stype ) then
		smodele = "";
		smodele = smodele..stype.."/";
		smodele = smodele..srep.."/";
		if ( sgenre ) then
			smodele = smodele..sgenre.."/";
		end
		smodele = smodele..snom..".m2";
		GameTooltip:SetOwner(self, "ANCHOR_RIGHT");
		GameTooltip:AddLine(smodele);
		GameTooltip:Show();
	end

end

function DBcorps_ListMob_Item_Modele_OnClick()

local stype,srep,sgenre,snom,sblp;
local smodele;
local inummodele;

	if ( DBCS_MVW_exist == true ) then
		stype,srep,sgenre,snom,sblp,inumcreature = DBmobs_MVW_detail_modele(DBCORPS_MOB_CRITERES.nommob,DBCORPS_MOB_CRITERES.numregion);
		if ( inumcreature ) then
			DBCS_MVW_afficher_mobs_model(inumcreature);
			DBCS_Model_Viewer_numcreature = inumcreature;
			DBCS_Model_Viewer_creature_afficher();
		else
			if ( stype ) then
				ShowUIPanel(DBCS_Model_Viewer_DressUpFrame);
				DBCS_Model_Viewer_DressUpFrameModel_Player_OnClick();
				smodele = "";
				smodele = smodele..srep;
				if ( sgenre ) then
					smodele = smodele.."/"..sgenre;
				end
				DBCS_MVW_afficher_modele_blp(stype,smodele,snom..".m2",nil,nil);
			end
		end
--[[
		if ( stype ) then
			DBCS_Model_Viewer_Model_OnShow();
			if ( stype == "character" ) then
				--smodele = stype.."/"..srep.."/"..sgenre.."/"..snom..".m2";
				ShowUIPanel(DBCS_Model_Viewer_DressUpFrame);
				smodele = "";
				smodele = smodele..stype.."/";
				smodele = smodele..srep.."/";
				if ( sgenre ) then
					smodele = smodele..sgenre.."/";
				end
				smodele = smodele..snom..".m2";
				DBCS_MVW_affichermodele_m2(srep,snom,smodele,inumcreature)
			elseif ( stype == "creature" ) then
				inummodele = DBCS_MVW_recherche_nummodele(srep,snom);
				if ( inummodele ) then
					ShowUIPanel(DBCS_Model_Viewer_DressUpFrame);
					DBCS_MVW_affichermodele(inummodele,false,inumcreature);
				else
					ShowUIPanel(DBCS_Model_Viewer_DressUpFrame);
					smodele = "";
					smodele = smodele..stype.."/";
					smodele = smodele..srep.."/";
					if ( sgenre ) then
						smodele = smodele..sgenre.."/";
					end
					smodele = smodele..snom..".m2";
					DBCS_MVW_affichermodele_m2(srep,snom,smodele,inumcreature)
				end
				--smodele = stype.."/"..srep.."/"..snom..".m2";
			end
		end
--]]
	end

end

function DBcorps_AfficherObjet(numobjet,numcourt2)

	DBCORPS_OBJET_CRITERES.numobjet = numobjet;
	DBCORPS_OBJET_CRITERES.numcourt2 = numcourt2;
	DBCORPS_OBJET_CRITERES.detail = DBOS_detail(DBCORPS_OBJET_CRITERES.numobjet,DBCORPS_OBJET_CRITERES.numcourt2);
	DBcorps_ListObjet_Criteres();
	DBCORPS_OBJET_LISTE = DBmobs_Liste_des_mobs_ayant_l_objet(DBCORPS_OBJET_CRITERES);
	DBCORPS_OBJET_LISTE_nb = table.getn(DBCORPS_OBJET_LISTE);
	_G["DBcorpsFrame_ObjetFrame_Criteres_Elements"]:SetText(DBCORPS_OBJET_LISTE_nb.." \195\169l\195\169ments trouv\195\169s.")
	DBcorps_ListObjet_Trier();

	if ( DBCORPS_OBJET_LISTE_nb > 0 ) then
		DBcorps_init();
		--DBcorpsFrame:Show();
		PanelTemplates_SetTab(DBcorpsFrame, 4);
		DBcorps_ShowSubFrame(4);
	end

	DBcorpsFrame_ObjetFrame_Liste_ScrollFrameScrollBar:SetValue(0);
	DBcorps_Objet_Scroll_Update();

	if ( DBCS_prog_serveur == 1 ) then
		DBCORPS_QUETES_LISTE = DBquetes_rechercheobjet(DBCORPS_OBJET_CRITERES.numobjet);
		DBCORPS_QUETES_LISTE_nb = table.getn(DBCORPS_QUETES_LISTE);
		_G["DBcorpsFrame_QuetesFrame_Criteres_Elements"]:SetText(DBCORPS_QUETES_LISTE_nb.." \195\169l\195\169ments trouv\195\169s.")
		DBcorps_ListQuetes_Trier();
	end

	DBCORPS_QUETES2_LISTE = DBquetes2_rechercheobjet(DBCORPS_OBJET_CRITERES.numobjet);
	DBCORPS_QUETES2_LISTE_nb = table.getn(DBCORPS_QUETES2_LISTE);
	_G["DBcorpsFrame_Quetes2Frame_Criteres_Elements"]:SetText(DBCORPS_QUETES2_LISTE_nb.." \195\169l\195\169ments trouv\195\169s.")
	DBcorps_ListQuetes2_Trier();

	if ( DBCORPS_OBJET_LISTE_nb == 0 and DBQS ) then
		if ( DBCORPS_QUETES2_LISTE_nb > 0 ) then
			DBcorps_init();
			PanelTemplates_SetTab(DBcorpsFrame, 6);
			DBcorps_ShowSubFrame(6);
		else
			if ( DBCORPS_QUETES_LISTE_nb > 0 and DBCS_prog_serveur == 1 ) then
				DBcorps_init();
				PanelTemplates_SetTab(DBcorpsFrame, 5);
				DBcorps_ShowSubFrame(5);
			else
				PlaySound("igQuestFailed");
			end
		end
	else
		if ( DBCORPS_OBJET_LISTE_nb == 0 ) then
			PlaySound("igQuestFailed");
		end
	end

	if ( DBCS_prog_serveur == 1 ) then
		FauxScrollFrame_SetOffset(DBcorpsFrame_QuetesFrame_Liste_ScrollFrame,0);
		DBcorpsFrame_QuetesFrame_Liste_ScrollFrameScrollBar:SetValue(0);
		DBcorps_Quetes_Scroll_Update();
	end
	FauxScrollFrame_SetOffset(DBcorpsFrame_Quetes2Frame_Liste_ScrollFrame,0);
	DBcorpsFrame_Quetes2Frame_Liste_ScrollFrameScrollBar:SetValue(0);
	DBcorps_Quetes2_Scroll_Update();

end

function DBcorps_ListObjets_Select(self)

local button = self;
local i = button:GetID();
local inumobjet;
local senchant;
local ipos;

	i = i + FauxScrollFrame_GetOffset(DBcorpsFrame_ObjetsFrame_Liste_ScrollFrame);
	if ( DBCORPS_OBJETS_LISTE[i][5] == "e" ) then
		inumobjet = DBCORPS_OBJETS_LISTE[i][1];
		if ( DBOS_enchant[inumobjet] ) then
			senchant = DBOS_enchant[inumobjet][1];
			ipos = strfind(senchant,": ");
			if ( ipos ) then
				senchant = strsub(senchant,ipos+2);
			end
			DBCS_affichermob(senchant,"0");
		end
		return nil;
	end
	DBCORPS_OBJET_CRITERES.numobjet = DBCORPS_OBJETS_LISTE[i][1];
	if ( IsControlKeyDown()  and DBQS ) then

		if ( DBCS_prog_serveur == 1 ) then
			DBCORPS_QUETES_LISTE = DBquetes_rechercheobjet(DBCORPS_OBJET_CRITERES.numobjet);
			DBCORPS_QUETES_LISTE_nb = table.getn(DBCORPS_QUETES_LISTE);
			_G["DBcorpsFrame_QuetesFrame_Criteres_Elements"]:SetText(DBCORPS_QUETES_LISTE_nb.." \195\169l\195\169ments trouv\195\169s.")
			DBcorps_ListQuetes_Trier();

			FauxScrollFrame_SetOffset(DBcorpsFrame_QuetesFrame_Liste_ScrollFrame,0);
			DBcorpsFrame_QuetesFrame_Liste_ScrollFrameScrollBar:SetValue(0);
			DBcorps_Quetes_Scroll_Update();
		end

		DBCORPS_QUETES2_LISTE = DBquetes2_rechercheobjet(DBCORPS_OBJET_CRITERES.numobjet);
		DBCORPS_QUETES2_LISTE_nb = table.getn(DBCORPS_QUETES2_LISTE);
		_G["DBcorpsFrame_Quetes2Frame_Criteres_Elements"]:SetText(DBCORPS_QUETES2_LISTE_nb.." \195\169l\195\169ments trouv\195\169s.")
		DBcorps_ListQuetes2_Trier();

		FauxScrollFrame_SetOffset(DBcorpsFrame_Quetes2Frame_Liste_ScrollFrame,0);
		DBcorpsFrame_Quetes2Frame_Liste_ScrollFrameScrollBar:SetValue(0);
		DBcorps_Quetes2_Scroll_Update();

		if ( DBCORPS_QUETES2_LISTE_nb > 0 ) then
			PanelTemplates_SetTab(DBcorpsFrame, 6);
			DBcorps_ShowSubFrame(6);
		else
			if ( DBCORPS_QUETES_LISTE_nb > 0 and DBCS_prog_serveur == 1 ) then
				PanelTemplates_SetTab(DBcorpsFrame, 5);
				DBcorps_ShowSubFrame(5);
			else
				PlaySound("igQuestFailed");
			end
		end
	else
		DBCORPS_OBJET_CRITERES.numcourt2 = DBCORPS_OBJETS_LISTE[i][2];
		DBCORPS_OBJET_CRITERES.detail = DBOS_detail(DBCORPS_OBJET_CRITERES.numobjet,DBCORPS_OBJET_CRITERES.numcourt2);
		DBcorps_ListObjet_Criteres();
		DBCORPS_OBJET_LISTE = DBmobs_Liste_des_mobs_ayant_l_objet(DBCORPS_OBJET_CRITERES);
		DBCORPS_OBJET_LISTE_nb = table.getn(DBCORPS_OBJET_LISTE);
		_G["DBcorpsFrame_ObjetFrame_Criteres_Elements"]:SetText(DBCORPS_OBJET_LISTE_nb.." \195\169l\195\169ments trouv\195\169s.")
		DBcorps_ListObjet_Trier();

		DBcorpsFrame_ObjetFrame_Liste_ScrollFrameScrollBar:SetValue(0);
		DBcorps_Objet_Scroll_Update();

		if ( DBCORPS_OBJET_LISTE_nb > 0 ) then
			PanelTemplates_SetTab(DBcorpsFrame, 4);
			DBcorps_ShowSubFrame(4);
		end

		if ( DBCS_prog_serveur == 1 ) then
			DBCORPS_QUETES_LISTE = DBquetes_rechercheobjet(DBCORPS_OBJET_CRITERES.numobjet);
			DBCORPS_QUETES_LISTE_nb = table.getn(DBCORPS_QUETES_LISTE);
			_G["DBcorpsFrame_QuetesFrame_Criteres_Elements"]:SetText(DBCORPS_QUETES_LISTE_nb.." \195\169l\195\169ments trouv\195\169s.")
			DBcorps_ListQuetes_Trier();

			FauxScrollFrame_SetOffset(DBcorpsFrame_QuetesFrame_Liste_ScrollFrame,0);
			DBcorpsFrame_QuetesFrame_Liste_ScrollFrameScrollBar:SetValue(0);
			DBcorps_Quetes_Scroll_Update();
		end

		DBCORPS_QUETES2_LISTE = DBquetes2_rechercheobjet(DBCORPS_OBJET_CRITERES.numobjet);
		DBCORPS_QUETES2_LISTE_nb = table.getn(DBCORPS_QUETES2_LISTE);
		_G["DBcorpsFrame_Quetes2Frame_Criteres_Elements"]:SetText(DBCORPS_QUETES2_LISTE_nb.." \195\169l\195\169ments trouv\195\169s.")
		DBcorps_ListQuetes2_Trier();

		FauxScrollFrame_SetOffset(DBcorpsFrame_Quetes2Frame_Liste_ScrollFrame,0);
		DBcorpsFrame_Quetes2Frame_Liste_ScrollFrameScrollBar:SetValue(0);
		DBcorps_Quetes2_Scroll_Update();

		if ( DBCORPS_OBJET_LISTE_nb == 0 and DBQS ) then
			if ( DBCORPS_QUETES2_LISTE_nb > 0 ) then
				PanelTemplates_SetTab(DBcorpsFrame, 6);
				DBcorps_ShowSubFrame(6);
			else
				if ( DBCORPS_QUETES_LISTE_nb > 0 and DBCS_prog_serveur == 1 ) then
					PanelTemplates_SetTab(DBcorpsFrame, 5);
					DBcorps_ShowSubFrame(5);
				else
					PlaySound("igQuestFailed");
				end
			end
		else
			if ( DBCORPS_OBJET_LISTE_nb == 0 ) then
				PlaySound("igQuestFailed");
			end
		end

	end

end

function DBcorps_ListMob_Select(self)

local button = self;
local i = button:GetID();

	i = i + FauxScrollFrame_GetOffset(DBcorpsFrame_MobFrame_Liste_ScrollFrame);
	if ( DBCORPS_MOB_LISTE[i][5] == "e" ) then
		PlaySound("igQuestFailed");
		return nil;
	end
	DBCORPS_OBJET_CRITERES.numobjet = DBCORPS_MOB_LISTE[i][1];
	DBCORPS_OBJET_CRITERES.numcourt2 = DBCORPS_MOB_LISTE[i][2];
	DBCORPS_OBJET_CRITERES.detail = DBOS_detail(DBCORPS_OBJET_CRITERES.numobjet,DBCORPS_OBJET_CRITERES.numcourt2);
	DBcorps_ListObjet_Criteres();

	DBCORPS_OBJET_LISTE = DBmobs_Liste_des_mobs_ayant_l_objet(DBCORPS_OBJET_CRITERES);
	DBCORPS_OBJET_LISTE_nb = table.getn(DBCORPS_OBJET_LISTE);
	_G["DBcorpsFrame_ObjetFrame_Criteres_Elements"]:SetText(DBCORPS_OBJET_LISTE_nb.." \195\169l\195\169ments trouv\195\169s.")
	DBcorps_ListObjet_Trier();

	FauxScrollFrame_SetOffset(DBcorpsFrame_ObjetFrame_Liste_ScrollFrame,0);
	DBcorpsFrame_ObjetFrame_Liste_ScrollFrameScrollBar:SetValue(0);
	DBcorps_Objet_Scroll_Update();

	if ( DBCS_prog_serveur == 1 ) then
		DBCORPS_QUETES_LISTE = DBquetes_rechercheobjet(DBCORPS_OBJET_CRITERES.numobjet);
		DBCORPS_QUETES_LISTE_nb = table.getn(DBCORPS_QUETES_LISTE);
		_G["DBcorpsFrame_QuetesFrame_Criteres_Elements"]:SetText(DBCORPS_QUETES_LISTE_nb.." \195\169l\195\169ments trouv\195\169s.")
		DBcorps_ListQuetes_Trier();

		FauxScrollFrame_SetOffset(DBcorpsFrame_QuetesFrame_Liste_ScrollFrame,0);
		DBcorpsFrame_QuetesFrame_Liste_ScrollFrameScrollBar:SetValue(0);
		DBcorps_Quetes_Scroll_Update();
	end

	DBCORPS_QUETES2_LISTE = DBquetes2_rechercheobjet(DBCORPS_OBJET_CRITERES.numobjet);
	DBCORPS_QUETES2_LISTE_nb = table.getn(DBCORPS_QUETES2_LISTE);
	_G["DBcorpsFrame_Quetes2Frame_Criteres_Elements"]:SetText(DBCORPS_QUETES2_LISTE_nb.." \195\169l\195\169ments trouv\195\169s.")
	DBcorps_ListQuetes2_Trier();

	FauxScrollFrame_SetOffset(DBcorpsFrame_Quetes2Frame_Liste_ScrollFrame,0);
	DBcorpsFrame_Quetes2Frame_Liste_ScrollFrameScrollBar:SetValue(0);
	DBcorps_Quetes2_Scroll_Update();

	if ( DBCORPS_OBJET_LISTE_nb > 0 ) then
		PanelTemplates_SetTab(DBcorpsFrame, 4);
		DBcorps_ShowSubFrame(4);
	else
		if ( DBCORPS_QUETES2_LISTE_nb > 0 ) then
			PanelTemplates_SetTab(DBcorpsFrame, 6);
			DBcorps_ShowSubFrame(6);
		else
			if ( DBCS_prog_serveur == 1 ) then
				if ( DBCORPS_QUETES_LISTE_nb > 0 ) then
					PanelTemplates_SetTab(DBcorpsFrame, 5);
					DBcorps_ShowSubFrame(5);
				end
			end
		end
	end

end

--	link = "item:"..DBCORPS_OBJET_CRITERES.numobjet..":"..DBCORPS_OBJET_CRITERES.numcourt2;
function DBcorps_ListObjet_Supprimer(index)

--local button = this;
--local i = button:GetID();

local snommob;
local snumregion;
local inumobjet;

	--i = i + FauxScrollFrame_GetOffset(DBcorpsFrame_ObjetFrame_Liste_ScrollFrame);
	snommob = DBCORPS_OBJET_LISTE[index][1];
	snumregion = DBCORPS_OBJET_LISTE[index][2];
	inumobjet = DBCORPS_OBJET_CRITERES.numobjet;
	--StaticPopup_Hide("ABANDON_QUEST_WITH_ITEMS");
	--StaticPopup_Show("ABANDON_QUEST", GetAbandonQuestName());

	StaticPopupDialogs["DBCS_STATICPOPUPDIALOG_SUPPRIMERLOOT"] = {
		text = "Etes-vous s\195\187r de vouloir supprimer l'objet ["..inumobjet.."] pour le mob ["..snommob.."] de la r\195\169gion ["..snumregion.."] ?",
		button1 = TEXT(ACCEPT),
		button2 = TEXT(CANCEL),
		OnAccept = function()
			DBCS_supprimerloot(snommob,snumregion,inumobjet,index);
		end,
		timeout = 60,
		--whileDead = 1,
		hideOnEscape = 1
	};
	StaticPopup_Show("DBCS_STATICPOPUPDIALOG_SUPPRIMERLOOT");
	--DBmobs_supprimerloot(snommob,snumregion,inumobjet);

end

function DBCS_supprimerloot(snommob,snumregion,inumobjet,index)

local bbon;

	bbon = DBmobs_supprimerloot(snommob,snumregion,inumobjet);
	
	if ( bbon == true ) then
		table.remove(DBCORPS_OBJET_LISTE,index);
		DBOS_tooltip_surqui[inumobjet] = nil;
		DBCORPS_OBJET_LISTE_nb = table.getn(DBCORPS_OBJET_LISTE);
		_G["DBcorpsFrame_ObjetFrame_Criteres_Elements"]:SetText(DBCORPS_OBJET_LISTE_nb.." \195\169l\195\169ments trouv\195\169s.")
		DBcorps_Objet_Scroll_Update();
	end

end

function DBcorps_ListObjet_Select(self)

local button = self;
local i = button:GetID();
local stype;

	i = i + FauxScrollFrame_GetOffset(DBcorpsFrame_ObjetFrame_Liste_ScrollFrame);
	DBCORPS_MOB_CRITERES.nommob = DBCORPS_OBJET_LISTE[i][1];
	DBCORPS_MOB_CRITERES.numregion = DBCORPS_OBJET_LISTE[i][2];
	DBCORPS_MOB_CRITERES.detail = DBmobs_Detail(DBCORPS_OBJET_LISTE[i][1],DBCORPS_OBJET_LISTE[i][2],DBCS_salaireskin);
	DBcorpsFrame_MobFrame_Criteres_ListeSpell:Hide();
	DBcorps_ListMob_Criteres();

	--DBcorpsFrame_MobFrame_Criteres_Modele_IconTexture:SetTexture("interface/cursor/unableinspect.blp");
	DBcorpsFrame_MobFrame_Criteres_Modele_IconTexture:Hide();
	if ( DBCS_MVW_exist == true and DBCORPS_MOB_CRITERES.detail ) then
		stype,_,_,_,_,_ = DBmobs_MVW_detail_modele(DBCORPS_MOB_CRITERES.nommob,DBCORPS_MOB_CRITERES.numregion);
		if ( stype ) then
			--DBcorpsFrame_MobFrame_Criteres_Modele_IconTexture:SetTexture("interface/cursor/inspect.blp");
			DBcorpsFrame_MobFrame_Criteres_Modele_IconTexture:Show();
		end
	end

	DBCORPS_MOB_LISTE = DBmobs_Objets(DBCORPS_MOB_CRITERES);
	DBCORPS_MOB_LISTE_nb = table.getn(DBCORPS_MOB_LISTE);
	_G["DBcorpsFrame_MobFrame_Criteres_Elements"]:SetText(DBCORPS_MOB_LISTE_nb.." \195\169l\195\169ments trouv\195\169s.")
	DBcorps_ListMob_Trier();

	DBcorpsFrame_MobFrame_Liste_ScrollFrameScrollBar:SetValue(0);
	DBcorps_Mob_Scroll_Update();

	if ( DBCORPS_MOB_LISTE_nb > 0 ) then

		PanelTemplates_SetTab(DBcorpsFrame, 3);
		DBcorps_ShowSubFrame(3);

	end

end

function DBcorps_ListObjet_Criteres()

local element_base;
local element;
local r,g,b,hex;

	element_base = "DBcorpsFrame_ObjetFrame_Criteres_";

	element = _G[element_base.."Nomobjet"];
	if ( DBCORPS_OBJET_CRITERES.detail and DBCORPS_OBJET_CRITERES.detail.nomobjet ) then
		element:SetText(DBCORPS_OBJET_CRITERES.detail.nomobjet);
	else
		element:SetText("");
	end
	if ( DBCORPS_OBJET_CRITERES.detail and DBCORPS_OBJET_CRITERES.detail.nomobjet ) then
		r,g,b,hex = GetItemQualityColor(DBCORPS_OBJET_CRITERES.detail.rarity);
		element:SetTextColor(r, g, b);
	end
	element = _G[element_base.."Item_IconTexture"];
	if ( DBCORPS_OBJET_CRITERES.detail and DBCORPS_OBJET_CRITERES.detail.nomobjet ) then
		element:SetTexture("Interface/Icons/INV_Misc_QuestionMark");
		element:SetTexture(DBCORPS_OBJET_CRITERES.detail.texture);
	else
		element:SetTexture("");
	end
	if ( DBCORPS_OBJET_CRITERES.detail and DBCORPS_OBJET_CRITERES.detail.nomobjet and DBCORPS_OBJET_CRITERES.detail.t70 and DBCORPS_OBJET_CRITERES.detail.t70 == 1 ) then
		_G[element_base.."AltCurrencyFrameItem1"]:Hide();
		_G[element_base.."AltCurrencyFrameItem2"]:Hide();
		_G[element_base.."AltCurrencyFrameItem3"]:Hide();
		if ( DBCORPS_OBJET_CRITERES.detail.t72 and DBCORPS_OBJET_CRITERES.detail.t72 > 0 ) then
			DBCS_MerchantFrame_UpdateAltCurrency(element_base.."AltCurrencyFrame", DBCORPS_OBJET_CRITERES.detail);
			MoneyFrame_Update(element_base.."MoneyFrame", DBCORPS_OBJET_CRITERES.detail.t72);
			_G[element_base.."AltCurrencyFrame"]:ClearAllPoints();
			_G[element_base.."AltCurrencyFrame"]:SetPoint("LEFT", _G[element_base.."MoneyFrame"]:GetName(), "RIGHT", -14, 0);
			_G[element_base.."AltCurrencyFrame"]:Show();
			_G[element_base.."MoneyFrame"]:Show();
		else
			DBCS_MerchantFrame_UpdateAltCurrency(element_base.."AltCurrencyFrame", DBCORPS_OBJET_CRITERES.detail);
			_G[element_base.."AltCurrencyFrame"]:ClearAllPoints();
			--_G[element_base.."AltCurrencyFrame"]:SetPoint("TOPLEFT", buttonName.."_Prix", "TOPLEFT", 0, 0);
			_G[element_base.."AltCurrencyFrame"]:SetPoint("LEFT", element_base.."MoneyFrame", "LEFT", 0, 0);
			_G[element_base.."MoneyFrame"]:Hide();
			_G[element_base.."AltCurrencyFrame"]:Show();
		end
	else
		_G[element_base.."AltCurrencyFrame"]:Hide();
		_G[element_base.."MoneyFrame"]:Hide();
	end

end

function DBcorps_ListMobs_Trier(sTRI,sINVERSER)

	--local t_ordre = {};
	local sSENS = DBCORPS_MOBS_LISTE_sens;
	local sARROW = "DBcorpsFrame_MobsFrame_Tri_";

	if ( sTRI == nil ) then
		sTRI = DBCORPS_MOBS_LISTE_ordre;
	end
	if ( sINVERSER == nil ) then
		sINVERSER = 0;
	end
	if ( sTRI == DBCORPS_MOBS_LISTE_ordre ) then
		if ( sINVERSER == 1 ) then
			if ( sSENS == "ASC" ) then
				sSENS = "DESC";
			else
				sSENS = "ASC";
			end
			DBCORPS_MOBS_LISTE_sens = sSENS;
		end
	else
		DBCORPS_MOBS_LISTE_ordre = sTRI;
		sSENS = "ASC";
		DBCORPS_MOBS_LISTE_sens = sSENS;
	end

	_G[sARROW.."Nom_Arrow"]:Hide();
	_G[sARROW.."Nivmin_Arrow"]:Hide();
	_G[sARROW.."Nivmax_Arrow"]:Hide();
	_G[sARROW.."Classe_Arrow"]:Hide();
	_G[sARROW.."Type_Arrow"]:Hide();
	_G[sARROW.."Famille_Arrow"]:Hide();
	_G[sARROW.."Salaire_Arrow"]:Hide();
	_G[sARROW.."Nbcorps_Arrow"]:Hide();
	_G[sARROW.."Nbskin_Arrow"]:Hide();
	_G[sARROW.."Nomregion_Arrow"]:Hide();

	
	DBCORPS_MOBS_TRI = {};
	if ( sTRI == "nommob" ) then
		if ( sSENS == "ASC" ) then
			_G[sARROW.."Nom_Arrow"]:SetTexCoord(0, 0.5625, 0, 1.0);
		else
			_G[sARROW.."Nom_Arrow"]:SetTexCoord(0, 0.5625, 1.0, 0);
		end
		_G[sARROW.."Nom_Arrow"]:Show();
		DBCORPS_MOBS_TRI[1] = {};
		DBCORPS_MOBS_TRI[1].champ = "nommob";
		DBCORPS_MOBS_TRI[1].sens = sSENS;
		DBCORPS_MOBS_TRI[2] = {};
		DBCORPS_MOBS_TRI[2].champ = "nomregion";
		DBCORPS_MOBS_TRI[2].sens = sSENS;
	elseif ( sTRI == "nivmin" ) then
		if ( sSENS == "ASC" ) then
			_G[sARROW.."Nivmin_Arrow"]:SetTexCoord(0, 0.5625, 0, 1.0);
		else
			_G[sARROW.."Nivmin_Arrow"]:SetTexCoord(0, 0.5625, 1.0, 0);
		end
		_G[sARROW.."Nivmin_Arrow"]:Show();
		DBCORPS_MOBS_TRI[1] = {};
		DBCORPS_MOBS_TRI[1].champ = "nivmin";
		DBCORPS_MOBS_TRI[1].sens = sSENS;
		DBCORPS_MOBS_TRI[2] = {};
		DBCORPS_MOBS_TRI[2].champ = "nivmax";
		DBCORPS_MOBS_TRI[2].sens = sSENS;
		DBCORPS_MOBS_TRI[3] = {};
		DBCORPS_MOBS_TRI[3].champ = "nommob";
		DBCORPS_MOBS_TRI[3].sens = sSENS;
		DBCORPS_MOBS_TRI[4] = {};
		DBCORPS_MOBS_TRI[4].champ = "nomregion";
		DBCORPS_MOBS_TRI[4].sens = sSENS;
	elseif ( sTRI == "nivmax" ) then
		if ( sSENS == "ASC" ) then
			_G[sARROW.."Nivmax_Arrow"]:SetTexCoord(0, 0.5625, 0, 1.0);
		else
			_G[sARROW.."Nivmax_Arrow"]:SetTexCoord(0, 0.5625, 1.0, 0);
		end
		_G[sARROW.."Nivmax_Arrow"]:Show();
		DBCORPS_MOBS_TRI[1] = {};
		DBCORPS_MOBS_TRI[1].champ = "nivmax";
		DBCORPS_MOBS_TRI[1].sens = sSENS;
		DBCORPS_MOBS_TRI[2] = {};
		DBCORPS_MOBS_TRI[2].champ = "nivmin";
		DBCORPS_MOBS_TRI[2].sens = sSENS;
		DBCORPS_MOBS_TRI[3] = {};
		DBCORPS_MOBS_TRI[3].champ = "nommob";
		DBCORPS_MOBS_TRI[3].sens = sSENS;
		DBCORPS_MOBS_TRI[4] = {};
		DBCORPS_MOBS_TRI[4].champ = "nomregion";
		DBCORPS_MOBS_TRI[4].sens = sSENS;
	elseif ( sTRI == "classe" ) then
		if ( sSENS == "ASC" ) then
			_G[sARROW.."Classe_Arrow"]:SetTexCoord(0, 0.5625, 0, 1.0);
		else
			_G[sARROW.."Classe_Arrow"]:SetTexCoord(0, 0.5625, 1.0, 0);
		end
		_G[sARROW.."Classe_Arrow"]:Show();
		DBCORPS_MOBS_TRI[1] = {};
		DBCORPS_MOBS_TRI[1].champ = "classe";
		DBCORPS_MOBS_TRI[1].sens = sSENS;
		DBCORPS_MOBS_TRI[2] = {};
		DBCORPS_MOBS_TRI[2].champ = "type";
		DBCORPS_MOBS_TRI[2].sens = sSENS;
		DBCORPS_MOBS_TRI[3] = {};
		DBCORPS_MOBS_TRI[3].champ = "famille";
		DBCORPS_MOBS_TRI[3].sens = sSENS;
		DBCORPS_MOBS_TRI[4] = {};
		DBCORPS_MOBS_TRI[4].champ = "nommob";
		DBCORPS_MOBS_TRI[4].sens = sSENS;
		DBCORPS_MOBS_TRI[5] = {};
		DBCORPS_MOBS_TRI[5].champ = "nomregion";
		DBCORPS_MOBS_TRI[5].sens = sSENS;
	elseif ( sTRI == "type" ) then
		if ( sSENS == "ASC" ) then
			_G[sARROW.."Type_Arrow"]:SetTexCoord(0, 0.5625, 0, 1.0);
		else
			_G[sARROW.."Type_Arrow"]:SetTexCoord(0, 0.5625, 1.0, 0);
		end
		_G[sARROW.."Type_Arrow"]:Show();
		DBCORPS_MOBS_TRI[1] = {};
		DBCORPS_MOBS_TRI[1].champ = "type";
		DBCORPS_MOBS_TRI[1].sens = sSENS;
		DBCORPS_MOBS_TRI[2] = {};
		DBCORPS_MOBS_TRI[2].champ = "famille";
		DBCORPS_MOBS_TRI[2].sens = sSENS;
		DBCORPS_MOBS_TRI[3] = {};
		DBCORPS_MOBS_TRI[3].champ = "nommob";
		DBCORPS_MOBS_TRI[3].sens = sSENS;
		DBCORPS_MOBS_TRI[4] = {};
		DBCORPS_MOBS_TRI[4].champ = "nomregion";
		DBCORPS_MOBS_TRI[4].sens = sSENS;
	elseif ( sTRI == "famille" ) then
		if ( sSENS == "ASC" ) then
			_G[sARROW.."Famille_Arrow"]:SetTexCoord(0, 0.5625, 0, 1.0);
		else
			_G[sARROW.."Famille_Arrow"]:SetTexCoord(0, 0.5625, 1.0, 0);
		end
		_G[sARROW.."Famille_Arrow"]:Show();
		DBCORPS_MOBS_TRI[1] = {};
		DBCORPS_MOBS_TRI[1].champ = "famille";
		DBCORPS_MOBS_TRI[1].sens = sSENS;
		DBCORPS_MOBS_TRI[2] = {};
		DBCORPS_MOBS_TRI[2].champ = "type";
		DBCORPS_MOBS_TRI[2].sens = sSENS;
		DBCORPS_MOBS_TRI[3] = {};
		DBCORPS_MOBS_TRI[3].champ = "nommob";
		DBCORPS_MOBS_TRI[3].sens = sSENS;
		DBCORPS_MOBS_TRI[4] = {};
		DBCORPS_MOBS_TRI[4].champ = "nomregion";
		DBCORPS_MOBS_TRI[4].sens = sSENS;
	elseif ( sTRI == "salaire" ) then
		if ( sSENS == "ASC" ) then
			_G[sARROW.."Salaire_Arrow"]:SetTexCoord(0, 0.5625, 0, 1.0);
		else
			_G[sARROW.."Salaire_Arrow"]:SetTexCoord(0, 0.5625, 1.0, 0);
		end
		_G[sARROW.."Salaire_Arrow"]:Show();
		DBCORPS_MOBS_TRI[1] = {};
		DBCORPS_MOBS_TRI[1].champ = "salaire";
		DBCORPS_MOBS_TRI[1].sens = sSENS;
		DBCORPS_MOBS_TRI[2] = {};
		DBCORPS_MOBS_TRI[2].champ = "nbcorps";
		DBCORPS_MOBS_TRI[2].sens = sSENS;
		DBCORPS_MOBS_TRI[3] = {};
		DBCORPS_MOBS_TRI[3].champ = "nommob";
		DBCORPS_MOBS_TRI[3].sens = sSENS;
		DBCORPS_MOBS_TRI[4] = {};
		DBCORPS_MOBS_TRI[4].champ = "nomregion";
		DBCORPS_MOBS_TRI[4].sens = sSENS;
	elseif ( sTRI == "nbcorps" ) then
		if ( sSENS == "ASC" ) then
			_G[sARROW.."Nbcorps_Arrow"]:SetTexCoord(0, 0.5625, 0, 1.0);
		else
			_G[sARROW.."Nbcorps_Arrow"]:SetTexCoord(0, 0.5625, 1.0, 0);
		end
		_G[sARROW.."Nbcorps_Arrow"]:Show();
		DBCORPS_MOBS_TRI[1] = {};
		DBCORPS_MOBS_TRI[1].champ = "nbcorps";
		DBCORPS_MOBS_TRI[1].sens = sSENS;
		DBCORPS_MOBS_TRI[2] = {};
		DBCORPS_MOBS_TRI[2].champ = "nommob";
		DBCORPS_MOBS_TRI[2].sens = sSENS;
		DBCORPS_MOBS_TRI[3] = {};
		DBCORPS_MOBS_TRI[3].champ = "nomregion";
		DBCORPS_MOBS_TRI[3].sens = sSENS;
	elseif ( sTRI == "nbskin" ) then
		if ( sSENS == "ASC" ) then
			_G[sARROW.."Nbskin_Arrow"]:SetTexCoord(0, 0.5625, 0, 1.0);
		else
			_G[sARROW.."Nbskin_Arrow"]:SetTexCoord(0, 0.5625, 1.0, 0);
		end
		_G[sARROW.."Nbskin_Arrow"]:Show();
		DBCORPS_MOBS_TRI[1] = {};
		DBCORPS_MOBS_TRI[1].champ = "nbskin";
		DBCORPS_MOBS_TRI[1].sens = sSENS;
		DBCORPS_MOBS_TRI[2] = {};
		DBCORPS_MOBS_TRI[2].champ = "nommob";
		DBCORPS_MOBS_TRI[2].sens = sSENS;
		DBCORPS_MOBS_TRI[3] = {};
		DBCORPS_MOBS_TRI[3].champ = "nomregion";
		DBCORPS_MOBS_TRI[3].sens = sSENS;
	elseif ( sTRI == "nomregion" ) then
		if ( sSENS == "ASC" ) then
			_G[sARROW.."Nomregion_Arrow"]:SetTexCoord(0, 0.5625, 0, 1.0);
		else
			_G[sARROW.."Nomregion_Arrow"]:SetTexCoord(0, 0.5625, 1.0, 0);
		end
		_G[sARROW.."Nomregion_Arrow"]:Show();
		DBCORPS_MOBS_TRI[1] = {};
		DBCORPS_MOBS_TRI[1].champ = "nomregion";
		DBCORPS_MOBS_TRI[1].sens = sSENS;
		DBCORPS_MOBS_TRI[2] = {};
		DBCORPS_MOBS_TRI[2].champ = "nommob";
		DBCORPS_MOBS_TRI[2].sens = sSENS;
		DBCORPS_MOBS_TRI[3] = {};
		DBCORPS_MOBS_TRI[3].champ = "nomregion";
		DBCORPS_MOBS_TRI[3].sens = sSENS;
	else
		if ( sSENS == "ASC" ) then
			_G[sARROW.."Nom_Arrow"]:SetTexCoord(0, 0.5625, 0, 1.0);
		else
			_G[sARROW.."Nom_Arrow"]:SetTexCoord(0, 0.5625, 1.0, 0);
		end
		_G[sARROW.."Nom_Arrow"]:Show();
		DBCORPS_MOBS_TRI[1] = {};
		DBCORPS_MOBS_TRI[1].champ = "nommob";
		DBCORPS_MOBS_TRI[1].sens = sSENS;
		DBCORPS_MOBS_TRI[2] = {};
		DBCORPS_MOBS_TRI[2].champ = "nomregion";
		DBCORPS_MOBS_TRI[2].sens = sSENS;
	end

	table.sort(DBCORPS_MOBS_LISTE,DBcorps_ListMobs_Trier_sort);

	DBcorps_Mobs_Scroll_Update();

end

function DBcorps_ListObjets_Trier(sTRI,sINVERSER)

	--local t_ordre = {};
	local sSENS = DBCORPS_OBJETS_LISTE_sens;
	local sARROW = "DBcorpsFrame_ObjetsFrame_Tri_";

	if ( sTRI == nil ) then
		sTRI = DBCORPS_OBJETS_LISTE_ordre;
	end
	if ( sINVERSER == nil ) then
		sINVERSER = 0;
	end
	if ( sTRI == DBCORPS_OBJETS_LISTE_ordre ) then
		if ( sINVERSER == 1 ) then
			if ( sSENS == "ASC" ) then
				sSENS = "DESC";
			else
				sSENS = "ASC";
			end
			DBCORPS_OBJETS_LISTE_sens = sSENS;
		end
	else
		DBCORPS_OBJETS_LISTE_ordre = sTRI;
		sSENS = "ASC";
		DBCORPS_OBJETS_LISTE_sens = sSENS;
	end

	_G[sARROW.."Rarity_Arrow"]:Hide();
	_G[sARROW.."Nomobjet_Arrow"]:Hide();
	_G[sARROW.."Niveau_Arrow"]:Hide();
	_G[sARROW.."Nivmin_Arrow"]:Hide();
	_G[sARROW.."Numobjet_Arrow"]:Hide();
	_G[sARROW.."Prix_Arrow"]:Hide();

	DBCORPS_OBJETS_TRI = {};
	if ( sTRI == "rarity" ) then
		if ( sSENS == "ASC" ) then
			_G[sARROW.."Rarity_Arrow"]:SetTexCoord(0, 0.5625, 0, 1.0);
		else
			_G[sARROW.."Rarity_Arrow"]:SetTexCoord(0, 0.5625, 1.0, 0);
		end
		_G[sARROW.."Rarity_Arrow"]:Show();
		DBCORPS_OBJETS_TRI[1] = {};
		DBCORPS_OBJETS_TRI[1].champ = "rarity";
		DBCORPS_OBJETS_TRI[1].sens = sSENS;
		DBCORPS_OBJETS_TRI[2] = {};
		DBCORPS_OBJETS_TRI[2].champ = "nomobjet";
		DBCORPS_OBJETS_TRI[2].sens = "ASC";
		DBCORPS_OBJETS_TRI[3] = {};
		DBCORPS_OBJETS_TRI[3].champ = "numobjet";
		DBCORPS_OBJETS_TRI[3].sens = "ASC";
	elseif ( sTRI == "nomobjet" ) then
		if ( sSENS == "ASC" ) then
			_G[sARROW.."Nomobjet_Arrow"]:SetTexCoord(0, 0.5625, 0, 1.0);
		else
			_G[sARROW.."Nomobjet_Arrow"]:SetTexCoord(0, 0.5625, 1.0, 0);
		end
		_G[sARROW.."Nomobjet_Arrow"]:Show();
		DBCORPS_OBJETS_TRI[1] = {};
		DBCORPS_OBJETS_TRI[1].champ = "nomobjet";
		DBCORPS_OBJETS_TRI[1].sens = sSENS;
		DBCORPS_OBJETS_TRI[2] = {};
		DBCORPS_OBJETS_TRI[2].champ = "numobjet";
		DBCORPS_OBJETS_TRI[2].sens = "ASC";
	elseif ( sTRI == "niveau" ) then
		if ( sSENS == "ASC" ) then
			_G[sARROW.."Niveau_Arrow"]:SetTexCoord(0, 0.5625, 0, 1.0);
		else
			_G[sARROW.."Niveau_Arrow"]:SetTexCoord(0, 0.5625, 1.0, 0);
		end
		_G[sARROW.."Niveau_Arrow"]:Show();
		DBCORPS_OBJETS_TRI[1] = {};
		DBCORPS_OBJETS_TRI[1].champ = "niveau";
		DBCORPS_OBJETS_TRI[1].sens = sSENS;
		DBCORPS_OBJETS_TRI[2] = {};
		DBCORPS_OBJETS_TRI[2].champ = "rarity";
		DBCORPS_OBJETS_TRI[2].sens = "DESC";
		DBCORPS_OBJETS_TRI[3] = {};
		DBCORPS_OBJETS_TRI[3].champ = "nomobjet";
		DBCORPS_OBJETS_TRI[3].sens = "ASC";
		DBCORPS_OBJETS_TRI[4] = {};
		DBCORPS_OBJETS_TRI[4].champ = "numobjet";
		DBCORPS_OBJETS_TRI[4].sens = "ASC";
	elseif ( sTRI == "nivmin" ) then
		if ( sSENS == "ASC" ) then
			_G[sARROW.."Nivmin_Arrow"]:SetTexCoord(0, 0.5625, 0, 1.0);
		else
			_G[sARROW.."Nivmin_Arrow"]:SetTexCoord(0, 0.5625, 1.0, 0);
		end
		_G[sARROW.."Nivmin_Arrow"]:Show();
		DBCORPS_OBJETS_TRI[1] = {};
		DBCORPS_OBJETS_TRI[1].champ = "nivmin";
		DBCORPS_OBJETS_TRI[1].sens = sSENS;
		DBCORPS_OBJETS_TRI[2] = {};
		DBCORPS_OBJETS_TRI[2].champ = "rarity";
		DBCORPS_OBJETS_TRI[2].sens = "DESC";
		DBCORPS_OBJETS_TRI[3] = {};
		DBCORPS_OBJETS_TRI[3].champ = "nomobjet";
		DBCORPS_OBJETS_TRI[3].sens = "ASC";
		DBCORPS_OBJETS_TRI[4] = {};
		DBCORPS_OBJETS_TRI[4].champ = "numobjet";
		DBCORPS_OBJETS_TRI[4].sens = "ASC";
	elseif ( sTRI == "numobjet" ) then
		if ( sSENS == "ASC" ) then
			_G[sARROW.."Numobjet_Arrow"]:SetTexCoord(0, 0.5625, 0, 1.0);
		else
			_G[sARROW.."Numobjet_Arrow"]:SetTexCoord(0, 0.5625, 1.0, 0);
		end
		_G[sARROW.."Numobjet_Arrow"]:Show();
		DBCORPS_OBJETS_TRI[1] = {};
		DBCORPS_OBJETS_TRI[1].champ = "numobjet";
		DBCORPS_OBJETS_TRI[1].sens = sSENS;
	elseif ( sTRI == "prix" ) then
		if ( sSENS == "ASC" ) then
			_G[sARROW.."Prix_Arrow"]:SetTexCoord(0, 0.5625, 0, 1.0);
		else
			_G[sARROW.."Prix_Arrow"]:SetTexCoord(0, 0.5625, 1.0, 0);
		end
		_G[sARROW.."Prix_Arrow"]:Show();
		DBCORPS_OBJETS_TRI[1] = {};
		DBCORPS_OBJETS_TRI[1].champ = "prix";
		DBCORPS_OBJETS_TRI[1].sens = sSENS;
		DBCORPS_OBJETS_TRI[2] = {};
		DBCORPS_OBJETS_TRI[2].champ = "rarity";
		DBCORPS_OBJETS_TRI[2].sens = "DESC";
		DBCORPS_OBJETS_TRI[3] = {};
		DBCORPS_OBJETS_TRI[3].champ = "nomobjet";
		DBCORPS_OBJETS_TRI[3].sens = "ASC";
		DBCORPS_OBJETS_TRI[4] = {};
		DBCORPS_OBJETS_TRI[4].champ = "numobjet";
		DBCORPS_OBJETS_TRI[4].sens = "ASC";
	elseif ( sTRI == "skill" ) then
		DBCORPS_OBJETS_TRI[1] = {};
		DBCORPS_OBJETS_TRI[1].champ = "skill";
		DBCORPS_OBJETS_TRI[1].sens = "DESC";
		DBCORPS_OBJETS_TRI[2] = {};
		DBCORPS_OBJETS_TRI[2].champ = "rarity";
		DBCORPS_OBJETS_TRI[2].sens = "DESC";
		DBCORPS_OBJETS_TRI[3] = {};
		DBCORPS_OBJETS_TRI[3].champ = "nomobjet";
		DBCORPS_OBJETS_TRI[3].sens = "ASC";
		DBCORPS_OBJETS_TRI[4] = {};
		DBCORPS_OBJETS_TRI[4].champ = "numobjet";
		DBCORPS_OBJETS_TRI[4].sens = "ASC";
	elseif ( sTRI == "armure" ) then
		DBCORPS_OBJETS_TRI[1] = {};
		DBCORPS_OBJETS_TRI[1].champ = "armure";
		DBCORPS_OBJETS_TRI[1].sens = "DESC";
		DBCORPS_OBJETS_TRI[2] = {};
		DBCORPS_OBJETS_TRI[2].champ = "blocage";
		DBCORPS_OBJETS_TRI[2].sens = "DESC";
		DBCORPS_OBJETS_TRI[3] = {};
		DBCORPS_OBJETS_TRI[3].champ = "rarity";
		DBCORPS_OBJETS_TRI[3].sens = "DESC";
		DBCORPS_OBJETS_TRI[4] = {};
		DBCORPS_OBJETS_TRI[4].champ = "nomobjet";
		DBCORPS_OBJETS_TRI[4].sens = "ASC";
		DBCORPS_OBJETS_TRI[5] = {};
		DBCORPS_OBJETS_TRI[5].champ = "numobjet";
		DBCORPS_OBJETS_TRI[5].sens = "ASC";
	elseif ( sTRI == "dps" ) then
		DBCORPS_OBJETS_TRI[1] = {};
		DBCORPS_OBJETS_TRI[1].champ = "dps";
		DBCORPS_OBJETS_TRI[1].sens = "DESC";
		DBCORPS_OBJETS_TRI[2] = {};
		DBCORPS_OBJETS_TRI[2].champ = "vitesse";
		DBCORPS_OBJETS_TRI[2].sens = "DESC";
		DBCORPS_OBJETS_TRI[3] = {};
		DBCORPS_OBJETS_TRI[3].champ = "rarity";
		DBCORPS_OBJETS_TRI[3].sens = "DESC";
		DBCORPS_OBJETS_TRI[4] = {};
		DBCORPS_OBJETS_TRI[4].champ = "nomobjet";
		DBCORPS_OBJETS_TRI[4].sens = "ASC";
		DBCORPS_OBJETS_TRI[5] = {};
		DBCORPS_OBJETS_TRI[5].champ = "numobjet";
		DBCORPS_OBJETS_TRI[5].sens = "ASC";
	elseif ( sTRI == "vitesse" ) then
		DBCORPS_OBJETS_TRI[1] = {};
		DBCORPS_OBJETS_TRI[1].champ = "vitesse";
		DBCORPS_OBJETS_TRI[1].sens = "DESC";
		DBCORPS_OBJETS_TRI[2] = {};
		DBCORPS_OBJETS_TRI[2].champ = "dps";
		DBCORPS_OBJETS_TRI[2].sens = "DESC";
		DBCORPS_OBJETS_TRI[3] = {};
		DBCORPS_OBJETS_TRI[3].champ = "rarity";
		DBCORPS_OBJETS_TRI[3].sens = "DESC";
		DBCORPS_OBJETS_TRI[4] = {};
		DBCORPS_OBJETS_TRI[4].champ = "nomobjet";
		DBCORPS_OBJETS_TRI[4].sens = "ASC";
		DBCORPS_OBJETS_TRI[5] = {};
		DBCORPS_OBJETS_TRI[5].champ = "numobjet";
		DBCORPS_OBJETS_TRI[5].sens = "ASC";
	elseif ( sTRI == "blocage" ) then
		DBCORPS_OBJETS_TRI[1] = {};
		DBCORPS_OBJETS_TRI[1].champ = "blocage";
		DBCORPS_OBJETS_TRI[1].sens = "DESC";
		DBCORPS_OBJETS_TRI[2] = {};
		DBCORPS_OBJETS_TRI[2].champ = "armure";
		DBCORPS_OBJETS_TRI[2].sens = "DESC";
		DBCORPS_OBJETS_TRI[3] = {};
		DBCORPS_OBJETS_TRI[3].champ = "rarity";
		DBCORPS_OBJETS_TRI[3].sens = "DESC";
		DBCORPS_OBJETS_TRI[4] = {};
		DBCORPS_OBJETS_TRI[4].champ = "nomobjet";
		DBCORPS_OBJETS_TRI[4].sens = "ASC";
		DBCORPS_OBJETS_TRI[5] = {};
		DBCORPS_OBJETS_TRI[5].champ = "numobjet";
		DBCORPS_OBJETS_TRI[5].sens = "ASC";
	elseif ( sTRI == "degmin" ) then
		DBCORPS_OBJETS_TRI[1] = {};
		DBCORPS_OBJETS_TRI[1].champ = "degmin";
		DBCORPS_OBJETS_TRI[1].sens = "DESC";
		DBCORPS_OBJETS_TRI[2] = {};
		DBCORPS_OBJETS_TRI[2].champ = "degmax";
		DBCORPS_OBJETS_TRI[2].sens = "DESC";
		DBCORPS_OBJETS_TRI[3] = {};
		DBCORPS_OBJETS_TRI[3].champ = "rarity";
		DBCORPS_OBJETS_TRI[3].sens = "DESC";
		DBCORPS_OBJETS_TRI[4] = {};
		DBCORPS_OBJETS_TRI[4].champ = "nomobjet";
		DBCORPS_OBJETS_TRI[4].sens = "ASC";
		DBCORPS_OBJETS_TRI[5] = {};
		DBCORPS_OBJETS_TRI[5].champ = "numobjet";
		DBCORPS_OBJETS_TRI[5].sens = "ASC";
	elseif ( sTRI == "degmax" ) then
		DBCORPS_OBJETS_TRI[1] = {};
		DBCORPS_OBJETS_TRI[1].champ = "degmax";
		DBCORPS_OBJETS_TRI[1].sens = "DESC";
		DBCORPS_OBJETS_TRI[2] = {};
		DBCORPS_OBJETS_TRI[2].champ = "degmin";
		DBCORPS_OBJETS_TRI[2].sens = "DESC";
		DBCORPS_OBJETS_TRI[3] = {};
		DBCORPS_OBJETS_TRI[3].champ = "rarity";
		DBCORPS_OBJETS_TRI[3].sens = "DESC";
		DBCORPS_OBJETS_TRI[4] = {};
		DBCORPS_OBJETS_TRI[4].champ = "nomobjet";
		DBCORPS_OBJETS_TRI[4].sens = "ASC";
		DBCORPS_OBJETS_TRI[5] = {};
		DBCORPS_OBJETS_TRI[5].champ = "numobjet";
		DBCORPS_OBJETS_TRI[5].sens = "ASC";
	elseif ( sTRI == "resistarcanes" ) then
		DBCORPS_OBJETS_TRI[1] = {};
		DBCORPS_OBJETS_TRI[1].champ = "resistarcanes";
		DBCORPS_OBJETS_TRI[1].sens = "DESC";
		DBCORPS_OBJETS_TRI[2] = {};
		DBCORPS_OBJETS_TRI[2].champ = "rarity";
		DBCORPS_OBJETS_TRI[2].sens = "DESC";
		DBCORPS_OBJETS_TRI[3] = {};
		DBCORPS_OBJETS_TRI[3].champ = "nomobjet";
		DBCORPS_OBJETS_TRI[3].sens = "ASC";
		DBCORPS_OBJETS_TRI[4] = {};
		DBCORPS_OBJETS_TRI[4].champ = "numobjet";
		DBCORPS_OBJETS_TRI[4].sens = "ASC";
	elseif ( sTRI == "resistfeu" ) then
		DBCORPS_OBJETS_TRI[1] = {};
		DBCORPS_OBJETS_TRI[1].champ = "resistfeu";
		DBCORPS_OBJETS_TRI[1].sens = "DESC";
		DBCORPS_OBJETS_TRI[2] = {};
		DBCORPS_OBJETS_TRI[2].champ = "rarity";
		DBCORPS_OBJETS_TRI[2].sens = "DESC";
		DBCORPS_OBJETS_TRI[3] = {};
		DBCORPS_OBJETS_TRI[3].champ = "nomobjet";
		DBCORPS_OBJETS_TRI[3].sens = "ASC";
		DBCORPS_OBJETS_TRI[4] = {};
		DBCORPS_OBJETS_TRI[4].champ = "numobjet";
		DBCORPS_OBJETS_TRI[4].sens = "ASC";
	elseif ( sTRI == "resistnature" ) then
		DBCORPS_OBJETS_TRI[1] = {};
		DBCORPS_OBJETS_TRI[1].champ = "resistnature";
		DBCORPS_OBJETS_TRI[1].sens = "DESC";
		DBCORPS_OBJETS_TRI[2] = {};
		DBCORPS_OBJETS_TRI[2].champ = "rarity";
		DBCORPS_OBJETS_TRI[2].sens = "DESC";
		DBCORPS_OBJETS_TRI[3] = {};
		DBCORPS_OBJETS_TRI[3].champ = "nomobjet";
		DBCORPS_OBJETS_TRI[3].sens = "ASC";
		DBCORPS_OBJETS_TRI[4] = {};
		DBCORPS_OBJETS_TRI[4].champ = "numobjet";
		DBCORPS_OBJETS_TRI[4].sens = "ASC";
	elseif ( sTRI == "resistgivre" ) then
		DBCORPS_OBJETS_TRI[1] = {};
		DBCORPS_OBJETS_TRI[1].champ = "resistgivre";
		DBCORPS_OBJETS_TRI[1].sens = "DESC";
		DBCORPS_OBJETS_TRI[2] = {};
		DBCORPS_OBJETS_TRI[2].champ = "rarity";
		DBCORPS_OBJETS_TRI[2].sens = "DESC";
		DBCORPS_OBJETS_TRI[3] = {};
		DBCORPS_OBJETS_TRI[3].champ = "nomobjet";
		DBCORPS_OBJETS_TRI[3].sens = "ASC";
		DBCORPS_OBJETS_TRI[4] = {};
		DBCORPS_OBJETS_TRI[4].champ = "numobjet";
		DBCORPS_OBJETS_TRI[4].sens = "ASC";
	elseif ( sTRI == "resistombre" ) then
		DBCORPS_OBJETS_TRI[1] = {};
		DBCORPS_OBJETS_TRI[1].champ = "resistombre";
		DBCORPS_OBJETS_TRI[1].sens = "DESC";
		DBCORPS_OBJETS_TRI[2] = {};
		DBCORPS_OBJETS_TRI[2].champ = "rarity";
		DBCORPS_OBJETS_TRI[2].sens = "DESC";
		DBCORPS_OBJETS_TRI[3] = {};
		DBCORPS_OBJETS_TRI[3].champ = "nomobjet";
		DBCORPS_OBJETS_TRI[3].sens = "ASC";
		DBCORPS_OBJETS_TRI[4] = {};
		DBCORPS_OBJETS_TRI[4].champ = "numobjet";
		DBCORPS_OBJETS_TRI[4].sens = "ASC";
	elseif ( sTRI == "t27" ) then
		DBCORPS_OBJETS_TRI[1] = {};
		DBCORPS_OBJETS_TRI[1].champ = "t27";
		DBCORPS_OBJETS_TRI[1].sens = "DESC";
		DBCORPS_OBJETS_TRI[2] = {};
		DBCORPS_OBJETS_TRI[2].champ = "rarity";
		DBCORPS_OBJETS_TRI[2].sens = "DESC";
		DBCORPS_OBJETS_TRI[3] = {};
		DBCORPS_OBJETS_TRI[3].champ = "nomobjet";
		DBCORPS_OBJETS_TRI[3].sens = "ASC";
		DBCORPS_OBJETS_TRI[4] = {};
		DBCORPS_OBJETS_TRI[4].champ = "numobjet";
		DBCORPS_OBJETS_TRI[4].sens = "ASC";
	elseif ( sTRI == "t28" ) then
		DBCORPS_OBJETS_TRI[1] = {};
		DBCORPS_OBJETS_TRI[1].champ = "t28";
		DBCORPS_OBJETS_TRI[1].sens = "DESC";
		DBCORPS_OBJETS_TRI[2] = {};
		DBCORPS_OBJETS_TRI[2].champ = "rarity";
		DBCORPS_OBJETS_TRI[2].sens = "DESC";
		DBCORPS_OBJETS_TRI[3] = {};
		DBCORPS_OBJETS_TRI[3].champ = "nomobjet";
		DBCORPS_OBJETS_TRI[3].sens = "ASC";
		DBCORPS_OBJETS_TRI[4] = {};
		DBCORPS_OBJETS_TRI[4].champ = "numobjet";
		DBCORPS_OBJETS_TRI[4].sens = "ASC";
--			[29]	équipé vie par 5 sec					Equipé : Rend x points de vie toutes les 5 sec.
	elseif ( sTRI == "t29" ) then
		DBCORPS_OBJETS_TRI[1] = {};
		DBCORPS_OBJETS_TRI[1].champ = "t29";
		DBCORPS_OBJETS_TRI[1].sens = "DESC";
		DBCORPS_OBJETS_TRI[2] = {};
		DBCORPS_OBJETS_TRI[2].champ = "rarity";
		DBCORPS_OBJETS_TRI[2].sens = "DESC";
		DBCORPS_OBJETS_TRI[3] = {};
		DBCORPS_OBJETS_TRI[3].champ = "nomobjet";
		DBCORPS_OBJETS_TRI[3].sens = "ASC";
		DBCORPS_OBJETS_TRI[4] = {};
		DBCORPS_OBJETS_TRI[4].champ = "numobjet";
		DBCORPS_OBJETS_TRI[4].sens = "ASC";
--			[30]	équipé dégats et soins des sorts et effets		Equipé : Augmente les dégâts et les soins produits par les sorts et effets magiques de 36 au maximum.
	elseif ( sTRI == "t30" ) then
		DBCORPS_OBJETS_TRI[1] = {};
		DBCORPS_OBJETS_TRI[1].champ = "t30";
		DBCORPS_OBJETS_TRI[1].sens = "DESC";
		DBCORPS_OBJETS_TRI[2] = {};
		DBCORPS_OBJETS_TRI[2].champ = "rarity";
		DBCORPS_OBJETS_TRI[2].sens = "DESC";
		DBCORPS_OBJETS_TRI[3] = {};
		DBCORPS_OBJETS_TRI[3].champ = "nomobjet";
		DBCORPS_OBJETS_TRI[3].sens = "ASC";
		DBCORPS_OBJETS_TRI[4] = {};
		DBCORPS_OBJETS_TRI[4].champ = "numobjet";
		DBCORPS_OBJETS_TRI[4].sens = "ASC";
--			[31]	équipé défense						Equipé : Défense augmentée de 9.
	elseif ( sTRI == "t31" ) then
		DBCORPS_OBJETS_TRI[1] = {};
		DBCORPS_OBJETS_TRI[1].champ = "t31";
		DBCORPS_OBJETS_TRI[1].sens = "DESC";
		DBCORPS_OBJETS_TRI[2] = {};
		DBCORPS_OBJETS_TRI[2].champ = "rarity";
		DBCORPS_OBJETS_TRI[2].sens = "DESC";
		DBCORPS_OBJETS_TRI[3] = {};
		DBCORPS_OBJETS_TRI[3].champ = "nomobjet";
		DBCORPS_OBJETS_TRI[3].sens = "ASC";
		DBCORPS_OBJETS_TRI[4] = {};
		DBCORPS_OBJETS_TRI[4].champ = "numobjet";
		DBCORPS_OBJETS_TRI[4].sens = "ASC";
--			[32]	équipé augmente score blocage bouclier		Equipé : Augmente le score de blocage de votre bouclier de 19.
	elseif ( sTRI == "t32" ) then
		DBCORPS_OBJETS_TRI[1] = {};
		DBCORPS_OBJETS_TRI[1].champ = "t32";
		DBCORPS_OBJETS_TRI[1].sens = "DESC";
		DBCORPS_OBJETS_TRI[2] = {};
		DBCORPS_OBJETS_TRI[2].champ = "rarity";
		DBCORPS_OBJETS_TRI[2].sens = "DESC";
		DBCORPS_OBJETS_TRI[3] = {};
		DBCORPS_OBJETS_TRI[3].champ = "nomobjet";
		DBCORPS_OBJETS_TRI[3].sens = "ASC";
		DBCORPS_OBJETS_TRI[4] = {};
		DBCORPS_OBJETS_TRI[4].champ = "numobjet";
		DBCORPS_OBJETS_TRI[4].sens = "ASC";
--			[33]	équipé chances toucher					Equipé : Augmente vos chances de toucher de 1%.
	elseif ( sTRI == "t33" ) then
		DBCORPS_OBJETS_TRI[1] = {};
		DBCORPS_OBJETS_TRI[1].champ = "t33";
		DBCORPS_OBJETS_TRI[1].sens = "DESC";
		DBCORPS_OBJETS_TRI[2] = {};
		DBCORPS_OBJETS_TRI[2].champ = "rarity";
		DBCORPS_OBJETS_TRI[2].sens = "DESC";
		DBCORPS_OBJETS_TRI[3] = {};
		DBCORPS_OBJETS_TRI[3].champ = "nomobjet";
		DBCORPS_OBJETS_TRI[3].sens = "ASC";
		DBCORPS_OBJETS_TRI[4] = {};
		DBCORPS_OBJETS_TRI[4].champ = "numobjet";
		DBCORPS_OBJETS_TRI[4].sens = "ASC";
--			[34]	équipé chances toucher avec sorts			Equipé : Augmente vos chances de toucher avec des sorts de 1%.
	elseif ( sTRI == "t34" ) then
		DBCORPS_OBJETS_TRI[1] = {};
		DBCORPS_OBJETS_TRI[1].champ = "t34";
		DBCORPS_OBJETS_TRI[1].sens = "DESC";
		DBCORPS_OBJETS_TRI[2] = {};
		DBCORPS_OBJETS_TRI[2].champ = "rarity";
		DBCORPS_OBJETS_TRI[2].sens = "DESC";
		DBCORPS_OBJETS_TRI[3] = {};
		DBCORPS_OBJETS_TRI[3].champ = "nomobjet";
		DBCORPS_OBJETS_TRI[3].sens = "ASC";
		DBCORPS_OBJETS_TRI[4] = {};
		DBCORPS_OBJETS_TRI[4].champ = "numobjet";
		DBCORPS_OBJETS_TRI[4].sens = "ASC";
--			[35]	équipé coup critique					Equipé : Augmente vos chances d'infliger un coup critique de 1%.
	elseif ( sTRI == "t35" ) then
		DBCORPS_OBJETS_TRI[1] = {};
		DBCORPS_OBJETS_TRI[1].champ = "t35";
		DBCORPS_OBJETS_TRI[1].sens = "DESC";
		DBCORPS_OBJETS_TRI[2] = {};
		DBCORPS_OBJETS_TRI[2].champ = "rarity";
		DBCORPS_OBJETS_TRI[2].sens = "DESC";
		DBCORPS_OBJETS_TRI[3] = {};
		DBCORPS_OBJETS_TRI[3].champ = "nomobjet";
		DBCORPS_OBJETS_TRI[3].sens = "ASC";
		DBCORPS_OBJETS_TRI[4] = {};
		DBCORPS_OBJETS_TRI[4].champ = "numobjet";
		DBCORPS_OBJETS_TRI[4].sens = "ASC";
--			[36]	équipé coup critique sorts				Equipé : Augmente vos chances d'infliger un coup critique avec vos sorts de 1%.
	elseif ( sTRI == "t36" ) then
		DBCORPS_OBJETS_TRI[1] = {};
		DBCORPS_OBJETS_TRI[1].champ = "t36";
		DBCORPS_OBJETS_TRI[1].sens = "DESC";
		DBCORPS_OBJETS_TRI[2] = {};
		DBCORPS_OBJETS_TRI[2].champ = "rarity";
		DBCORPS_OBJETS_TRI[2].sens = "DESC";
		DBCORPS_OBJETS_TRI[3] = {};
		DBCORPS_OBJETS_TRI[3].champ = "nomobjet";
		DBCORPS_OBJETS_TRI[3].sens = "ASC";
		DBCORPS_OBJETS_TRI[4] = {};
		DBCORPS_OBJETS_TRI[4].champ = "numobjet";
		DBCORPS_OBJETS_TRI[4].sens = "ASC";
--			[37]	équipé puissance attaque				Equipé : +24 à la puissance d'attaque.
	elseif ( sTRI == "t37" ) then
		DBCORPS_OBJETS_TRI[1] = {};
		DBCORPS_OBJETS_TRI[1].champ = "t37";
		DBCORPS_OBJETS_TRI[1].sens = "DESC";
		DBCORPS_OBJETS_TRI[2] = {};
		DBCORPS_OBJETS_TRI[2].champ = "rarity";
		DBCORPS_OBJETS_TRI[2].sens = "DESC";
		DBCORPS_OBJETS_TRI[3] = {};
		DBCORPS_OBJETS_TRI[3].champ = "nomobjet";
		DBCORPS_OBJETS_TRI[3].sens = "ASC";
		DBCORPS_OBJETS_TRI[4] = {};
		DBCORPS_OBJETS_TRI[4].champ = "numobjet";
		DBCORPS_OBJETS_TRI[4].sens = "ASC";
--			[38]	équipé puissance attaque distance			Equipé : +36 à la puissance des attaques à distance.
	elseif ( sTRI == "t38" ) then
		DBCORPS_OBJETS_TRI[1] = {};
		DBCORPS_OBJETS_TRI[1].champ = "t38";
		DBCORPS_OBJETS_TRI[1].sens = "DESC";
		DBCORPS_OBJETS_TRI[2] = {};
		DBCORPS_OBJETS_TRI[2].champ = "rarity";
		DBCORPS_OBJETS_TRI[2].sens = "DESC";
		DBCORPS_OBJETS_TRI[3] = {};
		DBCORPS_OBJETS_TRI[3].champ = "nomobjet";
		DBCORPS_OBJETS_TRI[3].sens = "ASC";
		DBCORPS_OBJETS_TRI[4] = {};
		DBCORPS_OBJETS_TRI[4].champ = "numobjet";
		DBCORPS_OBJETS_TRI[4].sens = "ASC";
--			[39]	équipé chances bloquer bouclier			Equipé : Augmente vos chances de bloquer les attaques avec un bouclier de 3%.
	elseif ( sTRI == "t39" ) then
		DBCORPS_OBJETS_TRI[1] = {};
		DBCORPS_OBJETS_TRI[1].champ = "t39";
		DBCORPS_OBJETS_TRI[1].sens = "DESC";
		DBCORPS_OBJETS_TRI[2] = {};
		DBCORPS_OBJETS_TRI[2].champ = "rarity";
		DBCORPS_OBJETS_TRI[2].sens = "DESC";
		DBCORPS_OBJETS_TRI[3] = {};
		DBCORPS_OBJETS_TRI[3].champ = "nomobjet";
		DBCORPS_OBJETS_TRI[3].sens = "ASC";
		DBCORPS_OBJETS_TRI[4] = {};
		DBCORPS_OBJETS_TRI[4].champ = "numobjet";
		DBCORPS_OBJETS_TRI[4].sens = "ASC";
--			[40]	équipé chances esquiver attaque			Equipé : Augmente vos chances d'esquiver une attaque de 1%.
	elseif ( sTRI == "t40" ) then
		DBCORPS_OBJETS_TRI[1] = {};
		DBCORPS_OBJETS_TRI[1].champ = "t40";
		DBCORPS_OBJETS_TRI[1].sens = "DESC";
		DBCORPS_OBJETS_TRI[2] = {};
		DBCORPS_OBJETS_TRI[2].champ = "rarity";
		DBCORPS_OBJETS_TRI[2].sens = "DESC";
		DBCORPS_OBJETS_TRI[3] = {};
		DBCORPS_OBJETS_TRI[3].champ = "nomobjet";
		DBCORPS_OBJETS_TRI[3].sens = "ASC";
		DBCORPS_OBJETS_TRI[4] = {};
		DBCORPS_OBJETS_TRI[4].champ = "numobjet";
		DBCORPS_OBJETS_TRI[4].sens = "ASC";
--			[41]	équipé dégats des sorts et effets de arcanes	Equipé : Augmente les dégâts infligés par les sorts et effets des Arcanes de 69 au maximum.
	elseif ( sTRI == "t41" ) then
		DBCORPS_OBJETS_TRI[1] = {};
		DBCORPS_OBJETS_TRI[1].champ = "t41";
		DBCORPS_OBJETS_TRI[1].sens = "DESC";
		DBCORPS_OBJETS_TRI[2] = {};
		DBCORPS_OBJETS_TRI[2].champ = "rarity";
		DBCORPS_OBJETS_TRI[2].sens = "DESC";
		DBCORPS_OBJETS_TRI[3] = {};
		DBCORPS_OBJETS_TRI[3].champ = "nomobjet";
		DBCORPS_OBJETS_TRI[3].sens = "ASC";
		DBCORPS_OBJETS_TRI[4] = {};
		DBCORPS_OBJETS_TRI[4].champ = "numobjet";
		DBCORPS_OBJETS_TRI[4].sens = "ASC";
--			[42]	équipé dégats des sorts et effets de feu		Equipé : Augmente les dégâts infligés par les sorts et effets de Feu de 34 au maximum.
	elseif ( sTRI == "t42" ) then
		DBCORPS_OBJETS_TRI[1] = {};
		DBCORPS_OBJETS_TRI[1].champ = "t42";
		DBCORPS_OBJETS_TRI[1].sens = "DESC";
		DBCORPS_OBJETS_TRI[2] = {};
		DBCORPS_OBJETS_TRI[2].champ = "rarity";
		DBCORPS_OBJETS_TRI[2].sens = "DESC";
		DBCORPS_OBJETS_TRI[3] = {};
		DBCORPS_OBJETS_TRI[3].champ = "nomobjet";
		DBCORPS_OBJETS_TRI[3].sens = "ASC";
		DBCORPS_OBJETS_TRI[4] = {};
		DBCORPS_OBJETS_TRI[4].champ = "numobjet";
		DBCORPS_OBJETS_TRI[4].sens = "ASC";
--			[43]	équipé dégats des sorts et effets de nature		Equipé : Augmente les dégâts infligés par les sorts et effets de Nature de 69 au maximum.
	elseif ( sTRI == "t43" ) then
		DBCORPS_OBJETS_TRI[1] = {};
		DBCORPS_OBJETS_TRI[1].champ = "t43";
		DBCORPS_OBJETS_TRI[1].sens = "DESC";
		DBCORPS_OBJETS_TRI[2] = {};
		DBCORPS_OBJETS_TRI[2].champ = "rarity";
		DBCORPS_OBJETS_TRI[2].sens = "DESC";
		DBCORPS_OBJETS_TRI[3] = {};
		DBCORPS_OBJETS_TRI[3].champ = "nomobjet";
		DBCORPS_OBJETS_TRI[3].sens = "ASC";
		DBCORPS_OBJETS_TRI[4] = {};
		DBCORPS_OBJETS_TRI[4].champ = "numobjet";
		DBCORPS_OBJETS_TRI[4].sens = "ASC";
--			[44]	équipé dégats des sorts et effets de givre		Equipé : Augmente les dégâts infligés par les sorts et effets de Givre de 21 au maximum.
	elseif ( sTRI == "t44" ) then
		DBCORPS_OBJETS_TRI[1] = {};
		DBCORPS_OBJETS_TRI[1].champ = "t44";
		DBCORPS_OBJETS_TRI[1].sens = "DESC";
		DBCORPS_OBJETS_TRI[2] = {};
		DBCORPS_OBJETS_TRI[2].champ = "rarity";
		DBCORPS_OBJETS_TRI[2].sens = "DESC";
		DBCORPS_OBJETS_TRI[3] = {};
		DBCORPS_OBJETS_TRI[3].champ = "nomobjet";
		DBCORPS_OBJETS_TRI[3].sens = "ASC";
		DBCORPS_OBJETS_TRI[4] = {};
		DBCORPS_OBJETS_TRI[4].champ = "numobjet";
		DBCORPS_OBJETS_TRI[4].sens = "ASC";
--			[45]	équipé dégats des sorts et effets de ombre		Equipé : Augmente les dégâts infligés par les sorts et effets d'Ombre de 69 au maximum.
	elseif ( sTRI == "t45" ) then
		DBCORPS_OBJETS_TRI[1] = {};
		DBCORPS_OBJETS_TRI[1].champ = "t45";
		DBCORPS_OBJETS_TRI[1].sens = "DESC";
		DBCORPS_OBJETS_TRI[2] = {};
		DBCORPS_OBJETS_TRI[2].champ = "rarity";
		DBCORPS_OBJETS_TRI[2].sens = "DESC";
		DBCORPS_OBJETS_TRI[3] = {};
		DBCORPS_OBJETS_TRI[3].champ = "nomobjet";
		DBCORPS_OBJETS_TRI[3].sens = "ASC";
		DBCORPS_OBJETS_TRI[4] = {};
		DBCORPS_OBJETS_TRI[4].champ = "numobjet";
		DBCORPS_OBJETS_TRI[4].sens = "ASC";
--			[47 ]	objet lanceur de quete
	elseif ( sTRI == "t47" ) then
		DBCORPS_OBJETS_TRI[1] = {};
		DBCORPS_OBJETS_TRI[1].champ = "t47";
		DBCORPS_OBJETS_TRI[1].sens = "DESC";
		DBCORPS_OBJETS_TRI[2] = {};
		DBCORPS_OBJETS_TRI[2].champ = "nivmin";
		DBCORPS_OBJETS_TRI[2].sens = "DESC";
		DBCORPS_OBJETS_TRI[3] = {};
		DBCORPS_OBJETS_TRI[3].champ = "niveau";
		DBCORPS_OBJETS_TRI[3].sens = "DESC";
		DBCORPS_OBJETS_TRI[4] = {};
		DBCORPS_OBJETS_TRI[4].champ = "rarity";
		DBCORPS_OBJETS_TRI[4].sens = "DESC";
		DBCORPS_OBJETS_TRI[5] = {};
		DBCORPS_OBJETS_TRI[5].champ = "nomobjet";
		DBCORPS_OBJETS_TRI[5].sens = "ASC";
		DBCORPS_OBJETS_TRI[6] = {};
		DBCORPS_OBJETS_TRI[6].champ = "numobjet";
		DBCORPS_OBJETS_TRI[6].sens = "ASC";
--			[48 ]	date de création de l'objet
	elseif ( sTRI == "t48" ) then
		DBCORPS_OBJETS_TRI[1] = {};
		DBCORPS_OBJETS_TRI[1].champ = "t48";
		DBCORPS_OBJETS_TRI[1].sens = "DESC";
		DBCORPS_OBJETS_TRI[2] = {};
		DBCORPS_OBJETS_TRI[2].champ = "rarity";
		DBCORPS_OBJETS_TRI[2].sens = "DESC";
		DBCORPS_OBJETS_TRI[3] = {};
		DBCORPS_OBJETS_TRI[3].champ = "numobjet";
		DBCORPS_OBJETS_TRI[3].sens = "ASC";
		--DBCORPS_OBJETS_TRI[3] = {};
		--DBCORPS_OBJETS_TRI[3].champ = "nomobjet";
		--DBCORPS_OBJETS_TRI[3].sens = "ASC";
--			[50 ]	niveau reputation
	elseif ( sTRI == "t50" ) then
		DBCORPS_OBJETS_TRI[1] = {};
		DBCORPS_OBJETS_TRI[1].champ = "t50";
		DBCORPS_OBJETS_TRI[1].sens = "ASC";
		DBCORPS_OBJETS_TRI[2] = {};
		DBCORPS_OBJETS_TRI[2].champ = "t49";
		DBCORPS_OBJETS_TRI[2].sens = "ASC";
		DBCORPS_OBJETS_TRI[3] = {};
		DBCORPS_OBJETS_TRI[3].champ = "rarity";
		DBCORPS_OBJETS_TRI[3].sens = "DESC";
		DBCORPS_OBJETS_TRI[4] = {};
		DBCORPS_OBJETS_TRI[4].champ = "nomobjet";
		DBCORPS_OBJETS_TRI[4].sens = "ASC";
		DBCORPS_OBJETS_TRI[5] = {};
		DBCORPS_OBJETS_TRI[5].champ = "numobjet";
		DBCORPS_OBJETS_TRI[5].sens = "ASC";
--			[54]	équipé score résilience					Equipé : Augmente de 11 le score de résilience.
	elseif ( sTRI == "t54" ) then
		DBCORPS_OBJETS_TRI[1] = {};
		DBCORPS_OBJETS_TRI[1].champ = "t54";
		DBCORPS_OBJETS_TRI[1].sens = "DESC";
		DBCORPS_OBJETS_TRI[2] = {};
		DBCORPS_OBJETS_TRI[2].champ = "rarity";
		DBCORPS_OBJETS_TRI[2].sens = "DESC";
		DBCORPS_OBJETS_TRI[3] = {};
		DBCORPS_OBJETS_TRI[3].champ = "nomobjet";
		DBCORPS_OBJETS_TRI[3].sens = "ASC";
		DBCORPS_OBJETS_TRI[4] = {};
		DBCORPS_OBJETS_TRI[4].champ = "numobjet";
		DBCORPS_OBJETS_TRI[4].sens = "ASC";
--			[56]	Force
	elseif ( sTRI == "t56" ) then
		DBCORPS_OBJETS_TRI[1] = {};
		DBCORPS_OBJETS_TRI[1].champ = "t56";
		DBCORPS_OBJETS_TRI[1].sens = "DESC";
		DBCORPS_OBJETS_TRI[2] = {};
		DBCORPS_OBJETS_TRI[2].champ = "rarity";
		DBCORPS_OBJETS_TRI[2].sens = "DESC";
		DBCORPS_OBJETS_TRI[3] = {};
		DBCORPS_OBJETS_TRI[3].champ = "nomobjet";
		DBCORPS_OBJETS_TRI[3].sens = "ASC";
		DBCORPS_OBJETS_TRI[4] = {};
		DBCORPS_OBJETS_TRI[4].champ = "numobjet";
		DBCORPS_OBJETS_TRI[4].sens = "ASC";
--			[57]	Agilité
	elseif ( sTRI == "t57" ) then
		DBCORPS_OBJETS_TRI[1] = {};
		DBCORPS_OBJETS_TRI[1].champ = "t57";
		DBCORPS_OBJETS_TRI[1].sens = "DESC";
		DBCORPS_OBJETS_TRI[2] = {};
		DBCORPS_OBJETS_TRI[2].champ = "rarity";
		DBCORPS_OBJETS_TRI[2].sens = "DESC";
		DBCORPS_OBJETS_TRI[3] = {};
		DBCORPS_OBJETS_TRI[3].champ = "nomobjet";
		DBCORPS_OBJETS_TRI[3].sens = "ASC";
		DBCORPS_OBJETS_TRI[4] = {};
		DBCORPS_OBJETS_TRI[4].champ = "numobjet";
		DBCORPS_OBJETS_TRI[4].sens = "ASC";
--			[58]	Endurance
	elseif ( sTRI == "t58" ) then
		DBCORPS_OBJETS_TRI[1] = {};
		DBCORPS_OBJETS_TRI[1].champ = "t58";
		DBCORPS_OBJETS_TRI[1].sens = "DESC";
		DBCORPS_OBJETS_TRI[2] = {};
		DBCORPS_OBJETS_TRI[2].champ = "rarity";
		DBCORPS_OBJETS_TRI[2].sens = "DESC";
		DBCORPS_OBJETS_TRI[3] = {};
		DBCORPS_OBJETS_TRI[3].champ = "nomobjet";
		DBCORPS_OBJETS_TRI[3].sens = "ASC";
		DBCORPS_OBJETS_TRI[4] = {};
		DBCORPS_OBJETS_TRI[4].champ = "numobjet";
		DBCORPS_OBJETS_TRI[4].sens = "ASC";
--			[59]	Intelligence
	elseif ( sTRI == "t59" ) then
		DBCORPS_OBJETS_TRI[1] = {};
		DBCORPS_OBJETS_TRI[1].champ = "t59";
		DBCORPS_OBJETS_TRI[1].sens = "DESC";
		DBCORPS_OBJETS_TRI[2] = {};
		DBCORPS_OBJETS_TRI[2].champ = "rarity";
		DBCORPS_OBJETS_TRI[2].sens = "DESC";
		DBCORPS_OBJETS_TRI[3] = {};
		DBCORPS_OBJETS_TRI[3].champ = "nomobjet";
		DBCORPS_OBJETS_TRI[3].sens = "ASC";
		DBCORPS_OBJETS_TRI[4] = {};
		DBCORPS_OBJETS_TRI[4].champ = "numobjet";
		DBCORPS_OBJETS_TRI[4].sens = "ASC";
--			[60]	Esprit
	elseif ( sTRI == "t60" ) then
		DBCORPS_OBJETS_TRI[1] = {};
		DBCORPS_OBJETS_TRI[1].champ = "t60";
		DBCORPS_OBJETS_TRI[1].sens = "DESC";
		DBCORPS_OBJETS_TRI[2] = {};
		DBCORPS_OBJETS_TRI[2].champ = "rarity";
		DBCORPS_OBJETS_TRI[2].sens = "DESC";
		DBCORPS_OBJETS_TRI[3] = {};
		DBCORPS_OBJETS_TRI[3].champ = "nomobjet";
		DBCORPS_OBJETS_TRI[3].sens = "ASC";
		DBCORPS_OBJETS_TRI[4] = {};
		DBCORPS_OBJETS_TRI[4].champ = "numobjet";
		DBCORPS_OBJETS_TRI[4].sens = "ASC";
--			[105]	score expertise
	elseif ( sTRI == "t62" ) then
		DBCORPS_OBJETS_TRI[1] = {};
		DBCORPS_OBJETS_TRI[1].champ = "t62";
		DBCORPS_OBJETS_TRI[1].sens = "DESC";
		DBCORPS_OBJETS_TRI[2] = {};
		DBCORPS_OBJETS_TRI[2].champ = "rarity";
		DBCORPS_OBJETS_TRI[2].sens = "DESC";
		DBCORPS_OBJETS_TRI[3] = {};
		DBCORPS_OBJETS_TRI[3].champ = "nomobjet";
		DBCORPS_OBJETS_TRI[3].sens = "ASC";
		DBCORPS_OBJETS_TRI[4] = {};
		DBCORPS_OBJETS_TRI[4].champ = "numobjet";
		DBCORPS_OBJETS_TRI[4].sens = "ASC";
--			[106]	score expertise
	elseif ( sTRI == "t63" ) then
		DBCORPS_OBJETS_TRI[1] = {};
		DBCORPS_OBJETS_TRI[1].champ = "t63";
		DBCORPS_OBJETS_TRI[1].sens = "DESC";
		DBCORPS_OBJETS_TRI[2] = {};
		DBCORPS_OBJETS_TRI[2].champ = "rarity";
		DBCORPS_OBJETS_TRI[2].sens = "DESC";
		DBCORPS_OBJETS_TRI[3] = {};
		DBCORPS_OBJETS_TRI[3].champ = "nomobjet";
		DBCORPS_OBJETS_TRI[3].sens = "ASC";
		DBCORPS_OBJETS_TRI[4] = {};
		DBCORPS_OBJETS_TRI[4].champ = "numobjet";
		DBCORPS_OBJETS_TRI[4].sens = "ASC";
--			[107]	score hâte
	elseif ( sTRI == "t64" ) then
		DBCORPS_OBJETS_TRI[1] = {};
		DBCORPS_OBJETS_TRI[1].champ = "t64";
		DBCORPS_OBJETS_TRI[1].sens = "DESC";
		DBCORPS_OBJETS_TRI[2] = {};
		DBCORPS_OBJETS_TRI[2].champ = "rarity";
		DBCORPS_OBJETS_TRI[2].sens = "DESC";
		DBCORPS_OBJETS_TRI[3] = {};
		DBCORPS_OBJETS_TRI[3].champ = "nomobjet";
		DBCORPS_OBJETS_TRI[3].sens = "ASC";
		DBCORPS_OBJETS_TRI[4] = {};
		DBCORPS_OBJETS_TRI[4].champ = "numobjet";
		DBCORPS_OBJETS_TRI[4].sens = "ASC";
--			[108]	score pénétration armure
	elseif ( sTRI == "t65" ) then
		DBCORPS_OBJETS_TRI[1] = {};
		DBCORPS_OBJETS_TRI[1].champ = "t65";
		DBCORPS_OBJETS_TRI[1].sens = "DESC";
		DBCORPS_OBJETS_TRI[2] = {};
		DBCORPS_OBJETS_TRI[2].champ = "rarity";
		DBCORPS_OBJETS_TRI[2].sens = "DESC";
		DBCORPS_OBJETS_TRI[3] = {};
		DBCORPS_OBJETS_TRI[3].champ = "nomobjet";
		DBCORPS_OBJETS_TRI[3].sens = "ASC";
		DBCORPS_OBJETS_TRI[4] = {};
		DBCORPS_OBJETS_TRI[4].champ = "numobjet";
		DBCORPS_OBJETS_TRI[4].sens = "ASC";
--			[112]	équipé résilience JCJ					Equipé : Augmente de 52 la résilience en jcj.
	elseif ( sTRI == "t66" ) then
		DBCORPS_OBJETS_TRI[1] = {};
		DBCORPS_OBJETS_TRI[1].champ = "t66";
		DBCORPS_OBJETS_TRI[1].sens = "DESC";
		DBCORPS_OBJETS_TRI[2] = {};
		DBCORPS_OBJETS_TRI[2].champ = "rarity";
		DBCORPS_OBJETS_TRI[2].sens = "DESC";
		DBCORPS_OBJETS_TRI[3] = {};
		DBCORPS_OBJETS_TRI[3].champ = "nomobjet";
		DBCORPS_OBJETS_TRI[3].sens = "ASC";
		DBCORPS_OBJETS_TRI[4] = {};
		DBCORPS_OBJETS_TRI[4].champ = "numobjet";
		DBCORPS_OBJETS_TRI[4].sens = "ASC";
--			[113]	équipé expertise						Equipé : Augmente de 29 l'expertise.
	elseif ( sTRI == "t67" ) then
		DBCORPS_OBJETS_TRI[1] = {};
		DBCORPS_OBJETS_TRI[1].champ = "t67";
		DBCORPS_OBJETS_TRI[1].sens = "DESC";
		DBCORPS_OBJETS_TRI[2] = {};
		DBCORPS_OBJETS_TRI[2].champ = "rarity";
		DBCORPS_OBJETS_TRI[2].sens = "DESC";
		DBCORPS_OBJETS_TRI[3] = {};
		DBCORPS_OBJETS_TRI[3].champ = "nomobjet";
		DBCORPS_OBJETS_TRI[3].sens = "ASC";
		DBCORPS_OBJETS_TRI[4] = {};
		DBCORPS_OBJETS_TRI[4].champ = "numobjet";
		DBCORPS_OBJETS_TRI[4].sens = "ASC";
--			[114]	équipé hâte								Equipé : Augmente de 32 la hâte.
	elseif ( sTRI == "t68" ) then
		DBCORPS_OBJETS_TRI[1] = {};
		DBCORPS_OBJETS_TRI[1].champ = "t68";
		DBCORPS_OBJETS_TRI[1].sens = "DESC";
		DBCORPS_OBJETS_TRI[2] = {};
		DBCORPS_OBJETS_TRI[2].champ = "rarity";
		DBCORPS_OBJETS_TRI[2].sens = "DESC";
		DBCORPS_OBJETS_TRI[3] = {};
		DBCORPS_OBJETS_TRI[3].champ = "nomobjet";
		DBCORPS_OBJETS_TRI[3].sens = "ASC";
		DBCORPS_OBJETS_TRI[4] = {};
		DBCORPS_OBJETS_TRI[4].champ = "numobjet";
		DBCORPS_OBJETS_TRI[4].sens = "ASC";
--			[115]	équipé toucher							Equipé : Augmente de 42 le toucher.
	elseif ( sTRI == "t69" ) then
		DBCORPS_OBJETS_TRI[1] = {};
		DBCORPS_OBJETS_TRI[1].champ = "t69";
		DBCORPS_OBJETS_TRI[1].sens = "DESC";
		DBCORPS_OBJETS_TRI[2] = {};
		DBCORPS_OBJETS_TRI[2].champ = "rarity";
		DBCORPS_OBJETS_TRI[2].sens = "DESC";
		DBCORPS_OBJETS_TRI[3] = {};
		DBCORPS_OBJETS_TRI[3].champ = "nomobjet";
		DBCORPS_OBJETS_TRI[3].sens = "ASC";
		DBCORPS_OBJETS_TRI[4] = {};
		DBCORPS_OBJETS_TRI[4].champ = "numobjet";
		DBCORPS_OBJETS_TRI[4].sens = "ASC";
--			[116]	équipé maîtrise							Equipé : Augmente de 42 la Maîtrise.
	elseif ( sTRI == "t70" ) then
		DBCORPS_OBJETS_TRI[1] = {};
		DBCORPS_OBJETS_TRI[1].champ = "t70";
		DBCORPS_OBJETS_TRI[1].sens = "DESC";
		DBCORPS_OBJETS_TRI[2] = {};
		DBCORPS_OBJETS_TRI[2].champ = "rarity";
		DBCORPS_OBJETS_TRI[2].sens = "DESC";
		DBCORPS_OBJETS_TRI[3] = {};
		DBCORPS_OBJETS_TRI[3].champ = "nomobjet";
		DBCORPS_OBJETS_TRI[3].sens = "ASC";
		DBCORPS_OBJETS_TRI[4] = {};
		DBCORPS_OBJETS_TRI[4].champ = "numobjet";
		DBCORPS_OBJETS_TRI[4].sens = "ASC";
--			[117]	équipé puissance sorts					Equipé : Augmente de 42 la puissance des sorts.
	elseif ( sTRI == "t71" ) then
		DBCORPS_OBJETS_TRI[1] = {};
		DBCORPS_OBJETS_TRI[1].champ = "t71";
		DBCORPS_OBJETS_TRI[1].sens = "DESC";
		DBCORPS_OBJETS_TRI[2] = {};
		DBCORPS_OBJETS_TRI[2].champ = "rarity";
		DBCORPS_OBJETS_TRI[2].sens = "DESC";
		DBCORPS_OBJETS_TRI[3] = {};
		DBCORPS_OBJETS_TRI[3].champ = "nomobjet";
		DBCORPS_OBJETS_TRI[3].sens = "ASC";
		DBCORPS_OBJETS_TRI[4] = {};
		DBCORPS_OBJETS_TRI[4].champ = "numobjet";
		DBCORPS_OBJETS_TRI[4].sens = "ASC";
--			[118]	équipé parade							Equipé : Augmente de 42 la parade.
	elseif ( sTRI == "t72" ) then
		DBCORPS_OBJETS_TRI[1] = {};
		DBCORPS_OBJETS_TRI[1].champ = "t72";
		DBCORPS_OBJETS_TRI[1].sens = "DESC";
		DBCORPS_OBJETS_TRI[2] = {};
		DBCORPS_OBJETS_TRI[2].champ = "rarity";
		DBCORPS_OBJETS_TRI[2].sens = "DESC";
		DBCORPS_OBJETS_TRI[3] = {};
		DBCORPS_OBJETS_TRI[3].champ = "nomobjet";
		DBCORPS_OBJETS_TRI[3].sens = "ASC";
		DBCORPS_OBJETS_TRI[4] = {};
		DBCORPS_OBJETS_TRI[4].champ = "numobjet";
		DBCORPS_OBJETS_TRI[4].sens = "ASC";
--			[119]	équipé esquive							Equipé : Augmente de 42 l'esquive.
	elseif ( sTRI == "t73" ) then
		DBCORPS_OBJETS_TRI[1] = {};
		DBCORPS_OBJETS_TRI[1].champ = "t73";
		DBCORPS_OBJETS_TRI[1].sens = "DESC";
		DBCORPS_OBJETS_TRI[2] = {};
		DBCORPS_OBJETS_TRI[2].champ = "rarity";
		DBCORPS_OBJETS_TRI[2].sens = "DESC";
		DBCORPS_OBJETS_TRI[3] = {};
		DBCORPS_OBJETS_TRI[3].champ = "nomobjet";
		DBCORPS_OBJETS_TRI[3].sens = "ASC";
		DBCORPS_OBJETS_TRI[4] = {};
		DBCORPS_OBJETS_TRI[4].champ = "numobjet";
		DBCORPS_OBJETS_TRI[4].sens = "ASC";
--			[120]	équipé puissance JCJ					Equipé : Augmente de 52 la puissance en jcj.
	elseif ( sTRI == "t74" ) then
		DBCORPS_OBJETS_TRI[1] = {};
		DBCORPS_OBJETS_TRI[1].champ = "t74";
		DBCORPS_OBJETS_TRI[1].sens = "DESC";
		DBCORPS_OBJETS_TRI[2] = {};
		DBCORPS_OBJETS_TRI[2].champ = "rarity";
		DBCORPS_OBJETS_TRI[2].sens = "DESC";
		DBCORPS_OBJETS_TRI[3] = {};
		DBCORPS_OBJETS_TRI[3].champ = "nomobjet";
		DBCORPS_OBJETS_TRI[3].sens = "ASC";
		DBCORPS_OBJETS_TRI[4] = {};
		DBCORPS_OBJETS_TRI[4].champ = "numobjet";
		DBCORPS_OBJETS_TRI[4].sens = "ASC";
	elseif ( sTRI == "coffre" ) then
		DBCORPS_OBJETS_TRI[1] = {};
		DBCORPS_OBJETS_TRI[1].champ = "coffre";
		DBCORPS_OBJETS_TRI[1].sens = "DESC";
		DBCORPS_OBJETS_TRI[2] = {};
		DBCORPS_OBJETS_TRI[2].champ = "rarity";
		DBCORPS_OBJETS_TRI[2].sens = "DESC";
		DBCORPS_OBJETS_TRI[3] = {};
		DBCORPS_OBJETS_TRI[3].champ = "nomobjet";
		DBCORPS_OBJETS_TRI[3].sens = "ASC";
		DBCORPS_OBJETS_TRI[4] = {};
		DBCORPS_OBJETS_TRI[4].champ = "numobjet";
		DBCORPS_OBJETS_TRI[4].sens = "ASC";
	else
		if ( sSENS == "ASC" ) then
			_G[sARROW.."Rarity_Arrow"]:SetTexCoord(0, 0.5625, 0, 1.0);
		else
			_G[sARROW.."Rarity_Arrow"]:SetTexCoord(0, 0.5625, 1.0, 0);
		end
		_G[sARROW.."Rarity_Arrow"]:Show();
		DBCORPS_OBJETS_TRI[1] = {};
		DBCORPS_OBJETS_TRI[1].champ = "rarity";
		DBCORPS_OBJETS_TRI[1].sens = sSENS;
		DBCORPS_OBJETS_TRI[2] = {};
		DBCORPS_OBJETS_TRI[2].champ = "nomobjet";
		DBCORPS_OBJETS_TRI[2].sens = sSENS;
		DBCORPS_OBJETS_TRI[3] = {};
		DBCORPS_OBJETS_TRI[3].champ = "numobjet";
		DBCORPS_OBJETS_TRI[3].sens = "ASC";
	end

	table.sort(DBCORPS_OBJETS_LISTE,DBcorps_ListObjets_Trier_sort);

	DBcorps_Objets_Scroll_Update();

end

function DBcorps_ListMob_Trier(sTRI,sINVERSER)

	--local t_ordre = {};
	local sSENS = DBCORPS_MOB_LISTE_sens;
	local sARROW = "DBcorpsFrame_MobFrame_Tri_";

	if ( sTRI == nil ) then
		sTRI = DBCORPS_MOB_LISTE_ordre;
	end
	if ( sINVERSER == nil ) then
		sINVERSER = 0;
	end
	if ( sTRI == DBCORPS_MOB_LISTE_ordre ) then
		if ( sINVERSER == 1 ) then
			if ( sSENS == "ASC" ) then
				sSENS = "DESC";
			else
				sSENS = "ASC";
			end
			DBCORPS_MOB_LISTE_sens = sSENS;
		end
	else
		DBCORPS_MOB_LISTE_ordre = sTRI;
		sSENS = "ASC";
		DBCORPS_MOB_LISTE_sens = sSENS;
	end

	_G[sARROW.."Rarity_Arrow"]:Hide();
	_G[sARROW.."Nomobjet_Arrow"]:Hide();
	_G[sARROW.."Nivmin_Arrow"]:Hide();
	_G[sARROW.."Niveau_Arrow"]:Hide();
	_G[sARROW.."Pctdrop_Arrow"]:Hide();
	_G[sARROW.."Numobjet_Arrow"]:Hide();
	_G[sARROW.."Prix_Arrow"]:Hide();

	DBCORPS_MOB_TRI = {};
	if ( sTRI == "rarity" ) then
		if ( sSENS == "ASC" ) then
			_G[sARROW.."Rarity_Arrow"]:SetTexCoord(0, 0.5625, 0, 1.0);
		else
			_G[sARROW.."Rarity_Arrow"]:SetTexCoord(0, 0.5625, 1.0, 0);
		end
		_G[sARROW.."Rarity_Arrow"]:Show();
		DBCORPS_MOB_TRI[1] = {};
		DBCORPS_MOB_TRI[1].champ = "rarity";
		DBCORPS_MOB_TRI[1].sens = sSENS;
		DBCORPS_MOB_TRI[2] = {};
		DBCORPS_MOB_TRI[2].champ = "nomobjet";
		DBCORPS_MOB_TRI[2].sens = "ASC";
	elseif ( sTRI == "nomobjet" ) then
		if ( sSENS == "ASC" ) then
			_G[sARROW.."Nomobjet_Arrow"]:SetTexCoord(0, 0.5625, 0, 1.0);
		else
			_G[sARROW.."Nomobjet_Arrow"]:SetTexCoord(0, 0.5625, 1.0, 0);
		end
		_G[sARROW.."Nomobjet_Arrow"]:Show();
		DBCORPS_MOB_TRI[1] = {};
		DBCORPS_MOB_TRI[1].champ = "nomobjet";
		DBCORPS_MOB_TRI[1].sens = sSENS;
	elseif ( sTRI == "nivmin" ) then
		if ( sSENS == "ASC" ) then
			_G[sARROW.."Nivmin_Arrow"]:SetTexCoord(0, 0.5625, 0, 1.0);
		else
			_G[sARROW.."Nivmin_Arrow"]:SetTexCoord(0, 0.5625, 1.0, 0);
		end
		_G[sARROW.."Nivmin_Arrow"]:Show();
		DBCORPS_MOB_TRI[1] = {};
		DBCORPS_MOB_TRI[1].champ = "nivmin";
		DBCORPS_MOB_TRI[1].sens = sSENS;
		DBCORPS_MOB_TRI[2] = {};
		DBCORPS_MOB_TRI[2].champ = "rarity";
		DBCORPS_MOB_TRI[2].sens = "DESC";
		DBCORPS_MOB_TRI[3] = {};
		DBCORPS_MOB_TRI[3].champ = "nomobjet";
		DBCORPS_MOB_TRI[3].sens = "ASC";
	elseif ( sTRI == "niveau" ) then
		if ( sSENS == "ASC" ) then
			_G[sARROW.."Niveau_Arrow"]:SetTexCoord(0, 0.5625, 0, 1.0);
		else
			_G[sARROW.."Niveau_Arrow"]:SetTexCoord(0, 0.5625, 1.0, 0);
		end
		_G[sARROW.."Niveau_Arrow"]:Show();
		DBCORPS_MOB_TRI[1] = {};
		DBCORPS_MOB_TRI[1].champ = "niveau";
		DBCORPS_MOB_TRI[1].sens = sSENS;
		DBCORPS_MOB_TRI[2] = {};
		DBCORPS_MOB_TRI[2].champ = "rarity";
		DBCORPS_MOB_TRI[2].sens = "DESC";
		DBCORPS_MOB_TRI[3] = {};
		DBCORPS_MOB_TRI[3].champ = "nomobjet";
		DBCORPS_MOB_TRI[3].sens = "ASC";
	elseif ( sTRI == "pctdrop" ) then
		if ( sSENS == "ASC" ) then
			_G[sARROW.."Pctdrop_Arrow"]:SetTexCoord(0, 0.5625, 0, 1.0);
		else
			_G[sARROW.."Pctdrop_Arrow"]:SetTexCoord(0, 0.5625, 1.0, 0);
		end
		_G[sARROW.."Pctdrop_Arrow"]:Show();
		DBCORPS_MOB_TRI[1] = {};
		DBCORPS_MOB_TRI[1].champ = "pctdrop";
		DBCORPS_MOB_TRI[1].sens = sSENS;
		DBCORPS_MOB_TRI[2] = {};
		DBCORPS_MOB_TRI[2].champ = "rarity";
		DBCORPS_MOB_TRI[2].sens = "DESC";
		DBCORPS_MOB_TRI[3] = {};
		DBCORPS_MOB_TRI[3].champ = "nomobjet";
		DBCORPS_MOB_TRI[3].sens = "ASC";
	elseif ( sTRI == "numobjet" ) then
		if ( sSENS == "ASC" ) then
			_G[sARROW.."Numobjet_Arrow"]:SetTexCoord(0, 0.5625, 0, 1.0);
		else
			_G[sARROW.."Numobjet_Arrow"]:SetTexCoord(0, 0.5625, 1.0, 0);
		end
		_G[sARROW.."Numobjet_Arrow"]:Show();
		DBCORPS_MOB_TRI[1] = {};
		DBCORPS_MOB_TRI[1].champ = "numobjet";
		DBCORPS_MOB_TRI[1].sens = sSENS;
	elseif ( sTRI == "prix" ) then
		if ( sSENS == "ASC" ) then
			_G[sARROW.."Prix_Arrow"]:SetTexCoord(0, 0.5625, 0, 1.0);
		else
			_G[sARROW.."Prix_Arrow"]:SetTexCoord(0, 0.5625, 1.0, 0);
		end
		_G[sARROW.."Prix_Arrow"]:Show();
		DBCORPS_MOB_TRI[1] = {};
		DBCORPS_MOB_TRI[1].champ = "prix";
		DBCORPS_MOB_TRI[1].sens = sSENS;
		DBCORPS_MOB_TRI[2] = {};
		DBCORPS_MOB_TRI[2].champ = "rarity";
		DBCORPS_MOB_TRI[2].sens = "DESC";
		DBCORPS_MOB_TRI[3] = {};
		DBCORPS_MOB_TRI[3].champ = "nomobjet";
		DBCORPS_MOB_TRI[3].sens = "ASC";
	else
		if ( sSENS == "ASC" ) then
			_G[sARROW.."Rarity_Arrow"]:SetTexCoord(0, 0.5625, 0, 1.0);
		else
			_G[sARROW.."Rarity_Arrow"]:SetTexCoord(0, 0.5625, 1.0, 0);
		end
		_G[sARROW.."Rarity_Arrow"]:Show();
		DBCORPS_MOB_TRI[1] = {};
		DBCORPS_MOB_TRI[1].champ = "rarity";
		DBCORPS_MOB_TRI[1].sens = sSENS;
		DBCORPS_MOB_TRI[2] = {};
		DBCORPS_MOB_TRI[2].champ = "nomobjet";
		DBCORPS_MOB_TRI[2].sens = "ASC";
	end

	table.sort(DBCORPS_MOB_LISTE,DBcorps_ListMob_Trier_sort);

	DBcorps_Mob_Scroll_Update();

end

function DBcorps_ListObjet_Trier(sTRI,sINVERSER)

	--local t_ordre = {};
	local sSENS = DBCORPS_OBJET_LISTE_sens;
	local sARROW = "DBcorpsFrame_ObjetFrame_Tri_";

	if ( sTRI == nil ) then
		sTRI = DBCORPS_OBJET_LISTE_ordre;
	end
	if ( sINVERSER == nil ) then
		sINVERSER = 0;
	end
	if ( sTRI == DBCORPS_OBJET_LISTE_ordre ) then
		if ( sINVERSER == 1 ) then
			if ( sSENS == "ASC" ) then
				sSENS = "DESC";
			else
				sSENS = "ASC";
			end
			DBCORPS_OBJET_LISTE_sens = sSENS;
		end
	else
		DBCORPS_OBJET_LISTE_ordre = sTRI;
		sSENS = "ASC";
		DBCORPS_OBJET_LISTE_sens = sSENS;
	end

	_G[sARROW.."Nommob_Arrow"]:Hide();
	_G[sARROW.."Nivmin_Arrow"]:Hide();
	_G[sARROW.."Nivmax_Arrow"]:Hide();
	_G[sARROW.."Classe_Arrow"]:Hide();
	_G[sARROW.."Type_Arrow"]:Hide();
	_G[sARROW.."Famille_Arrow"]:Hide();
	_G[sARROW.."Pctdrop_Arrow"]:Hide();
	_G[sARROW.."Nbcorps_Arrow"]:Hide();
	_G[sARROW.."Nbskin_Arrow"]:Hide();
	_G[sARROW.."Nomregion_Arrow"]:Hide();

	
	DBCORPS_OBJET_TRI = {};
	if ( sTRI == "nommob" ) then
		if ( sSENS == "ASC" ) then
			_G[sARROW.."Nommob_Arrow"]:SetTexCoord(0, 0.5625, 0, 1.0);
		else
			_G[sARROW.."Nommob_Arrow"]:SetTexCoord(0, 0.5625, 1.0, 0);
		end
		_G[sARROW.."Nommob_Arrow"]:Show();
		DBCORPS_OBJET_TRI[1] = {};
		DBCORPS_OBJET_TRI[1].champ = "nommob";
		DBCORPS_OBJET_TRI[1].sens = sSENS;
		DBCORPS_OBJET_TRI[2] = {};
		DBCORPS_OBJET_TRI[2].champ = "nomregion";
		DBCORPS_OBJET_TRI[2].sens = sSENS;
	elseif ( sTRI == "nivmin" ) then
		if ( sSENS == "ASC" ) then
			_G[sARROW.."Nivmin_Arrow"]:SetTexCoord(0, 0.5625, 0, 1.0);
		else
			_G[sARROW.."Nivmin_Arrow"]:SetTexCoord(0, 0.5625, 1.0, 0);
		end
		_G[sARROW.."Nivmin_Arrow"]:Show();
		DBCORPS_OBJET_TRI[1] = {};
		DBCORPS_OBJET_TRI[1].champ = "nivmin";
		DBCORPS_OBJET_TRI[1].sens = sSENS;
		DBCORPS_OBJET_TRI[2] = {};
		DBCORPS_OBJET_TRI[2].champ = "nivmax";
		DBCORPS_OBJET_TRI[2].sens = sSENS;
		DBCORPS_OBJET_TRI[3] = {};
		DBCORPS_OBJET_TRI[3].champ = "nommob";
		DBCORPS_OBJET_TRI[3].sens = sSENS;
		DBCORPS_OBJET_TRI[4] = {};
		DBCORPS_OBJET_TRI[4].champ = "nomregion";
		DBCORPS_OBJET_TRI[4].sens = sSENS;
	elseif ( sTRI == "nivmax" ) then
		if ( sSENS == "ASC" ) then
			_G[sARROW.."Nivmax_Arrow"]:SetTexCoord(0, 0.5625, 0, 1.0);
		else
			_G[sARROW.."Nivmax_Arrow"]:SetTexCoord(0, 0.5625, 1.0, 0);
		end
		_G[sARROW.."Nivmax_Arrow"]:Show();
		DBCORPS_OBJET_TRI[1] = {};
		DBCORPS_OBJET_TRI[1].champ = "nivmax";
		DBCORPS_OBJET_TRI[1].sens = sSENS;
		DBCORPS_OBJET_TRI[2] = {};
		DBCORPS_OBJET_TRI[2].champ = "nivmin";
		DBCORPS_OBJET_TRI[2].sens = sSENS;
		DBCORPS_OBJET_TRI[3] = {};
		DBCORPS_OBJET_TRI[3].champ = "nommob";
		DBCORPS_OBJET_TRI[3].sens = sSENS;
		DBCORPS_OBJET_TRI[4] = {};
		DBCORPS_OBJET_TRI[4].champ = "nomregion";
		DBCORPS_OBJET_TRI[4].sens = sSENS;
	elseif ( sTRI == "classe" ) then
		if ( sSENS == "ASC" ) then
			_G[sARROW.."Classe_Arrow"]:SetTexCoord(0, 0.5625, 0, 1.0);
		else
			_G[sARROW.."Classe_Arrow"]:SetTexCoord(0, 0.5625, 1.0, 0);
		end
		_G[sARROW.."Classe_Arrow"]:Show();
		DBCORPS_OBJET_TRI[1] = {};
		DBCORPS_OBJET_TRI[1].champ = "classe";
		DBCORPS_OBJET_TRI[1].sens = sSENS;
		DBCORPS_OBJET_TRI[2] = {};
		DBCORPS_OBJET_TRI[2].champ = "type";
		DBCORPS_OBJET_TRI[2].sens = sSENS;
		DBCORPS_OBJET_TRI[3] = {};
		DBCORPS_OBJET_TRI[3].champ = "famille";
		DBCORPS_OBJET_TRI[3].sens = sSENS;
		DBCORPS_OBJET_TRI[4] = {};
		DBCORPS_OBJET_TRI[4].champ = "nommob";
		DBCORPS_OBJET_TRI[4].sens = sSENS;
		DBCORPS_OBJET_TRI[5] = {};
		DBCORPS_OBJET_TRI[5].champ = "nomregion";
		DBCORPS_OBJET_TRI[5].sens = sSENS;
	elseif ( sTRI == "type" ) then
		if ( sSENS == "ASC" ) then
			_G[sARROW.."Type_Arrow"]:SetTexCoord(0, 0.5625, 0, 1.0);
		else
			_G[sARROW.."Type_Arrow"]:SetTexCoord(0, 0.5625, 1.0, 0);
		end
		_G[sARROW.."Type_Arrow"]:Show();
		DBCORPS_OBJET_TRI[1] = {};
		DBCORPS_OBJET_TRI[1].champ = "type";
		DBCORPS_OBJET_TRI[1].sens = sSENS;
		DBCORPS_OBJET_TRI[2] = {};
		DBCORPS_OBJET_TRI[2].champ = "famille";
		DBCORPS_OBJET_TRI[2].sens = sSENS;
		DBCORPS_OBJET_TRI[3] = {};
		DBCORPS_OBJET_TRI[3].champ = "nommob";
		DBCORPS_OBJET_TRI[3].sens = sSENS;
		DBCORPS_OBJET_TRI[4] = {};
		DBCORPS_OBJET_TRI[4].champ = "nomregion";
		DBCORPS_OBJET_TRI[4].sens = sSENS;
	elseif ( sTRI == "famille" ) then
		if ( sSENS == "ASC" ) then
			_G[sARROW.."Famille_Arrow"]:SetTexCoord(0, 0.5625, 0, 1.0);
		else
			_G[sARROW.."Famille_Arrow"]:SetTexCoord(0, 0.5625, 1.0, 0);
		end
		_G[sARROW.."Famille_Arrow"]:Show();
		DBCORPS_OBJET_TRI[1] = {};
		DBCORPS_OBJET_TRI[1].champ = "famille";
		DBCORPS_OBJET_TRI[1].sens = sSENS;
		DBCORPS_OBJET_TRI[2] = {};
		DBCORPS_OBJET_TRI[2].champ = "nommob";
		DBCORPS_OBJET_TRI[2].sens = sSENS;
		DBCORPS_OBJET_TRI[3] = {};
		DBCORPS_OBJET_TRI[3].champ = "nomregion";
		DBCORPS_OBJET_TRI[3].sens = sSENS;
	elseif ( sTRI == "pctdrop" ) then
		if ( sSENS == "ASC" ) then
			_G[sARROW.."Pctdrop_Arrow"]:SetTexCoord(0, 0.5625, 0, 1.0);
		else
			_G[sARROW.."Pctdrop_Arrow"]:SetTexCoord(0, 0.5625, 1.0, 0);
		end
		_G[sARROW.."Pctdrop_Arrow"]:Show();
		DBCORPS_OBJET_TRI[1] = {};
		DBCORPS_OBJET_TRI[1].champ = "pctdrop";
		DBCORPS_OBJET_TRI[1].sens = sSENS;
		DBCORPS_OBJET_TRI[2] = {};
		DBCORPS_OBJET_TRI[2].champ = "nbcorps";
		DBCORPS_OBJET_TRI[2].sens = sSENS;
		DBCORPS_OBJET_TRI[3] = {};
		DBCORPS_OBJET_TRI[3].champ = "nommob";
		DBCORPS_OBJET_TRI[3].sens = sSENS;
		DBCORPS_OBJET_TRI[4] = {};
		DBCORPS_OBJET_TRI[4].champ = "nomregion";
		DBCORPS_OBJET_TRI[4].sens = sSENS;
	elseif ( sTRI == "nbcorps" ) then
		if ( sSENS == "ASC" ) then
			_G[sARROW.."Nbcorps_Arrow"]:SetTexCoord(0, 0.5625, 0, 1.0);
		else
			_G[sARROW.."Nbcorps_Arrow"]:SetTexCoord(0, 0.5625, 1.0, 0);
		end
		_G[sARROW.."Nbcorps_Arrow"]:Show();
		DBCORPS_OBJET_TRI[1] = {};
		DBCORPS_OBJET_TRI[1].champ = "nbcorps";
		DBCORPS_OBJET_TRI[1].sens = sSENS;
		DBCORPS_OBJET_TRI[2] = {};
		DBCORPS_OBJET_TRI[2].champ = "nommob";
		DBCORPS_OBJET_TRI[2].sens = sSENS;
		DBCORPS_OBJET_TRI[3] = {};
		DBCORPS_OBJET_TRI[3].champ = "nomregion";
		DBCORPS_OBJET_TRI[3].sens = sSENS;
	elseif ( sTRI == "nbskin" ) then
		if ( sSENS == "ASC" ) then
			_G[sARROW.."Nbskin_Arrow"]:SetTexCoord(0, 0.5625, 0, 1.0);
		else
			_G[sARROW.."Nbskin_Arrow"]:SetTexCoord(0, 0.5625, 1.0, 0);
		end
		_G[sARROW.."Nbskin_Arrow"]:Show();
		DBCORPS_OBJET_TRI[1] = {};
		DBCORPS_OBJET_TRI[1].champ = "nbskin";
		DBCORPS_OBJET_TRI[1].sens = sSENS;
		DBCORPS_OBJET_TRI[2] = {};
		DBCORPS_OBJET_TRI[2].champ = "nommob";
		DBCORPS_OBJET_TRI[2].sens = sSENS;
		DBCORPS_OBJET_TRI[3] = {};
		DBCORPS_OBJET_TRI[3].champ = "nomregion";
		DBCORPS_OBJET_TRI[3].sens = sSENS;
	elseif ( sTRI == "nomregion" ) then
		if ( sSENS == "ASC" ) then
			_G[sARROW.."Nomregion_Arrow"]:SetTexCoord(0, 0.5625, 0, 1.0);
		else
			_G[sARROW.."Nomregion_Arrow"]:SetTexCoord(0, 0.5625, 1.0, 0);
		end
		_G[sARROW.."Nomregion_Arrow"]:Show();
		DBCORPS_OBJET_TRI[1] = {};
		DBCORPS_OBJET_TRI[1].champ = "nomregion";
		DBCORPS_OBJET_TRI[1].sens = sSENS;
		DBCORPS_OBJET_TRI[2] = {};
		DBCORPS_OBJET_TRI[2].champ = "nommob";
		DBCORPS_OBJET_TRI[2].sens = sSENS;
		DBCORPS_OBJET_TRI[3] = {};
		DBCORPS_OBJET_TRI[3].champ = "nomregion";
		DBCORPS_OBJET_TRI[3].sens = sSENS;
	else
		if ( sSENS == "ASC" ) then
			_G[sARROW.."Nom_Arrow"]:SetTexCoord(0, 0.5625, 0, 1.0);
		else
			_G[sARROW.."Nom_Arrow"]:SetTexCoord(0, 0.5625, 1.0, 0);
		end
		_G[sARROW.."Nom_Arrow"]:Show();
		DBCORPS_OBJET_TRI[1] = {};
		DBCORPS_OBJET_TRI[1].champ = "nommob";
		DBCORPS_OBJET_TRI[1].sens = sSENS;
		DBCORPS_OBJET_TRI[2] = {};
		DBCORPS_OBJET_TRI[2].champ = "nomregion";
		DBCORPS_OBJET_TRI[2].sens = sSENS;
	end

	table.sort(DBCORPS_OBJET_LISTE,DBcorps_ListObjet_Trier_sort);

	DBcorps_Objet_Scroll_Update();

end

function DBcorps_ListConnaissanceBete_Trier(sTRI,sINVERSER)

	local sSENS = DBCORPS_ConnaissanceBete_LISTE_sens;
	local sARROW = "DBcorpsFrame_ConnaissanceBeteFrame_Tri_";

	if ( sTRI == nil ) then
		sTRI = DBCORPS_ConnaissanceBete_LISTE_ordre;
	end
	if ( sINVERSER == nil ) then
		sINVERSER = 0;
	end
	if ( sTRI == DBCORPS_ConnaissanceBete_LISTE_ordre ) then
		if ( sINVERSER == 1 ) then
			if ( sSENS == "ASC" ) then
				sSENS = "DESC";
			else
				sSENS = "ASC";
			end
			DBCORPS_ConnaissanceBete_LISTE_sens = sSENS;
		end
	else
		DBCORPS_ConnaissanceBete_LISTE_ordre = sTRI;
		sSENS = "ASC";
		DBCORPS_ConnaissanceBete_LISTE_sens = sSENS;
	end

	_G[sARROW.."Nom_Arrow"]:Hide();
	_G[sARROW.."Niveau_Arrow"]:Hide();
	_G[sARROW.."Classe_Arrow"]:Hide();
	_G[sARROW.."Famille_Arrow"]:Hide();
	_G[sARROW.."Dmin_Arrow"]:Hide();
	_G[sARROW.."Dmax_Arrow"]:Hide();
	_G[sARROW.."Armure_Arrow"]:Hide();
	_G[sARROW.."Pdv_Arrow"]:Hide();
	_G[sARROW.."Technique_Arrow"]:Hide();
	_G[sARROW.."Nomregion_Arrow"]:Hide();

	DBCORPS_ConnaissanceBete_TRI = {};
	if ( sTRI == "nommob" ) then
		if ( sSENS == "ASC" ) then
			_G[sARROW.."Nom_Arrow"]:SetTexCoord(0, 0.5625, 0, 1.0);
		else
			_G[sARROW.."Nom_Arrow"]:SetTexCoord(0, 0.5625, 1.0, 0);
		end
		_G[sARROW.."Nom_Arrow"]:Show();
		DBCORPS_ConnaissanceBete_TRI[1] = {};
		DBCORPS_ConnaissanceBete_TRI[1].champ = "nommob";
		DBCORPS_ConnaissanceBete_TRI[1].sens = sSENS;
		DBCORPS_ConnaissanceBete_TRI[2] = {};
		DBCORPS_ConnaissanceBete_TRI[2].champ = "niveau";
		DBCORPS_ConnaissanceBete_TRI[2].sens = sSENS;
	elseif ( sTRI == "niveau" ) then
		if ( sSENS == "ASC" ) then
			_G[sARROW.."Niveau_Arrow"]:SetTexCoord(0, 0.5625, 0, 1.0);
		else
			_G[sARROW.."Niveau_Arrow"]:SetTexCoord(0, 0.5625, 1.0, 0);
		end
		_G[sARROW.."Niveau_Arrow"]:Show();
		DBCORPS_ConnaissanceBete_TRI[1] = {};
		DBCORPS_ConnaissanceBete_TRI[1].champ = "niveau";
		DBCORPS_ConnaissanceBete_TRI[1].sens = sSENS;
		DBCORPS_ConnaissanceBete_TRI[2] = {};
		DBCORPS_ConnaissanceBete_TRI[2].champ = "nommob";
		DBCORPS_ConnaissanceBete_TRI[2].sens = sSENS;
	elseif ( sTRI == "classe" ) then
		if ( sSENS == "ASC" ) then
			_G[sARROW.."Classe_Arrow"]:SetTexCoord(0, 0.5625, 0, 1.0);
		else
			_G[sARROW.."Classe_Arrow"]:SetTexCoord(0, 0.5625, 1.0, 0);
		end
		_G[sARROW.."Classe_Arrow"]:Show();
		DBCORPS_ConnaissanceBete_TRI[1] = {};
		DBCORPS_ConnaissanceBete_TRI[1].champ = "classe";
		DBCORPS_ConnaissanceBete_TRI[1].sens = sSENS;
		DBCORPS_ConnaissanceBete_TRI[2] = {};
		DBCORPS_ConnaissanceBete_TRI[2].champ = "nommob";
		DBCORPS_ConnaissanceBete_TRI[2].sens = sSENS;
		DBCORPS_ConnaissanceBete_TRI[3] = {};
		DBCORPS_ConnaissanceBete_TRI[3].champ = "niveau";
		DBCORPS_ConnaissanceBete_TRI[3].sens = sSENS;
	elseif ( sTRI == "famille" ) then
		if ( sSENS == "ASC" ) then
			_G[sARROW.."Famille_Arrow"]:SetTexCoord(0, 0.5625, 0, 1.0);
		else
			_G[sARROW.."Famille_Arrow"]:SetTexCoord(0, 0.5625, 1.0, 0);
		end
		_G[sARROW.."Famille_Arrow"]:Show();
		DBCORPS_ConnaissanceBete_TRI[1] = {};
		DBCORPS_ConnaissanceBete_TRI[1].champ = "famille";
		DBCORPS_ConnaissanceBete_TRI[1].sens = sSENS;
		DBCORPS_ConnaissanceBete_TRI[2] = {};
		DBCORPS_ConnaissanceBete_TRI[2].champ = "classe";
		DBCORPS_ConnaissanceBete_TRI[2].sens = sSENS;
		DBCORPS_ConnaissanceBete_TRI[3] = {};
		DBCORPS_ConnaissanceBete_TRI[3].champ = "nommob";
		DBCORPS_ConnaissanceBete_TRI[3].sens = sSENS;
		DBCORPS_ConnaissanceBete_TRI[4] = {};
		DBCORPS_ConnaissanceBete_TRI[4].champ = "niveau";
		DBCORPS_ConnaissanceBete_TRI[4].sens = sSENS;
	elseif ( sTRI == "dmin" ) then
		if ( sSENS == "ASC" ) then
			_G[sARROW.."Dmin_Arrow"]:SetTexCoord(0, 0.5625, 0, 1.0);
		else
			_G[sARROW.."Dmin_Arrow"]:SetTexCoord(0, 0.5625, 1.0, 0);
		end
		_G[sARROW.."Dmin_Arrow"]:Show();
		DBCORPS_ConnaissanceBete_TRI[1] = {};
		DBCORPS_ConnaissanceBete_TRI[1].champ = "dmin";
		DBCORPS_ConnaissanceBete_TRI[1].sens = sSENS;
		DBCORPS_ConnaissanceBete_TRI[2] = {};
		DBCORPS_ConnaissanceBete_TRI[2].champ = "dmax";
		DBCORPS_ConnaissanceBete_TRI[2].sens = sSENS;
		DBCORPS_ConnaissanceBete_TRI[3] = {};
		DBCORPS_ConnaissanceBete_TRI[3].champ = "niveau";
		DBCORPS_ConnaissanceBete_TRI[3].sens = sSENS;
		DBCORPS_ConnaissanceBete_TRI[4] = {};
		DBCORPS_ConnaissanceBete_TRI[4].champ = "nommob";
		DBCORPS_ConnaissanceBete_TRI[4].sens = sSENS;
	elseif ( sTRI == "dmax" ) then
		if ( sSENS == "ASC" ) then
			_G[sARROW.."Dmax_Arrow"]:SetTexCoord(0, 0.5625, 0, 1.0);
		else
			_G[sARROW.."Dmax_Arrow"]:SetTexCoord(0, 0.5625, 1.0, 0);
		end
		_G[sARROW.."Dmax_Arrow"]:Show();
		DBCORPS_ConnaissanceBete_TRI[1] = {};
		DBCORPS_ConnaissanceBete_TRI[1].champ = "dmax";
		DBCORPS_ConnaissanceBete_TRI[1].sens = sSENS;
		DBCORPS_ConnaissanceBete_TRI[2] = {};
		DBCORPS_ConnaissanceBete_TRI[2].champ = "dmin";
		DBCORPS_ConnaissanceBete_TRI[2].sens = sSENS;
		DBCORPS_ConnaissanceBete_TRI[3] = {};
		DBCORPS_ConnaissanceBete_TRI[3].champ = "niveau";
		DBCORPS_ConnaissanceBete_TRI[3].sens = sSENS;
		DBCORPS_ConnaissanceBete_TRI[4] = {};
		DBCORPS_ConnaissanceBete_TRI[4].champ = "nommob";
		DBCORPS_ConnaissanceBete_TRI[4].sens = sSENS;
	elseif ( sTRI == "armure" ) then
		if ( sSENS == "ASC" ) then
			_G[sARROW.."Armure_Arrow"]:SetTexCoord(0, 0.5625, 0, 1.0);
		else
			_G[sARROW.."Armure_Arrow"]:SetTexCoord(0, 0.5625, 1.0, 0);
		end
		_G[sARROW.."Armure_Arrow"]:Show();
		DBCORPS_ConnaissanceBete_TRI[1] = {};
		DBCORPS_ConnaissanceBete_TRI[1].champ = "armure";
		DBCORPS_ConnaissanceBete_TRI[1].sens = sSENS;
		DBCORPS_ConnaissanceBete_TRI[2] = {};
		DBCORPS_ConnaissanceBete_TRI[2].champ = "pdv";
		DBCORPS_ConnaissanceBete_TRI[2].sens = sSENS;
		DBCORPS_ConnaissanceBete_TRI[3] = {};
		DBCORPS_ConnaissanceBete_TRI[3].champ = "niveau";
		DBCORPS_ConnaissanceBete_TRI[3].sens = sSENS;
		DBCORPS_ConnaissanceBete_TRI[4] = {};
		DBCORPS_ConnaissanceBete_TRI[4].champ = "nommob";
		DBCORPS_ConnaissanceBete_TRI[4].sens = sSENS;
	elseif ( sTRI == "pdv" ) then
		if ( sSENS == "ASC" ) then
			_G[sARROW.."Pdv_Arrow"]:SetTexCoord(0, 0.5625, 0, 1.0);
		else
			_G[sARROW.."Pdv_Arrow"]:SetTexCoord(0, 0.5625, 1.0, 0);
		end
		_G[sARROW.."Pdv_Arrow"]:Show();
		DBCORPS_ConnaissanceBete_TRI[1] = {};
		DBCORPS_ConnaissanceBete_TRI[1].champ = "pdv";
		DBCORPS_ConnaissanceBete_TRI[1].sens = sSENS;
		DBCORPS_ConnaissanceBete_TRI[2] = {};
		DBCORPS_ConnaissanceBete_TRI[2].champ = "armure";
		DBCORPS_ConnaissanceBete_TRI[2].sens = sSENS;
		DBCORPS_ConnaissanceBete_TRI[3] = {};
		DBCORPS_ConnaissanceBete_TRI[3].champ = "niveau";
		DBCORPS_ConnaissanceBete_TRI[3].sens = sSENS;
		DBCORPS_ConnaissanceBete_TRI[4] = {};
		DBCORPS_ConnaissanceBete_TRI[4].champ = "nommob";
		DBCORPS_ConnaissanceBete_TRI[4].sens = sSENS;
	elseif ( sTRI == "technique" ) then
		if ( sSENS == "ASC" ) then
			_G[sARROW.."Technique_Arrow"]:SetTexCoord(0, 0.5625, 0, 1.0);
		else
			_G[sARROW.."Technique_Arrow"]:SetTexCoord(0, 0.5625, 1.0, 0);
		end
		_G[sARROW.."Technique_Arrow"]:Show();
		DBCORPS_ConnaissanceBete_TRI[1] = {};
		DBCORPS_ConnaissanceBete_TRI[1].champ = "nommob";
		DBCORPS_ConnaissanceBete_TRI[1].sens = sSENS;
		DBCORPS_ConnaissanceBete_TRI[2] = {};
		DBCORPS_ConnaissanceBete_TRI[2].champ = "niveau";
		DBCORPS_ConnaissanceBete_TRI[2].sens = sSENS;
	elseif ( sTRI == "nomregion" ) then
		if ( sSENS == "ASC" ) then
			_G[sARROW.."Nomregion_Arrow"]:SetTexCoord(0, 0.5625, 0, 1.0);
		else
			_G[sARROW.."Nomregion_Arrow"]:SetTexCoord(0, 0.5625, 1.0, 0);
		end
		_G[sARROW.."Nomregion_Arrow"]:Show();
		DBCORPS_ConnaissanceBete_TRI[1] = {};
		DBCORPS_ConnaissanceBete_TRI[1].champ = "nomregion";
		DBCORPS_ConnaissanceBete_TRI[1].sens = sSENS;
		DBCORPS_ConnaissanceBete_TRI[2] = {};
		DBCORPS_ConnaissanceBete_TRI[2].champ = "nommob";
		DBCORPS_ConnaissanceBete_TRI[2].sens = sSENS;
		DBCORPS_ConnaissanceBete_TRI[3] = {};
		DBCORPS_ConnaissanceBete_TRI[3].champ = "niveau";
		DBCORPS_ConnaissanceBete_TRI[3].sens = sSENS;
	else
		if ( sSENS == "ASC" ) then
			_G[sARROW.."Nom_Arrow"]:SetTexCoord(0, 0.5625, 0, 1.0);
		else
			_G[sARROW.."Nom_Arrow"]:SetTexCoord(0, 0.5625, 1.0, 0);
		end
		_G[sARROW.."Nom_Arrow"]:Show();
		DBCORPS_ConnaissanceBete_TRI[1] = {};
		DBCORPS_ConnaissanceBete_TRI[1].champ = "nommob";
		DBCORPS_ConnaissanceBete_TRI[1].sens = sSENS;
		DBCORPS_ConnaissanceBete_TRI[2] = {};
		DBCORPS_ConnaissanceBete_TRI[2].champ = "niveau";
		DBCORPS_ConnaissanceBete_TRI[2].sens = sSENS;
	end

	table.sort(DBCORPS_ConnaissanceBete_LISTE,DBcorps_ListConnaissanceBete_Trier_sort);

	DBcorps_ConnaissanceBete_Scroll_Update();

end

function DBcorps_ListPNJ_Trier(sTRI,sINVERSER)

	local sSENS = DBCORPS_PNJ_LISTE_sens;
	local sARROW = "DBcorpsFrame_PNJFrame_Tri_";

	if ( sTRI == nil ) then
		sTRI = DBCORPS_PNJ_LISTE_ordre;
	end
	if ( sINVERSER == nil ) then
		sINVERSER = 0;
	end
	if ( sTRI == DBCORPS_PNJ_LISTE_ordre ) then
		if ( sINVERSER == 1 ) then
			if ( sSENS == "ASC" ) then
				sSENS = "DESC";
			else
				sSENS = "ASC";
			end
			DBCORPS_PNJ_LISTE_sens = sSENS;
		end
	else
		DBCORPS_PNJ_LISTE_ordre = sTRI;
		sSENS = "ASC";
		DBCORPS_PNJ_LISTE_sens = sSENS;
	end

	_G[sARROW.."NumPNJ_Arrow"]:Hide();
	_G[sARROW.."NomPNJ_Arrow"]:Hide();

	DBCORPS_PNJ_TRI = {};
	if ( sTRI == "numPNJ" ) then
		if ( sSENS == "ASC" ) then
			_G[sARROW.."NumPNJ_Arrow"]:SetTexCoord(0, 0.5625, 0, 1.0);
		else
			_G[sARROW.."NumPNJ_Arrow"]:SetTexCoord(0, 0.5625, 1.0, 0);
		end
		_G[sARROW.."NumPNJ_Arrow"]:Show();
		DBCORPS_PNJ_TRI[1] = {};
		DBCORPS_PNJ_TRI[1].champ = "numPNJ";
		DBCORPS_PNJ_TRI[1].sens = sSENS;
	elseif ( sTRI == "nomPNJ" ) then
		if ( sSENS == "ASC" ) then
			_G[sARROW.."NomPNJ_Arrow"]:SetTexCoord(0, 0.5625, 0, 1.0);
		else
			_G[sARROW.."NomPNJ_Arrow"]:SetTexCoord(0, 0.5625, 1.0, 0);
		end
		_G[sARROW.."NomPNJ_Arrow"]:Show();
		DBCORPS_PNJ_TRI[1] = {};
		DBCORPS_PNJ_TRI[1].champ = "nomPNJ";
		DBCORPS_PNJ_TRI[1].sens = sSENS;
		DBCORPS_PNJ_TRI[2] = {};
		DBCORPS_PNJ_TRI[2].champ = "numPNJ";
		DBCORPS_PNJ_TRI[2].sens = sSENS;
	end

	table.sort(DBCORPS_PNJ_LISTE,DBcorps_ListPNJ_Trier_sort);

	DBcorps_PNJ_Scroll_Update();

end

function DBcorps_ListMobs_Trier_sort(elem1,elem2)

	return DBmobs_Trier(elem1,elem2,DBCORPS_MOBS_TRI,1);

end

function DBcorps_ListObjets_Trier_sort(elem1,elem2)

	return DBobjets_Trier(elem1,elem2,DBCORPS_OBJETS_TRI,1);

end

function DBcorps_ListMob_Trier_sort(elem1,elem2)

	return DBobjets_Trier(elem1,elem2,DBCORPS_MOB_TRI,1);

end

function DBcorps_ListObjet_Trier_sort(elem1,elem2)

	return DBmobs_Trier(elem1,elem2,DBCORPS_OBJET_TRI,1);

end

function DBcorps_ListConnaissanceBete_Trier_sort(elem1,elem2)

	return DBmobs_TrierConnaissanceBete(elem1,elem2,DBCORPS_ConnaissanceBete_TRI,1);

end

function DBcorps_ListPNJ_Trier_sort(elem1,elem2)

	return DBmobsPNJ_Trier(elem1,elem2,DBCORPS_PNJ_TRI,1);

end

--/script DEFAULT_CHAT_FRAME:AddMessage(DBcorpsFrame_FrameHomeCancel:GetRight()-DBcorpsFrame_FrameHomeCancel:GetLeft());
--/script DEFAULT_CHAT_FRAME:AddMessage(DBcorpsFrame_FrameHomeCancel:GetTop()-DBcorpsFrame_FrameHomeCancel:GetBottom());

function DBcorps_ListMobs_Reset()

	local item_base = "DBcorpsFrame_MobsFrame_Criteres_";

	_G[item_base.."Nommob"]:SetText("");
	_G[item_base.."Nivmin"]:SetText("");
	_G[item_base.."Nivmax"]:SetText("");
	_G[item_base.."Nbcorps_min"]:SetText("");
	_G[item_base.."Nbcorps_max"]:SetText("");
	_G[item_base.."Nbskin_min"]:SetText("");
	_G[item_base.."Nbskin_max"]:SetText("");
	_G[item_base.."Nomregion"]:SetText("");
	_G[item_base.."Classe"]:SetText("");
	_G[item_base.."Type"]:SetText("");
	_G[item_base.."Famille"]:SetText("");
	DBcorpsFrame_MobsFrame_Criteres_TypeRegion1_OnLoad();
	UIDropDownMenu_SetSelectedValue(DBcorpsFrame_MobsFrame_Criteres_TypeRegion1,-1);
	DBcorpsFrame_MobsFrame_Criteres_TypeRegion2_OnLoad();
	UIDropDownMenu_SetSelectedValue(DBcorpsFrame_MobsFrame_Criteres_TypeRegion2,-1);
	DBcorpsFrame_MobsFrame_Criteres_TypeRegion3_OnLoad();
	UIDropDownMenu_SetSelectedValue(DBcorpsFrame_MobsFrame_Criteres_TypeRegion3,-1);
	DBCORPS_MOBS_TypeRegion_select = nil;

end

function DBcorps_ListObjets_Reset()

	local item_base = "DBcorpsFrame_ObjetsFrame_Criteres_";

	DBcorpsFrame_ObjetsFrame_Criteres_Rarity_OnLoad();
	UIDropDownMenu_SetSelectedValue(DBcorpsFrame_ObjetsFrame_Criteres_Rarity,-1);
	_G[item_base.."Nomobjet"]:SetText("");
	_G[item_base.."Nivmin"]:SetText("");
	_G[item_base.."Nivmax"]:SetText("");
	_G[item_base.."Inconnus"]:SetChecked(0);
	DBcorpsFrame_ObjetsFrame_Criteres_Type_OnLoad();
	UIDropDownMenu_SetSelectedValue(DBcorpsFrame_ObjetsFrame_Criteres_Type,-1);
	DBcorpsFrame_ObjetsFrame_Criteres_SubType_OnLoad();
	UIDropDownMenu_SetSelectedValue(DBcorpsFrame_ObjetsFrame_Criteres_SubType,-1);
	DBcorpsFrame_ObjetsFrame_Criteres_Equiploc_OnLoad();
	UIDropDownMenu_SetSelectedValue(DBcorpsFrame_ObjetsFrame_Criteres_Equiploc,-1);
	DBcorpsFrame_ObjetsFrame_Criteres_Faction_OnLoad();
	UIDropDownMenu_SetSelectedValue(DBcorpsFrame_ObjetsFrame_Criteres_Faction,-1);
	DBcorpsFrame_ObjetsFrame_Criteres_Classe_OnLoad();
	UIDropDownMenu_SetSelectedValue(DBcorpsFrame_ObjetsFrame_Criteres_Classe,-1);
	DBcorpsFrame_ObjetsFrame_Criteres_Setsniveau0_OnLoad();
	UIDropDownMenu_SetSelectedValue(DBcorpsFrame_ObjetsFrame_Criteres_Setsniveau0,5);
	DBcorpsFrame_ObjetsFrame_Criteres_Setsniveau_OnLoad();
	UIDropDownMenu_SetSelectedValue(DBcorpsFrame_ObjetsFrame_Criteres_Setsniveau,-1);
	DBcorpsFrame_ObjetsFrame_Criteres_Setsnom_OnLoad();
	UIDropDownMenu_SetSelectedValue(DBcorpsFrame_ObjetsFrame_Criteres_Setsnom,0);

end

function DBcorps_ListConnaissanceBete_Reset()

	local item_base = "DBcorpsFrame_ConnaissanceBeteFrame_Criteres_";

	_G[item_base.."Nommob"]:SetText("");
	_G[item_base.."Nivmin"]:SetText("");
	_G[item_base.."Nivmax"]:SetText("");
	_G[item_base.."Famille"]:SetText("");
	DBcorpsFrame_ConnaissanceBeteFrame_Criteres_Technique_OnLoad();
	UIDropDownMenu_SetSelectedValue(DBcorpsFrame_ConnaissanceBeteFrame_Criteres_Technique,-1);
	_G[item_base.."Nomregion"]:SetText("");

end

function DBcorps_ListPNJ_Reset()

	local item_base = "DBcorpsFrame_PNJFrame_Criteres_";

	_G[item_base.."NumPNJ"]:SetText("");
	_G[item_base.."NomPNJ"]:SetText("");
	DBcorpsFrame_PNJFrame_Criteres_Type_OnLoad();
	UIDropDownMenu_SetSelectedValue(DBcorpsFrame_PNJFrame_Criteres_Type,-1);
	DBcorpsFrame_PNJFrame_Criteres_Rep_OnLoad();
	UIDropDownMenu_SetSelectedValue(DBcorpsFrame_PNJFrame_Criteres_Rep,-1);
	DBcorpsFrame_PNJFrame_Criteres_Sexe_OnLoad();
	UIDropDownMenu_SetSelectedValue(DBcorpsFrame_PNJFrame_Criteres_Sexe,-1);
	DBcorpsFrame_PNJFrame_Criteres_Nom_OnLoad();
	UIDropDownMenu_SetSelectedValue(DBcorpsFrame_PNJFrame_Criteres_Nom,-1);
	DBcorpsFrame_PNJFrame_Criteres_Classe_OnLoad();
	UIDropDownMenu_SetSelectedValue(DBcorpsFrame_PNJFrame_Criteres_Classe,-1);
	DBcorpsFrame_PNJFrame_Criteres_Type2_OnLoad();
	UIDropDownMenu_SetSelectedValue(DBcorpsFrame_PNJFrame_Criteres_Type2,-1);
	DBcorpsFrame_PNJFrame_Criteres_TypeRegion1_OnLoad();
	UIDropDownMenu_SetSelectedValue(DBcorpsFrame_PNJFrame_Criteres_TypeRegion1,-1);
	DBcorpsFrame_PNJFrame_Criteres_TypeRegion2_OnLoad();
	UIDropDownMenu_SetSelectedValue(DBcorpsFrame_PNJFrame_Criteres_TypeRegion2,-1);
	DBcorpsFrame_PNJFrame_Criteres_TypeRegion3_OnLoad();
	UIDropDownMenu_SetSelectedValue(DBcorpsFrame_PNJFrame_Criteres_TypeRegion3,-1);
	DBCORPS_PNJ_TypeRegion_select = nil;

end

function DBcorps_ListMobs_Update()

	local criteres = {};
	local item_base = "DBcorpsFrame_MobsFrame_Criteres_";

	criteres.nommob = _G[item_base.."Nommob"]:GetText();
	criteres.nivmin = tonumber(_G[item_base.."Nivmin"]:GetText());
	criteres.nivmax = tonumber(_G[item_base.."Nivmax"]:GetText());
	criteres.nbcorpsmin = tonumber(_G[item_base.."Nbcorps_min"]:GetText());
	criteres.nbcorpsmax = tonumber(_G[item_base.."Nbcorps_max"]:GetText());
	criteres.nbskinmin = tonumber(_G[item_base.."Nbskin_min"]:GetText());
	criteres.nbskinmax = tonumber(_G[item_base.."Nbskin_max"]:GetText());
	criteres.nomregion = _G[item_base.."Nomregion"]:GetText();
	criteres.classe = _G[item_base.."Classe"]:GetText();
	criteres.type = _G[item_base.."Type"]:GetText();
	criteres.famille = _G[item_base.."Famille"]:GetText();
	criteres.salaireskin = _G[item_base.."Salaireskin"]:GetChecked();
	if ( criteres.salaireskin == nil ) then
		criteres.salaireskin = 0;
	end
	DBCS_salaireskin = criteres.salaireskin;
	criteres.numregion = DBCORPS_MOBS_TypeRegion_select;

	DBcorpsFrame_MobsFrame_Liste_ScrollFrameScrollBar:SetValue(0);
	DBCORPS_MOBS_LISTE = DBmobs_Liste(criteres);
	DBCORPS_MOBS_LISTE_nb = table.getn(DBCORPS_MOBS_LISTE);
	_G["DBcorpsFrame_MobsFrame_Criteres_Elements"]:SetText(DBCORPS_MOBS_LISTE_nb.." \195\169l\195\169ments trouv\195\169s.")
	DBcorps_ListMobs_Trier();

end

function DBcorps_ListConnaissanceBete_Update()

	local criteres = {};
	local item_base = "DBcorpsFrame_ConnaissanceBeteFrame_Criteres_";

	criteres.nommob = _G[item_base.."Nommob"]:GetText();
	criteres.nivmin = tonumber(_G[item_base.."Nivmin"]:GetText());
	criteres.nivmax = tonumber(_G[item_base.."Nivmax"]:GetText());
	criteres.famille = _G[item_base.."Famille"]:GetText();
	criteres.nomregion = _G[item_base.."Nomregion"]:GetText();
	criteres.technique = UIDropDownMenu_GetSelectedValue(DBcorpsFrame_ConnaissanceBeteFrame_Criteres_Technique);

	DBcorpsFrame_ConnaissanceBeteFrame_Liste_ScrollFrameScrollBar:SetValue(0);
	DBCORPS_ConnaissanceBete_LISTE = DBmobs_ListeConnaissanceBete(criteres);
	DBCORPS_ConnaissanceBete_LISTE_nb = table.getn(DBCORPS_ConnaissanceBete_LISTE);
	_G["DBcorpsFrame_ConnaissanceBeteFrame_Criteres_Elements"]:SetText(DBCORPS_ConnaissanceBete_LISTE_nb.." \195\169l\195\169ments trouv\195\169s.")
	DBcorps_ListConnaissanceBete_Trier();

end

function DBcorps_ListObjets_MAJ()

--TraceFrame:AddMessage("DBCS_extract_nb = "..DBCS_extract_nb);
--TraceFrame:AddMessage("DBCS_extract_nb_save = "..DBCS_extract_nb_save);
	DBCS_extract_nb_MAJ = true;
	DBOS_extract_time = 0;
	--DBobjets_initobjets(1,45000);
	--DBobjets_initobjets(1,55000);
	--DBobjets_initobjets(1,60000);
	--DBobjets_initobjets(1,65000);
	DBobjets_initobjets(1,DBCS_extract_nb_max);
--TraceFrame:AddMessage("DBCS_extract_nb = "..DBCS_extract_nb);
--TraceFrame:AddMessage("DBCS_extract_nb_save = "..DBCS_extract_nb_save);

end

function DBcorps_ListObjets_Update()

--if ( InCombatLockdown() ) then
--	return nil;
--end

	local criteres = {};
	local item_base = "DBcorpsFrame_ObjetsFrame_Criteres_";

	criteres.rarity = UIDropDownMenu_GetSelectedValue(DBcorpsFrame_ObjetsFrame_Criteres_Rarity);
	criteres.nomobjet = _G[item_base.."Nomobjet"]:GetText();
	criteres.nivmin = tonumber(_G[item_base.."Nivmin"]:GetText());
	criteres.nivmax = tonumber(_G[item_base.."Nivmax"]:GetText());
	criteres.inconnus = _G[item_base.."Inconnus"]:GetChecked();
	if ( criteres.inconnus == nil ) then
		criteres.inconnus = 0;
	end
	criteres.type = UIDropDownMenu_GetSelectedValue(DBcorpsFrame_ObjetsFrame_Criteres_Type);
	criteres.subtype = UIDropDownMenu_GetSelectedValue(DBcorpsFrame_ObjetsFrame_Criteres_SubType);
	criteres.equiploc = UIDropDownMenu_GetSelectedValue(DBcorpsFrame_ObjetsFrame_Criteres_Equiploc);
	criteres.faction = UIDropDownMenu_GetSelectedValue(DBcorpsFrame_ObjetsFrame_Criteres_Faction);
	criteres.setsnom = UIDropDownMenu_GetSelectedValue(DBcorpsFrame_ObjetsFrame_Criteres_Setsnom);

	DBcorpsFrame_ObjetsFrame_Liste_ScrollFrameScrollBar:SetValue(0);
	DBCORPS_OBJETS_LISTE = DBobjets_Liste(criteres);
	DBCORPS_OBJETS_LISTE_nb = table.getn(DBCORPS_OBJETS_LISTE);
	_G["DBcorpsFrame_ObjetsFrame_Criteres_Elements"]:SetText(DBCORPS_OBJETS_LISTE_nb.." \195\169l\195\169ments trouv\195\169s.")
	DBcorps_ListObjets_Trier();

end

--/script DBcorps_ListObjets_liste_des_enchants_Update();
function DBcorps_ListObjets_liste_des_enchants_Update()

	DBcorpsFrame_ObjetsFrame_Liste_ScrollFrameScrollBar:SetValue(0);
	DBCORPS_OBJETS_LISTE = DBobjets_Liste_des_enchants();
	DBCORPS_OBJETS_LISTE_nb = table.getn(DBCORPS_OBJETS_LISTE);
	_G["DBcorpsFrame_ObjetsFrame_Criteres_Elements"]:SetText(DBCORPS_OBJETS_LISTE_nb.." \195\169l\195\169ments trouv\195\169s.")
	DBcorps_ListObjets_Trier();

end

--/script DBcorps_ListObjets_inconnu_ds_DBmobs_Update();
function DBcorps_ListObjets_inconnu_ds_DBmobs_Update()

	DBcorpsFrame_ObjetsFrame_Liste_ScrollFrameScrollBar:SetValue(0);
	DBCORPS_OBJETS_LISTE = DBobjets_Liste_inconnu_ds_DBmobs();
	DBCORPS_OBJETS_LISTE_nb = table.getn(DBCORPS_OBJETS_LISTE);
	_G["DBcorpsFrame_ObjetsFrame_Criteres_Elements"]:SetText(DBCORPS_OBJETS_LISTE_nb.." \195\169l\195\169ments trouv\195\169s.")
	DBcorps_ListObjets_Trier();

end

--/script DBcorps_ListObjets_inconnu_ds_DBquetes_Update();
function DBcorps_ListObjets_inconnu_ds_DBquetes_Update()

	DBcorpsFrame_ObjetsFrame_Liste_ScrollFrameScrollBar:SetValue(0);
	DBCORPS_OBJETS_LISTE = DBobjets_Liste_inconnu_ds_DBquetes();
	DBCORPS_OBJETS_LISTE_nb = table.getn(DBCORPS_OBJETS_LISTE);
	_G["DBcorpsFrame_ObjetsFrame_Criteres_Elements"]:SetText(DBCORPS_OBJETS_LISTE_nb.." \195\169l\195\169ments trouv\195\169s.")
	DBcorps_ListObjets_Trier();

end

function DBcorps_ListPNJ_Update()

--if ( InCombatLockdown() ) then
--	return nil;
--end

	local criteres = {};
	local item_base = "DBcorpsFrame_PNJFrame_Criteres_";

	criteres.numPNJ = tonumber(_G[item_base.."NumPNJ"]:GetText());
	criteres.nomPNJ = _G[item_base.."NomPNJ"]:GetText();
	criteres.type = UIDropDownMenu_GetSelectedValue(DBcorpsFrame_PNJFrame_Criteres_Type);
	criteres.rep = UIDropDownMenu_GetSelectedValue(DBcorpsFrame_PNJFrame_Criteres_Rep);
	criteres.sexe = UIDropDownMenu_GetSelectedValue(DBcorpsFrame_PNJFrame_Criteres_Sexe);
	criteres.nom = UIDropDownMenu_GetSelectedValue(DBcorpsFrame_PNJFrame_Criteres_Nom);
	criteres.classe = UIDropDownMenu_GetSelectedValue(DBcorpsFrame_PNJFrame_Criteres_Classe);
	criteres.type2 = UIDropDownMenu_GetSelectedValue(DBcorpsFrame_PNJFrame_Criteres_Type2);
	criteres.numregion = DBCORPS_PNJ_TypeRegion_select;

	DBcorpsFrame_PNJFrame_Liste_ScrollFrameScrollBar:SetValue(0);
	DBCORPS_PNJ_LISTE = DBmobsPNJ_Liste(criteres);
	DBCORPS_PNJ_LISTE_nb = table.getn(DBCORPS_PNJ_LISTE);
	_G["DBcorpsFrame_PNJFrame_Criteres_Elements"]:SetText(DBCORPS_PNJ_LISTE_nb.." \195\169l\195\169ments trouv\195\169s.")
	DBcorps_ListPNJ_Trier();

end

local DBcorps_PNJ_Liste_SPELL_tableau = {};
DBcorps_PNJ_Liste_SPELL_tableau[1] = { id = 1, name = "Fen\195\170tre chat" };
DBcorps_PNJ_Liste_SPELL_tableau[2] = { id = 2, name = "Locale" };
DBcorps_PNJ_Liste_SPELL_tableau[3] = { id = 3, name = "Groupe" };
DBcorps_PNJ_Liste_SPELL_tableau[4] = { id = 4, name = "Raid" };
DBcorps_PNJ_Liste_SPELL_tableau[5] = { id = 5, name = "Guilde" };
DBcorps_PNJ_Liste_SPELL_tableau[6] = { id = 6, name = "BG" };
DBcorps_PNJ_Liste_SPELL_tableau[7] = { id = 7, name = "Canal 1" };
DBcorps_PNJ_Liste_SPELL_tableau[8] = { id = 8, name = "Canal 2" };
DBcorps_PNJ_Liste_SPELL_tableau[9] = { id = 9, name = "Canal 3" };
DBcorps_PNJ_Liste_SPELL_tableau[10] = { id = 10, name = "Canal 4" };
DBcorps_PNJ_Liste_SPELL_tableau[11] = { id = 11, name = "Canal 5" };
DBcorps_PNJ_Liste_SPELL_tableau[12] = { id = 12, name = "Canal 6" };
DBcorps_PNJ_Liste_SPELL_tableau[13] = { id = 13, name = "Canal 7" };
DBcorps_PNJ_Liste_SPELL_tableau[14] = { id = 14, name = "Canal 8" };
DBcorps_PNJ_Liste_SPELL_tableau[15] = { id = 15, name = "Canal 9" };
DBcorps_PNJ_Liste_SPELL_tableau[16] = { id = 16, name = "Canal 10" };

local DBcorps_PNJ_Liste_SPELL_numPNJ;

function DBcorps_PNJ_Liste_SPELL_DropDown_OnLoad(self)

	UIDropDownMenu_Initialize(self, DBcorps_PNJ_Liste_SPELL_DropDown_Initialize, "MENU");

end

function DBcorps_PNJ_Liste_SPELL_DropDown_Initialize()

local i;
local info;


	for i = 1 , table.getn(DBcorps_PNJ_Liste_SPELL_tableau) do

		info = UIDropDownMenu_CreateInfo();
		info.text = DBcorps_PNJ_Liste_SPELL_tableau[i].name;
--			info.checked = nil;
		info.func = DBcorps_PNJ_Liste_SPELL_OnClick_Choix;
--		info.icon = DBcorps_PNJ_Liste_SPELL_tableau[i].icon;
		info.arg1 = i;
--		info.tCoordLeft = 0.0625;
--		info.tCoordRight = 0.9;
--		info.tCoordTop = 0.0625;
--		info.tCoordBottom = 0.9;
		UIDropDownMenu_AddButton(info);
	end
	
end

function DBcorps_PNJ_Liste_SPELL_OnClick_Choix(self,id)

local i;

--	DBcorps_PNJ_Liste_SPELL_id = DBcorps_PNJ_Liste_SPELL_tableau[id].id;
	--DBCS_Region_Minimap_Tracking_afficher_icone();
	--DBCS_Region_Minimap_Tracking_SetTracking_afficher();

	if ( DBmobs_Local and DBmobs_Local[DBcorps_PNJ_Liste_SPELL_numPNJ] and DBmobs_Local[DBcorps_PNJ_Liste_SPELL_numPNJ][1] and DBmobs_Local[DBcorps_PNJ_Liste_SPELL_numPNJ][1][1] ) then
		if ( id == 1 ) then
			TraceFrame:AddMessage("le mob num\195\169ro "..DBcorps_PNJ_Liste_SPELL_numPNJ.." : ("..DBmobs_Local[DBcorps_PNJ_Liste_SPELL_numPNJ][1][1]..") poss\195\168de ces sorts :");
		elseif ( id == 2 ) then
			SendChatMessage("le mob num\195\169ro "..DBcorps_PNJ_Liste_SPELL_numPNJ.." : ("..DBmobs_Local[DBcorps_PNJ_Liste_SPELL_numPNJ][1][1]..") poss\195\168de ces sorts :","SAY",DBCS_language);
		elseif ( id == 3 ) then
			SendChatMessage("le mob num\195\169ro "..DBcorps_PNJ_Liste_SPELL_numPNJ.." : ("..DBmobs_Local[DBcorps_PNJ_Liste_SPELL_numPNJ][1][1]..") poss\195\168de ces sorts :","PARTY",DBCS_language);
		elseif ( id == 4 ) then
			SendChatMessage("le mob num\195\169ro "..DBcorps_PNJ_Liste_SPELL_numPNJ.." : ("..DBmobs_Local[DBcorps_PNJ_Liste_SPELL_numPNJ][1][1]..") poss\195\168de ces sorts :","RAID",DBCS_language);
		elseif ( id == 5 ) then
			SendChatMessage("le mob num\195\169ro "..DBcorps_PNJ_Liste_SPELL_numPNJ.." : ("..DBmobs_Local[DBcorps_PNJ_Liste_SPELL_numPNJ][1][1]..") poss\195\168de ces sorts :","GUILD",DBCS_language);
		elseif ( id == 6 ) then
			SendChatMessage("le mob num\195\169ro "..DBcorps_PNJ_Liste_SPELL_numPNJ.." : ("..DBmobs_Local[DBcorps_PNJ_Liste_SPELL_numPNJ][1][1]..") poss\195\168de ces sorts :","BATTLEGROUND",DBCS_language);
		elseif ( id == 7 ) then
			SendChatMessage("le mob num\195\169ro "..DBcorps_PNJ_Liste_SPELL_numPNJ.." : ("..DBmobs_Local[DBcorps_PNJ_Liste_SPELL_numPNJ][1][1]..") poss\195\168de ces sorts :","CHANNEL",DBCS_language,1);
		elseif ( id == 8 ) then
			SendChatMessage("le mob num\195\169ro "..DBcorps_PNJ_Liste_SPELL_numPNJ.." : ("..DBmobs_Local[DBcorps_PNJ_Liste_SPELL_numPNJ][1][1]..") poss\195\168de ces sorts :","CHANNEL",DBCS_language,2);
		elseif ( id == 9 ) then
			SendChatMessage("le mob num\195\169ro "..DBcorps_PNJ_Liste_SPELL_numPNJ.." : ("..DBmobs_Local[DBcorps_PNJ_Liste_SPELL_numPNJ][1][1]..") poss\195\168de ces sorts :","CHANNEL",DBCS_language,3);
		elseif ( id == 10 ) then
			SendChatMessage("le mob num\195\169ro "..DBcorps_PNJ_Liste_SPELL_numPNJ.." : ("..DBmobs_Local[DBcorps_PNJ_Liste_SPELL_numPNJ][1][1]..") poss\195\168de ces sorts :","CHANNEL",DBCS_language,4);
		elseif ( id == 11 ) then
			SendChatMessage("le mob num\195\169ro "..DBcorps_PNJ_Liste_SPELL_numPNJ.." : ("..DBmobs_Local[DBcorps_PNJ_Liste_SPELL_numPNJ][1][1]..") poss\195\168de ces sorts :","CHANNEL",DBCS_language,5);
		elseif ( id == 12 ) then
			SendChatMessage("le mob num\195\169ro "..DBcorps_PNJ_Liste_SPELL_numPNJ.." : ("..DBmobs_Local[DBcorps_PNJ_Liste_SPELL_numPNJ][1][1]..") poss\195\168de ces sorts :","CHANNEL",DBCS_language,6);
		elseif ( id == 13 ) then
			SendChatMessage("le mob num\195\169ro "..DBcorps_PNJ_Liste_SPELL_numPNJ.." : ("..DBmobs_Local[DBcorps_PNJ_Liste_SPELL_numPNJ][1][1]..") poss\195\168de ces sorts :","CHANNEL",DBCS_language,7);
		elseif ( id == 14 ) then
			SendChatMessage("le mob num\195\169ro "..DBcorps_PNJ_Liste_SPELL_numPNJ.." : ("..DBmobs_Local[DBcorps_PNJ_Liste_SPELL_numPNJ][1][1]..") poss\195\168de ces sorts :","CHANNEL",DBCS_language,8);
		elseif ( id == 15 ) then
			SendChatMessage("le mob num\195\169ro "..DBcorps_PNJ_Liste_SPELL_numPNJ.." : ("..DBmobs_Local[DBcorps_PNJ_Liste_SPELL_numPNJ][1][1]..") poss\195\168de ces sorts :","CHANNEL",DBCS_language,9);
		elseif ( id == 16 ) then
			SendChatMessage("le mob num\195\169ro "..DBcorps_PNJ_Liste_SPELL_numPNJ.." : ("..DBmobs_Local[DBcorps_PNJ_Liste_SPELL_numPNJ][1][1]..") poss\195\168de ces sorts :","CHANNEL",DBCS_language,10);
		end
	else
		if ( id == 1 ) then
			TraceFrame:AddMessage("le mob num\195\169ro "..DBcorps_PNJ_Liste_SPELL_numPNJ.." poss\195\168de ces sorts :");
		elseif ( id == 2 ) then
			SendChatMessage("le mob num\195\169ro "..DBcorps_PNJ_Liste_SPELL_numPNJ.." poss\195\168de ces sorts :","SAY",DBCS_language);
		elseif ( id == 3 ) then
			SendChatMessage("le mob num\195\169ro "..DBcorps_PNJ_Liste_SPELL_numPNJ.." poss\195\168de ces sorts :","PARTY",DBCS_language);
		elseif ( id == 4 ) then
			SendChatMessage("le mob num\195\169ro "..DBcorps_PNJ_Liste_SPELL_numPNJ.." poss\195\168de ces sorts :","RAID",DBCS_language);
		elseif ( id == 5 ) then
			SendChatMessage("le mob num\195\169ro "..DBcorps_PNJ_Liste_SPELL_numPNJ.." poss\195\168de ces sorts :","GUILD",DBCS_language);
		elseif ( id == 6 ) then
			SendChatMessage("le mob num\195\169ro "..DBcorps_PNJ_Liste_SPELL_numPNJ.." poss\195\168de ces sorts :","BATTLEGROUND",DBCS_language);
		elseif ( id == 7 ) then
			SendChatMessage("le mob num\195\169ro "..DBcorps_PNJ_Liste_SPELL_numPNJ.." poss\195\168de ces sorts :","CHANNEL",DBCS_language,1);
		elseif ( id == 8 ) then
			SendChatMessage("le mob num\195\169ro "..DBcorps_PNJ_Liste_SPELL_numPNJ.." poss\195\168de ces sorts :","CHANNEL",DBCS_language,2);
		elseif ( id == 9 ) then
			SendChatMessage("le mob num\195\169ro "..DBcorps_PNJ_Liste_SPELL_numPNJ.." poss\195\168de ces sorts :","CHANNEL",DBCS_language,3);
		elseif ( id == 10 ) then
			SendChatMessage("le mob num\195\169ro "..DBcorps_PNJ_Liste_SPELL_numPNJ.." poss\195\168de ces sorts :","CHANNEL",DBCS_language,4);
		elseif ( id == 11 ) then
			SendChatMessage("le mob num\195\169ro "..DBcorps_PNJ_Liste_SPELL_numPNJ.." poss\195\168de ces sorts :","CHANNEL",DBCS_language,5);
		elseif ( id == 12 ) then
			SendChatMessage("le mob num\195\169ro "..DBcorps_PNJ_Liste_SPELL_numPNJ.." poss\195\168de ces sorts :","CHANNEL",DBCS_language,6);
		elseif ( id == 13 ) then
			SendChatMessage("le mob num\195\169ro "..DBcorps_PNJ_Liste_SPELL_numPNJ.." poss\195\168de ces sorts :","CHANNEL",DBCS_language,7);
		elseif ( id == 14 ) then
			SendChatMessage("le mob num\195\169ro "..DBcorps_PNJ_Liste_SPELL_numPNJ.." poss\195\168de ces sorts :","CHANNEL",DBCS_language,8);
		elseif ( id == 15 ) then
			SendChatMessage("le mob num\195\169ro "..DBcorps_PNJ_Liste_SPELL_numPNJ.." poss\195\168de ces sorts :","CHANNEL",DBCS_language,9);
		elseif ( id == 16 ) then
			SendChatMessage("le mob num\195\169ro "..DBcorps_PNJ_Liste_SPELL_numPNJ.." poss\195\168de ces sorts :","CHANNEL",DBCS_language,10);
		end
	end
	if ( DBCS_mobs_spell[DBcorps_PNJ_Liste_SPELL_numPNJ] ) then
		for i , _ in pairs(DBCS_mobs_spell[DBcorps_PNJ_Liste_SPELL_numPNJ]) do
			if ( id == 1 ) then
				TraceFrame:AddMessage("sort num\195\169ro "..i.." : "..CMS_transformer_liens_en_liens_ds_langue(CMS_GetItemLink("@@blabla@-3@"..i.."@@"),"1"));
			elseif ( id == 2 ) then
				SendChatMessage("sort num\195\169ro "..i.." : "..CMS_transformer_liens_en_liens_ds_langue(CMS_GetItemLink("@@blabla@-3@"..i.."@@"),"1"),"SAY",DBCS_language);
			elseif ( id == 3 ) then
				SendChatMessage("sort num\195\169ro "..i.." : "..CMS_transformer_liens_en_liens_ds_langue(CMS_GetItemLink("@@blabla@-3@"..i.."@@"),"1"),"PARTY",DBCS_language);
			elseif ( id == 4 ) then
				SendChatMessage("sort num\195\169ro "..i.." : "..CMS_transformer_liens_en_liens_ds_langue(CMS_GetItemLink("@@blabla@-3@"..i.."@@"),"1"),"RAID",DBCS_language);
			elseif ( id == 5 ) then
				SendChatMessage("sort num\195\169ro "..i.." : "..CMS_transformer_liens_en_liens_ds_langue(CMS_GetItemLink("@@blabla@-3@"..i.."@@"),"1"),"GUILD",DBCS_language);
			elseif ( id == 6 ) then
				SendChatMessage("sort num\195\169ro "..i.." : "..CMS_transformer_liens_en_liens_ds_langue(CMS_GetItemLink("@@blabla@-3@"..i.."@@"),"1"),"BATTLEGROUND",DBCS_language);
			elseif ( id == 7 ) then
				SendChatMessage("sort num\195\169ro "..i.." : "..CMS_transformer_liens_en_liens_ds_langue(CMS_GetItemLink("@@blabla@-3@"..i.."@@"),"1"),"CHANNEL",DBCS_language,1);
			elseif ( id == 8 ) then
				SendChatMessage("sort num\195\169ro "..i.." : "..CMS_transformer_liens_en_liens_ds_langue(CMS_GetItemLink("@@blabla@-3@"..i.."@@"),"1"),"CHANNEL",DBCS_language,2);
			elseif ( id == 9 ) then
				SendChatMessage("sort num\195\169ro "..i.." : "..CMS_transformer_liens_en_liens_ds_langue(CMS_GetItemLink("@@blabla@-3@"..i.."@@"),"1"),"CHANNEL",DBCS_language,3);
			elseif ( id == 10 ) then
				SendChatMessage("sort num\195\169ro "..i.." : "..CMS_transformer_liens_en_liens_ds_langue(CMS_GetItemLink("@@blabla@-3@"..i.."@@"),"1"),"CHANNEL",DBCS_language,4);
			elseif ( id == 11 ) then
				SendChatMessage("sort num\195\169ro "..i.." : "..CMS_transformer_liens_en_liens_ds_langue(CMS_GetItemLink("@@blabla@-3@"..i.."@@"),"1"),"CHANNEL",DBCS_language,5);
			elseif ( id == 12 ) then
				SendChatMessage("sort num\195\169ro "..i.." : "..CMS_transformer_liens_en_liens_ds_langue(CMS_GetItemLink("@@blabla@-3@"..i.."@@"),"1"),"CHANNEL",DBCS_language,6);
			elseif ( id == 13 ) then
				SendChatMessage("sort num\195\169ro "..i.." : "..CMS_transformer_liens_en_liens_ds_langue(CMS_GetItemLink("@@blabla@-3@"..i.."@@"),"1"),"CHANNEL",DBCS_language,7);
			elseif ( id == 14 ) then
				SendChatMessage("sort num\195\169ro "..i.." : "..CMS_transformer_liens_en_liens_ds_langue(CMS_GetItemLink("@@blabla@-3@"..i.."@@"),"1"),"CHANNEL",DBCS_language,8);
			elseif ( id == 15 ) then
				SendChatMessage("sort num\195\169ro "..i.." : "..CMS_transformer_liens_en_liens_ds_langue(CMS_GetItemLink("@@blabla@-3@"..i.."@@"),"1"),"CHANNEL",DBCS_language,9);
			elseif ( id == 16 ) then
				SendChatMessage("sort num\195\169ro "..i.." : "..CMS_transformer_liens_en_liens_ds_langue(CMS_GetItemLink("@@blabla@-3@"..i.."@@"),"1"),"CHANNEL",DBCS_language,10);
			end
		end
	end

end

function DBcorps_PNJ_Liste_SPELL_OnClick(self)

local index;

	index = self:GetParent():GetID() + FauxScrollFrame_GetOffset(DBcorpsFrame_PNJFrame_Liste_ScrollFrame);
	DBcorps_PNJ_Liste_SPELL_numPNJ = DBCORPS_PNJ_LISTE[index][1];

	ToggleDropDownMenu(1, nil, DBcorpsFrame_PNJFrame_Liste_DropDown, self, 0, -5);
	--ToggleDropDownMenu(1, nil, DBcorpsFrame_PNJFrame_Liste_DropDown, "DBcorpsFrame_PNJFrame_Liste_Button"..self:GetParent():GetID().."_SPELL", 0, -5);

end

function DBcorps_PNJ_Model_button_OnClick(self)

--[[
local index;
local inumPNJ;
local sval;
local smot_milieu;
local ilen;
local smot_tout;
local snom;

	if ( DBCS_Model_Viewer_numcreature ) then
	else
		return nil;
	end
	ShowUIPanel(DBCS_Model_Viewer_DressUpFrame);
	DBCS_Model_Viewer_DressUpFrameModel_Model_OnClick();
	index = self:GetParent():GetID() + FauxScrollFrame_GetOffset(DBcorpsFrame_PNJFrame_Liste_ScrollFrame);
	inumPNJ = DBCORPS_PNJ_LISTE[index][1];
	DBCS_Model_Viewer_numcreature = inumPNJ;
	if ( DBCS_mobs_model and DBCS_mobs_model[inumPNJ] and DBCS_mobs_model[inumPNJ][1] and DBCS_mobs_model[inumPNJ][1]["model"] ) then
		sval = DBCS_mobs_model[inumPNJ][1]["model"];
		sval = string.gsub(sval,"\\","/");
		DBCS_Model_Viewer_DressUpFrame_Target_Model:SetModel(sval);
		--DBCS_Model_Viewer_DressUpFrame_Target_Model:SetCreature(inumPNJ);
		DBCS_MVW_afficher_model_target();
	end
	DBCS_Model_Viewer_creature_afficher();
	if ( DBCS_mobs_model and DBCS_mobs_model[inumPNJ] and DBCS_mobs_model[inumPNJ][1] and DBCS_mobs_model[inumPNJ][1]["blp"] ) then
		smot_milieu = format("%X",inumPNJ);
		ilen = strlen(smot_milieu);
		--if ( DBCS_corps_screen_wow_build > DBCS_corps_screen_wow_build_live ) then
			smot_tout = "unit:0xF13"..strrep("0",5-ilen)..smot_milieu.."00000000:bla";
		--else
		--	smot_tout = "unit:0xF13"..strrep("0",7-ilen)..smot_milieu.."000000:bla";
		--end
		GameTooltipTextLeft1:SetText(nil);
		GameTooltip:SetOwner(self, "ANCHOR_TOPLEFT");
		GameTooltip:SetHyperlink(smot_tout);
		snom = GameTooltipTextLeft1:GetText();
		if ( snom == nil ) then
			DBmobsPNJ_Combo_t_init_afficher(DBCS_Model_Viewer_DressUpFrame_Target_Model,DBCS_mobs_model[inumPNJ][1]["model"],DBCS_mobs_model[inumPNJ][1]["blp"]);
		end
		GameTooltip:Hide();
		DBCS_MVW_afficher_model_target(DBCS_mobs_model[inumPNJ][1]["blp"]);
	end
	DBCS_Model_Viewer_DressUpFrameModel_Player_OnClick();
	
	if ( 1 == 1 ) then
		return nil;
	end
--]]
	
	--DBCS_MVW_afficher_modele_blp("creature","alliancelionmount","alliancelion","alliancelion@@",12562);
local index;
local inumPNJ;

	if ( DBCS_Model_Viewer_numcreature ) then
	else
		return nil;
	end
	index = self:GetParent():GetID() + FauxScrollFrame_GetOffset(DBcorpsFrame_PNJFrame_Liste_ScrollFrame);
	inumPNJ = DBCORPS_PNJ_LISTE[index][1];
	DBCS_MVW_afficher_mobs_model(inumPNJ);
	DBCS_Model_Viewer_numcreature = inumPNJ;
	DBCS_Model_Viewer_creature_afficher();

--[[

local sval;
local stableau;
local stype;
local i;
local srep;
local sskin;
local sblp;
local idisplay;
local ipos;

	ShowUIPanel(DBCS_Model_Viewer_DressUpFrame);
	DBCS_Model_Viewer_DressUpFrameModel_Player_OnClick();
	DBCS_Model_Viewer_numcreature = inumPNJ;
	stype = "creature";
	srep = "celestialdragonwyrm";
	sskin = "celestialdragonwyrm";
	if ( DBCS_mobs_model and DBCS_mobs_model[inumPNJ] and DBCS_mobs_model[inumPNJ][1] and DBCS_mobs_model[inumPNJ][1]["model"] ) then
		sval = DBCS_mobs_model[inumPNJ][1]["model"];
		sval = string.gsub(sval,"\\","/");
		stableau = { strsplit("/",sval) };
		stype = stableau[1];
		srep = "";
		for i = 2 , table.getn(stableau) do
			if ( i == table.getn(stableau) ) then
				ipos = strfind(stableau[i],"m2");
				if ( ipos ) then
					stableau[i] = strsub(stableau[i],1,strlen(stableau[i])-3);
				end
				sskin = stableau[i];
			else
				if ( i > 2 ) then
					srep = srep.."/";
				end
				srep = srep..stableau[i];
			end
		end
	end
	sblp = "";
	if ( DBCS_mobs_model and DBCS_mobs_model[inumPNJ] and DBCS_mobs_model[inumPNJ][1] and DBCS_mobs_model[inumPNJ][1]["blp"] ) then
		sblp = DBCS_mobs_model[inumPNJ][1]["blp"];
	end
	if ( strfind(sblp,"@") == nil ) then
		sblp = sblp.."@@";
	end
	idisplay = nil;
	if ( DBCS_mobs_model and DBCS_mobs_model[inumPNJ] and DBCS_mobs_model[inumPNJ][1] and DBCS_mobs_model[inumPNJ][1]["display"] ) then
		idisplay = DBCS_mobs_model[inumPNJ][1]["display"];
	end
	DBCS_MVW_afficher_modele_blp(stype,srep,sskin,sblp,idisplay);
--]]

end

function DBcorps_PNJ_Model_button_OnEnter(self)

local index;
local inumPNJ;
local smot_milieu;
local ilen;
local smot_tout;
local snom;

	index = self:GetParent():GetID() + FauxScrollFrame_GetOffset(DBcorpsFrame_PNJFrame_Liste_ScrollFrame);
	inumPNJ = DBCORPS_PNJ_LISTE[index][1];
	smot_milieu = format("%X",inumPNJ);
	ilen = strlen(smot_milieu);
	--if ( DBCS_corps_screen_wow_build > DBCS_corps_screen_wow_build_live ) then
		smot_tout = "unit:0xF13"..strrep("0",5-ilen)..smot_milieu.."00000000:bla";
	--else
	--	smot_tout = "unit:0xF13"..strrep("0",7-ilen)..smot_milieu.."000000:bla";
	--end

	GameTooltipTextLeft1:SetText(nil);
 	GameTooltip:SetOwner(self, "ANCHOR_TOPLEFT");
	GameTooltip:SetHyperlink(smot_tout);
	snom = GameTooltipTextLeft1:GetText();
	if ( snom == nil ) then
		GameTooltip:Hide();
		GameTooltip:SetOwner(self, "ANCHOR_TOPLEFT");
		if ( DBmobs_Local and DBmobs_Local[inumPNJ] and DBmobs_Local[inumPNJ][1] ) then
			GameTooltip:SetText(DBmobs_Local[inumPNJ][1][1]);
			if ( DBCS_Model_Viewer_numcreature ) then
				GameTooltip:AddLine("\ncliquer pour voir le mod\195\168le");
			end
		else
			if ( DBCS_Model_Viewer_numcreature ) then
				GameTooltip:SetText("Cliquer pour voir le mod\195\168le");
			end
		end
	else
		if ( DBCS_Model_Viewer_numcreature ) then
			GameTooltip:AddLine("\ncliquer pour voir le mod\195\168le");
		end
	end
	GameTooltip:Show();

end

function DBcorps_PNJ_Diff_0_OnEnter(self)

local index;
local inumPNJ;
local smessage;
local iniv;

	index = self:GetParent():GetID() + FauxScrollFrame_GetOffset(DBcorpsFrame_PNJFrame_Liste_ScrollFrame);
	inumPNJ = DBCORPS_PNJ_LISTE[index][1];
	smessage = "Liste des niveaux de difficult\195\169 0 ( hors instance )\n";
--	[1]		-- niveaux
--		[diff]	-- difficulté de l'instance
--			[80]
--				[1] = date quand vu ce niveau
--				[2]	=	dégats minimum
--				[3]	=	dégats maximum
--				[4]	=	armure
--				[5]	=	pdvmax
	for iniv , _ in pairs(DBCS_mobs_detail[inumPNJ][1][0]) do
		smessage = smessage.."\nNiveau "..iniv.." = ";
		if ( DBCS_mobs_detail[inumPNJ][1][0][iniv][5] ) then
			smessage = smessage..DBCS_mobs_detail[inumPNJ][1][0][iniv][5].." pdv, ";
		end
		if ( DBCS_mobs_detail[inumPNJ][1][0][iniv][4] ) then
			smessage = smessage..DBCS_mobs_detail[inumPNJ][1][0][iniv][4].." d'armure, ";
		end
		if ( DBCS_mobs_detail[inumPNJ][1][0][iniv][2] or DBCS_mobs_detail[inumPNJ][1][0][iniv][3] ) then
			smessage = smessage.."( ";
			if ( DBCS_mobs_detail[inumPNJ][1][0][iniv][2] ) then
				smessage = smessage..DBCS_mobs_detail[inumPNJ][1][0][iniv][2].." ";
			end
			smessage = smessage.." -> ";
			if ( DBCS_mobs_detail[inumPNJ][1][0][iniv][3] ) then
				smessage = smessage..DBCS_mobs_detail[inumPNJ][1][0][iniv][3].." ";
			end
			smessage = smessage.."en d\195\169g\195\162ts )";
		end
	end

 	GameTooltip:SetOwner(self, "ANCHOR_TOPLEFT");
	GameTooltip:SetText(smessage);
	GameTooltip:Show();

end

function DBcorps_PNJ_Diff_1_OnEnter(self)

local index;
local inumPNJ;
local smessage;
local iniv;

	index = self:GetParent():GetID() + FauxScrollFrame_GetOffset(DBcorpsFrame_PNJFrame_Liste_ScrollFrame);
	inumPNJ = DBCORPS_PNJ_LISTE[index][1];
	smessage = "Liste des niveaux de difficult\195\169 1 ( instance \195\160 5 ou \195\160 10 ou BC normal ou wow classique )\n";
--	[1]		-- niveaux
--		[diff]	-- difficulté de l'instance
--			[80]
--				[1] = date quand vu ce niveau
--				[2]	=	dégats minimum
--				[3]	=	dégats maximum
--				[4]	=	armure
--				[5]	=	pdvmax
	for iniv , _ in pairs(DBCS_mobs_detail[inumPNJ][1][1]) do
		smessage = smessage.."\nNiveau "..iniv.." = ";
		if ( DBCS_mobs_detail[inumPNJ][1][1][iniv][5] ) then
			smessage = smessage..DBCS_mobs_detail[inumPNJ][1][1][iniv][5].." pdv, ";
		end
		if ( DBCS_mobs_detail[inumPNJ][1][1][iniv][4] ) then
			smessage = smessage..DBCS_mobs_detail[inumPNJ][1][1][iniv][4].." d'armure, ";
		end
		if ( DBCS_mobs_detail[inumPNJ][1][1][iniv][2] or DBCS_mobs_detail[inumPNJ][1][1][iniv][3] ) then
			smessage = smessage.."( ";
			if ( DBCS_mobs_detail[inumPNJ][1][1][iniv][2] ) then
				smessage = smessage..DBCS_mobs_detail[inumPNJ][1][1][iniv][2].." ";
			end
			smessage = smessage.." -> ";
			if ( DBCS_mobs_detail[inumPNJ][1][1][iniv][3] ) then
				smessage = smessage..DBCS_mobs_detail[inumPNJ][1][1][iniv][3].." ";
			end
			smessage = smessage.."en d\195\169g\195\162ts )";
		end
	end

 	GameTooltip:SetOwner(self, "ANCHOR_TOPLEFT");
	GameTooltip:SetText(smessage);
	GameTooltip:Show();

end

function DBcorps_PNJ_Diff_2_OnEnter(self)

local index;
local inumPNJ;
local smessage;
local iniv;

	index = self:GetParent():GetID() + FauxScrollFrame_GetOffset(DBcorpsFrame_PNJFrame_Liste_ScrollFrame);
	inumPNJ = DBCORPS_PNJ_LISTE[index][1];
	smessage = "Liste des niveaux de difficult\195\169 2 ( instance \195\160 5 h\195\169ro\195\175que ou \195\160 25 ou BC h\195\169ro\195\175que )\n";
--	[1]		-- niveaux
--		[diff]	-- difficulté de l'instance
--			[80]
--				[1] = date quand vu ce niveau
--				[2]	=	dégats minimum
--				[3]	=	dégats maximum
--				[4]	=	armure
--				[5]	=	pdvmax
	for iniv , _ in pairs(DBCS_mobs_detail[inumPNJ][1][2]) do
		smessage = smessage.."\nNiveau "..iniv.." = ";
		if ( DBCS_mobs_detail[inumPNJ][1][2][iniv][5] ) then
			smessage = smessage..DBCS_mobs_detail[inumPNJ][1][2][iniv][5].." pdv, ";
		end
		if ( DBCS_mobs_detail[inumPNJ][1][2][iniv][4] ) then
			smessage = smessage..DBCS_mobs_detail[inumPNJ][1][2][iniv][4].." d'armure, ";
		end
		if ( DBCS_mobs_detail[inumPNJ][1][2][iniv][2] or DBCS_mobs_detail[inumPNJ][1][2][iniv][3] ) then
			smessage = smessage.."( ";
			if ( DBCS_mobs_detail[inumPNJ][1][2][iniv][2] ) then
				smessage = smessage..DBCS_mobs_detail[inumPNJ][1][2][iniv][2].." ";
			end
			smessage = smessage.." -> ";
			if ( DBCS_mobs_detail[inumPNJ][1][2][iniv][3] ) then
				smessage = smessage..DBCS_mobs_detail[inumPNJ][1][2][iniv][3].." ";
			end
			smessage = smessage.."en d\195\169g\195\162ts )";
		end
	end

 	GameTooltip:SetOwner(self, "ANCHOR_TOPLEFT");
	GameTooltip:SetText(smessage);
	GameTooltip:Show();

end

function DBcorps_PNJ_Diff_3_OnEnter(self)

local index;
local inumPNJ;
local smessage;
local iniv;

	index = self:GetParent():GetID() + FauxScrollFrame_GetOffset(DBcorpsFrame_PNJFrame_Liste_ScrollFrame);
	inumPNJ = DBCORPS_PNJ_LISTE[index][1];
	smessage = "Liste des niveaux de difficult\195\169 3 ( instance \195\160 10 h\195\169ro\195\175que )\n";
--	[1]		-- niveaux
--		[diff]	-- difficulté de l'instance
--			[80]
--				[1] = date quand vu ce niveau
--				[2]	=	dégats minimum
--				[3]	=	dégats maximum
--				[4]	=	armure
--				[5]	=	pdvmax
	for iniv , _ in pairs(DBCS_mobs_detail[inumPNJ][1][3]) do
		smessage = smessage.."\nNiveau "..iniv.." = ";
		if ( DBCS_mobs_detail[inumPNJ][1][3][iniv][5] ) then
			smessage = smessage..DBCS_mobs_detail[inumPNJ][1][3][iniv][5].." pdv, ";
		end
		if ( DBCS_mobs_detail[inumPNJ][1][3][iniv][4] ) then
			smessage = smessage..DBCS_mobs_detail[inumPNJ][1][3][iniv][4].." d'armure, ";
		end
		if ( DBCS_mobs_detail[inumPNJ][1][3][iniv][2] or DBCS_mobs_detail[inumPNJ][1][3][iniv][3] ) then
			smessage = smessage.."( ";
			if ( DBCS_mobs_detail[inumPNJ][1][3][iniv][2] ) then
				smessage = smessage..DBCS_mobs_detail[inumPNJ][1][3][iniv][2].." ";
			end
			smessage = smessage.." -> ";
			if ( DBCS_mobs_detail[inumPNJ][1][3][iniv][3] ) then
				smessage = smessage..DBCS_mobs_detail[inumPNJ][1][3][iniv][3].." ";
			end
			smessage = smessage.."en d\195\169g\195\162ts )";
		end
	end

 	GameTooltip:SetOwner(self, "ANCHOR_TOPLEFT");
	GameTooltip:SetText(smessage);
	GameTooltip:Show();

end

function DBcorps_PNJ_Diff_4_OnEnter(self)

local index;
local inumPNJ;
local smessage;
local iniv;

	index = self:GetParent():GetID() + FauxScrollFrame_GetOffset(DBcorpsFrame_PNJFrame_Liste_ScrollFrame);
	inumPNJ = DBCORPS_PNJ_LISTE[index][1];
	smessage = "Liste des niveaux de difficult\195\169 4 ( instance \195\160 25 h\195\169ro\195\175que )\n";
--	[1]		-- niveaux
--		[diff]	-- difficulté de l'instance
--			[80]
--				[1] = date quand vu ce niveau
--				[2]	=	dégats minimum
--				[3]	=	dégats maximum
--				[4]	=	armure
--				[5]	=	pdvmax
	for iniv , _ in pairs(DBCS_mobs_detail[inumPNJ][1][4]) do
		smessage = smessage.."\nNiveau "..iniv.." = ";
		if ( DBCS_mobs_detail[inumPNJ][1][4][iniv][5] ) then
			smessage = smessage..DBCS_mobs_detail[inumPNJ][1][4][iniv][5].." pdv, ";
		end
		if ( DBCS_mobs_detail[inumPNJ][1][4][iniv][4] ) then
			smessage = smessage..DBCS_mobs_detail[inumPNJ][1][4][iniv][4].." d'armure, ";
		end
		if ( DBCS_mobs_detail[inumPNJ][1][4][iniv][2] or DBCS_mobs_detail[inumPNJ][1][4][iniv][3] ) then
			smessage = smessage.."( ";
			if ( DBCS_mobs_detail[inumPNJ][1][4][iniv][2] ) then
				smessage = smessage..DBCS_mobs_detail[inumPNJ][1][4][iniv][2].." ";
			end
			smessage = smessage.." -> ";
			if ( DBCS_mobs_detail[inumPNJ][1][4][iniv][3] ) then
				smessage = smessage..DBCS_mobs_detail[inumPNJ][1][4][iniv][3].." ";
			end
			smessage = smessage.."en d\195\169g\195\162ts )";
		end
	end

 	GameTooltip:SetOwner(self, "ANCHOR_TOPLEFT");
	GameTooltip:SetText(smessage);
	GameTooltip:Show();

end

function DBcorps_PNJ_Domptable_OnEnter(self)

local index;
local inumPNJ;
local smessage;

	index = self:GetParent():GetID() + FauxScrollFrame_GetOffset(DBcorpsFrame_PNJFrame_Liste_ScrollFrame);
	inumPNJ = DBCORPS_PNJ_LISTE[index][1];
	if ( DBCS_mobs_detail and DBCS_mobs_detail[inumPNJ] and DBCS_mobs_detail[inumPNJ][4] ) then
		if ( DBCS_mobs_detail[inumPNJ][4] == 0 ) then
			smessage = "Insensible au domptage";
		elseif ( DBCS_mobs_detail[inumPNJ][4] == 1 ) then
			smessage = "Domptable (normal)";
		elseif ( DBCS_mobs_detail[inumPNJ][4] == 2 ) then
			smessage = "Domptable (exotique)";
		else
			smessage = "Domptage inconnu";
		end
		GameTooltip:SetOwner(self, "ANCHOR_TOPLEFT");
		GameTooltip:SetText(smessage);
		GameTooltip:Show();
	end

end

function DBcorps_PNJ_Liste_Region_0_OnClick(self)

local index;
local inumPNJ;
local btrouve;
local snumregion;
local inivcarte;

	index = self:GetParent():GetID() + FauxScrollFrame_GetOffset(DBcorpsFrame_PNJFrame_Liste_ScrollFrame);
	inumPNJ = DBCORPS_PNJ_LISTE[index][1];
--TraceFrame:AddMessage("DBcorps_PNJ_Liste_Region_0_OnClick : "..inumPNJ);
	--UIDropDownMenu_Initialize(DBcorpsFrame_PNJFrame_Liste_DropDown, DBcorps_PNJ_Liste_Region_0_Initialize(inumPNJ),"MENU");
--function ToggleDropDownMenu(level, value, dropDownFrame, anchorName, xOffset, yOffset, menuList, button)
	--ToggleDropDownMenu(1, nil, DBcorpsFrame_PNJFrame_Liste_DropDown, "cursor", 0, 0);
	--ToggleDropDownMenu(1, nil, DropDownList1, "cursor", 0, 0);
	--DropDownList1:Show();
	--ToggleDropDownMenu(self:GetParent():GetParent():GetID() + 1, self:GetParent().value, nil, nil, nil, nil, self:GetParent().menuList, self);
	--ToggleDropDownMenu(1, nil, nil, nil, nil, nil, DBcorpsFrame_PNJFrame_Liste_DropDown.menuList, DBcorpsFrame_PNJFrame_Liste_DropDown);
	--DBcorpsFrame_PNJFrame_Liste_DropDown:Show();
	--ToggleDropDownMenu();
	--DBcorpsFrame_PNJFrame_Liste_DropDown:SetPoint("TOPLEFT",cursor,"BOTTOMRIGHT",0,0);

	--HideDropDownMenu(1);
	--DBcorpsFrame_PNJFrame_Liste_DropDown.initialize = DBcorps_PNJ_Liste_Region_0_Initialize(inumPNJ);
	--DBcorpsFrame_PNJFrame_Liste_DropDown.displayMode = "MENU";
	--DBcorpsFrame_PNJFrame_Liste_DropDown.name = "loc";
	--ToggleDropDownMenu(1, nil, DBcorpsFrame_PNJFrame_Liste_DropDown, "cursor");
--DBCS_Region_Minimap_numregion = nil;
--DBCS_Region_Minimap_nivcarte = nil;
	if ( DBCS_mobs_locs and DBCS_mobs_locs[inumPNJ] ) then
		snumregion, inivcarte = DBCS_Region_liste_code_region_courante_new2();
		if ( DBCS_Region_Minimap_numregion and DBCS_Region_Minimap_nivcarte and DBCS_mobs_locs[inumPNJ][DBCS_Region_Minimap_numregion] and DBCS_mobs_locs[inumPNJ][DBCS_Region_Minimap_numregion][DBCS_Region_Minimap_nivcarte] and DBCS_mobs_locs[inumPNJ][DBCS_Region_Minimap_numregion][DBCS_Region_Minimap_nivcarte][0] ) then
			DBCS_Region_Minimap_init_loc_hide();
			DBCS_Region_Minimap_init_loc(inumPNJ,DBCS_Region_Minimap_numregion,DBCS_Region_Minimap_nivcarte,DBCS_mobs_locs[inumPNJ][DBCS_Region_Minimap_numregion][DBCS_Region_Minimap_nivcarte][0],"@","#","#");
		elseif ( snumregion and inivcarte and DBCS_mobs_locs[inumPNJ][snumregion] and DBCS_mobs_locs[inumPNJ][snumregion][inivcarte] and DBCS_mobs_locs[inumPNJ][snumregion][inivcarte][0] ) then
			DBCS_Region_Minimap_init_loc_hide();
			DBCS_Region_Minimap_init_loc(inumPNJ,snumregion,inivcarte,DBCS_mobs_locs[inumPNJ][snumregion][inivcarte][0],"@","#","#");
		else
			btrouve = false;
			for snumregion , _ in pairs(DBCS_mobs_locs[inumPNJ]) do
				if ( btrouve == false ) then
					for inivcarte , _ in pairs(DBCS_mobs_locs[inumPNJ][snumregion]) do
						if ( btrouve == false and DBCS_mobs_locs[inumPNJ][snumregion][inivcarte][0] ) then
							btrouve = true;
							--DBCS_Region_Minimap_init(snumregion,inivcarte);
							DBCS_Region_Minimap_init_loc_hide();
							DBCS_Region_Minimap_init_loc(inumPNJ,snumregion,inivcarte,DBCS_mobs_locs[inumPNJ][snumregion][inivcarte][0],"@","#","#");
						end
					end
				end
			end
		end
	end

end

function DBcorps_PNJ_Liste_Region_0_OnEnter(self)

local index;
local inumPNJ;
local smessage;
local i;

 	GameTooltip:SetOwner(self, "ANCHOR_TOPLEFT");
	smessage = "cliquer pour voir les locs fiables sur la carte\n";
	i = 0;

	index = self:GetParent():GetID() + FauxScrollFrame_GetOffset(DBcorpsFrame_PNJFrame_Liste_ScrollFrame);
	inumPNJ = DBCORPS_PNJ_LISTE[index][1];
	if ( DBCS_mobs_locs and DBCS_mobs_locs[inumPNJ] ) then
		for sregion , _ in pairs(DBCS_mobs_locs[inumPNJ]) do
			for inivcarte , _ in pairs(DBCS_mobs_locs[inumPNJ][sregion]) do
				if ( DBCS_mobs_locs[inumPNJ][sregion][inivcarte][0] ) then
					if ( i < 20 ) then
						i = i + 1;
						smessage = smessage.."\n"..sregion..":"..DBCS_Region_nom_region(sregion)..", niveau "..inivcarte;
					end
				end
			end
		end
	end

	GameTooltip:SetText(smessage);
	GameTooltip:Show();

end	

function DBcorps_PNJ_Liste_Region_1_OnClick(self)

local index;
local inumPNJ;
local btrouve;
local snumregion;
local inivcarte;

	index = self:GetParent():GetID() + FauxScrollFrame_GetOffset(DBcorpsFrame_PNJFrame_Liste_ScrollFrame);
	inumPNJ = DBCORPS_PNJ_LISTE[index][1];
	if ( DBCS_mobs_locs and DBCS_mobs_locs[inumPNJ] ) then
		snumregion, inivcarte = DBCS_Region_liste_code_region_courante_new2();
		if ( DBCS_Region_Minimap_numregion and DBCS_Region_Minimap_nivcarte and DBCS_mobs_locs[inumPNJ][DBCS_Region_Minimap_numregion] and DBCS_mobs_locs[inumPNJ][DBCS_Region_Minimap_numregion][DBCS_Region_Minimap_nivcarte] and DBCS_mobs_locs[inumPNJ][DBCS_Region_Minimap_numregion][DBCS_Region_Minimap_nivcarte][1] ) then
			DBCS_Region_Minimap_init_loc_hide();
			DBCS_Region_Minimap_init_loc(inumPNJ,DBCS_Region_Minimap_numregion,DBCS_Region_Minimap_nivcarte,DBCS_mobs_locs[inumPNJ][DBCS_Region_Minimap_numregion][DBCS_Region_Minimap_nivcarte][1],"@","#","#");
		elseif ( snumregion and inivcarte and DBCS_mobs_locs[inumPNJ][snumregion] and DBCS_mobs_locs[inumPNJ][snumregion][inivcarte] and DBCS_mobs_locs[inumPNJ][snumregion][inivcarte][1] ) then
			DBCS_Region_Minimap_init_loc_hide();
			DBCS_Region_Minimap_init_loc(inumPNJ,snumregion,inivcarte,DBCS_mobs_locs[inumPNJ][snumregion][inivcarte][1],"@","#","#");
		else
			btrouve = false;
			for snumregion , _ in pairs(DBCS_mobs_locs[inumPNJ]) do
				if ( btrouve == false ) then
					for inivcarte , _ in pairs(DBCS_mobs_locs[inumPNJ][snumregion]) do
						if ( btrouve == false and DBCS_mobs_locs[inumPNJ][snumregion][inivcarte][1] ) then
							btrouve = true;
							--DBCS_Region_Minimap_init(snumregion,inivcarte);
							DBCS_Region_Minimap_init_loc_hide();
							DBCS_Region_Minimap_init_loc(inumPNJ,snumregion,inivcarte,DBCS_mobs_locs[inumPNJ][snumregion][inivcarte][1],"@","#","#");
						end
					end
				end
			end
		end
	end

end

function DBcorps_PNJ_Liste_Region_1_OnEnter(self)

local index;
local inumPNJ;
local smessage;
local i;

 	GameTooltip:SetOwner(self, "ANCHOR_TOPLEFT");
	smessage = "cliquer pour voir les locs sur la carte\n";
	i = 0;

	index = self:GetParent():GetID() + FauxScrollFrame_GetOffset(DBcorpsFrame_PNJFrame_Liste_ScrollFrame);
	inumPNJ = DBCORPS_PNJ_LISTE[index][1];
	if ( DBCS_mobs_locs and DBCS_mobs_locs[inumPNJ] ) then
		for sregion , _ in pairs(DBCS_mobs_locs[inumPNJ]) do
			for inivcarte , _ in pairs(DBCS_mobs_locs[inumPNJ][sregion]) do
				if ( DBCS_mobs_locs[inumPNJ][sregion][inivcarte][1] ) then
					if ( i < 20 ) then
						i = i + 1;
						smessage = smessage.."\n"..sregion..":"..DBCS_Region_nom_region(sregion)..", niveau "..inivcarte;
					end
				end
			end
		end
	end

	GameTooltip:SetText(smessage);
	GameTooltip:Show();

end	

function DBcorps_PNJ_Liste_Region_0_OnLoad(self)

local index;
local inumPNJ;

	index = self:GetParent():GetID() + FauxScrollFrame_GetOffset(DBcorpsFrame_PNJFrame_Liste_ScrollFrame);
	if ( DBCORPS_PNJ_LISTE and DBCORPS_PNJ_LISTE[index] ) then
		inumPNJ = DBCORPS_PNJ_LISTE[index][1];
TraceFrame:AddMessage("DBcorps_PNJ_Liste_Region_0_OnLoad : "..inumPNJ);
		UIDropDownMenu_Initialize(self, DBcorps_PNJ_Liste_Region_0_Initialize(inumPNJ));
	end

end

--			<Frame name="$parent_Liste_Region_0" inherits="UIDropDownMenuTemplate" id="1">
--				<Anchors>
--					<Anchor point="TOPLEFT">
--						<Offset>
--							<AbsDimension x="594" y="0"/>
--						</Offset>
--					</Anchor>
--				</Anchors>
--				<Scripts>
--					<OnLoad>
--						DBcorps_PNJ_Liste_Region_0_OnLoad(self);
--					</OnLoad>
--					<OnShow>
--						DBcorps_PNJ_Liste_Region_0_OnLoad(self);
--					</OnShow>
--				</Scripts>
--			</Frame>

function DBcorps_PNJ_Liste_Region_0_Initialize(inumPNJ)

local sregion;
local inivcarte;
local info;

	--info = UIDropDownMenu_CreateInfo();

	if ( DBCS_mobs_locs and DBCS_mobs_locs[inumPNJ] ) then
		-- à modifier pour afficher le nom de la région qui a le + de locs
		for sregion , _ in pairs(DBCS_mobs_locs[inumPNJ]) do
			for inivcarte , _ in pairs(DBCS_mobs_locs[inumPNJ][sregion]) do
				--if ( DBCS_mobs_locs[inumPNJ][sregion][inivcarte][1] ) then
--TraceFrame:AddMessage("DBcorps_PNJ_Liste_Region_0_Initialize : "..sregion..":"..inivcarte);
					info = {};
					info.text = sregion..":"..inivcarte;
					info.value = sregion..":"..inivcarte;
					info.func = DBcorps_PNJ_Liste_Region_0_OnClick_DropDown;
					UIDropDownMenu_AddButton(info);
				--end
			end
		end
	else
	end

end

function DBcorps_PNJ_Liste_Region_0_OnClick_DropDown(self)

TraceFrame:AddMessage("DBcorps_PNJ_Liste_Region_0_OnClick_DropDown : "..self.value);

end

function DBcorpsFrame_MobsFrame_Criteres_TypeRegion1_OnLoad()

	UIDropDownMenu_Initialize(DBcorpsFrame_MobsFrame_Criteres_TypeRegion1, DBcorpsFrame_MobsFrame_Criteres_TypeRegion1_Initialize);

end

function DBcorpsFrame_MobsFrame_Criteres_TypeRegion1_Initialize()

	info = {};
	info.text = "Toutes";
	info.value = -1;
	info.func = DBcorpsFrame_MobsFrame_Criteres_TypeRegion1_OnClick;
	UIDropDownMenu_AddButton(info);
	for i=1, getn(DBCS_Region_liste_combo)  do
		info = {};
		info.text = DBCS_Region_liste_combo[i].name;
		info.value = i;
		info.func = DBcorpsFrame_MobsFrame_Criteres_TypeRegion1_OnClick;
		UIDropDownMenu_AddButton(info);
	end
	DBcorpsFrame_MobsFrame_Criteres_TypeRegion1Middle:SetWidth(200);

end

function DBcorpsFrame_MobsFrame_Criteres_TypeRegion1_OnClick(self)

	UIDropDownMenu_SetSelectedValue(DBcorpsFrame_MobsFrame_Criteres_TypeRegion1, self.value);
	DBcorpsFrame_MobsFrame_Criteres_TypeRegion2_OnLoad();
	UIDropDownMenu_SetSelectedValue(DBcorpsFrame_MobsFrame_Criteres_TypeRegion2,-1);
	DBcorpsFrame_MobsFrame_Criteres_TypeRegion3_OnLoad();
	UIDropDownMenu_SetSelectedValue(DBcorpsFrame_MobsFrame_Criteres_TypeRegion3,-1);
	DBCORPS_MOBS_TypeRegion_select = nil;

end

function DBcorpsFrame_MobsFrame_Criteres_TypeRegion2_OnLoad()

	UIDropDownMenu_Initialize(DBcorpsFrame_MobsFrame_Criteres_TypeRegion2, DBcorpsFrame_MobsFrame_Criteres_TypeRegion2_Initialize);

end

function DBcorpsFrame_MobsFrame_Criteres_TypeRegion2_Initialize()

	local snumregion;
	local icont;
	local iregion;
	local j;

	local ityperegion1 = UIDropDownMenu_GetSelectedValue(DBcorpsFrame_MobsFrame_Criteres_TypeRegion1);

	info = {};
	info.text = "Aucunes";
	info.value = -1;
	info.func = DBcorpsFrame_MobsFrame_Criteres_TypeRegion2_OnClick;
	UIDropDownMenu_AddButton(info);
	if ( DBCS_Region_liste_combo[ityperegion1] ) then
		for i = 1 , getn(DBCS_Region_liste_combo[ityperegion1])  do
			info = {};
			if ( DBCS_Region_liste_combo[ityperegion1][i].name ) then
				info.text = DBCS_Region_liste_combo[ityperegion1][i].name;
			else
				if ( DBCS_Region_liste_combo[ityperegion1][i].type == "Z" ) then
					snumregion = DBCS_Region_liste_combo[ityperegion1][i].snumregion;
					info.text = DBCS_Region_nom_region(snumregion);
					--icont = tonumber(strsub(snumregion,1,1));
					--iregion = tonumber(strsub(snumregion,2,3));
					--for j = 1 , getn(DBCS_RegionData[icont]) do
					--	if ( DBCS_RegionData[icont][j].index == iregion ) then
					--		info.text = DBCS_RegionData[icont][j].name;
					--	end
					--end
				else
				end
			end
			info.value = i;
			info.func = DBcorpsFrame_MobsFrame_Criteres_TypeRegion2_OnClick;
			UIDropDownMenu_AddButton(info);
		end
	end
	DBcorpsFrame_MobsFrame_Criteres_TypeRegion2Middle:SetWidth(200);

end

function DBcorpsFrame_MobsFrame_Criteres_TypeRegion2_OnClick(self)

	UIDropDownMenu_SetSelectedValue(DBcorpsFrame_MobsFrame_Criteres_TypeRegion2, self.value);
	DBcorpsFrame_MobsFrame_Criteres_TypeRegion3_OnLoad();
	UIDropDownMenu_SetSelectedValue(DBcorpsFrame_MobsFrame_Criteres_TypeRegion3,-1);
	DBCORPS_MOBS_TypeRegion_select = nil;
	local ityperegion1 = UIDropDownMenu_GetSelectedValue(DBcorpsFrame_MobsFrame_Criteres_TypeRegion1);
	local ityperegion2 = UIDropDownMenu_GetSelectedValue(DBcorpsFrame_MobsFrame_Criteres_TypeRegion2);
	local ityperegion3 = UIDropDownMenu_GetSelectedValue(DBcorpsFrame_MobsFrame_Criteres_TypeRegion3);
	if ( ityperegion1 > -1 ) then
		if ( ityperegion2 > -1 ) then
			if ( ityperegion3 > -1 ) then
				DBCORPS_MOBS_TypeRegion_select = DBCS_Region_liste_combo[ityperegion1][ityperegion2][ityperegion3].snumregion;
			else
				if ( DBCS_Region_liste_combo[ityperegion1][ityperegion2].snumregion ) then
					DBCORPS_MOBS_TypeRegion_select = DBCS_Region_liste_combo[ityperegion1][ityperegion2].snumregion;
				end
			end
		else
		end
	end

end

function DBcorpsFrame_MobsFrame_Criteres_TypeRegion3_OnLoad()

	UIDropDownMenu_Initialize(DBcorpsFrame_MobsFrame_Criteres_TypeRegion3, DBcorpsFrame_MobsFrame_Criteres_TypeRegion3_Initialize);

end

function DBcorpsFrame_MobsFrame_Criteres_TypeRegion3_Initialize()

	local snumregion;
	local icont;
	local iregion;
	local j;

	local ityperegion1 = UIDropDownMenu_GetSelectedValue(DBcorpsFrame_MobsFrame_Criteres_TypeRegion1);
	local ityperegion2 = UIDropDownMenu_GetSelectedValue(DBcorpsFrame_MobsFrame_Criteres_TypeRegion2);

	info = {};
	info.text = "Aucunes";
	info.value = -1;
	info.func = DBcorpsFrame_MobsFrame_Criteres_TypeRegion3_OnClick;
	UIDropDownMenu_AddButton(info);
	if ( DBCS_Region_liste_combo[ityperegion1] and DBCS_Region_liste_combo[ityperegion1][ityperegion2] ) then
		for i = 1 , getn(DBCS_Region_liste_combo[ityperegion1][ityperegion2])  do
			info = {};
			if ( DBCS_Region_liste_combo[ityperegion1][ityperegion2][i].name ) then
				info.text = DBCS_Region_liste_combo[ityperegion1][ityperegion2][i].name;
			else
				if ( DBCS_Region_liste_combo[ityperegion1][ityperegion2][i].type == "Z" ) then
					snumregion = DBCS_Region_liste_combo[ityperegion1][ityperegion2][i].snumregion;
					info.text = DBCS_Region_nom_region(snumregion);
					--icont = tonumber(strsub(snumregion,1,1));
					--iregion = tonumber(strsub(snumregion,2,3));
					--for j = 1 , getn(DBCS_RegionData[icont]) do
					--	if ( DBCS_RegionData[icont][j].index == iregion ) then
					--		--info.text = DBCS_RegionData[icont][j].name;
					--		info.text = DBCS_RegionData[icont][j].name;
					--	end
					--end
				else
				end
			end
			info.value = i;
			info.func = DBcorpsFrame_MobsFrame_Criteres_TypeRegion3_OnClick;
			UIDropDownMenu_AddButton(info);
		end
	end
	DBcorpsFrame_MobsFrame_Criteres_TypeRegion3Middle:SetWidth(200);

end

function DBcorpsFrame_MobsFrame_Criteres_TypeRegion3_OnClick(self)

	UIDropDownMenu_SetSelectedValue(DBcorpsFrame_MobsFrame_Criteres_TypeRegion3, self.value);
	DBCORPS_MOBS_TypeRegion_select = nil;
	local ityperegion1 = UIDropDownMenu_GetSelectedValue(DBcorpsFrame_MobsFrame_Criteres_TypeRegion1);
	local ityperegion2 = UIDropDownMenu_GetSelectedValue(DBcorpsFrame_MobsFrame_Criteres_TypeRegion2);
	local ityperegion3 = UIDropDownMenu_GetSelectedValue(DBcorpsFrame_MobsFrame_Criteres_TypeRegion3);
	if ( ityperegion1 > -1 ) then
		if ( ityperegion2 > -1 ) then
			if ( ityperegion3 > -1 ) then
				DBCORPS_MOBS_TypeRegion_select = DBCS_Region_liste_combo[ityperegion1][ityperegion2][ityperegion3].snumregion;
			else
				if ( DBCS_Region_liste_combo[ityperegion1][ityperegion2].snumregion ) then
					DBCORPS_MOBS_TypeRegion_select = DBCS_Region_liste_combo[ityperegion1][ityperegion2].snumregion;
				end
			end
		else
		end
	end

end

function DBcorpsFrame_ObjetsFrame_Criteres_Rarity_OnLoad()

	UIDropDownMenu_Initialize(DBcorpsFrame_ObjetsFrame_Criteres_Rarity, DBcorpsFrame_ObjetsFrame_Criteres_Rarity_Initialize);

end

function DBcorpsFrame_ObjetsFrame_Criteres_Rarity_Initialize()

	local r,g,b,hex;

	info = {};
	info.text = ALL;
	info.value = -1;
	info.func = DBcorpsFrame_ObjetsFrame_Criteres_Rarity_OnClick;
	UIDropDownMenu_AddButton(info);
--	for i = 0 , getn(ITEM_QUALITY_COLORS)  do
	for i = 0 , 7  do
		info = {};
		info.text = _G["ITEM_QUALITY"..i.."_DESC"];
		if ( info.text == nil ) then
			if ( i == 7 ) then
				info.text = "Li\195\169 au compte";
			else
				info.text = "Inconnu";
			end
		end
		r,g,b,hex = GetItemQualityColor(i);
		--info.hasColorSwatch = 1;
		if ( r ) then
			info.textR = r;
			info.textG = g;
			info.textB = b;
		end
		info.value = i;
		info.func = DBcorpsFrame_ObjetsFrame_Criteres_Rarity_OnClick;
		UIDropDownMenu_AddButton(info);
	end

end

function DBcorpsFrame_ObjetsFrame_Criteres_Rarity_OnClick(self)

	UIDropDownMenu_SetSelectedValue(DBcorpsFrame_ObjetsFrame_Criteres_Rarity, self.value);

end

function DBcorpsFrame_ObjetsFrame_Criteres_Type_OnLoad()

	UIDropDownMenu_Initialize(DBcorpsFrame_ObjetsFrame_Criteres_Type, DBcorpsFrame_ObjetsFrame_Criteres_Type_Initialize);

end

function DBcorpsFrame_ObjetsFrame_Criteres_Type_Initialize()

	info = {};
	info.text = ALL;
	info.value = -1;
	info.func = DBcorpsFrame_ObjetsFrame_Criteres_Type_OnClick;
	UIDropDownMenu_AddButton(info);
	info = {};
	info.text = "Aucuns";
	info.value = 0;
	info.func = DBcorpsFrame_ObjetsFrame_Criteres_Type_OnClick;
	UIDropDownMenu_AddButton(info);
	for i=1, getn(DBCS_objet_type)  do
		info = {};
		info.text = DBCS_objet_type[i].name;
		info.value = DBCS_objet_type[i].index;
		info.func = DBcorpsFrame_ObjetsFrame_Criteres_Type_OnClick;
		UIDropDownMenu_AddButton(info);
	end

end

function DBcorpsFrame_ObjetsFrame_Criteres_Type_OnClick(self)

	UIDropDownMenu_SetSelectedValue(DBcorpsFrame_ObjetsFrame_Criteres_Type, self.value);
	DBcorpsFrame_ObjetsFrame_Criteres_SubType_OnLoad();
	UIDropDownMenu_SetSelectedValue(DBcorpsFrame_ObjetsFrame_Criteres_SubType,-1);

end

function DBcorpsFrame_ObjetsFrame_Criteres_SubType_OnLoad()

	UIDropDownMenu_Initialize(DBcorpsFrame_ObjetsFrame_Criteres_SubType, DBcorpsFrame_ObjetsFrame_Criteres_SubType_Initialize);

end

function DBcorpsFrame_ObjetsFrame_Criteres_SubType_Initialize()

	local tablo;

	info = {};
	info.text = ALL;
	info.value = -1;
	info.func = DBcorpsFrame_ObjetsFrame_Criteres_SubType_OnClick;
	UIDropDownMenu_AddButton(info);
	tablo = DBCS_objet_type_subtype[UIDropDownMenu_GetSelectedValue(DBcorpsFrame_ObjetsFrame_Criteres_Type)];
	info = {};
	info.text = "Aucuns";
	info.value = 0;
	info.func = DBcorpsFrame_ObjetsFrame_Criteres_SubType_OnClick;
	UIDropDownMenu_AddButton(info);
	if ( tablo ) then
		for i=1, getn(tablo)  do
			info = {};
			info.text = DBCS_objet_subtype_index[tablo[i]];
			info.value = tablo[i];
			info.func = DBcorpsFrame_ObjetsFrame_Criteres_SubType_OnClick;
			UIDropDownMenu_AddButton(info);
		end
	end
	DBcorpsFrame_ObjetsFrame_Criteres_SubTypeMiddle:SetWidth(200);

end

function DBcorpsFrame_ObjetsFrame_Criteres_SubType_OnClick(self)

	UIDropDownMenu_SetSelectedValue(DBcorpsFrame_ObjetsFrame_Criteres_SubType, self.value);

end

function DBcorpsFrame_ObjetsFrame_Criteres_Equiploc_OnLoad()

	UIDropDownMenu_Initialize(DBcorpsFrame_ObjetsFrame_Criteres_Equiploc, DBcorpsFrame_ObjetsFrame_Criteres_Equiploc_Initialize);

end

function DBcorpsFrame_ObjetsFrame_Criteres_Equiploc_Initialize()

	info = {};
	info.text = ALL;
	info.value = -1;
	info.func = DBcorpsFrame_ObjetsFrame_Criteres_Equiploc_OnClick;
	UIDropDownMenu_AddButton(info);
	info = {};
	info.text = "Aucuns";
	info.value = 0;
	info.func = DBcorpsFrame_ObjetsFrame_Criteres_Equiploc_OnClick;
	UIDropDownMenu_AddButton(info);
	for i=1, getn(DBCS_objet_equiploc)  do
		info = {};
		info.text = DBCS_objet_equiploc[i].traduc;
		info.value = DBCS_objet_equiploc[i].index;
		info.func = DBcorpsFrame_ObjetsFrame_Criteres_Equiploc_OnClick;
		UIDropDownMenu_AddButton(info);
	end
	--DBcorpsFrame_ObjetsFrame_Criteres_EquiplocMiddle:SetWidth(200);

end

function DBcorpsFrame_ObjetsFrame_Criteres_Equiploc_OnClick(self)

	UIDropDownMenu_SetSelectedValue(DBcorpsFrame_ObjetsFrame_Criteres_Equiploc, self.value);

end

function DBcorpsFrame_ObjetsFrame_Criteres_Faction_OnLoad()

	UIDropDownMenu_Initialize(DBcorpsFrame_ObjetsFrame_Criteres_Faction, DBcorpsFrame_ObjetsFrame_Criteres_Faction_Initialize);

end

function DBcorpsFrame_ObjetsFrame_Criteres_Faction_Initialize()

local isetsniveau0;
local bbon;

	if ( DBcorpsFrame_ObjetsFrame_Criteres_Setsniveau0 ) then
		isetsniveau0 = UIDropDownMenu_GetSelectedValue(DBcorpsFrame_ObjetsFrame_Criteres_Setsniveau0);
	else
		isetsniveau0 = -1;
	end

	info = {};
	info.text = ALL;
	info.value = -1;
	info.func = DBcorpsFrame_ObjetsFrame_Criteres_Faction_OnClick;
	UIDropDownMenu_AddButton(info);
	info = {};
	info.text = "Aucuns";
	info.value = 0;
	info.func = DBcorpsFrame_ObjetsFrame_Criteres_Faction_OnClick;
	UIDropDownMenu_AddButton(info);
	for i=1, getn(DBCS_Reputation_nom)  do
		bbon = true;
		if ( isetsniveau0 > 0 ) then
			if ( DBCS_Reputation_nom[i].iextension == isetsniveau0 ) then
			else
				bbon = false;
			end
		end
		if ( bbon == true ) then
			info = {};
			info.text = DBCS_Reputation_nom[i].nom;
			info.value = DBCS_Reputation_nom[i].index;
			info.func = DBcorpsFrame_ObjetsFrame_Criteres_Faction_OnClick;
			UIDropDownMenu_AddButton(info);
		end
	end
	DBcorpsFrame_ObjetsFrame_Criteres_FactionMiddle:SetWidth(200);

end

function DBcorpsFrame_ObjetsFrame_Criteres_Faction_OnClick(self)

	UIDropDownMenu_SetSelectedValue(DBcorpsFrame_ObjetsFrame_Criteres_Faction, self.value);

end

function DBcorpsFrame_ObjetsFrame_Criteres_Classe_OnLoad()

	UIDropDownMenu_Initialize(DBcorpsFrame_ObjetsFrame_Criteres_Classe, DBcorpsFrame_ObjetsFrame_Criteres_Classe_Initialize);

end

function DBcorpsFrame_ObjetsFrame_Criteres_Classe_Initialize()

	info = {};
	info.text = ALL;
	info.value = -1;
	info.func = DBcorpsFrame_ObjetsFrame_Criteres_Classe_OnClick;
	UIDropDownMenu_AddButton(info);
	for i=1, getn(DBCS_classes)  do
		info = {};
		info.text = DBCS_classes[i];
		info.value = i;
		info.func = DBcorpsFrame_ObjetsFrame_Criteres_Classe_OnClick;
		UIDropDownMenu_AddButton(info);
	end

end

function DBcorpsFrame_ObjetsFrame_Criteres_Classe_OnClick(self)

	UIDropDownMenu_SetSelectedValue(DBcorpsFrame_ObjetsFrame_Criteres_Classe, self.value);
	DBcorpsFrame_ObjetsFrame_Criteres_Setsnom_OnLoad();
	UIDropDownMenu_SetSelectedValue(DBcorpsFrame_ObjetsFrame_Criteres_Setsnom,DBCS_setsnom_choix);
	if ( self.value > 1 and UIDropDownMenu_GetSelectedValue(DBcorpsFrame_ObjetsFrame_Criteres_Setsnom,DBCS_setsnom_choix) > 0 ) then
		DBcorps_ListObjets_Update();
	end

end

function DBcorpsFrame_ObjetsFrame_Criteres_Setsniveau0_OnLoad()

	UIDropDownMenu_Initialize(DBcorpsFrame_ObjetsFrame_Criteres_Setsniveau0, DBcorpsFrame_ObjetsFrame_Criteres_Setsniveau0_Initialize);

end

function DBcorpsFrame_ObjetsFrame_Criteres_Setsniveau0_Initialize()

local info;
local i;

	info = {};
	info.text = ALL;
	info.value = -1;
	info.func = DBcorpsFrame_ObjetsFrame_Criteres_Setsniveau0_OnClick;
	UIDropDownMenu_AddButton(info);
	for i = 1 , 5  do
		info = {};
		if ( i == 1 ) then
			info.text = "basic";
		elseif ( i == 2 ) then
			info.text = "BC";
		elseif ( i == 3 ) then
			info.text = "WOTLK";
		elseif ( i == 4 ) then
			info.text = "CaTa";
		elseif ( i == 5 ) then
			info.text = "Myst";
		end
		info.value = i;
		info.func = DBcorpsFrame_ObjetsFrame_Criteres_Setsniveau0_OnClick;
		UIDropDownMenu_AddButton(info);
	end
	DBcorpsFrame_ObjetsFrame_Criteres_Setsniveau0Middle:SetWidth(55);

end

function DBcorpsFrame_ObjetsFrame_Criteres_Setsniveau0_OnClick(self)

	UIDropDownMenu_SetSelectedValue(DBcorpsFrame_ObjetsFrame_Criteres_Setsniveau0, self.value);
	DBcorpsFrame_ObjetsFrame_Criteres_Setsniveau_OnLoad();
	UIDropDownMenu_SetSelectedValue(DBcorpsFrame_ObjetsFrame_Criteres_Setsniveau,-1);
	DBcorpsFrame_ObjetsFrame_Criteres_Faction_OnLoad();
	UIDropDownMenu_SetSelectedValue(DBcorpsFrame_ObjetsFrame_Criteres_Faction,-1);
	--DBcorpsFrame_ObjetsFrame_Criteres_Setsnom_OnLoad();
	--UIDropDownMenu_SetSelectedValue(DBcorpsFrame_ObjetsFrame_Criteres_Setsnom,DBCS_setsnom_choix);
	--if ( self.value > 1 and UIDropDownMenu_GetSelectedValue(DBcorpsFrame_ObjetsFrame_Criteres_Setsnom,DBCS_setsnom_choix) > 0 ) then
	--	DBcorps_ListObjets_Update();
	--end

end

function DBcorpsFrame_ObjetsFrame_Criteres_Setsniveau_OnLoad()

	UIDropDownMenu_Initialize(DBcorpsFrame_ObjetsFrame_Criteres_Setsniveau, DBcorpsFrame_ObjetsFrame_Criteres_Setsniveau_Initialize);

end

function DBcorpsFrame_ObjetsFrame_Criteres_Setsniveau_Initialize()

local info;
local i;

local isetsniveau0 = UIDropDownMenu_GetSelectedValue(DBcorpsFrame_ObjetsFrame_Criteres_Setsniveau0);
local bbon;

	info = {};
	info.text = ALL;
	info.value = -1;
	info.func = DBcorpsFrame_ObjetsFrame_Criteres_Setsniveau_OnClick;
	UIDropDownMenu_AddButton(info);
	for i = 1 , getn(DBCS_setsniveau)  do
		bbon = true;
		if ( isetsniveau0 > 0 ) then
			if ( DBCS_setsniveau[i].iextension == isetsniveau0 ) then
			else
				bbon = false;
			end
		end
		if ( bbon == true ) then
			info = {};
			info.text = DBCS_setsniveau[i].name;
			info.value = DBCS_setsniveau[i].index;
			info.func = DBcorpsFrame_ObjetsFrame_Criteres_Setsniveau_OnClick;
			UIDropDownMenu_AddButton(info);
		end
	end
	DBcorpsFrame_ObjetsFrame_Criteres_SetsniveauMiddle:SetWidth(170);

end

function DBcorpsFrame_ObjetsFrame_Criteres_Setsniveau_OnClick(self)

	UIDropDownMenu_SetSelectedValue(DBcorpsFrame_ObjetsFrame_Criteres_Setsniveau, self.value);
	DBcorpsFrame_ObjetsFrame_Criteres_Setsnom_OnLoad();
	UIDropDownMenu_SetSelectedValue(DBcorpsFrame_ObjetsFrame_Criteres_Setsnom,DBCS_setsnom_choix);
	if ( self.value > 1 and UIDropDownMenu_GetSelectedValue(DBcorpsFrame_ObjetsFrame_Criteres_Setsnom,DBCS_setsnom_choix) > 0 ) then
		DBcorps_ListObjets_Update();
	end

end

function DBcorpsFrame_ObjetsFrame_Criteres_Setsnom_OnLoad()

	UIDropDownMenu_Initialize(DBcorpsFrame_ObjetsFrame_Criteres_Setsnom, DBcorpsFrame_ObjetsFrame_Criteres_Setsnom_Initialize);

end

function DBcorpsFrame_ObjetsFrame_Criteres_Setsnom_Initialize()

	local ivide = 1;
	local ibon;
	
	local iclasse = UIDropDownMenu_GetSelectedValue(DBcorpsFrame_ObjetsFrame_Criteres_Classe);
	local isetsniveau = UIDropDownMenu_GetSelectedValue(DBcorpsFrame_ObjetsFrame_Criteres_Setsniveau);

	DBCS_setsnom_choix = 0;

	for i=1, getn(DBCS_setsnom)  do
		ibon = 1;
		if ( iclasse > -1 or isetsniveau > -1 ) then
			if ( iclasse > -1 ) then
				if ( DBCS_setsnom[i].classe[iclasse] ) then
				else
					ibon = 0;
				end
			end
			if ( isetsniveau > -1 ) then
				if ( DBCS_setsnom[i].niveau == isetsniveau ) then
				else
					ibon = 0;
				end
			end
		else
			ibon = 0;
		end
		if ( ibon == 1 ) then
			info = {};
			info.text = DBCS_setsnom[i].name;
			info.value = i;
			info.func = DBcorpsFrame_ObjetsFrame_Criteres_Setsnom_OnClick;
			UIDropDownMenu_AddButton(info);
			if ( DBCS_setsnom_choix == 0 ) then
				DBCS_setsnom_choix = i;
			end
			ivide = 0;
		end
	end
	if ( ivide == 1 ) then
		info = {};
		info.text = "Pas de choix";
		info.value = 0;
		info.func = DBcorpsFrame_ObjetsFrame_Criteres_Setsnom_OnClick;
		UIDropDownMenu_AddButton(info);
	end
	DBcorpsFrame_ObjetsFrame_Criteres_SetsnomMiddle:SetWidth(200);

end

function DBcorpsFrame_ObjetsFrame_Criteres_Setsnom_OnClick(self)

	UIDropDownMenu_SetSelectedValue(DBcorpsFrame_ObjetsFrame_Criteres_Setsnom, self.value);
	if ( self.value > 0 ) then
		DBcorps_ListObjets_Update();
	end

end

function DBcorpsFrame_ObjetsFrame_Tri_Tri_OnLoad()

	UIDropDownMenu_Initialize(DBcorpsFrame_ObjetsFrame_Tri_Tri, DBcorpsFrame_ObjetsFrame_Tri_Tri_Initialize);

end

function DBcorpsFrame_ObjetsFrame_Tri_Tri_Initialize()

	info = {};
	info.text = "Aucuns";
	info.value = 0;
	info.func = DBcorpsFrame_ObjetsFrame_Tri_Tri_OnClick;
	UIDropDownMenu_AddButton(info);
	for i = 1 , getn(DBCS_objet_tri)  do
		info = {};
		info.text = DBCS_objet_tri[i].traduc;
		info.value = i;
		info.func = DBcorpsFrame_ObjetsFrame_Tri_Tri_OnClick;
		UIDropDownMenu_AddButton(info);
	end

end

function DBcorpsFrame_ObjetsFrame_Tri_Tri_OnClick(self)

local i;

	UIDropDownMenu_SetSelectedValue(DBcorpsFrame_ObjetsFrame_Tri_Tri, self.value);
	--i = UIDropDownMenu_GetSelectedValue(DBcorpsFrame_ObjetsFrame_Tri_tri);
	if ( self.value == 0 ) then
		DBcorps_ListObjets_Trier();
	else
		--DBCORPS_OBJETS_LISTE_sens = "DESC"
		DBcorps_ListObjets_Trier(DBCS_objet_tri[self.value].name,0);
	end

end

function DBcorpsFrame_ConnaissanceBeteFrame_Criteres_Technique_OnLoad()

	UIDropDownMenu_Initialize(DBcorpsFrame_ConnaissanceBeteFrame_Criteres_Technique, DBcorpsFrame_ConnaissanceBeteFrame_Criteres_Technique_Initialize);

end

function DBcorpsFrame_ConnaissanceBeteFrame_Criteres_Technique_Initialize()

	info = {};
	info.text = ALL;
	info.value = -1;
	info.func = DBcorpsFrame_ConnaissanceBeteFrame_Criteres_Technique_OnClick;
	UIDropDownMenu_AddButton(info);
	for i=1, getn(DBCS_ConnaissanceBete_technique)  do
		info = {};
		info.text = DBCS_ConnaissanceBete_technique[i].nom;
		info.value = i;
		info.func = DBcorpsFrame_ConnaissanceBeteFrame_Criteres_Technique_OnClick;
		UIDropDownMenu_AddButton(info);
	end

end

function DBcorpsFrame_ConnaissanceBeteFrame_Criteres_Technique_OnClick(self)

	UIDropDownMenu_SetSelectedValue(DBcorpsFrame_ConnaissanceBeteFrame_Criteres_Technique, self.value);

end

function DBcorpsFrame_PNJFrame_Criteres_Type_OnLoad()

	UIDropDownMenu_Initialize(DBcorpsFrame_PNJFrame_Criteres_Type, DBcorpsFrame_PNJFrame_Criteres_Type_Initialize);

end

function DBcorpsFrame_PNJFrame_Criteres_Type_Initialize()

local info;
local i;

	--DBmobsPNJ_Combo_t_init();
	info = {};
	info.text = ALL;
	info.value = -1;
	info.func = DBcorpsFrame_PNJFrame_Criteres_Type_OnClick;
	UIDropDownMenu_AddButton(info);
	if ( DBmobsPNJ_Combo_t ) then
		for i = 1 , table.getn(DBmobsPNJ_Combo_t)  do
			info = {};
			info.text = DBmobsPNJ_Combo_t[i].nom;
			info.value = i;
			info.func = DBcorpsFrame_PNJFrame_Criteres_Type_OnClick;
			UIDropDownMenu_AddButton(info);
		end
	end

end

function DBcorpsFrame_PNJFrame_Criteres_Type_OnClick(self)

	UIDropDownMenu_SetSelectedValue(DBcorpsFrame_PNJFrame_Criteres_Type, self.value);
	DBcorpsFrame_PNJFrame_Criteres_Rep_OnLoad();
	UIDropDownMenu_SetSelectedValue(DBcorpsFrame_PNJFrame_Criteres_Rep,-1);
	DBcorpsFrame_PNJFrame_Criteres_Sexe_OnLoad();
	UIDropDownMenu_SetSelectedValue(DBcorpsFrame_PNJFrame_Criteres_Sexe,-1);
	DBcorpsFrame_PNJFrame_Criteres_Nom_OnLoad();
	UIDropDownMenu_SetSelectedValue(DBcorpsFrame_PNJFrame_Criteres_Nom,-1);

end

function DBcorpsFrame_PNJFrame_Criteres_Rep_OnLoad()

	UIDropDownMenu_Initialize(DBcorpsFrame_PNJFrame_Criteres_Rep, DBcorpsFrame_PNJFrame_Criteres_Rep_Initialize);

end

function DBcorpsFrame_PNJFrame_Criteres_Rep_Initialize()

local info;
local i;
local itype;

	info = {};
	info.text = ALL;
	info.value = -1;
	info.func = DBcorpsFrame_PNJFrame_Criteres_Rep_OnClick;
	UIDropDownMenu_AddButton(info);
	itype = UIDropDownMenu_GetSelectedValue(DBcorpsFrame_PNJFrame_Criteres_Type);
	if ( DBmobsPNJ_Combo_t and itype and itype > 0 ) then
		for i = 1 , table.getn(DBmobsPNJ_Combo_t[itype])  do
			info = {};
			info.text = DBmobsPNJ_Combo_t[itype][i].nom;
			info.value = i;
			info.func = DBcorpsFrame_PNJFrame_Criteres_Rep_OnClick;
			UIDropDownMenu_AddButton(info);
		end
	end

end

function DBcorpsFrame_PNJFrame_Criteres_Rep_OnClick(self)

	UIDropDownMenu_SetSelectedValue(DBcorpsFrame_PNJFrame_Criteres_Rep, self.value);
	DBcorpsFrame_PNJFrame_Criteres_Sexe_OnLoad();
	UIDropDownMenu_SetSelectedValue(DBcorpsFrame_PNJFrame_Criteres_Sexe,-1);
	DBcorpsFrame_PNJFrame_Criteres_Nom_OnLoad();
	UIDropDownMenu_SetSelectedValue(DBcorpsFrame_PNJFrame_Criteres_Nom,-1);

end

function DBcorpsFrame_PNJFrame_Criteres_Sexe_OnLoad()

	UIDropDownMenu_Initialize(DBcorpsFrame_PNJFrame_Criteres_Sexe, DBcorpsFrame_PNJFrame_Criteres_Sexe_Initialize);

end

function DBcorpsFrame_PNJFrame_Criteres_Sexe_Initialize()

local info;
local i;
local itype;
local irep;

	info = {};
	info.text = ALL;
	info.value = -1;
	info.func = DBcorpsFrame_PNJFrame_Criteres_Sexe_OnClick;
	UIDropDownMenu_AddButton(info);
	itype = UIDropDownMenu_GetSelectedValue(DBcorpsFrame_PNJFrame_Criteres_Type);
	irep = UIDropDownMenu_GetSelectedValue(DBcorpsFrame_PNJFrame_Criteres_Rep);
	if ( DBmobsPNJ_Combo_t and itype and itype > 0 and irep and irep > 0 ) then
		for i = 1 , table.getn(DBmobsPNJ_Combo_t[itype][irep])  do
			info = {};
			info.text = DBmobsPNJ_Combo_t[itype][irep][i].nom;
			info.value = i;
			info.func = DBcorpsFrame_PNJFrame_Criteres_Sexe_OnClick;
			UIDropDownMenu_AddButton(info);
		end
	end

end

function DBcorpsFrame_PNJFrame_Criteres_Sexe_OnClick(self)

	UIDropDownMenu_SetSelectedValue(DBcorpsFrame_PNJFrame_Criteres_Sexe, self.value);
	DBcorpsFrame_PNJFrame_Criteres_Nom_OnLoad();
	UIDropDownMenu_SetSelectedValue(DBcorpsFrame_PNJFrame_Criteres_Nom,-1);

end

function DBcorpsFrame_PNJFrame_Criteres_Nom_OnLoad()

	UIDropDownMenu_Initialize(DBcorpsFrame_PNJFrame_Criteres_Nom, DBcorpsFrame_PNJFrame_Criteres_Nom_Initialize);

end

function DBcorpsFrame_PNJFrame_Criteres_Nom_Initialize()

local info;
local i;
local itype;
local irep;
local isexe;

	info = {};
	info.text = ALL;
	info.value = -1;
	info.func = DBcorpsFrame_PNJFrame_Criteres_Nom_OnClick;
	UIDropDownMenu_AddButton(info);
	itype = UIDropDownMenu_GetSelectedValue(DBcorpsFrame_PNJFrame_Criteres_Type);
	irep = UIDropDownMenu_GetSelectedValue(DBcorpsFrame_PNJFrame_Criteres_Rep);
	isexe = UIDropDownMenu_GetSelectedValue(DBcorpsFrame_PNJFrame_Criteres_Sexe);
	if ( DBmobsPNJ_Combo_t and itype and itype > 0 and irep and irep > 0 and isexe and isexe > 0 ) then
		for i = 1 , table.getn(DBmobsPNJ_Combo_t[itype][irep][isexe])  do
			info = {};
			info.text = DBmobsPNJ_Combo_t[itype][irep][isexe][i].nom;
			info.value = i;
			info.func = DBcorpsFrame_PNJFrame_Criteres_Nom_OnClick;
			UIDropDownMenu_AddButton(info);
		end
	end

end

function DBcorpsFrame_PNJFrame_Criteres_Nom_OnClick(self)

	UIDropDownMenu_SetSelectedValue(DBcorpsFrame_PNJFrame_Criteres_Nom, self.value);

end

function DBcorpsFrame_PNJFrame_Criteres_Classe_OnLoad()

	UIDropDownMenu_Initialize(DBcorpsFrame_PNJFrame_Criteres_Classe, DBcorpsFrame_PNJFrame_Criteres_Classe_Initialize);

end

function DBcorpsFrame_PNJFrame_Criteres_Classe_Initialize()

local info;
local i;

	info = {};
	info.text = ALL;
	info.value = -1;
	info.func = DBcorpsFrame_PNJFrame_Criteres_Classe_OnClick;
	UIDropDownMenu_AddButton(info);
	if ( DBCS_mobs_detail_tableau_classification ) then
		for i = 1 , table.getn(DBCS_mobs_detail_tableau_classification)  do
			info = {};
			info.text = DBCS_mobs_detail_tableau_classification[i];
			info.value = i;
			info.func = DBcorpsFrame_PNJFrame_Criteres_Classe_OnClick;
			UIDropDownMenu_AddButton(info);
		end
	end

end

function DBcorpsFrame_PNJFrame_Criteres_Classe_OnClick(self)

	UIDropDownMenu_SetSelectedValue(DBcorpsFrame_PNJFrame_Criteres_Classe, self.value);

end

function DBcorpsFrame_PNJFrame_Criteres_Type2_OnLoad()

	UIDropDownMenu_Initialize(DBcorpsFrame_PNJFrame_Criteres_Type2, DBcorpsFrame_PNJFrame_Criteres_Type2_Initialize);

end

function DBcorpsFrame_PNJFrame_Criteres_Type2_Initialize()

local info;
local i;

	info = {};
	info.text = ALL;
	info.value = -1;
	info.func = DBcorpsFrame_PNJFrame_Criteres_Type2_OnClick;
	UIDropDownMenu_AddButton(info);
	if ( DBCS_mobs_detail_tableau_type ) then
		for i = 1 , table.getn(DBCS_mobs_detail_tableau_type)  do
			info = {};
			info.text = DBCS_mobs_detail_tableau_type[i];
			info.value = i;
			info.func = DBcorpsFrame_PNJFrame_Criteres_Type2_OnClick;
			UIDropDownMenu_AddButton(info);
		end
	end

end

function DBcorpsFrame_PNJFrame_Criteres_Type2_OnClick(self)

	UIDropDownMenu_SetSelectedValue(DBcorpsFrame_PNJFrame_Criteres_Type2, self.value);

end

function DBcorpsFrame_PNJFrame_Criteres_TypeRegion1_OnLoad()

	UIDropDownMenu_Initialize(DBcorpsFrame_PNJFrame_Criteres_TypeRegion1, DBcorpsFrame_PNJFrame_Criteres_TypeRegion1_Initialize);

end

function DBcorpsFrame_PNJFrame_Criteres_TypeRegion1_Initialize()

local i;

	info = {};
	info.text = "Toutes";
	info.value = -1;
	info.func = DBcorpsFrame_PNJFrame_Criteres_TypeRegion1_OnClick;
	UIDropDownMenu_AddButton(info);
	if ( DBCS_Region_liste_combo ) then
		for i = 1 , table.getn(DBCS_Region_liste_combo)  do
			info = {};
			info.text = DBCS_Region_liste_combo[i].name;
			info.value = i;
			info.func = DBcorpsFrame_PNJFrame_Criteres_TypeRegion1_OnClick;
			UIDropDownMenu_AddButton(info);
		end
	end
	DBcorpsFrame_PNJFrame_Criteres_TypeRegion1Middle:SetWidth(200);

end

function DBcorpsFrame_PNJFrame_Criteres_TypeRegion1_OnClick(self)

	UIDropDownMenu_SetSelectedValue(DBcorpsFrame_PNJFrame_Criteres_TypeRegion1, self.value);
	DBcorpsFrame_PNJFrame_Criteres_TypeRegion2_OnLoad();
	UIDropDownMenu_SetSelectedValue(DBcorpsFrame_PNJFrame_Criteres_TypeRegion2,-1);
	DBcorpsFrame_PNJFrame_Criteres_TypeRegion3_OnLoad();
	UIDropDownMenu_SetSelectedValue(DBcorpsFrame_PNJFrame_Criteres_TypeRegion3,-1);
	DBCORPS_PNJ_TypeRegion_select = nil;

end

function DBcorpsFrame_PNJFrame_Criteres_TypeRegion2_OnLoad()

	UIDropDownMenu_Initialize(DBcorpsFrame_PNJFrame_Criteres_TypeRegion2, DBcorpsFrame_PNJFrame_Criteres_TypeRegion2_Initialize);

end

function DBcorpsFrame_PNJFrame_Criteres_TypeRegion2_Initialize()

local snumregion;
local icont;
local iregion;
local i;

local ityperegion1 = UIDropDownMenu_GetSelectedValue(DBcorpsFrame_PNJFrame_Criteres_TypeRegion1);

	info = {};
	info.text = "Aucunes";
	info.value = -1;
	info.func = DBcorpsFrame_PNJFrame_Criteres_TypeRegion2_OnClick;
	UIDropDownMenu_AddButton(info);
	if ( DBCS_Region_liste_combo and DBCS_Region_liste_combo[ityperegion1] ) then
		for i = 1 , table.getn(DBCS_Region_liste_combo[ityperegion1])  do
			info = {};
			if ( DBCS_Region_liste_combo[ityperegion1][i].name ) then
				info.text = DBCS_Region_liste_combo[ityperegion1][i].name;
			else
				if ( DBCS_Region_liste_combo[ityperegion1][i].type == "Z" ) then
					info.text = DBCS_Region_nom_region(DBCS_Region_liste_combo[ityperegion1][i].snumregion);
				else
				end
			end
			info.value = i;
			info.func = DBcorpsFrame_PNJFrame_Criteres_TypeRegion2_OnClick;
			UIDropDownMenu_AddButton(info);
		end
	end
	DBcorpsFrame_PNJFrame_Criteres_TypeRegion2Middle:SetWidth(200);

end

function DBcorpsFrame_PNJFrame_Criteres_TypeRegion2_OnClick(self)

	UIDropDownMenu_SetSelectedValue(DBcorpsFrame_PNJFrame_Criteres_TypeRegion2, self.value);
	DBcorpsFrame_PNJFrame_Criteres_TypeRegion3_OnLoad();
	UIDropDownMenu_SetSelectedValue(DBcorpsFrame_PNJFrame_Criteres_TypeRegion3,-1);
	DBCORPS_PNJ_TypeRegion_select = nil;
local ityperegion1 = UIDropDownMenu_GetSelectedValue(DBcorpsFrame_PNJFrame_Criteres_TypeRegion1);
local ityperegion2 = UIDropDownMenu_GetSelectedValue(DBcorpsFrame_PNJFrame_Criteres_TypeRegion2);
local ityperegion3 = UIDropDownMenu_GetSelectedValue(DBcorpsFrame_PNJFrame_Criteres_TypeRegion3);
	if ( ityperegion1 > -1 ) then
		if ( ityperegion2 > -1 ) then
			if ( ityperegion3 > -1 ) then
				DBCORPS_PNJ_TypeRegion_select = DBCS_Region_liste_combo[ityperegion1][ityperegion2][ityperegion3].snumregion;
			else
				if ( DBCS_Region_liste_combo[ityperegion1][ityperegion2].snumregion ) then
					DBCORPS_PNJ_TypeRegion_select = DBCS_Region_liste_combo[ityperegion1][ityperegion2].snumregion;
				end
			end
		else
		end
	end

end

function DBcorpsFrame_PNJFrame_Criteres_TypeRegion3_OnLoad()

	UIDropDownMenu_Initialize(DBcorpsFrame_PNJFrame_Criteres_TypeRegion3, DBcorpsFrame_PNJFrame_Criteres_TypeRegion3_Initialize);

end

function DBcorpsFrame_PNJFrame_Criteres_TypeRegion3_Initialize()

local snumregion;
local icont;
local iregion;
local i;

local ityperegion1 = UIDropDownMenu_GetSelectedValue(DBcorpsFrame_PNJFrame_Criteres_TypeRegion1);
local ityperegion2 = UIDropDownMenu_GetSelectedValue(DBcorpsFrame_PNJFrame_Criteres_TypeRegion2);

	info = {};
	info.text = "Aucunes";
	info.value = -1;
	info.func = DBcorpsFrame_PNJFrame_Criteres_TypeRegion3_OnClick;
	UIDropDownMenu_AddButton(info);
	if ( DBCS_Region_liste_combo and DBCS_Region_liste_combo[ityperegion1] and DBCS_Region_liste_combo[ityperegion1][ityperegion2] ) then
		for i = 1 , table.getn(DBCS_Region_liste_combo[ityperegion1][ityperegion2])  do
			info = {};
			if ( DBCS_Region_liste_combo[ityperegion1][ityperegion2][i].name ) then
				info.text = DBCS_Region_liste_combo[ityperegion1][ityperegion2][i].name;
			else
				if ( DBCS_Region_liste_combo[ityperegion1][ityperegion2][i].type == "Z" ) then
					info.text = DBCS_Region_nom_region(DBCS_Region_liste_combo[ityperegion1][ityperegion2][i].snumregion);
				else
				end
			end
			info.value = i;
			info.func = DBcorpsFrame_PNJFrame_Criteres_TypeRegion3_OnClick;
			UIDropDownMenu_AddButton(info);
		end
	end
	DBcorpsFrame_PNJFrame_Criteres_TypeRegion3Middle:SetWidth(200);

end

function DBcorpsFrame_PNJFrame_Criteres_TypeRegion3_OnClick(self)

	UIDropDownMenu_SetSelectedValue(DBcorpsFrame_PNJFrame_Criteres_TypeRegion3, self.value);
	DBCORPS_PNJ_TypeRegion_select = nil;
local ityperegion1 = UIDropDownMenu_GetSelectedValue(DBcorpsFrame_PNJFrame_Criteres_TypeRegion1);
local ityperegion2 = UIDropDownMenu_GetSelectedValue(DBcorpsFrame_PNJFrame_Criteres_TypeRegion2);
local ityperegion3 = UIDropDownMenu_GetSelectedValue(DBcorpsFrame_PNJFrame_Criteres_TypeRegion3);
	if ( ityperegion1 > -1 ) then
		if ( ityperegion2 > -1 ) then
			if ( ityperegion3 > -1 ) then
				DBCORPS_PNJ_TypeRegion_select = DBCS_Region_liste_combo[ityperegion1][ityperegion2][ityperegion3].snumregion;
			else
				if ( DBCS_Region_liste_combo[ityperegion1][ityperegion2].snumregion ) then
					DBCORPS_PNJ_TypeRegion_select = DBCS_Region_liste_combo[ityperegion1][ityperegion2].snumregion;
				end
			end
		else
		end
	end

end

function DBCS_montant_vers_chaine(money)

local gold;
local silver;
local copper;
local sreturn;

	gold = floor(money / 10000);
	silver = floor((money - (gold * 10000)) / 100);
	copper = mod(money, 100);
	
	sreturn = "";
	if ( gold > 0 ) then
		sreturn = sreturn..gold.."|TInterface/icons/inv_misc_coin_02:0|t";
	end
	if ( gold > 0 or silver > 0 ) then
		if ( silver < 10 ) then
			sreturn = sreturn.."0"..silver.."|TInterface/icons/inv_misc_coin_04:0|t";
		else
			sreturn = sreturn..silver.."|TInterface/icons/inv_misc_coin_04:0|t";
		end
	end
	if ( copper < 10 ) then
		sreturn = sreturn.."0"..copper.."|TInterface/icons/inv_misc_coin_06:0|t";
	else
		sreturn = sreturn..copper.."|TInterface/icons/inv_misc_coin_06:0|t";
	end
	
	return sreturn;

end

function DBCS_MoneyFrame_Update(frameName, money)

	local frame = _G[frameName];
	local info = frame.info;
	--if ( not info ) then
	--	message("Error moneyType not set");
	--end

	-- Breakdown the money into denominations
	local gold = floor(money / (COPPER_PER_SILVER * SILVER_PER_GOLD));
	local silver = floor((money - (gold * COPPER_PER_SILVER * SILVER_PER_GOLD)) / COPPER_PER_SILVER);
	local copper = mod(money, COPPER_PER_SILVER);

	local goldButton = _G[frameName.."GoldButton"];
	local silverButton = _G[frameName.."SilverButton"];
	local copperButton = _G[frameName.."CopperButton"];

	--local iconWidth = MONEY_ICON_WIDTH;
	--local spacing = MONEY_BUTTON_SPACING;
	--if ( frame.small ) then
		iconWidth = 13;
		spacing = 0;
	--end

	-- Set values for each denomination
	goldButton:SetText(gold);
	goldButton:SetWidth(goldButton:GetTextWidth() + iconWidth);
	goldButton:Show();
	silverButton:SetText("88");
	silverButton:SetWidth(silverButton:GetTextWidth() + iconWidth);
	silverButton:SetText(silver);
	silverButton:Show();
	copperButton:SetText("88");
	copperButton:SetWidth(copperButton:GetTextWidth() + iconWidth);
	copperButton:SetText(copper);
	copperButton:Show();

	-- Store how much money the frame is displaying
	frame.staticMoney = money;

	-- If not collapsable don't need to continue
	--if ( not info.collapse ) then
	--	return;
	--end

	local width = iconWidth;
	local showLowerDenominations, truncateCopper;
	if ( gold > 0 ) then
		width = width + goldButton:GetWidth();
		if ( info.showSmallerCoins ) then
			showLowerDenominations = 1;
		end
		if ( info.truncateSmallCoins ) then
			truncateCopper = 1;
		end
	else
		goldButton:Hide();
	end

	if ( silver > 0 or showLowerDenominations ) then
		width = width + silverButton:GetWidth();
		goldButton:SetPoint("RIGHT", frameName.."SilverButton", "LEFT", spacing, 0);
		if ( goldButton:IsVisible() ) then
			width = width - spacing;
		end
		if ( info.showSmallerCoins ) then
			showLowerDenominations = 1;
		end
	else
		silverButton:Hide();
		goldButton:SetPoint("RIGHT", frameName.."SilverButton",	"RIGHT", 0, 0);
	end

	-- Used if we're not showing lower denominations
	if ( (copper > 0 or showLowerDenominations or info.showSmallerCoins == "Backpack") and not truncateCopper) then
		width = width + copperButton:GetWidth();
		silverButton:SetPoint("RIGHT", frameName.."CopperButton", "LEFT", spacing, 0);
		if ( silverButton:IsVisible() ) then
			width = width - spacing;
		end
	else
		copperButton:Hide();
		silverButton:SetPoint("RIGHT", frameName.."CopperButton", "RIGHT", 0, 0);
	end

	frame:SetWidth(width);
end

function DBCS_formattext(stexte,caracparligne)

local nb;
local snewtexte;
local i;
local ipos;
local sligne;
local lg;

	snewtexte = "";
	nb = strlen(stexte);
	i = 0;
	while ( i < nb ) do
		sligne = strsub(stexte,i+1,i+caracparligne);
		ipos = strfind(sligne,"\n");
		if ( ipos ) then
			snewtexte = snewtexte..strsub(stexte,i+1,i+ipos+1);
			i = i + ipos + 1;
		else
			lg = caracparligne;
			if ( i+lg < nb ) then
				ipos = 0;
				while ( ipos ) do
					ipos = strfind(sligne," ",ipos+1);
					if ( ipos ) then
						lg = ipos;
					end
				end
			end
			snewtexte = snewtexte..strsub(stexte,i+1,i+lg).."\n";
			i = i + lg;
		end
	end
	
	return snewtexte;

end

					--<OnKeyDown>
						--if ( IsControlKeyDown() ) then
						--	ShowInspectCursor();
						--else
						--	ResetCursor();
						--end
					--</OnKeyDown>
					--<OnKeyUp>
						--ResetCursor();
					--</OnKeyUp>

--		<NormalTexture file="Interface\PetitionFrame\GuildCharter-Icon">
--			<Size>
--				<AbsDimension x="20" y="20"/>
--			</Size>
--			<Anchors>
--				<Anchor point="CENTER">
--					<Offset>
--						<AbsDimension x="-1" y="1"/>
--					</Offset>
--				</Anchor>
--			</Anchors>
--		</NormalTexture>
--		<PushedTexture file="Interface\PetitionFrame\GuildCharter-Icon">
--			<Size>
--				<AbsDimension x="20" y="20"/>
--			</Size>
--			<Anchors>
--				<Anchor point="CENTER">
--					<Offset>
--						<AbsDimension x="0" y="0"/>
--					</Offset>
--				</Anchor>
--			</Anchors>
--		</PushedTexture>

--	<Button name="DBCS_Quetes_Item">
--		<Size>
--			<AbsDimension x="10" y="10"/>
--		</Size>
--		<Layers>
--			<Layer level="BORDER">
--				<Texture name="$parent_IconTexture"/>
--			</Layer>
--		</Layers>
--	</Button>

--		<TitleRegion setAllPoints="true"/>
--		<Backdrop bgFile="Interface\DialogFrame\UI-DialogBox-Background" edgeFile="Interface\DialogFrame\UI-DialogBox-Border" tile="true">
--			<BackgroundInsets>
--				<AbsInset left="1" right="1" top="1" bottom="1"/>
--			</BackgroundInsets>
--			<TileSize>
--				<AbsValue val="1"/>
--			</TileSize>
--			<EdgeSize>
--				<AbsValue val="1"/>
--			</EdgeSize>
--		</Backdrop>		

--/script DBcorpsMap:Show()
--/script DBCS_testmap()

DBCS_map_onenter_imax = 0;
DBCS_map_onenter_premier = 0;
DBCS_map_onclick_imax = 0;
DBCS_map_onclick_tablo = {};
DBCS_map_onclick_jmax = 0;

--/script DBCS_testmap("0X0@10X10@20X20@","@","X")
--/script DBCS_testmap("0X0@10X10@")
--/script DBCS_testmap("10X10@")
function DBCS_testmap(slisteloc,cdelim1,cdelim2)

	local i;
	local iposdeb;
	local iposfin;
	local ipos;
	local x;
	local y;
	local smot;
	local ochamp;
	local sligne;

	for i = 1 , DBCS_map_onenter_imax do
		_G["DBcorpsMap_tex"..i]:Hide();
	end

	if ( slisteloc == nil ) then
		return;
	end
	sligne = slisteloc;
	
	iposdeb = 1;
	iposfin = 0;
	i = 0;
	while ( iposfin ) do
		iposfin = strfind(sligne,cdelim1,iposdeb);
		if ( iposfin ) then
			smot = strsub(sligne,iposdeb,iposfin-1);
			iposdeb = iposfin + 1;
			sligne = strsub(sligne,iposdeb);
			iposdeb = 1;
			ipos = strfind(smot,cdelim2);
			if ( ipos ) then
				i = i + 1;
				x = tonumber(strsub(smot,1,ipos-1));
				y = tonumber(strsub(smot,ipos+1));
				if ( i > DBCS_map_onenter_imax ) then
					DBcorpsMap:CreateTexture("DBcorpsMap_tex"..i);
					DBCS_map_onenter_imax = i;
				end
				ochamp = _G["DBcorpsMap_tex"..i];
				ochamp:Hide();
				ochamp:SetHeight(10);
				ochamp:SetWidth(10);
				ochamp:SetTexture(1,0,0);
				ochamp:SetPoint("CENTER",DBcorpsMap,"TOPLEFT",x,-(y/100*87));
				ochamp:Show();
			end
		end
	end
	
end

function DBcorps_ListMobs_Item_Nomregion_OnEnter(self)

	GameTooltip:SetOwner(self, "ANCHOR_TOPLEFT");
	GameTooltip:SetText("Cliquer pour voir les locs sur la carte");
	GameTooltip:Show();
	
	if ( 1 == 1 ) then
		return nil;
	end
	
	--	la suite est périmée

local iindex;
local snommob;
local snumregion;
local ttablo;
local snomrepregion = "Ironforge";
local snomfileregion = "Ironforge";
local ochamp;
local i1,i2;

	iindex = self:GetParent():GetID() + FauxScrollFrame_GetOffset(DBcorpsFrame_MobsFrame_Liste_ScrollFrame);

	snommob = DBCORPS_MOBS_LISTE[iindex][1];
	snumregion = DBCORPS_MOBS_LISTE[iindex][2];
	i1,i2 = DB_indexregionbynum(snumregion);
	snomrepregion = DBCS_RegionData[i1][i2].repertoire;
	snomfileregion = DBCS_RegionData[i1][i2].fichier;
	--if ( snomfileregion == "" ) then
	--	snomfileregion = "Ironforge";
	--end
	ttablo = DBmobs_Detail(snommob,snumregion,DBCS_salaireskin);
	
	DBcorpsMap:Hide();
	for i = 1 , 12, 1 do
		if ( DBCS_map_onenter_premier == 0 ) then
			DBcorpsMap:CreateTexture("DBcorpsMapfond_tex"..i);
		end
		ochamp = _G["DBcorpsMapfond_tex"..i];
		ochamp:Hide();
		ochamp:SetHeight(33);
		ochamp:SetWidth(25);
		if ( snomfileregion == "" ) then
			ochamp:SetTexture();
		else
			if ( snomrepregion == nil ) then
				ochamp:SetTexture("Interface/WorldMap/"..snomfileregion.."/"..snomfileregion..i);
			else
				ochamp:SetTexture("Interface/WorldMap/"..snomrepregion.."/"..snomfileregion..i);
			end
		end
		if ( i == 1 ) then
			ochamp:SetPoint("TOPLEFT",DBcorpsMap,"TOPLEFT",0,0);
		elseif ( i == 2 ) then
			ochamp:SetPoint("TOPLEFT",DBcorpsMap,"TOPLEFT",25,0);
		elseif ( i == 3 ) then
			ochamp:SetPoint("TOPLEFT",DBcorpsMap,"TOPLEFT",50,0);
		elseif ( i == 4 ) then
			ochamp:SetPoint("TOPLEFT",DBcorpsMap,"TOPLEFT",75,0);
		elseif ( i == 5 ) then
			ochamp:SetPoint("TOPLEFT",DBcorpsMap,"TOPLEFT",0,-33);
		elseif ( i == 6 ) then
			ochamp:SetPoint("TOPLEFT",DBcorpsMap,"TOPLEFT",25,-33);
		elseif ( i == 7 ) then
			ochamp:SetPoint("TOPLEFT",DBcorpsMap,"TOPLEFT",50,-33);
		elseif ( i == 8 ) then
			ochamp:SetPoint("TOPLEFT",DBcorpsMap,"TOPLEFT",75,-33);
		elseif ( i == 9 ) then
			ochamp:SetPoint("TOPLEFT",DBcorpsMap,"TOPLEFT",0,-66);
		elseif ( i == 10 ) then
			ochamp:SetPoint("TOPLEFT",DBcorpsMap,"TOPLEFT",25,-66);
		elseif ( i == 11 ) then
			ochamp:SetPoint("TOPLEFT",DBcorpsMap,"TOPLEFT",50,-66);
		elseif ( i == 12 ) then
			ochamp:SetPoint("TOPLEFT",DBcorpsMap,"TOPLEFT",75,-66);
		end
		ochamp:Show();
		--_G["WorldMapDetailTile"..i]:SetTexture("Interface\\WorldMap\\"..mapFileName.."\\"..mapFileName..i);
		--	/script DEFAULT_CHAT_FRAME:AddMessage(WorldMapDetail:GetWidth())
	end		
	if ( ttablo ) then
		--mapFileName, textureHeight, textureWidth = GetMapInfo();	
		--	/script DEFAULT_CHAT_FRAME:AddMessage(GetMapInfo())
		DBCS_testmap(ttablo.locs,"@","Y");
		if ( snomfileregion == "" ) then
		else
			DBcorpsMap:Show();
		end
	end
	DBCS_map_onenter_premier = 1;

end

function DBcorps_ListObjet_Item_Nomregion_OnEnter(self)

	GameTooltip:SetOwner(self, "ANCHOR_TOPLEFT");
	GameTooltip:SetText("Cliquer pour voir les locs sur la carte");
	GameTooltip:Show();
	
	if ( 1 == 1 ) then
		return nil;
	end

--	la suite est périmée

local iindex;
local snommob;
local snumregion;
local ttablo;
local snomfileregion = "Ironforge";
local ochamp;
local i1,i2;

	iindex = self:GetParent():GetID() + FauxScrollFrame_GetOffset(DBcorpsFrame_ObjetFrame_Liste_ScrollFrame);

	snommob = DBCORPS_OBJET_LISTE[iindex][1];
	snumregion = DBCORPS_OBJET_LISTE[iindex][2];
	i1,i2 = DB_indexregionbynum(snumregion);
	snomfileregion = DBCS_RegionData[i1][i2].fichier;
	--if ( snomfileregion == "" ) then
	--	snomfileregion = "Ironforge";
	--end
	ttablo = DBmobs_Detail(snommob,snumregion,DBCS_salaireskin);
	
	DBcorpsMap:Hide();
	for i = 1 , 12, 1 do
		if ( DBCS_map_onenter_premier == 0 ) then
			DBcorpsMap:CreateTexture("DBcorpsMapfond_tex"..i);
		end
		ochamp = _G["DBcorpsMapfond_tex"..i];
		ochamp:Hide();
		ochamp:SetHeight(33);
		ochamp:SetWidth(25);
		if ( snomfileregion == "" ) then
			ochamp:SetTexture();
		else
			ochamp:SetTexture("Interface\\WorldMap\\"..snomfileregion.."\\"..snomfileregion..i);
		end
		if ( i == 1 ) then
			ochamp:SetPoint("TOPLEFT",DBcorpsMap,"TOPLEFT",0,0);
		elseif ( i == 2 ) then
			ochamp:SetPoint("TOPLEFT",DBcorpsMap,"TOPLEFT",25,0);
		elseif ( i == 3 ) then
			ochamp:SetPoint("TOPLEFT",DBcorpsMap,"TOPLEFT",50,0);
		elseif ( i == 4 ) then
			ochamp:SetPoint("TOPLEFT",DBcorpsMap,"TOPLEFT",75,0);
		elseif ( i == 5 ) then
			ochamp:SetPoint("TOPLEFT",DBcorpsMap,"TOPLEFT",0,-33);
		elseif ( i == 6 ) then
			ochamp:SetPoint("TOPLEFT",DBcorpsMap,"TOPLEFT",25,-33);
		elseif ( i == 7 ) then
			ochamp:SetPoint("TOPLEFT",DBcorpsMap,"TOPLEFT",50,-33);
		elseif ( i == 8 ) then
			ochamp:SetPoint("TOPLEFT",DBcorpsMap,"TOPLEFT",75,-33);
		elseif ( i == 9 ) then
			ochamp:SetPoint("TOPLEFT",DBcorpsMap,"TOPLEFT",0,-66);
		elseif ( i == 10 ) then
			ochamp:SetPoint("TOPLEFT",DBcorpsMap,"TOPLEFT",25,-66);
		elseif ( i == 11 ) then
			ochamp:SetPoint("TOPLEFT",DBcorpsMap,"TOPLEFT",50,-66);
		elseif ( i == 12 ) then
			ochamp:SetPoint("TOPLEFT",DBcorpsMap,"TOPLEFT",75,-66);
		end
		ochamp:Show();
		--_G["WorldMapDetailTile"..i]:SetTexture("Interface\\WorldMap\\"..mapFileName.."\\"..mapFileName..i);
		--	/script DEFAULT_CHAT_FRAME:AddMessage(WorldMapDetail:GetWidth())
	end		
	if ( ttablo ) then
		--mapFileName, textureHeight, textureWidth = GetMapInfo();	
		--	/script DEFAULT_CHAT_FRAME:AddMessage(GetMapInfo())
		DBCS_testmap(ttablo.locs,"@","Y");
		if ( snomfileregion == "" ) then
		else
			DBcorpsMap:Show();
		end
	end
	DBCS_map_onenter_premier = 1;

end

function DBcorps_ListConnaissanceBete_Item_Nomregion_OnClick(self)

local iindex;
local snommob;
local snumregion;
local ttablo;
local slocs;

	if ( IsControlKeyDown() ) then
	else
		return;
	end

	iindex = self:GetParent():GetID() + FauxScrollFrame_GetOffset(DBcorpsFrame_ConnaissanceBeteFrame_Liste_ScrollFrame);
	
	snommob = DBCORPS_ConnaissanceBete_LISTE[iindex][1];
	snumregion = DBCORPS_ConnaissanceBete_LISTE[iindex][2];
	
	ttablo = DBmobs_Detail(snommob,snumregion,DBCS_salaireskin);
	slocs = ttablo.locs;
	if ( slocs == nil ) then
		return;
	end

	DBcorps_Afficherworldmap_element(snumregion,snommob,slocs,"@","Y");

end

function DBcorps_ListMobs_Item_Nomregion_OnClick(self)

local iindex;
local snommob;
local snumregion;
local ttablo;
local slocs;

	--if ( IsControlKeyDown() ) then
	--else
	--	return;
	--end

	iindex = self:GetParent():GetID() + FauxScrollFrame_GetOffset(DBcorpsFrame_MobsFrame_Liste_ScrollFrame);
	
	snommob = DBCORPS_MOBS_LISTE[iindex][1];
	snumregion = DBCORPS_MOBS_LISTE[iindex][2];
	
	ttablo = DBmobs_Detail(snommob,snumregion,DBCS_salaireskin);
	slocs = ttablo.locs;
	if ( slocs == nil ) then
		slocs = "@";
		--return;
	else
		slocs = "@"..slocs;
	end

	--DBcorps_Afficherworldmap_element(snumregion,snommob,slocs,"@","Y");
	DBCS_Region_Minimap_init_loc_hide();
	DBCS_Region_Minimap_init_loc(snommob,snumregion,0,slocs,"@","Y");

end

function DBcorps_ListObjet_Item_Nomregion_OnClick(self)

local iindex;
local snommob;
local snumregion;
local ttablo;
local slocs;

	--if ( IsControlKeyDown() ) then
	--else
	--	return;
	--end

	iindex = self:GetParent():GetID() + FauxScrollFrame_GetOffset(DBcorpsFrame_ObjetFrame_Liste_ScrollFrame);
	
	snommob = DBCORPS_OBJET_LISTE[iindex][1];
	snumregion = DBCORPS_OBJET_LISTE[iindex][2];
	
	ttablo = DBmobs_Detail(snommob,snumregion,DBCS_salaireskin);
	slocs = ttablo.locs;
	if ( slocs == nil ) then
		slocs = "@";
		--return;
	else
		slocs = "@"..slocs;
	end

	--DBcorps_Afficherworldmap_element(snumregion,snommob,slocs,"@","Y");
	DBCS_Region_Minimap_init_loc_hide();
	DBCS_Region_Minimap_init_loc(snommob,snumregion,0,slocs,"@","Y");

end

function DBCS_DBcorpsMap_worldtex_OnEnter(self)

	--GameTooltip:SetOwner(self, "ANCHOR_BOTTOMLEFT");
	--GameTooltip:AddLine(self.toolTip);
	--GameTooltip:Show();
--TraceFrame:AddMessage(self:GetLeft().." : "..WorldMapDetailFrame:GetWidth());
	if ( self:GetLeft() < (WorldMapDetailFrame:GetWidth()/2) ) then
		WorldMapTooltip:SetOwner(self, "ANCHOR_RIGHT");
	else
		WorldMapTooltip:SetOwner(self, "ANCHOR_BOTTOMLEFT");
	end
	WorldMapTooltip:SetText(self.toolTip);
	WorldMapTooltip:Show();

end

function DBCS_DBcorpsMap_worldtex_OnLeave()

	--GameTooltip:Hide();
	WorldMapTooltip:Hide();

end

function DBcorps_MiniMap_fra_OnEnter(self)

	GameTooltip:SetOwner(self, "ANCHOR_TOPLEFT");
	GameTooltip:SetText(self.toolTip);
	GameTooltip:Show();

end

function DBcorps_MiniMap_fra_OnLeave()

	GameTooltip:Hide();

end

function DBCS_afficherplante(snumregion)

if ( InCombatLockdown() ) then
	return nil;
end

local tablo;
local ttablo;
local criteres = {};
local inumelem;
local iposdeb;
local iposfin;
local i;
local j;
local ipos;
local x;
local y;
local oframe;
local ochamp;
local iwidth;
local iheight;
local slocs;
local bfin;
local stexture;
local snom;

local bvalue;

	bvalue = DBcorps_Worldmap_Frame_Plantes_Plante:GetChecked();
	if ( bvalue == nil ) then
		bvalue = 0;
	end
	if ( bvalue == 0 ) then
		return;
	end

	--criteres.nomregion = DB_nomregionbynum(snumregion);
	criteres.numregion = snumregion;
	criteres.famille = "cueillette";

	tablo = DBmobs_Liste(criteres);
	
	DBCORPS_MOBS_TRI = {};
	DBCORPS_MOBS_TRI[1] = {};
	DBCORPS_MOBS_TRI[1].champ = "nommobcueillette";
	DBCORPS_MOBS_TRI[1].sens = "ASC";
	table.sort(tablo,DBcorps_ListMobs_Trier_sort);

	iwidth = WorldMapDetailFrame:GetWidth();
	iheight = WorldMapDetailFrame:GetHeight();
	
	i = 0;
	for inumelem = 1 , table.getn(tablo) do
		ttablo = DBmobs_Detail(tablo[inumelem][1],tablo[inumelem][2],DBCS_salaireskin);
		--DBCS_minage
		stexture = "Interface\\Icons\\INV_Misc_QuestionMark";
		snom = tablo[inumelem][1];
		bfin = 0;
		j = 0;
		while ( bfin == 0 and j < table.getn(DBCS_cueillette) ) do
			j = j + 1;
			ipos = strfind(strlower(tablo[inumelem][1]),DBCS_cueillette[j].nomplante,1);
			if ( ipos ) then
				stexture = DBCS_cueillette[j].texture;
				if ( DBCS_cueillette[j].skill > 0 ) then
					snom = snom.." ("..DBCS_cueillette[j].skill..")";
				end
				bfin = 1;
			end
		end
--TraceFrame:AddMessage("nommob : "..tablo[inumelem][1].." , texture : "..stexture);
		slocs = ttablo.locs;
		if ( slocs == nil ) then
			slocs = "";
		end
		iposdeb = 1;
		iposfin = 0;
		while ( iposfin ) do
			iposfin = strfind(slocs,"@",iposdeb);
			if ( iposfin ) then
				smot = strsub(slocs,iposdeb,iposfin-1);
				iposdeb = iposfin + 1;
				slocs = strsub(slocs,iposdeb);
				iposdeb = 1;
				ipos = strfind(smot,"Y");
				if ( ipos ) then
					x = tonumber(strsub(smot,1,ipos-1));
					y = tonumber(strsub(smot,ipos+1));
					if ( DBCS_map_onclick_tablo[y] == nil ) then
						DBCS_map_onclick_tablo[y] = {};
					end
					if ( DBCS_map_onclick_tablo[y][x] == nil ) then
						DBCS_map_onclick_jmax = DBCS_map_onclick_jmax + 1;
						i = DBCS_map_onclick_jmax;
					else
						i = DBCS_map_onclick_tablo[y][x];
					end
					if ( i > DBCS_map_onclick_imax ) then
						oframe = CreateFrame("Button","DBcorpsMap_worldfra"..i,WorldMapDetailFrame);
						oframe:SetWidth(10);
						oframe:SetHeight(10);
						oframe:CreateTexture("DBcorpsMap_worldtex"..i);
						DBCS_map_onclick_imax = i;
					else
						oframe = _G["DBcorpsMap_worldfra"..i];
					end
					if ( DBCS_map_onclick_tablo[y][x] == nil ) then
						DBCS_map_onclick_tablo[y][x] = i;
						oframe:Hide();
						oframe.toolTip = snom;
						oframe:SetPoint("CENTER",WorldMapDetailFrame,"TOPLEFT",((x/100)*iwidth),-((y/100)*iheight));
						oframe:SetScript("OnEnter",DBCS_DBcorpsMap_worldtex_OnEnter);
						oframe:SetScript("OnLeave",DBCS_DBcorpsMap_worldtex_OnLeave);
						oframe:SetFrameLevel(WorldMapPlayer:GetFrameLevel() + 1);
						oframe:SetFrameStrata("FULLSCREEN_DIALOG");	--	TOOLTIP");
						ochamp = _G["DBcorpsMap_worldtex"..i];
						ochamp:Hide();
						ochamp:SetHeight(10);
						ochamp:SetWidth(10);
						ochamp:SetTexture(stexture);
						ochamp:SetPoint("CENTER",0,0);
						ochamp:Show();
						oframe:Show();
					else
						oframe.toolTip = oframe.toolTip.."\n"..snom;
					end
				end
			end
		end
	end

	--DBCS_map_onclick_tablo

end

function DBCS_affichercoffre(snumregion)

if ( InCombatLockdown() ) then
	return nil;
end

local tablo;
local ttablo;
local criteres = {};
local inumelem;
local iposdeb;
local iposfin;
local i;
local j;
local ipos;
local x;
local y;
local oframe;
local ochamp;
local iwidth;
local iheight;
local slocs;
local bfin;
local stexture;
local snom;

local bvalue;

	bvalue = DBcorps_Worldmap_Frame_Coffres_Coffre:GetChecked();
	if ( bvalue == nil ) then
		bvalue = 0;
	end
	if ( bvalue == 0 ) then
		return;
	end

	--criteres.nomregion = DB_nomregionbynum(snumregion);
	criteres.numregion = snumregion;
	criteres.famille = "ouverture";

	tablo = DBmobs_Liste(criteres);
	
	DBCORPS_MOBS_TRI = {};
	DBCORPS_MOBS_TRI[1] = {};
	DBCORPS_MOBS_TRI[1].champ = "nommobouverture";
	DBCORPS_MOBS_TRI[1].sens = "ASC";
	table.sort(tablo,DBcorps_ListMobs_Trier_sort);

	iwidth = WorldMapDetailFrame:GetWidth();
	iheight = WorldMapDetailFrame:GetHeight();
	
	i = 0;
	for inumelem = 1 , table.getn(tablo) do
		ttablo = DBmobs_Detail(tablo[inumelem][1],tablo[inumelem][2],DBCS_salaireskin);
		--DBCS_minage
		stexture = "Interface\\Icons\\INV_Misc_QuestionMark";
		snom = tablo[inumelem][1];
		bfin = 0;
		j = 0;
		while ( bfin == 0 and j < table.getn(DBCS_coffre) ) do
			j = j + 1;
			ipos = strfind(strlower(tablo[inumelem][1]),DBCS_coffre[j].nomcoffre,1);
			if ( ipos ) then
				if ( DBCS_coffre[j].special ) then
					ipos = strfind(strlower(tablo[inumelem][1]),DBCS_coffre[j].special,1);
					if ( ipos ) then
						stexture = DBCS_coffre[j].texture;
						bfin = 1;
					end
				else
					stexture = DBCS_coffre[j].texture;
					bfin = 1;
				end
			end
		end
--TraceFrame:AddMessage("nommob : "..tablo[inumelem][1].." , texture : "..stexture);
		slocs = ttablo.locs;
		if ( slocs == nil ) then
			slocs = "";
		end
		iposdeb = 1;
		iposfin = 0;
		while ( iposfin ) do
			iposfin = strfind(slocs,"@",iposdeb);
			if ( iposfin ) then
				smot = strsub(slocs,iposdeb,iposfin-1);
				iposdeb = iposfin + 1;
				slocs = strsub(slocs,iposdeb);
				iposdeb = 1;
				ipos = strfind(smot,"Y");
				if ( ipos ) then
					x = tonumber(strsub(smot,1,ipos-1));
					y = tonumber(strsub(smot,ipos+1));
					if ( DBCS_map_onclick_tablo[y] == nil ) then
						DBCS_map_onclick_tablo[y] = {};
					end
					if ( DBCS_map_onclick_tablo[y][x] == nil ) then
						DBCS_map_onclick_jmax = DBCS_map_onclick_jmax + 1;
						i = DBCS_map_onclick_jmax;
					else
						i = DBCS_map_onclick_tablo[y][x];
					end
					if ( i > DBCS_map_onclick_imax ) then
						oframe = CreateFrame("Button","DBcorpsMap_worldfra"..i,WorldMapDetailFrame);
						oframe:SetWidth(10);
						oframe:SetHeight(10);
						oframe:CreateTexture("DBcorpsMap_worldtex"..i);
						DBCS_map_onclick_imax = i;
					else
						oframe = _G["DBcorpsMap_worldfra"..i];
					end
					if ( DBCS_map_onclick_tablo[y][x] == nil ) then
						DBCS_map_onclick_tablo[y][x] = i;
						oframe:Hide();
						oframe.toolTip = snom;
						oframe:SetPoint("CENTER",WorldMapDetailFrame,"TOPLEFT",((x/100)*iwidth),-((y/100)*iheight));
						oframe:SetScript("OnEnter",DBCS_DBcorpsMap_worldtex_OnEnter);
						oframe:SetScript("OnLeave",DBCS_DBcorpsMap_worldtex_OnLeave);
						oframe:SetFrameLevel(WorldMapPlayer:GetFrameLevel() + 1);
						oframe:SetFrameStrata("FULLSCREEN_DIALOG");	--	TOOLTIP");
						ochamp = _G["DBcorpsMap_worldtex"..i];
						ochamp:Hide();
						ochamp:SetHeight(10);
						ochamp:SetWidth(10);
						ochamp:SetTexture(stexture);
						ochamp:SetPoint("CENTER",0,0);
						ochamp:Show();
						oframe:Show();
					else
						oframe.toolTip = oframe.toolTip.."\n"..snom;
					end
				end
			end
		end
	end

	--DBCS_map_onclick_tablo

end

--	zoneIndex = GetCurrentMapZone();

function DBcorpsFrame_Objets_new_OnClick()

local bvalue;

	if ( DBCS_config["informer"] == nil ) then
		DBCS_config["informer"] = {};
	end
	if ( DBCS_config["informer"]["objets_new"] == nil ) then
		DBCS_config["informer"]["objets_new"] = true;
	end
	bvalue = DBcorpsFrame_Objets_new:GetChecked();
	if ( bvalue == nil ) then
		bvalue = 0;
	end
	if ( bvalue == 0 ) then
		DBCS_config["informer"]["objets_new"] = false;
		DBCS_afficher_new_objets = false;
	else
		DBCS_config["informer"]["objets_new"] = true;
		DBCS_afficher_new_objets = true;
	end

end

function DBcorpsFrame_Quetes_new_OnClick()

local bvalue;

	if ( DBCS_config["informer"] == nil ) then
		DBCS_config["informer"] = {};
	end
	if ( DBCS_config["informer"]["quetes_new"] == nil ) then
		DBCS_config["informer"]["quetes_new"] = true;
	end
	bvalue = DBcorpsFrame_Quetes_new:GetChecked();
	if ( bvalue == nil ) then
		bvalue = 0;
	end
	if ( bvalue == 0 ) then
		DBCS_config["informer"]["quetes_new"] = false;
		DBCS_afficher_new_quetes = false;
	else
		DBCS_config["informer"]["quetes_new"] = true;
		DBCS_afficher_new_quetes = true;
	end

end

function DBCS_Worldmap_Frame_Mines_OnClick()

local bvalue;
local i;

	if ( DBCS_config["affichageiconesmap"] == nil ) then
		DBCS_config["affichageiconesmap"] = {};
	end
	if ( DBCS_config["affichageiconesmap"][DBCS_serveur] == nil ) then
		DBCS_config["affichageiconesmap"][DBCS_serveur] = {};
	end
	if ( DBCS_config["affichageiconesmap"][DBCS_serveur][DBCS_joueur] == nil ) then
		DBCS_config["affichageiconesmap"][DBCS_serveur][DBCS_joueur] = {};
	end
	bvalue = DBcorps_Worldmap_Frame_Mines_Mine:GetChecked();
	if ( bvalue == nil ) then
		bvalue = 0;
	end
	if ( bvalue == 0 ) then
		DBCS_config["affichageiconesmap"][DBCS_serveur][DBCS_joueur]["mines"] = nil;
		for i = 1 , DBCS_listeicone_minerai_minimap_max do
			_G["DBcorps_MiniMap_fra_Minerai"..i]:Hide();
			_G["DBcorps_MiniMap_tex_Minerai"..i]:Hide();
		end
	else
		DBCS_config["affichageiconesmap"][DBCS_serveur][DBCS_joueur]["mines"] = 1;
	end

	DBCS_worldmap_afficherlocs();

end

function DBCS_Worldmap_Frame_Plantes_OnClick()

local bvalue;
local i;

	if ( DBCS_config["affichageiconesmap"] == nil ) then
		DBCS_config["affichageiconesmap"] = {};
	end
	if ( DBCS_config["affichageiconesmap"][DBCS_serveur] == nil ) then
		DBCS_config["affichageiconesmap"][DBCS_serveur] = {};
	end
	if ( DBCS_config["affichageiconesmap"][DBCS_serveur][DBCS_joueur] == nil ) then
		DBCS_config["affichageiconesmap"][DBCS_serveur][DBCS_joueur] = {};
	end
	bvalue = DBcorps_Worldmap_Frame_Plantes_Plante:GetChecked();
	if ( bvalue == nil ) then
		bvalue = 0;
	end
	if ( bvalue == 0 ) then
		DBCS_config["affichageiconesmap"][DBCS_serveur][DBCS_joueur]["plantes"] = nil;
		for i = 1 , DBCS_listeicone_plante_minimap_max do
			_G["DBcorps_MiniMap_fra_plante"..i]:Hide();
			_G["DBcorps_MiniMap_tex_plante"..i]:Hide();
		end
	else
		DBCS_config["affichageiconesmap"][DBCS_serveur][DBCS_joueur]["plantes"] = 1;
	end

	DBCS_worldmap_afficherlocs();

end

function DBCS_Worldmap_Frame_Coffres_OnClick()

local bvalue;
local i;

	if ( DBCS_config["affichageiconesmap"] == nil ) then
		DBCS_config["affichageiconesmap"] = {};
	end
	if ( DBCS_config["affichageiconesmap"][DBCS_serveur] == nil ) then
		DBCS_config["affichageiconesmap"][DBCS_serveur] = {};
	end
	if ( DBCS_config["affichageiconesmap"][DBCS_serveur][DBCS_joueur] == nil ) then
		DBCS_config["affichageiconesmap"][DBCS_serveur][DBCS_joueur] = {};
	end
	bvalue = DBcorps_Worldmap_Frame_Coffres_Coffre:GetChecked();
	if ( bvalue == nil ) then
		bvalue = 0;
	end
	if ( bvalue == 0 ) then
		DBCS_config["affichageiconesmap"][DBCS_serveur][DBCS_joueur]["coffres"] = nil;
		for i = 1 , DBCS_listeicone_coffre_minimap_max do
			_G["DBcorps_MiniMap_fra_coffre"..i]:Hide();
			_G["DBcorps_MiniMap_tex_coffre"..i]:Hide();
		end
	else
		DBCS_config["affichageiconesmap"][DBCS_serveur][DBCS_joueur]["coffres"] = 1;
	end

	DBCS_worldmap_afficherlocs();

end

function DBCS_worldmap_afficherlocs()

local i;
local icontinent;
local izone;
local j;
local snumregion;
local inumMapAreaID;
local inivcarte;

	for i = 1 , DBCS_map_onclick_imax do
		_G["DBcorpsMap_worldfra"..i]:Hide();
		_G["DBcorpsMap_worldtex"..i]:Hide();
	end
	for i = 1 , DBCS_listeicone_minerai_max do
		_G["DBcorpsMap_worldfra_minerai"..i]:Hide();
		_G["DBcorpsMap_worldtex_minerai"..i]:Hide();
	end
	for i = 1 , DBCS_listeicone_plante_max do
		_G["DBcorpsMap_worldfra_plante"..i]:Hide();
		_G["DBcorpsMap_worldtex_plante"..i]:Hide();
	end
	for i = 1 , DBCS_listeicone_coffre_max do
		_G["DBcorpsMap_worldfra_coffre"..i]:Hide();
		_G["DBcorpsMap_worldtex_coffre"..i]:Hide();
	end
	for i = 1 , DBCS_listeicone_banc_max do
		_G["DBcorpsMap_worldfra_banc"..i]:Hide();
		_G["DBcorpsMap_worldtex_banc"..i]:Hide();
	end
	for i = 1 , DBCS_listeicone_artefact_max do
		_G["DBcorpsMap_worldfra_artefact"..i]:Hide();
		_G["DBcorpsMap_worldtex_artefact"..i]:Hide();
	end
	for i = 1 , DBCS_listeicone_rare_max do
		_G["DBcorpsMap_worldfra_rare"..i]:Hide();
		_G["DBcorpsMap_worldtex_rare"..i]:Hide();
	end
	--if ( InCombatLockdown() ) then
	--	return nil;
	--end
	inumMapAreaID = GetCurrentMapAreaID();
	inivcarte = DBCS_Region_liste_numcarte();
	snumregion = DBCS_Region_numregion_depuis_coderegion(inumMapAreaID,inivcarte);

--	icontinent = GetCurrentMapContinent();
--	izone = GetCurrentMapZone();
----TraceFrame:AddMessage("continent : "..icontinent.." , region : "..izone);
--	--if ( izone > 0 and DBCS_RegionData[icontinent] ) then
--	if ( ( icontinent > 0 ) and ( izone > 0 ) ) then
--		--snumregion = DBCS_Region_Code_By_continent_et_zone(icontinent,izone);
--		snumregion = DBCS_Region_Code_Region(icontinent,izone);
--		--j = 0;
--		--for i = 1 , table.getn(DBCS_RegionData[icontinent]) do
--		--	if ( DBCS_RegionData[icontinent][i].nummap == izone ) then
--		--		j = DBCS_RegionData[icontinent][i].index;
--		--	end
--		--end
--		--if ( j > 0 ) then
--		--	snumregion = ""..tostring(icontinent);
--		--	if ( j < 10 ) then
--		--		snumregion = snumregion.."0";
--		--	end
--		--	snumregion = snumregion..tostring(j);
----TraceFrame:AddMessage("snumregion : "..snumregion);
			DBCS_testminerai(snumregion,0);
--		--end
--	end

end

local DBCS_chrono1 = false;
local DBCS_chrono1_itime = 0;

--/script DBCS_message5sec()
function DBCS_message5sec()

--local itime = GetTime();

--	if ( DBCS_chrono1 == true ) then
--		return;
--	end

	if ( DBCS_chrono1 == true ) then
		if ( ( GetTime() - DBCS_chrono1_itime ) > 5 ) then
			TraceFrame:AddMessage("message apres 5 sec");
			DBCS_chrono1_itime = GetTime();
		end
	end

end

--/script DBCS_message5sec_debut()
function DBCS_message5sec_debut()

	DBCS_chrono1 = true;
	DBCS_chrono1_itime = GetTime();

end
--/script DBCS_message5sec_fin()
function DBCS_message5sec_fin()

	DBCS_chrono1 = false;
	DBCS_chrono1_itime = 0;

end

--	DBcorpsFrame_ObjetsFrame_Criteres_Bar

function DBCS_memo_region_init(snumregion)

	if ( snumregion == DBCS_memo_region_region ) then
if ( DBCS_debug > 1 ) then
TraceFrame:AddMessage("je re init DBCS_memo_region_region.");
end
		DBCS_memo_region_region = "";
--if ( DBCS_debug > 1 ) then
--TraceFrame:AddMessage("3 DBCS_memo_region_region : "..DBCS_memo_region_region);
--end
		DBCS_memo_region_scale = 0;
		DBCS_memo_region_xoffset = 0;
		DBCS_memo_region_yoffset = 0;
		DBCS_map_region = "";
	end

end

--/script DBCS_memo_region("205");
--/script DBCS_memo_region("203");
function DBCS_memo_region(snumregion)

local tablo;
local ttablo;
local tlocs;
local sloc;
local criteres = {};
local inumelem;
local iposdeb;
local iposfin;
local i;
local j;
local k;
local ipos;
local x;
local y;
local oframe;
local ochamp;
local iwidth;
local iheight;
local slocs;
local bfin;
local stexture;
local snom;
local a,b;
local ecartx,ecarty;
local inummap;
local iskill;

local bvalue;

	--bvalue = DBcorps_Worldmap_Frame_Mines_Mine:GetChecked();
	--if ( bvalue == nil ) then
	--	bvalue = 0;
	--end
	--if ( bvalue == 0 ) then
	--	DBCS_listeicone_minerai = {};
	--	DBCS_listeicone_minerai_region = "";
	--	return;
	--end

	if ( DBCS_memo_region_region == snumregion ) then
	else

--if ( DBCS_debug > 1 ) then
--TraceFrame:AddMessage("1 snumregion : "..snumregion);
--end
		DBCS_memo_region_region = snumregion;
--if ( DBCS_debug > 1 ) then
--TraceFrame:AddMessage("2 DBCS_memo_region_region : "..DBCS_memo_region_region);
--end

		--if ( DBCS_corps_screen_wow_build < 13316 ) then
		--	a,b = DB_indexregionbynum(snumregion);
		--	ecartx = DBCS_RegionData[a][b].ressx;
		--	ecarty = DBCS_RegionData[a][b].ressy;
		--	DBCS_memo_region_scale = (DBCS_RegionData[a][b].scale or 0);
		--	DBCS_memo_region_xoffset = (DBCS_RegionData[a][b].xoffset or 0);
		--	DBCS_memo_region_yoffset = (DBCS_RegionData[a][b].yoffset or 0);
		--else
--TraceFrame:AddMessage("2 DBCS_memo_region_region : "..DBCS_memo_region_region);
			snom, _, _, _, _, _, _, _, ecartx, ecarty, DBCS_memo_region_xoffset, DBCS_memo_region_yoffset = DBCS_Region_nom_carte(snumregion);
			if ( snom == snumregion ) then
				return nil;
			end
		--end
		
		criteres.numregion = snumregion;
		criteres.famille = "minage";
		tablo = DBmobs_Liste(criteres);
		DBCORPS_MOBS_TRI = {};
		DBCORPS_MOBS_TRI[1] = {};
		DBCORPS_MOBS_TRI[1].champ = "nommobminage";
		DBCORPS_MOBS_TRI[1].sens = "ASC";
		table.sort(tablo,DBcorps_ListMobs_Trier_sort);

		DBCS_listeicone_minerai = {};
		for inumelem = 1 , table.getn(tablo) do
			snom = tablo[inumelem][1];
			ttablo = DBmobs_Detail(tablo[inumelem][1],tablo[inumelem][2],DBCS_salaireskin);
			tlocs = ttablo.locprecise;
			if ( tlocs == nil ) then
				tlocs = {};
			end
			stexture = "Interface\\Icons\\INV_Misc_QuestionMark";
			bfin = 0;
			j = 0;
			while ( bfin == 0 and j < table.getn(DBCS_minage) ) do
				j = j + 1;
				ipos = strfind(strlower(snom),DBCS_minage[j].nomminerai,1);
				if ( ipos ) then
					if ( DBCS_minage[j].special ) then
						ipos = strfind(strlower(snom),DBCS_minage[j].special,1);
						if ( ipos ) then
							stexture = DBCS_minage[j].texture;
							iskill = DBCS_minage[j].skill;
							bfin = 1;
						end
					else
						stexture = DBCS_minage[j].texture;
						iskill = DBCS_minage[j].skill;
						bfin = 1;
					end
				end
			end
			for sloc, _ in pairs(tlocs) do
				ipos = strfind(sloc,"@",1);
				x = tonumber(strsub(sloc,1,ipos-1));
				y = tonumber(strsub(sloc,ipos+1));
				k = 0;
				for j = 1 , table.getn(DBCS_listeicone_minerai) do
					if ( ( k == 0 ) and ( abs(DBCS_listeicone_minerai[j].x-x) <= ecartx ) and ( abs(DBCS_listeicone_minerai[j].y-y) <= ecarty ) ) then
						k = j;
					end
				end
				if ( k == 0 ) then
					k = table.getn(DBCS_listeicone_minerai) + 1;
					DBCS_listeicone_minerai[k] = {};
					DBCS_listeicone_minerai[k].x = x;
					DBCS_listeicone_minerai[k].y = y;
					DBCS_listeicone_minerai[k].tooltip = snom;
					DBCS_listeicone_minerai[k].texture = stexture;
					if ( iskill > 0 ) then
						DBCS_listeicone_minerai[k].tooltip = DBCS_listeicone_minerai[k].tooltip.." ("..iskill..")";
					end
				else
					DBCS_listeicone_minerai[k].tooltip = DBCS_listeicone_minerai[k].tooltip.."\n"..snom;
					if ( iskill > 0 ) then
						DBCS_listeicone_minerai[k].tooltip = DBCS_listeicone_minerai[k].tooltip.." ("..iskill..")";
					end
				end
			end
		end
--if ( DBCS_debug > 1 ) then
--TraceFrame:AddMessage("minerai zone "..snumregion.." : "..table.getn(DBCS_listeicone_minerai));
--end
		for i = 1 , table.getn(DBCS_listeicone_minerai) do
			--if ( a == 3 or a == 4 or snumregion == "125" or snumregion == "123" or snumregion == "124" or snumregion == "209" or snumregion == "217" or snumregion == "228" or snumregion == "229" or snumregion == "230" or snumregion == "231" ) then
				DBCS_listeicone_minerai[i].xabs = DBCS_listeicone_minerai[i].x * DBCS_memo_region_xoffset;
				DBCS_listeicone_minerai[i].yabs = DBCS_listeicone_minerai[i].y * DBCS_memo_region_yoffset;
			--else
			--	DBCS_listeicone_minerai[i].xabs = DBCS_listeicone_minerai[i].x * DBCS_memo_region_scale + DBCS_memo_region_xoffset;
			--	DBCS_listeicone_minerai[i].yabs = DBCS_listeicone_minerai[i].y * DBCS_memo_region_scale + DBCS_memo_region_yoffset;
			--end
		end
		
		--for i = 1 , table.getn(DBCS_listeicone_minerai) do
		--	TraceFrame:AddMessage("\nmine : "..i);
		--	TraceFrame:AddMessage("x : "..DBCS_listeicone_minerai[i].x);
		--	TraceFrame:AddMessage("y : "..DBCS_listeicone_minerai[i].y);
		--	TraceFrame:AddMessage("texture : "..DBCS_listeicone_minerai[i].texture);
		--	TraceFrame:AddMessage("tooltip : "..DBCS_listeicone_minerai[i].tooltip);
		--end

		criteres.numregion = snumregion;
		criteres.famille = "cueillette";
		tablo = DBmobs_Liste(criteres);
		DBCORPS_MOBS_TRI = {};
		DBCORPS_MOBS_TRI[1] = {};
		DBCORPS_MOBS_TRI[1].champ = "nommobcueillette";
		DBCORPS_MOBS_TRI[1].sens = "ASC";
		table.sort(tablo,DBcorps_ListMobs_Trier_sort);

		DBCS_listeicone_plante = {};
		for inumelem = 1 , table.getn(tablo) do
			snom = tablo[inumelem][1];
			ttablo = DBmobs_Detail(tablo[inumelem][1],tablo[inumelem][2],DBCS_salaireskin);
			tlocs = ttablo.locprecise;
			if ( tlocs == nil ) then
				tlocs = {};
			end
			stexture = "Interface\\Icons\\INV_Misc_QuestionMark";
			bfin = 0;
			j = 0;
			iskill = 0;
			while ( bfin == 0 and j < table.getn(DBCS_cueillette) ) do
				j = j + 1;
				ipos = strfind(strlower(snom),DBCS_cueillette[j].nomplante,1);
				if ( ipos ) then
					stexture = DBCS_cueillette[j].texture;
					iskill = DBCS_cueillette[j].skill;
					bfin = 1;
				end
			end
			for sloc, _ in pairs(tlocs) do
				ipos = strfind(sloc,"@",1);
				x = tonumber(strsub(sloc,1,ipos-1));
				y = tonumber(strsub(sloc,ipos+1));
				k = table.getn(DBCS_listeicone_plante) + 1;
				DBCS_listeicone_plante[k] = {};
				DBCS_listeicone_plante[k].x = x;
				DBCS_listeicone_plante[k].y = y;
				DBCS_listeicone_plante[k].tooltip = snom;
				if ( iskill > 0 ) then
					DBCS_listeicone_plante[k].tooltip = DBCS_listeicone_plante[k].tooltip.." ("..iskill..")";
				end
				DBCS_listeicone_plante[k].texture = stexture;
			end
		end
--if ( DBCS_debug > 1 ) then
--TraceFrame:AddMessage("plante zone "..snumregion.." : "..table.getn(DBCS_listeicone_plante));
--end
		for i = 1 , table.getn(DBCS_listeicone_plante) do
			--if ( a == 3 or a == 4 or snumregion == "125" or snumregion == "123" or snumregion == "124" or snumregion == "209" or snumregion == "217" or snumregion == "228" or snumregion == "229" or snumregion == "230" or snumregion == "231" ) then
				DBCS_listeicone_plante[i].xabs = DBCS_listeicone_plante[i].x * DBCS_memo_region_xoffset;
				DBCS_listeicone_plante[i].yabs = DBCS_listeicone_plante[i].y * DBCS_memo_region_yoffset;
			--else
			--	DBCS_listeicone_plante[i].xabs = DBCS_listeicone_plante[i].x * DBCS_memo_region_scale + DBCS_memo_region_xoffset;
			--	DBCS_listeicone_plante[i].yabs = DBCS_listeicone_plante[i].y * DBCS_memo_region_scale + DBCS_memo_region_yoffset;
			--end
		end
		
		--for i = 1 , table.getn(DBCS_listeicone_plante) do
		--	TraceFrame:AddMessage("\nplante : "..i);
		--	TraceFrame:AddMessage("x : "..DBCS_listeicone_plante[i].x);
		--	TraceFrame:AddMessage("y : "..DBCS_listeicone_plante[i].y);
		--	TraceFrame:AddMessage("texture : "..DBCS_listeicone_plante[i].texture);
		--	TraceFrame:AddMessage("tooltip : "..DBCS_listeicone_plante[i].tooltip);
		--end

		criteres.numregion = snumregion;
		criteres.famille = "ouverture";
		tablo = DBmobs_Liste(criteres);
		DBCORPS_MOBS_TRI = {};
		DBCORPS_MOBS_TRI[1] = {};
		DBCORPS_MOBS_TRI[1].champ = "nommobouverture";
		DBCORPS_MOBS_TRI[1].sens = "ASC";
		table.sort(tablo,DBcorps_ListMobs_Trier_sort);

		DBCS_listeicone_coffre = {};
		for inumelem = 1 , table.getn(tablo) do
			snom = tablo[inumelem][1];
			ttablo = DBmobs_Detail(tablo[inumelem][1],tablo[inumelem][2],DBCS_salaireskin);
			tlocs = ttablo.locprecise;
			if ( tlocs == nil ) then
				tlocs = {};
			end
			stexture = "Interface\\Icons\\INV_Misc_QuestionMark";
			bfin = 0;
			j = 0;
			while ( bfin == 0 and j < table.getn(DBCS_coffre) ) do
				j = j + 1;
				ipos = strfind(strlower(snom),DBCS_coffre[j].nomcoffre,1);
				if ( ipos ) then
					if ( DBCS_coffre[j].special ) then
						ipos = strfind(strlower(snom),DBCS_coffre[j].special,1);
						if ( ipos ) then
							stexture = DBCS_coffre[j].texture;
							bfin = 1;
						end
					else
						stexture = DBCS_coffre[j].texture;
						bfin = 1;
					end
				end
			end
			for sloc, _ in pairs(tlocs) do
				ipos = strfind(sloc,"@",1);
				x = tonumber(strsub(sloc,1,ipos-1));
				y = tonumber(strsub(sloc,ipos+1));
				k = table.getn(DBCS_listeicone_coffre) + 1;
				DBCS_listeicone_coffre[k] = {};
				DBCS_listeicone_coffre[k].x = x;
				DBCS_listeicone_coffre[k].y = y;
				DBCS_listeicone_coffre[k].tooltip = snom;
				DBCS_listeicone_coffre[k].texture = stexture;
			end
		end
--if ( DBCS_debug > 1 ) then
--TraceFrame:AddMessage("coffre zone "..snumregion.." : "..table.getn(DBCS_listeicone_coffre).." DBCS_memo_region_xoffset = "..DBCS_memo_region_xoffset);
--if ( a == 3 or snumregion == "125" or snumregion == "123" or snumregion == "124" ) then
--TraceFrame:AddMessage("zone new");
--end
--end
		for i = 1 , table.getn(DBCS_listeicone_coffre) do
			--if ( a == 3 or a == 4 or snumregion == "125" or snumregion == "123" or snumregion == "124" or snumregion == "209" or snumregion == "217" or snumregion == "228" or snumregion == "229" or snumregion == "230" or snumregion == "231" ) then
				DBCS_listeicone_coffre[i].xabs = DBCS_listeicone_coffre[i].x * DBCS_memo_region_xoffset;
				DBCS_listeicone_coffre[i].yabs = DBCS_listeicone_coffre[i].y * DBCS_memo_region_yoffset;
			--else
			--	DBCS_listeicone_coffre[i].xabs = DBCS_listeicone_coffre[i].x * DBCS_memo_region_scale + DBCS_memo_region_xoffset;
			--	DBCS_listeicone_coffre[i].yabs = DBCS_listeicone_coffre[i].y * DBCS_memo_region_scale + DBCS_memo_region_yoffset;
			--end
		end
		
		--for i = 1 , table.getn(DBCS_listeicone_coffre) do
		--	TraceFrame:AddMessage("\ncoffre : "..i);
		--	TraceFrame:AddMessage("x : "..DBCS_listeicone_coffre[i].x);
		--	TraceFrame:AddMessage("y : "..DBCS_listeicone_coffre[i].y);
		--	TraceFrame:AddMessage("texture : "..DBCS_listeicone_coffre[i].texture);
		--	TraceFrame:AddMessage("tooltip : "..DBCS_listeicone_coffre[i].tooltip);
		--end

		criteres.numregion = snumregion;
		criteres.famille = "banc";
		tablo = DBmobs_Liste(criteres);
		DBCORPS_MOBS_TRI = {};
		DBCORPS_MOBS_TRI[1] = {};
		DBCORPS_MOBS_TRI[1].champ = "nommobbanc";
		DBCORPS_MOBS_TRI[1].sens = "ASC";
		table.sort(tablo,DBcorps_ListMobs_Trier_sort);

		DBCS_listeicone_banc = {};
		for inumelem = 1 , table.getn(tablo) do
			snom = tablo[inumelem][1];
			ttablo = DBmobs_Detail(tablo[inumelem][1],tablo[inumelem][2],DBCS_salaireskin);
			tlocs = ttablo.locprecise;
			if ( tlocs == nil ) then
				tlocs = {};
			end
			--stexture = "Interface\\Icons\\INV_Misc_QuestionMark";
			stexture = "Interface/Icons/INV_Fishingpole_01";
			--bfin = 0;
			--j = 0;
			--while ( bfin == 0 and j < table.getn(DBCS_coffre) ) do
			--	j = j + 1;
			--	ipos = strfind(strlower(snom),DBCS_coffre[j].nomcoffre,1);
			--	if ( ipos ) then
			--		if ( DBCS_coffre[j].special ) then
			--			ipos = strfind(strlower(snom),DBCS_coffre[j].special,1);
			--			if ( ipos ) then
			--				stexture = DBCS_coffre[j].texture;
			--				bfin = 1;
			--			end
			--		else
			--			stexture = DBCS_coffre[j].texture;
			--			bfin = 1;
			--		end
			--	end
			--end
			for sloc, _ in pairs(tlocs) do
				ipos = strfind(sloc,"@",1);
				x = tonumber(strsub(sloc,1,ipos-1));
				y = tonumber(strsub(sloc,ipos+1));
				k = table.getn(DBCS_listeicone_banc) + 1;
				DBCS_listeicone_banc[k] = {};
				DBCS_listeicone_banc[k].x = x;
				DBCS_listeicone_banc[k].y = y;
				DBCS_listeicone_banc[k].tooltip = snom;
				DBCS_listeicone_banc[k].texture = stexture;
			end
		end
		for i = 1 , table.getn(DBCS_listeicone_banc) do
			--if ( a == 3 or a == 4 or snumregion == "125" or snumregion == "123" or snumregion == "124" or snumregion == "209" or snumregion == "217" or snumregion == "228" or snumregion == "229" or snumregion == "230" or snumregion == "231" ) then
				DBCS_listeicone_banc[i].xabs = DBCS_listeicone_banc[i].x * DBCS_memo_region_xoffset;
				DBCS_listeicone_banc[i].yabs = DBCS_listeicone_banc[i].y * DBCS_memo_region_yoffset;
			--else
			--	DBCS_listeicone_banc[i].xabs = DBCS_listeicone_banc[i].x * DBCS_memo_region_scale + DBCS_memo_region_xoffset;
			--	DBCS_listeicone_banc[i].yabs = DBCS_listeicone_banc[i].y * DBCS_memo_region_scale + DBCS_memo_region_yoffset;
			--end
		end

		criteres.numregion = snumregion;
		criteres.famille = "artefact";
		tablo = DBmobs_Liste(criteres);
		DBCORPS_MOBS_TRI = {};
		DBCORPS_MOBS_TRI[1] = {};
		DBCORPS_MOBS_TRI[1].champ = "nommobartefact";
		DBCORPS_MOBS_TRI[1].sens = "ASC";
		table.sort(tablo,DBcorps_ListMobs_Trier_sort);

		DBCS_listeicone_artefact = {};
		for inumelem = 1 , table.getn(tablo) do
			snom = tablo[inumelem][1];
			ttablo = DBmobs_Detail(tablo[inumelem][1],tablo[inumelem][2],DBCS_salaireskin);
			tlocs = ttablo.locprecise;
			if ( tlocs == nil ) then
				tlocs = {};
			end
			--stexture = "Interface\\Icons\\INV_Misc_QuestionMark";
			stexture = "Interface/Icons/INV_Misc_Shovel_01";
			--bfin = 0;
			--j = 0;
			--while ( bfin == 0 and j < table.getn(DBCS_coffre) ) do
			--	j = j + 1;
			--	ipos = strfind(strlower(snom),DBCS_coffre[j].nomcoffre,1);
			--	if ( ipos ) then
			--		if ( DBCS_coffre[j].special ) then
			--			ipos = strfind(strlower(snom),DBCS_coffre[j].special,1);
			--			if ( ipos ) then
			--				stexture = DBCS_coffre[j].texture;
			--				bfin = 1;
			--			end
			--		else
			--			stexture = DBCS_coffre[j].texture;
			--			bfin = 1;
			--		end
			--	end
			--end
			for sloc, _ in pairs(tlocs) do
				ipos = strfind(sloc,"@",1);
				x = tonumber(strsub(sloc,1,ipos-1));
				y = tonumber(strsub(sloc,ipos+1));
				k = table.getn(DBCS_listeicone_artefact) + 1;
				DBCS_listeicone_artefact[k] = {};
				DBCS_listeicone_artefact[k].x = x;
				DBCS_listeicone_artefact[k].y = y;
				DBCS_listeicone_artefact[k].tooltip = snom;
				DBCS_listeicone_artefact[k].texture = stexture;
			end
		end
		for i = 1 , table.getn(DBCS_listeicone_artefact) do
			--if ( a == 3 or a == 4 or snumregion == "125" or snumregion == "123" or snumregion == "124" or snumregion == "209" or snumregion == "217" or snumregion == "228" or snumregion == "229" or snumregion == "230" or snumregion == "231" ) then
				DBCS_listeicone_artefact[i].xabs = DBCS_listeicone_artefact[i].x * DBCS_memo_region_xoffset;
				DBCS_listeicone_artefact[i].yabs = DBCS_listeicone_artefact[i].y * DBCS_memo_region_yoffset;
			--else
			--	DBCS_listeicone_artefact[i].xabs = DBCS_listeicone_artefact[i].x * DBCS_memo_region_scale + DBCS_memo_region_xoffset;
			--	DBCS_listeicone_artefact[i].yabs = DBCS_listeicone_artefact[i].y * DBCS_memo_region_scale + DBCS_memo_region_yoffset;
			--end
		end

		criteres.numregion = snumregion;
		criteres.famille = "rare";
		tablo = DBmobs_Liste(criteres);
		DBCORPS_MOBS_TRI = {};
		DBCORPS_MOBS_TRI[1] = {};
		DBCORPS_MOBS_TRI[1].champ = "nommobrare";
		DBCORPS_MOBS_TRI[1].sens = "ASC";
		table.sort(tablo,DBcorps_ListMobs_Trier_sort);

		DBCS_listeicone_rare = {};
		for inumelem = 1 , table.getn(tablo) do
			snom = tablo[inumelem][1];
			ttablo = DBmobs_Detail(tablo[inumelem][1],tablo[inumelem][2],DBCS_salaireskin);
			tlocs = ttablo.locprecise;
			if ( tlocs == nil ) then
				tlocs = {};
			end
			--stexture = "Interface\\Icons\\INV_Misc_QuestionMark";
			stexture = "Interface/Icons/ability_mount_camel_gray";
			--bfin = 0;
			--j = 0;
			--while ( bfin == 0 and j < table.getn(DBCS_coffre) ) do
			--	j = j + 1;
			--	ipos = strfind(strlower(snom),DBCS_coffre[j].nomcoffre,1);
			--	if ( ipos ) then
			--		if ( DBCS_coffre[j].special ) then
			--			ipos = strfind(strlower(snom),DBCS_coffre[j].special,1);
			--			if ( ipos ) then
			--				stexture = DBCS_coffre[j].texture;
			--				bfin = 1;
			--			end
			--		else
			--			stexture = DBCS_coffre[j].texture;
			--			bfin = 1;
			--		end
			--	end
			--end
			for sloc, _ in pairs(tlocs) do
				ipos = strfind(sloc,"@",1);
				x = tonumber(strsub(sloc,1,ipos-1));
				y = tonumber(strsub(sloc,ipos+1));
				k = table.getn(DBCS_listeicone_rare) + 1;
				DBCS_listeicone_rare[k] = {};
				DBCS_listeicone_rare[k].x = x;
				DBCS_listeicone_rare[k].y = y;
				DBCS_listeicone_rare[k].tooltip = snom;
				DBCS_listeicone_rare[k].texture = stexture;
			end
		end
		for i = 1 , table.getn(DBCS_listeicone_rare) do
			--if ( a == 3 or a == 4 or snumregion == "125" or snumregion == "123" or snumregion == "124" or snumregion == "209" or snumregion == "217" or snumregion == "228" or snumregion == "229" or snumregion == "230" or snumregion == "231" ) then
				DBCS_listeicone_rare[i].xabs = DBCS_listeicone_rare[i].x * DBCS_memo_region_xoffset;
				DBCS_listeicone_rare[i].yabs = DBCS_listeicone_rare[i].y * DBCS_memo_region_yoffset;
			--else
			--	DBCS_listeicone_rare[i].xabs = DBCS_listeicone_rare[i].x * DBCS_memo_region_scale + DBCS_memo_region_xoffset;
			--	DBCS_listeicone_rare[i].yabs = DBCS_listeicone_rare[i].y * DBCS_memo_region_scale + DBCS_memo_region_yoffset;
			--end
		end

	end

end

function DBCS_afficherminerai(snumregion)

if ( InCombatLockdown() ) then
	return nil;
end

local tablo;
local ttablo;
local criteres = {};
local inumelem;
local iposdeb;
local iposfin;
local i;
local j;
local ipos;
local x;
local y;
local oframe;
local ochamp;
local iwidth;
local iheight;
local slocs;
local bfin;
local stexture;
local snom;

local bvalue;

	bvalue = DBcorps_Worldmap_Frame_Mines_Mine:GetChecked();
	if ( bvalue == nil ) then
		bvalue = 0;
	end
	if ( bvalue == 0 ) then
		return;
	end

	--criteres.nomregion = DB_nomregionbynum(snumregion);
	criteres.numregion = snumregion;
	criteres.famille = "minage";

	tablo = DBmobs_Liste(criteres);
	
	DBCORPS_MOBS_TRI = {};
	DBCORPS_MOBS_TRI[1] = {};
	DBCORPS_MOBS_TRI[1].champ = "nommobminage";
	DBCORPS_MOBS_TRI[1].sens = "ASC";
	table.sort(tablo,DBcorps_ListMobs_Trier_sort);

	iwidth = WorldMapDetailFrame:GetWidth();
	iheight = WorldMapDetailFrame:GetHeight();
	
	i = 0;
	for inumelem = 1 , table.getn(tablo) do
		ttablo = DBmobs_Detail(tablo[inumelem][1],tablo[inumelem][2],DBCS_salaireskin);
		--DBCS_minage
		stexture = "Interface\\Icons\\INV_Misc_QuestionMark";
		snom = tablo[inumelem][1];
		bfin = 0;
		j = 0;
		while ( bfin == 0 and j < table.getn(DBCS_minage) ) do
			j = j + 1;
			ipos = strfind(strlower(tablo[inumelem][1]),DBCS_minage[j].nomminerai,1);
			if ( ipos ) then
				if ( DBCS_minage[j].special ) then
					ipos = strfind(strlower(tablo[inumelem][1]),DBCS_minage[j].special,1);
					if ( ipos ) then
						stexture = DBCS_minage[j].texture;
						if ( DBCS_minage[j].skill > 0 ) then
							snom = snom.." ("..DBCS_minage[j].skill..")";
						end
						bfin = 1;
					end
				else
					stexture = DBCS_minage[j].texture;
					if ( DBCS_minage[j].skill > 0 ) then
						snom = snom.." ("..DBCS_minage[j].skill..")";
					end
					bfin = 1;
				end
			end
		end
--TraceFrame:AddMessage("nommob : "..tablo[inumelem][1].." , texture : "..stexture);
		slocs = ttablo.locs;
		if ( slocs == nil ) then
			slocs = "";
		end
		iposdeb = 1;
		iposfin = 0;
		while ( iposfin ) do
			iposfin = strfind(slocs,"@",iposdeb);
			if ( iposfin ) then
				smot = strsub(slocs,iposdeb,iposfin-1);
				iposdeb = iposfin + 1;
				slocs = strsub(slocs,iposdeb);
				iposdeb = 1;
				ipos = strfind(smot,"Y");
				if ( ipos ) then
					x = tonumber(strsub(smot,1,ipos-1));
					y = tonumber(strsub(smot,ipos+1));
					if ( DBCS_map_onclick_tablo[y] == nil ) then
						DBCS_map_onclick_tablo[y] = {};
					end
					if ( DBCS_map_onclick_tablo[y][x] == nil ) then
						DBCS_map_onclick_jmax = DBCS_map_onclick_jmax + 1;
						i = DBCS_map_onclick_jmax;
					else
						i = DBCS_map_onclick_tablo[y][x];
					end
					if ( i > DBCS_map_onclick_imax ) then
						oframe = CreateFrame("Button","DBcorpsMap_worldfra"..i,WorldMapDetailFrame);
						oframe:SetWidth(10);
						oframe:SetHeight(10);
						oframe:CreateTexture("DBcorpsMap_worldtex"..i);
						DBCS_map_onclick_imax = i;
					else
						oframe = _G["DBcorpsMap_worldfra"..i];
					end
					if ( DBCS_map_onclick_tablo[y][x] == nil ) then
						DBCS_map_onclick_tablo[y][x] = i;
						oframe:Hide();
						oframe.toolTip = snom;
						oframe:SetPoint("CENTER",WorldMapDetailFrame,"TOPLEFT",((x/100)*iwidth),-((y/100)*iheight));
						oframe:SetScript("OnEnter",DBCS_DBcorpsMap_worldtex_OnEnter);
						oframe:SetScript("OnLeave",DBCS_DBcorpsMap_worldtex_OnLeave);
						oframe:SetFrameLevel(WorldMapPlayer:GetFrameLevel() + 1);
						oframe:SetFrameStrata("FULLSCREEN_DIALOG");	--	TOOLTIP");
						ochamp = _G["DBcorpsMap_worldtex"..i];
						ochamp:Hide();
						ochamp:SetHeight(10);
						ochamp:SetWidth(10);
						ochamp:SetTexture(stexture);
						ochamp:SetPoint("CENTER",0,0);
						ochamp:Show();
						oframe:Show();
					else
						oframe.toolTip = oframe.toolTip.."\n"..snom;
					end
				end
			end
		end
	end

	--DBCS_map_onclick_tablo

end

function DBCS_initcarte()

local i;

	for i = 1 , DBCS_map_onclick_imax do
		_G["DBcorpsMap_worldfra"..i]:Hide();
		_G["DBcorpsMap_worldtex"..i]:Hide();
	end

	for i = 1 , DBCS_listeicone_minerai_max do
		_G["DBcorpsMap_worldfra_minerai"..i]:Hide();
		_G["DBcorpsMap_worldtex_minerai"..i]:Hide();
	end
	
	for i = 1 , DBCS_listeicone_plante_max do
		_G["DBcorpsMap_worldfra_plante"..i]:Hide();
		_G["DBcorpsMap_worldtex_plante"..i]:Hide();
	end
	
	for i = 1 , DBCS_listeicone_coffre_max do
		_G["DBcorpsMap_worldfra_coffre"..i]:Hide();
		_G["DBcorpsMap_worldtex_coffre"..i]:Hide();
	end
	
	DBCS_map_onclick_tablo = {};
	DBCS_map_onclick_jmax = 0;

--local i1;
--local i2;
--local inummap;

	--i1,i2 = DB_indexregionbynum(snumregion);
	--inummap = DBCS_RegionData[i1][i2].nummap;
	
end

--/script DBCS_afficherminerai_new()
function DBCS_afficherminerai_new()

if ( InCombatLockdown() ) then
	return nil;
end

local i;
local iwidth;
local iheight;
local x;
local y;
local oframe;
local ochamp;

local bvalue;

	bvalue = DBcorps_Worldmap_Frame_Mines_Mine:GetChecked();
	if ( bvalue == nil ) then
		bvalue = 0;
	end
	if ( bvalue == 0 ) then
		return;
	end

	iwidth = WorldMapDetailFrame:GetWidth();
	iheight = WorldMapDetailFrame:GetHeight();

	for i = 1 , table.getn(DBCS_listeicone_minerai) do
	--	TraceFrame:AddMessage("\nmine : "..i);
	--	TraceFrame:AddMessage("x : "..DBCS_listeicone_minerai[i].x);
	--	TraceFrame:AddMessage("y : "..DBCS_listeicone_minerai[i].y);
	--	TraceFrame:AddMessage("texture : "..DBCS_listeicone_minerai[i].texture);
	--	TraceFrame:AddMessage("tooltip : "..DBCS_listeicone_minerai[i].tooltip);
		x = DBCS_listeicone_minerai[i].x;
		y = DBCS_listeicone_minerai[i].y;
		--DBCS_map_onclick_jmax = DBCS_map_onclick_jmax + 1;
		--if ( i > DBCS_listeicone_minerai_max ) then
		--	DBCS_listeicone_minerai_max = i;
		--end
		if ( i > DBCS_listeicone_minerai_max ) then
			oframe = CreateFrame("Button","DBcorpsMap_worldfra_minerai"..i,WorldMapDetailFrame);
			oframe:Hide();
			oframe:SetWidth(10);
			oframe:SetHeight(10);
			oframe:CreateTexture("DBcorpsMap_worldtex_minerai"..i);
			DBCS_listeicone_minerai_max = i;
		else
			oframe = _G["DBcorpsMap_worldfra_minerai"..i];
		end
		--oframe = CreateFrame("Button","DBcorpsMap_worldfra_minerai"..i,WorldMapDetailFrame);
		--oframe:Hide();
		--oframe:SetWidth(10);
		--oframe:SetHeight(10);
		--oframe:CreateTexture("DBcorpsMap_worldtex_minerai"..i);
		oframe.toolTip = DBCS_listeicone_minerai[i].tooltip;
		oframe:SetPoint("CENTER",WorldMapDetailFrame,"TOPLEFT",((x/100)*iwidth),-((y/100)*iheight));
		oframe:SetScript("OnEnter",DBCS_DBcorpsMap_worldtex_OnEnter);
		oframe:SetScript("OnLeave",DBCS_DBcorpsMap_worldtex_OnLeave);
		--oframe:SetFrameLevel(WorldMapPlayer:GetFrameLevel() - 1);
		oframe:SetFrameLevel(Minimap:GetFrameLevel() + 1);
		oframe:SetFrameStrata("FULLSCREEN_DIALOG");
		ochamp = _G["DBcorpsMap_worldtex_minerai"..i];
		ochamp:Hide();
		ochamp:SetHeight(10);
		ochamp:SetWidth(10);
		ochamp:SetTexture(DBCS_listeicone_minerai[i].texture);
		ochamp:SetPoint("CENTER",0,0);
		ochamp:Show();
		oframe:Show();
	end

end

--/script DBCS_afficherplante_new()
function DBCS_afficherplante_new()

if ( InCombatLockdown() ) then
	return nil;
end

local i;
local iwidth;
local iheight;
local x;
local y;
local oframe;
local ochamp;

local bvalue;

	bvalue = DBcorps_Worldmap_Frame_Plantes_Plante:GetChecked();
	if ( bvalue == nil ) then
		bvalue = 0;
	end
	if ( bvalue == 0 ) then
		return;
	end

	iwidth = WorldMapDetailFrame:GetWidth();
	iheight = WorldMapDetailFrame:GetHeight();

	for i = 1 , table.getn(DBCS_listeicone_plante) do
		x = DBCS_listeicone_plante[i].x;
		y = DBCS_listeicone_plante[i].y;
		if ( i > DBCS_listeicone_plante_max ) then
			oframe = CreateFrame("Button","DBcorpsMap_worldfra_plante"..i,WorldMapDetailFrame);
			oframe:Hide();
			oframe:SetWidth(10);
			oframe:SetHeight(10);
			oframe:CreateTexture("DBcorpsMap_worldtex_plante"..i);
			DBCS_listeicone_plante_max = i;
		else
			oframe = _G["DBcorpsMap_worldfra_plante"..i];
		end
		oframe.toolTip = DBCS_listeicone_plante[i].tooltip;
		oframe:SetPoint("CENTER",WorldMapDetailFrame,"TOPLEFT",((x/100)*iwidth),-((y/100)*iheight));
		oframe:SetScript("OnEnter",DBCS_DBcorpsMap_worldtex_OnEnter);
		oframe:SetScript("OnLeave",DBCS_DBcorpsMap_worldtex_OnLeave);
		--oframe:SetFrameLevel(WorldMapPlayer:GetFrameLevel() - 1);
		oframe:SetFrameStrata("FULLSCREEN_DIALOG");
		ochamp = _G["DBcorpsMap_worldtex_plante"..i];
		ochamp:Hide();
		ochamp:SetHeight(10);
		ochamp:SetWidth(10);
		ochamp:SetTexture(DBCS_listeicone_plante[i].texture);
		ochamp:SetPoint("CENTER",0,0);
		ochamp:Show();
		oframe:Show();
	end

end

--/script DBCS_affichercoffre_new()
function DBCS_affichercoffre_new()

if ( InCombatLockdown() ) then
	return nil;
end

local i;
local iwidth;
local iheight;
local x;
local y;
local oframe;
local ochamp;

local bvalue;

	bvalue = DBcorps_Worldmap_Frame_Coffres_Coffre:GetChecked();
	if ( bvalue == nil ) then
		bvalue = 0;
	end
	if ( bvalue == 0 ) then
		return;
	end

	iwidth = WorldMapDetailFrame:GetWidth();
	iheight = WorldMapDetailFrame:GetHeight();

	for i = 1 , table.getn(DBCS_listeicone_coffre) do
		x = DBCS_listeicone_coffre[i].x;
		y = DBCS_listeicone_coffre[i].y;
		if ( i > DBCS_listeicone_coffre_max ) then
			oframe = CreateFrame("Button","DBcorpsMap_worldfra_coffre"..i,WorldMapDetailFrame);
			oframe:Hide();
			oframe:SetWidth(10);
			oframe:SetHeight(10);
			oframe:CreateTexture("DBcorpsMap_worldtex_coffre"..i);
			DBCS_listeicone_coffre_max = i;
		else
			oframe = _G["DBcorpsMap_worldfra_coffre"..i];
		end
		oframe.toolTip = DBCS_listeicone_coffre[i].tooltip;
		oframe:SetPoint("CENTER",WorldMapDetailFrame,"TOPLEFT",((x/100)*iwidth),-((y/100)*iheight));
		oframe:SetScript("OnEnter",DBCS_DBcorpsMap_worldtex_OnEnter);
		oframe:SetScript("OnLeave",DBCS_DBcorpsMap_worldtex_OnLeave);
		--oframe:SetFrameLevel(WorldMapPlayer:GetFrameLevel() - 1);
		oframe:SetFrameStrata("FULLSCREEN_DIALOG");
		ochamp = _G["DBcorpsMap_worldtex_coffre"..i];
		ochamp:Hide();
		ochamp:SetHeight(10);
		ochamp:SetWidth(10);
		ochamp:SetTexture(DBCS_listeicone_coffre[i].texture);
		ochamp:SetPoint("CENTER",0,0);
		ochamp:Show();
		oframe:Show();
	end

end

--/script DBCS_afficherbanc_new()
function DBCS_afficherbanc_new()

if ( InCombatLockdown() ) then
	return nil;
end

local i;
local iwidth;
local iheight;
local x;
local y;
local oframe;
local ochamp;

	iwidth = WorldMapDetailFrame:GetWidth();
	iheight = WorldMapDetailFrame:GetHeight();

	for i = 1 , table.getn(DBCS_listeicone_banc) do
		x = DBCS_listeicone_banc[i].x;
		y = DBCS_listeicone_banc[i].y;
		if ( i > DBCS_listeicone_banc_max ) then
			oframe = CreateFrame("Button","DBcorpsMap_worldfra_banc"..i,WorldMapDetailFrame);
			oframe:Hide();
			oframe:SetWidth(10);
			oframe:SetHeight(10);
			oframe:CreateTexture("DBcorpsMap_worldtex_banc"..i);
			DBCS_listeicone_banc_max = i;
		else
			oframe = _G["DBcorpsMap_worldfra_banc"..i];
		end
		oframe.toolTip = DBCS_listeicone_banc[i].tooltip;
		oframe:SetPoint("CENTER",WorldMapDetailFrame,"TOPLEFT",((x/100)*iwidth),-((y/100)*iheight));
		oframe:SetScript("OnEnter",DBCS_DBcorpsMap_worldtex_OnEnter);
		oframe:SetScript("OnLeave",DBCS_DBcorpsMap_worldtex_OnLeave);
		--if ( WorldMapPlayer ) then
		--	oframe:SetFrameLevel(WorldMapPlayer:GetFrameLevel() - 1);
		--end
		oframe:SetFrameStrata("FULLSCREEN_DIALOG");
		ochamp = _G["DBcorpsMap_worldtex_banc"..i];
		ochamp:Hide();
		ochamp:SetHeight(10);
		ochamp:SetWidth(10);
		ochamp:SetTexture(DBCS_listeicone_banc[i].texture);
		ochamp:SetPoint("CENTER",0,0);
		ochamp:Show();
		oframe:Show();
	end

end

--/script DBCS_afficherartefact_new()
function DBCS_afficherartefact_new()

if ( InCombatLockdown() ) then
	return nil;
end

local i;
local iwidth;
local iheight;
local x;
local y;
local oframe;
local ochamp;

	iwidth = WorldMapDetailFrame:GetWidth();
	iheight = WorldMapDetailFrame:GetHeight();

	for i = 1 , table.getn(DBCS_listeicone_artefact) do
		x = DBCS_listeicone_artefact[i].x;
		y = DBCS_listeicone_artefact[i].y;
		if ( i > DBCS_listeicone_artefact_max ) then
			oframe = CreateFrame("Button","DBcorpsMap_worldfra_artefact"..i,WorldMapDetailFrame);
			oframe:Hide();
			oframe:SetWidth(10);
			oframe:SetHeight(10);
			oframe:CreateTexture("DBcorpsMap_worldtex_artefact"..i);
			DBCS_listeicone_artefact_max = i;
		else
			oframe = _G["DBcorpsMap_worldfra_artefact"..i];
		end
		oframe.toolTip = DBCS_listeicone_artefact[i].tooltip;
		oframe:SetPoint("CENTER",WorldMapDetailFrame,"TOPLEFT",((x/100)*iwidth),-((y/100)*iheight));
		oframe:SetScript("OnEnter",DBCS_DBcorpsMap_worldtex_OnEnter);
		oframe:SetScript("OnLeave",DBCS_DBcorpsMap_worldtex_OnLeave);
		--oframe:SetFrameLevel(WorldMapPlayer:GetFrameLevel() - 1);
		oframe:SetFrameStrata("FULLSCREEN_DIALOG");
		ochamp = _G["DBcorpsMap_worldtex_artefact"..i];
		ochamp:Hide();
		ochamp:SetHeight(10);
		ochamp:SetWidth(10);
		ochamp:SetTexture(DBCS_listeicone_artefact[i].texture);
		ochamp:SetPoint("CENTER",0,0);
		ochamp:Show();
		oframe:Show();
	end

end

--/script DBCS_afficherrare_new()
function DBCS_afficherrare_new()

if ( InCombatLockdown() ) then
	return nil;
end

local i;
local iwidth;
local iheight;
local x;
local y;
local oframe;
local ochamp;

	iwidth = WorldMapDetailFrame:GetWidth();
	iheight = WorldMapDetailFrame:GetHeight();

	for i = 1 , table.getn(DBCS_listeicone_rare) do
		x = DBCS_listeicone_rare[i].x;
		y = DBCS_listeicone_rare[i].y;
		if ( i > DBCS_listeicone_rare_max ) then
			oframe = CreateFrame("Button","DBcorpsMap_worldfra_rare"..i,WorldMapDetailFrame);
			oframe:Hide();
			oframe:SetWidth(10);
			oframe:SetHeight(10);
			oframe:CreateTexture("DBcorpsMap_worldtex_rare"..i);
			DBCS_listeicone_rare_max = i;
		else
			oframe = _G["DBcorpsMap_worldfra_rare"..i];
		end
		oframe.toolTip = DBCS_listeicone_rare[i].tooltip;
		oframe:SetPoint("CENTER",WorldMapDetailFrame,"TOPLEFT",((x/100)*iwidth),-((y/100)*iheight));
		oframe:SetScript("OnEnter",DBCS_DBcorpsMap_worldtex_OnEnter);
		oframe:SetScript("OnLeave",DBCS_DBcorpsMap_worldtex_OnLeave);
		--oframe:SetFrameLevel(WorldMapPlayer:GetFrameLevel() - 1);
		oframe:SetFrameStrata("FULLSCREEN_DIALOG");
		ochamp = _G["DBcorpsMap_worldtex_rare"..i];
		ochamp:Hide();
		ochamp:SetHeight(10);
		ochamp:SetWidth(10);
		ochamp:SetTexture(DBCS_listeicone_rare[i].texture);
		ochamp:SetPoint("CENTER",0,0);
		ochamp:Show();
		oframe:Show();
	end

end

--/script DBCS_testminerai("205",1)
function DBCS_testminerai(snumregion,bcarte)

local i1;
local i2;
local inummap;

	if ( bcarte == nil ) then
		bcarte = 1;
	end
	i1,i2 = DB_indexregionbynum(snumregion);	--DB_indexregionbynum	DBCS_Region_Region_Code
	inummap = DBCS_RegionData[i1][i2].nummap;
	if ( inummap > 0 and bcarte == 1 ) then
		--ToggleWorldMap();
		ToggleFrame(WorldMapFrame);
		--SetMapZoom(i1,inummap);	--20121031
	end
	DBCS_initcarte();
	
	DBCS_memo_region(snumregion);
	DBCS_afficherminerai_new();
	DBCS_afficherplante_new();
	DBCS_affichercoffre_new();
if ( DBCS_debug > 1 ) then
	DBCS_afficherbanc_new();
end
if ( DBCS_debug > 1 ) then
	--DBCS_afficherartefact_new();
end
--if ( DBCS_debug > 1 ) then
	DBCS_afficherrare_new();
--end
	
	--DBCS_afficherminerai_minimap(snumregion);

	--DBCS_afficherminerai(snumregion);
	--DBCS_afficherplante(snumregion);
	--DBCS_affichercoffre(snumregion);

end

--/script ToggleDropDownMenu(1, nil, MiniMapBattlefieldDropDown, "MiniMapBattlefieldFrame", 10, -5);

--/script MiniMapBattlefieldFrame:Show();
--/script MiniMapBattlefieldFrame:Hide();

--/script DBCS_minimap_ressources_test_hide();
function DBCS_minimap_ressources_test_hide()

local i;

	for i = 1 , DBCS_listeicone_minerai_minimap_max do
		_G["DBcorps_MiniMap_fra_Minerai"..i]:Hide();
		_G["DBcorps_MiniMap_tex_Minerai"..i]:Hide();
	end
	for i = 1 , DBCS_listeicone_plante_minimap_max do
		_G["DBcorps_MiniMap_fra_plante"..i]:Hide();
		_G["DBcorps_MiniMap_tex_plante"..i]:Hide();
	end
	for i = 1 , DBCS_listeicone_coffre_minimap_max do
		_G["DBcorps_MiniMap_fra_coffre"..i]:Hide();
		_G["DBcorps_MiniMap_tex_coffre"..i]:Hide();
	end
	for i = 1 , DBCS_listeicone_banc_minimap_max do
		_G["DBcorps_MiniMap_fra_banc"..i]:Hide();
		_G["DBcorps_MiniMap_tex_banc"..i]:Hide();
	end
	for i = 1 , DBCS_listeicone_artefact_minimap_max do
		_G["DBcorps_MiniMap_fra_artefact"..i]:Hide();
		_G["DBcorps_MiniMap_tex_artefact"..i]:Hide();
	end
	for i = 1 , DBCS_listeicone_rare_minimap_max do
		_G["DBcorps_MiniMap_fra_rare"..i]:Hide();
		_G["DBcorps_MiniMap_tex_rare"..i]:Hide();
	end

end

--/script DBCS_minimap_ressources_test();
function DBCS_minimap_ressources_test()

if ( InCombatLockdown() ) then
	return nil;
end

local px;
local py;
local pxabs;
local pyabs;
local xscale;
local yscale;
local i,j;
local pxminimap;
local pyminimap;
local ixminimap;
local iyminimap;
local idist;
local ixdelta;
local iydelta;
local oframe;
local ochamp;
local bvalue;

--TOOLTIP
--FULLSCREEN_DIALOG
--FULLSCREEN
--DIALOG
--HIGH
--MEDIUM
--LOW
--BACKGROUND

	px,py = DBCS_position100_x(3,0);
	if ( DBCS_corps_screen_wow_build < 13316 ) then
		if ( DBCS_map_continent == 3 or DBCS_map_continent == 4 or DBCS_map_region == "125" or DBCS_map_region == "123" or DBCS_map_region == "124" or DBCS_map_region == "209" or DBCS_map_region == "217" or DBCS_map_region == "228" or DBCS_map_region == "229" or DBCS_map_region == "230" or DBCS_map_region == "231" ) then
--if ( DBCS_debug > 1 ) then
--TraceFrame:AddMessage("zone nouvelle");
--end
			pxabs = px * DBCS_memo_region_xoffset;
			pyabs = py * DBCS_memo_region_yoffset;
		else
--if ( DBCS_debug > 1 ) then
--TraceFrame:AddMessage("zone ancienne");
--end
			pxabs = px * DBCS_memo_region_scale + DBCS_memo_region_xoffset;
			pyabs = py * DBCS_memo_region_scale + DBCS_memo_region_yoffset;
		end
		if ( DBCS_map_region == "125" or DBCS_map_region == "123" or DBCS_map_region == "124" or DBCS_map_region == "209" or DBCS_map_region == "217" or DBCS_map_region == "228" or DBCS_map_region == "229" or DBCS_map_region == "230" or DBCS_map_region == "231" ) then
			xscale , yscale = DBCS_GetMapScale(3,DBCS_map_InCity,DBCS_map_Nivzoom);
		else
			xscale , yscale = DBCS_GetMapScale(DBCS_map_continent,DBCS_map_InCity,DBCS_map_Nivzoom);
		end
	else
		pxabs = px * DBCS_memo_region_xoffset;
		pyabs = py * DBCS_memo_region_yoffset;
		xscale , yscale = DBCS_GetMapScale(3,DBCS_map_InCity,DBCS_map_Nivzoom);
	end
	pxminimap = pxabs * xscale;
	pyminimap = pyabs * yscale;

	if ( DBCS_map_mine == 0 or DBCS_memo_region_xoffset == 0 ) then
		--if ( DBCS_map_region_refresh == DBCS_map_region ) then
		--else
			for i = 1 , DBCS_listeicone_minerai_minimap_max do
				_G["DBcorps_MiniMap_fra_Minerai"..i]:Hide();
				_G["DBcorps_MiniMap_tex_Minerai"..i]:Hide();
			end
		--end
	else
		if ( DBCS_listeicone_minerai_minimap_max > 0 ) then
			j = table.getn(DBCS_listeicone_minerai);
			if ( j == 0 ) then
				j = 1;
			end
			--if ( DBCS_map_region_refresh == DBCS_map_region ) then
			--else
				for i = j , DBCS_listeicone_minerai_minimap_max do
					_G["DBcorps_MiniMap_fra_Minerai"..i]:Hide();
					_G["DBcorps_MiniMap_tex_Minerai"..i]:Hide();
				end
			--end
		end
--if ( DBCS_debug > 1 ) then
--TraceFrame:AddMessage("les "..table.getn(DBCS_listeicone_minerai).." minerais");
--/script DEFAULT_CHAT_FRAME:AddMessage("les "..table.getn(DBCS_listeicone_minerai).." minerais");
--end
		for i = 1 , table.getn(DBCS_listeicone_minerai) do
			ixminimap = DBCS_listeicone_minerai[i].xabs * xscale;
			iyminimap = DBCS_listeicone_minerai[i].yabs * yscale;
			idist,ixdelta,iydelta = DBCS_Distance(pxminimap,pyminimap,ixminimap,iyminimap);
			if ( i > DBCS_listeicone_minerai_minimap_max ) then
				oframe = CreateFrame("Button","DBcorps_MiniMap_fra_Minerai"..i,Minimap);
				oframe:Hide();
				oframe:SetWidth(12);
				oframe:SetHeight(12);
				oframe:CreateTexture("DBcorps_MiniMap_tex_Minerai"..i);
				DBCS_listeicone_minerai_minimap_max = i;
				oframe:SetScript("OnEnter",DBcorps_MiniMap_fra_OnEnter);
				oframe:SetScript("OnLeave",DBcorps_MiniMap_fra_OnLeave);
				oframe:SetFrameLevel(Minimap:GetFrameLevel() + 1);
				oframe:SetFrameStrata("LOW");
				ochamp = _G["DBcorps_MiniMap_tex_Minerai"..i];
				ochamp:Hide();
				ochamp:SetHeight(12);
				ochamp:SetWidth(12);
				ochamp:SetPoint("CENTER",0,0);
			else
				oframe = _G["DBcorps_MiniMap_fra_Minerai"..i];
				ochamp = _G["DBcorps_MiniMap_tex_Minerai"..i];
			end
			oframe.toolTip = DBCS_listeicone_minerai[i].tooltip;
			ochamp:SetTexture("Interface\\Addons\\DBcorps\\Icons\\minerai");
			--if ( idist/100 < 59 ) then 
			if ( ( DBCS_debug < 2 and idist/100 < 59 ) or ( DBCS_debug > 1 and idist/100 < 159 ) ) then 
				oframe:SetPoint("CENTER",Minimap,"CENTER",ixdelta/100,-iydelta/100);
				if ( xscale == 0 ) then
					ochamp:Hide();
					oframe:Hide();
				else
					ochamp:Show();
					oframe:Show();
				end
			else
				ochamp:Hide();
				oframe:Hide();
			end
		end
	end
	if ( DBCS_map_plante == 0 or DBCS_memo_region_xoffset == 0 ) then
		--if ( DBCS_map_region_refresh == DBCS_map_region ) then
		--else
			for i = 1 , DBCS_listeicone_plante_minimap_max do
				_G["DBcorps_MiniMap_fra_plante"..i]:Hide();
				_G["DBcorps_MiniMap_tex_plante"..i]:Hide();
			end
		--end
	else
		if ( DBCS_listeicone_plante_minimap_max > 0 ) then
			j = table.getn(DBCS_listeicone_plante);
			if ( j == 0 ) then
				j = 1;
			end
			--if ( DBCS_map_region_refresh == DBCS_map_region ) then
			--else
				for i = j , DBCS_listeicone_plante_minimap_max do
					_G["DBcorps_MiniMap_fra_plante"..i]:Hide();
					_G["DBcorps_MiniMap_tex_plante"..i]:Hide();
				end
			--end
		end
		for i = 1 , table.getn(DBCS_listeicone_plante) do
			ixminimap = DBCS_listeicone_plante[i].xabs * xscale;
			iyminimap = DBCS_listeicone_plante[i].yabs * yscale;
			idist,ixdelta,iydelta = DBCS_Distance(pxminimap,pyminimap,ixminimap,iyminimap);
			if ( i > DBCS_listeicone_plante_minimap_max ) then
				oframe = CreateFrame("Button","DBcorps_MiniMap_fra_plante"..i,Minimap);
				oframe:Hide();
				oframe:SetWidth(12);
				oframe:SetHeight(12);
				oframe:CreateTexture("DBcorps_MiniMap_tex_plante"..i);
				DBCS_listeicone_plante_minimap_max = i;
				oframe:SetScript("OnEnter",DBcorps_MiniMap_fra_OnEnter);
				oframe:SetScript("OnLeave",DBcorps_MiniMap_fra_OnLeave);
				oframe:SetFrameLevel(Minimap:GetFrameLevel() + 1);
				oframe:SetFrameStrata("LOW");
				ochamp = _G["DBcorps_MiniMap_tex_plante"..i];
				ochamp:Hide();
				ochamp:SetHeight(12);
				ochamp:SetWidth(12);
				ochamp:SetPoint("CENTER",0,0);
			else
				oframe = _G["DBcorps_MiniMap_fra_plante"..i];
				ochamp = _G["DBcorps_MiniMap_tex_plante"..i];
			end
			oframe.toolTip = DBCS_listeicone_plante[i].tooltip;
			ochamp:SetTexture("Interface\\Addons\\DBcorps\\Icons\\plante");
			if ( idist/100 < 59 ) then 
				oframe:SetPoint("CENTER",Minimap,"CENTER",ixdelta/100,-iydelta/100);
				if ( xscale == 0 ) then
					ochamp:Hide();
					oframe:Hide();
				else
					ochamp:Show();
					oframe:Show();
				end
			else
				ochamp:Hide();
				oframe:Hide();
			end
		end
	end
	if ( DBCS_map_coffre == 0 or DBCS_memo_region_xoffset == 0 ) then
	--if ( DBCS_map_coffre == 0 ) then
		--if ( DBCS_map_region_refresh == DBCS_map_region ) then
		--else
			for i = 1 , DBCS_listeicone_coffre_minimap_max do
				_G["DBcorps_MiniMap_fra_coffre"..i]:Hide();
				_G["DBcorps_MiniMap_tex_coffre"..i]:Hide();
			end
		--end
	else
		if ( DBCS_listeicone_coffre_minimap_max > 0 ) then
			j = table.getn(DBCS_listeicone_coffre);
			if ( j == 0 ) then
				j = 1;
			end
			--if ( DBCS_map_region_refresh == DBCS_map_region ) then
			--else
				for i = j , DBCS_listeicone_coffre_minimap_max do
					_G["DBcorps_MiniMap_fra_coffre"..i]:Hide();
					_G["DBcorps_MiniMap_tex_coffre"..i]:Hide();
				end
			--end
		end
		for i = 1 , table.getn(DBCS_listeicone_coffre) do
			ixminimap = DBCS_listeicone_coffre[i].xabs * xscale;
			iyminimap = DBCS_listeicone_coffre[i].yabs * yscale;
			idist,ixdelta,iydelta = DBCS_Distance(pxminimap,pyminimap,ixminimap,iyminimap);
			if ( i > DBCS_listeicone_coffre_minimap_max ) then
				oframe = CreateFrame("Button","DBcorps_MiniMap_fra_coffre"..i,Minimap);
				oframe:Hide();
				oframe:SetWidth(12);
				oframe:SetHeight(12);
				oframe:CreateTexture("DBcorps_MiniMap_tex_coffre"..i);
				DBCS_listeicone_coffre_minimap_max = i;
				oframe:SetScript("OnEnter",DBcorps_MiniMap_fra_OnEnter);
				oframe:SetScript("OnLeave",DBcorps_MiniMap_fra_OnLeave);
				oframe:SetFrameLevel(Minimap:GetFrameLevel() + 1);
				oframe:SetFrameStrata("LOW");
				ochamp = _G["DBcorps_MiniMap_tex_coffre"..i];
				ochamp:Hide();
				ochamp:SetHeight(12);
				ochamp:SetWidth(12);
				ochamp:SetPoint("CENTER",0,0);
			else
				oframe = _G["DBcorps_MiniMap_fra_coffre"..i];
				ochamp = _G["DBcorps_MiniMap_tex_coffre"..i];
			end
			oframe.toolTip = DBCS_listeicone_coffre[i].tooltip;
			ochamp:SetTexture("Interface\\Addons\\DBcorps\\Icons\\coffre");
--if ( DBCS_debug > 1 ) then
--TraceFrame:AddMessage("idist/100 = "..(idist/100));
--end
			if ( (idist/100) < 59 ) then 
				oframe:SetPoint("CENTER",Minimap,"CENTER",ixdelta/100,-iydelta/100);
				if ( xscale == 0 ) then
				--if ( DBCS_memo_region_xoffset == 0 ) then
					ochamp:Hide();
					oframe:Hide();
				else
					ochamp:Show();
					oframe:Show();
				end
			else
				ochamp:Hide();
				oframe:Hide();
			end
		end
	end
if ( DBCS_debug > 1 ) then
		if ( DBCS_listeicone_banc_minimap_max > 0 ) then
			j = table.getn(DBCS_listeicone_banc);
			if ( j == 0 ) then
				j = 1;
			end
			for i = j , DBCS_listeicone_banc_minimap_max do
				_G["DBcorps_MiniMap_fra_banc"..i]:Hide();
				_G["DBcorps_MiniMap_tex_banc"..i]:Hide();
			end
		end
		for i = 1 , table.getn(DBCS_listeicone_banc) do
			ixminimap = DBCS_listeicone_banc[i].xabs * xscale;
			iyminimap = DBCS_listeicone_banc[i].yabs * yscale;
			idist,ixdelta,iydelta = DBCS_Distance(pxminimap,pyminimap,ixminimap,iyminimap);
			if ( i > DBCS_listeicone_banc_minimap_max ) then
				oframe = CreateFrame("Button","DBcorps_MiniMap_fra_banc"..i,Minimap);
				oframe:Hide();
				oframe:SetWidth(12);
				oframe:SetHeight(12);
				oframe:CreateTexture("DBcorps_MiniMap_tex_banc"..i);
				DBCS_listeicone_banc_minimap_max = i;
				oframe:SetScript("OnEnter",DBcorps_MiniMap_fra_OnEnter);
				oframe:SetScript("OnLeave",DBcorps_MiniMap_fra_OnLeave);
				oframe:SetFrameLevel(Minimap:GetFrameLevel() + 1);
				oframe:SetFrameStrata("LOW");
				ochamp = _G["DBcorps_MiniMap_tex_banc"..i];
				ochamp:Hide();
				ochamp:SetHeight(12);
				ochamp:SetWidth(12);
				ochamp:SetPoint("CENTER",0,0);
			else
				oframe = _G["DBcorps_MiniMap_fra_banc"..i];
				ochamp = _G["DBcorps_MiniMap_tex_banc"..i];
			end
			oframe.toolTip = DBCS_listeicone_banc[i].tooltip;
			ochamp:SetTexture("Interface\\Addons\\DBcorps\\Icons\\coffre");
			if ( (idist/100) < 59 ) then 
				oframe:SetPoint("CENTER",Minimap,"CENTER",ixdelta/100,-iydelta/100);
				if ( xscale == 0 ) then
					ochamp:Hide();
					oframe:Hide();
				else
					ochamp:Show();
					oframe:Show();
				end
			else
				ochamp:Hide();
				oframe:Hide();
			end
		end
end
if ( ( DBCS_debug > 1 ) and ( 1 == 0 ) ) then
		if ( DBCS_listeicone_artefact_minimap_max > 0 ) then
			j = table.getn(DBCS_listeicone_artefact);
			if ( j == 0 ) then
				j = 1;
			end
			for i = j , DBCS_listeicone_artefact_minimap_max do
				_G["DBcorps_MiniMap_fra_artefact"..i]:Hide();
				_G["DBcorps_MiniMap_tex_artefact"..i]:Hide();
			end
		end
		for i = 1 , table.getn(DBCS_listeicone_artefact) do
			ixminimap = DBCS_listeicone_artefact[i].xabs * xscale;
			iyminimap = DBCS_listeicone_artefact[i].yabs * yscale;
			idist,ixdelta,iydelta = DBCS_Distance(pxminimap,pyminimap,ixminimap,iyminimap);
			if ( i > DBCS_listeicone_artefact_minimap_max ) then
				oframe = CreateFrame("Button","DBcorps_MiniMap_fra_artefact"..i,Minimap);
				oframe:Hide();
				oframe:SetWidth(12);
				oframe:SetHeight(12);
				oframe:CreateTexture("DBcorps_MiniMap_tex_artefact"..i);
				DBCS_listeicone_artefact_minimap_max = i;
				oframe:SetScript("OnEnter",DBcorps_MiniMap_fra_OnEnter);
				oframe:SetScript("OnLeave",DBcorps_MiniMap_fra_OnLeave);
				oframe:SetFrameLevel(Minimap:GetFrameLevel() + 1);
				oframe:SetFrameStrata("LOW");
				ochamp = _G["DBcorps_MiniMap_tex_artefact"..i];
				ochamp:Hide();
				ochamp:SetHeight(12);
				ochamp:SetWidth(12);
				ochamp:SetPoint("CENTER",0,0);
			else
				oframe = _G["DBcorps_MiniMap_fra_artefact"..i];
				ochamp = _G["DBcorps_MiniMap_tex_artefact"..i];
			end
			oframe.toolTip = DBCS_listeicone_artefact[i].tooltip;
			ochamp:SetTexture("Interface\\Addons\\DBcorps\\Icons\\coffre");
			if ( (idist/100) < 59 ) then 
				oframe:SetPoint("CENTER",Minimap,"CENTER",ixdelta/100,-iydelta/100);
				if ( xscale == 0 ) then
					ochamp:Hide();
					oframe:Hide();
				else
					ochamp:Show();
					oframe:Show();
				end
			else
				ochamp:Hide();
				oframe:Hide();
			end
		end
end
--if ( DBCS_debug > 1 ) then
		if ( DBCS_listeicone_rare_minimap_max > 0 ) then
			j = table.getn(DBCS_listeicone_rare);
			if ( j == 0 ) then
				j = 1;
			end
			for i = j , DBCS_listeicone_rare_minimap_max do
				_G["DBcorps_MiniMap_fra_rare"..i]:Hide();
				_G["DBcorps_MiniMap_tex_rare"..i]:Hide();
			end
		end
		for i = 1 , table.getn(DBCS_listeicone_rare) do
			ixminimap = DBCS_listeicone_rare[i].xabs * xscale;
			iyminimap = DBCS_listeicone_rare[i].yabs * yscale;
			idist,ixdelta,iydelta = DBCS_Distance(pxminimap,pyminimap,ixminimap,iyminimap);
			if ( i > DBCS_listeicone_rare_minimap_max ) then
				oframe = CreateFrame("Button","DBcorps_MiniMap_fra_rare"..i,Minimap);
				oframe:Hide();
				oframe:SetWidth(12);
				oframe:SetHeight(12);
				oframe:CreateTexture("DBcorps_MiniMap_tex_rare"..i);
				DBCS_listeicone_rare_minimap_max = i;
				oframe:SetScript("OnEnter",DBcorps_MiniMap_fra_OnEnter);
				oframe:SetScript("OnLeave",DBcorps_MiniMap_fra_OnLeave);
				oframe:SetFrameLevel(Minimap:GetFrameLevel() + 1);
				oframe:SetFrameStrata("LOW");
				ochamp = _G["DBcorps_MiniMap_tex_rare"..i];
				ochamp:Hide();
				ochamp:SetHeight(12);
				ochamp:SetWidth(12);
				ochamp:SetPoint("CENTER",0,0);
			else
				oframe = _G["DBcorps_MiniMap_fra_rare"..i];
				ochamp = _G["DBcorps_MiniMap_tex_rare"..i];
			end
			oframe.toolTip = DBCS_listeicone_rare[i].tooltip;
			ochamp:SetTexture("Interface\\Addons\\DBcorps\\Icons\\coffre");
			if ( (idist/100) < 59 ) then 
				oframe:SetPoint("CENTER",Minimap,"CENTER",ixdelta/100,-iydelta/100);
				if ( xscale == 0 ) then
					ochamp:Hide();
					oframe:Hide();
				else
					ochamp:Show();
					oframe:Show();
				end
			else
				ochamp:Hide();
				oframe:Hide();
			end
		end
--end
	DBCS_map_region_refresh = DBCS_map_region;

end

function DBCS_Pythag(dx, dy)	-- pris de gatherer
	local d = math.sqrt(dx*dx + dy*dy); -- (a*a) is usually computationally faster than math.pow(a,2)
	return d;
end

function DBCS_Distance(originX, originY, targetX, targetY)	-- pris de gatherer
	local dx = (targetX - originX);
	local dy = (targetY - originY);
	local d = DBCS_Pythag(dx, dy);
	return d, dx, dy;
end

--	elseif (event == "MINIMAP_UPDATE_ZOOM") then
--		GatherMap_InCity = isMinimapInCity();

function DBCS_isMinimapInCity()
-- prise de gatherer

	local tempzoom = 0;
	local inCity = false;

	if (GetCVar("minimapZoom") == GetCVar("minimapInsideZoom")) then
		if (GetCVar("minimapInsideZoom")+0 >= 3) then 
			Minimap:SetZoom(Minimap:GetZoom() - 1);
			tempzoom = 1;
		else
			Minimap:SetZoom(Minimap:GetZoom() + 1);
			tempzoom = -1;
		end
	end
	if (GetCVar("minimapInsideZoom")+0 == Minimap:GetZoom()) then
		inCity = true;
	end
	Minimap:SetZoom(Minimap:GetZoom() + tempzoom);
	
	return inCity;
	
end

function DBCS_GetMapScale(continent, inCity, zoomLevel)

	if ((continent == nil) or (zoomLevel == nil)) then
		return 0,0;
	end

	if ((not DBCS_scales) or 
	(not DBCS_scales[continent]) or 
	(not DBCS_scales[continent].scales) or 
	(not DBCS_scales[continent].scales[zoomLevel]) or 
	(not DBCS_scales[continent].scales[zoomLevel].xscale) or
	(not DBCS_scales[continent].scales[zoomLevel].yscale)) then
		return 0,0;
	end

	local scaleX = DBCS_scales[continent].scales[zoomLevel].xscale;
	local scaleY = DBCS_scales[continent].scales[zoomLevel].yscale;

	if (inCity == true) then

		local cityScale = DBCS_scales.cityZoom[zoomLevel];

		scaleX = scaleX * cityScale;
		scaleY = scaleY * cityScale;

	end
	
	return scaleX, scaleY;

end

function DBCS_guilde_loc()

local itime;
local sregion = "";
local sregion_map = "";
local ix = 0;
local iy = 0;
local icontinent;
local izone;
local i;
local j;

	itime = GetTime();
	if ( itime - DBCS_guilde_time > 1 ) then
		if ( IsInGuild() ) then
		else
			DBCS_guilde_time = GetTime();
			return nil;
		end
--TraceFrame:AddMessage("itime = "..itime);
		if ( WorldMapFrame:IsShown() ) then
			DBCS_guilde_time = GetTime();
			return nil;
--			icontinent = GetCurrentMapContinent();
----TraceFrame:AddMessage("icontinent = "..icontinent);
--			if ( icontinent < 0 ) then
--				DBCS_guilde_time = GetTime();
--				return nil;
--			end
--			izone = GetCurrentMapZone();
--			if ( izone > 0 ) then
--				if ( DBCS_RegionData[icontinent] ) then
--					j = 0;
--					for i = 1 , table.getn(DBCS_RegionData[icontinent]) do
--						if ( DBCS_RegionData[icontinent][i].nummap == izone ) then
--							j = DBCS_RegionData[icontinent][i].index;
--						end
--					end
--					if ( j > 0 ) then
--						sregion_map = ""..tostring(icontinent);
--						if ( j < 10 ) then
--							sregion_map = sregion_map.."0";
--						end
--						sregion_map = sregion_map..tostring(j);
--					end
--				end
--				sregion = sregion_map;
--			else
--				sregion_map = ""..tostring(icontinent);
--				sregion_map = sregion_map.."00";
--				sregion = sregion_map;
--			end
--			--if ( sregion == sregion_map ) then
--			ix,iy = DBCS_position100(0);
--			--end
----TraceFrame:AddMessage("itime = "..itime.." , sregion = "..sregion.." , ix = "..ix.." , iy = "..iy);
		else
			ix,iy = DBCS_position100(1);
			sregion = DBCS_Region_liste_code_region_courante_new2();	--DBCS_numregionbyname(GetRealZoneText());
		end
		if ( DBCS_guilde_region == sregion and DBCS_guilde_x == ix and DBCS_guilde_y == iy ) then
		else
			DBCS_guilde_region = sregion;
			DBCS_guilde_x = ix;
			DBCS_guilde_y = iy;
--if ( DBCS_debug > 1 ) then
--	TraceFrame:AddMessage("itime = "..itime.." , DBCS_guilde_region = "..DBCS_guilde_region.." , DBCS_guilde_x = "..DBCS_guilde_x.." , DBCS_guilde_y = "..DBCS_guilde_y);
--end
			SendAddonMessage("DBCS","@ADBCS@xxXX@XLOC@"..DBCS_guilde_region.."@"..DBCS_guilde_x.."@"..DBCS_guilde_y.."@","GUILD");
			--DBCS_SendChatMessage("@ADBCS@xxXX@XLOC@"..DBCS_guilde_region.."@"..DBCS_guilde_x.."@"..DBCS_guilde_y.."@","CHANNEL",DBCS_language,DBCS_CMS_numcanalCMS);
----	SendAddonMessage( "prefix", "message" , "PARTY/RAID/GUILD/BATTLEGROUND" )	prefix+message = 254 octets max
		end
		DBCS_guilde_time = GetTime();
	end

end

local bDBCS_maj_minimap_encombat = false;
--/script DBCS_map_brefresh = false;
function DBCS_maj_minimap()

local itime;
local sTEST;
local DBCS_map_region_test;
local DBCS_map_continent_test;
local DBCS_map_InCity_test;
local DBCS_map_Nivzoom_test;
local DBCS_map_x_test;
local DBCS_map_y_test;
local DBCS_map_mine_test;
local i;
local b_cache_mines_bougepas = false;

if ( InCombatLockdown() ) then
	if ( bDBCS_maj_minimap_encombat == false ) then
		for i = 1 , DBCS_listeicone_minerai_minimap_max do
			_G["DBcorps_MiniMap_fra_Minerai"..i]:Hide();
			_G["DBcorps_MiniMap_tex_Minerai"..i]:Hide();
		end
		for i = 1 , DBCS_listeicone_plante_minimap_max do
			_G["DBcorps_MiniMap_fra_plante"..i]:Hide();
			_G["DBcorps_MiniMap_tex_plante"..i]:Hide();
		end
		for i = 1 , DBCS_listeicone_coffre_minimap_max do
			_G["DBcorps_MiniMap_fra_coffre"..i]:Hide();
			_G["DBcorps_MiniMap_tex_coffre"..i]:Hide();
		end
	end
	bDBCS_maj_minimap_encombat = true;
	return nil;
end

	bDBCS_maj_minimap_encombat = false;
	itime = GetTime();
--	sTEST = "time";
	if ( itime - DBCS_map_time > DBCS_map_refresh and DBCS_map_brefresh == true ) then
--TraceFrame:AddMessage("itime = "..itime.." et DBCS_map_time = "..DBCS_map_time);
		if ( DBCS_map_redraw == false ) then
			DBCS_map_region_test = DBCS_Region_liste_code_region_courante_new2();	--DBCS_numregionbyname(GetRealZoneText());
			if ( DBCS_map_region == DBCS_map_region_test ) then
				DBCS_map_continent_test , _ = DBCS_Region_Region_Code(DBCS_map_region_test);	--DBCS_Region_Region_Code	DB_indexregionbynum
				if ( DBCS_map_continent == DBCS_map_continent_test ) then
					DBCS_map_InCity_test = DBCS_isMinimapInCity();
					if ( DBCS_map_InCity == DBCS_map_InCity_test ) then
						DBCS_map_Nivzoom_test = Minimap:GetZoom();
						if ( DBCS_map_Nivzoom == DBCS_map_Nivzoom_test ) then
							DBCS_map_x_test,DBCS_map_y_test = DBCS_position100_x(3,0);
							if ( DBCS_map_x == DBCS_map_x_test ) then
								if ( DBCS_map_y == DBCS_map_y_test ) then
									b_cache_mines_bougepas = true;
									DBCS_map_mine_test = DBcorps_Worldmap_Frame_Mines_Mine:GetChecked();
									if ( DBCS_map_mine_test == nil ) then
										DBCS_map_mine_test = 0;
									end
									if ( DBCS_map_mine == DBCS_map_mine_test ) then
										DBCS_map_plante_test = DBcorps_Worldmap_Frame_Plantes_Plante:GetChecked();
										if ( DBCS_map_plante_test == nil ) then
											DBCS_map_plante_test = 0;
										end
										if ( DBCS_map_plante == DBCS_map_plante_test ) then
											DBCS_map_coffre_test = DBcorps_Worldmap_Frame_Coffres_Coffre:GetChecked();
											if ( DBCS_map_coffre_test == nil ) then
												DBCS_map_coffre_test = 0;
											end
											if ( DBCS_map_coffre == DBCS_map_coffre_test ) then
											else
												DBCS_map_redraw = true;
												DBCS_map_region_refresh = "";
--												sTEST = "coffre";
											end
										else
											DBCS_map_redraw = true;
											DBCS_map_region_refresh = "";
--											sTEST = "plante";
										end
									else
										DBCS_map_redraw = true;
										DBCS_map_region_refresh = "";
--										sTEST = "mine";
									end
								else
									DBCS_map_redraw = true;
--									sTEST = "y";
								end
							else
								DBCS_map_redraw = true;
--								sTEST = "x";
							end
						else
							DBCS_map_redraw = true;
--							sTEST = "zoom";
						end
					else
						DBCS_map_redraw = true;
--						sTEST = "incity";
					end
				else
					DBCS_map_redraw = true;
--					sTEST = "continent";
				end
			else
				DBCS_map_redraw = true;
--				sTEST = "region";
			end
		end
		if ( DBCS_map_redraw == true ) then
--if ( DBCS_debug > 1 ) then
--TraceFrame:AddMessage("je redessine la minimap. : "..sTEST);
--end
			DBCS_map_region = DBCS_Region_liste_code_region_courante_new2();	--DBCS_numregionbyname(GetRealZoneText());
--if ( DBCS_debug > 1 ) then
--TraceFrame:AddMessage("4 GetRealZoneText() : "..GetRealZoneText());
--end
--if ( DBCS_debug > 1 ) then
--TraceFrame:AddMessage("5 DBCS_map_region : "..DBCS_map_region);
--end
			DBCS_map_continent , _ = DBCS_Region_Region_Code(DBCS_map_region);
			DBCS_map_InCity = DBCS_isMinimapInCity();
			DBCS_map_Nivzoom = Minimap:GetZoom();
			DBCS_map_x,DBCS_map_y = DBCS_position100_x(3,0);
			DBCS_map_mine = DBcorps_Worldmap_Frame_Mines_Mine:GetChecked();
			if ( DBCS_map_mine == nil ) then
				DBCS_map_mine = 0;
			end
			DBCS_map_plante = DBcorps_Worldmap_Frame_Plantes_Plante:GetChecked();
			if ( DBCS_map_plante == nil ) then
				DBCS_map_plante = 0;
			end
			DBCS_map_coffre = DBcorps_Worldmap_Frame_Coffres_Coffre:GetChecked();
			if ( DBCS_map_coffre == nil ) then
				DBCS_map_coffre = 0;
			end

--			if ( DBCS_map_continent > 0 ) then
				DBCS_memo_region(DBCS_map_region);
				DBCS_minimap_ressources_test();
--			end

			DBCS_map_redraw = false;
		else
			if ( b_cache_mines_bougepas == true ) then
				for i = 1 , DBCS_listeicone_minerai_minimap_max do
					_G["DBcorps_MiniMap_fra_Minerai"..i]:Hide();
					_G["DBcorps_MiniMap_tex_Minerai"..i]:Hide();
				end
				--for i = 1 , DBCS_listeicone_artefact_minimap_max do
				--	_G["DBcorps_MiniMap_fra_artefact"..i]:Hide();
				--	_G["DBcorps_MiniMap_tex_artefact"..i]:Hide();
				--end
				--for i = 1 , DBCS_listeicone_rare_minimap_max do
				--	_G["DBcorps_MiniMap_fra_rare"..i]:Hide();
				--	_G["DBcorps_MiniMap_tex_rare"..i]:Hide();
				--end
			end
		end
		DBCS_map_time = GetTime();
	end

end

--/script DBCS_test_pair();
function DBCS_test_pair()

local i,j,k;
local tablo = { ["a"] = 3 , ["b"] = 2 , ["c"] = 1  };

	for i, j in pairs(tablo) do
if ( DBCS_debug > 1 ) then
TraceFrame:AddMessage("tablo : i = "..i.." : j = "..j.." : tablo["..i.."] = "..tablo[i]);
end
	end

end

--	<Button name="DBcorpsFrame_TabButtonTemplate" virtual="true">
--		<Size>
--			<AbsDimension x="115" y="32"/>
--		</Size>
--		<Layers>
--			<Layer level="BACKGROUND">
--				<Texture name="$parentLeftDisabled" file="Interface\PaperDollInfoFrame\UI-Character-ActiveTab">
--					<Size>
--						<AbsDimension x="20" y="32"/>
--					</Size>
--					<Anchors>
--						<Anchor point="TOPLEFT">
--							<Offset>
--								<AbsDimension x="0" y="5"/>
--        						</Offset>
--        					</Anchor>
--        				</Anchors>
--					<TexCoords left="0" right="0.15625" top="0" bottom="1.0"/>
--        			</Texture>
--				<Texture name="$parentMiddleDisabled" file="Interface\PaperDollInfoFrame\UI-Character-ActiveTab">
--        				<Size>
--        					<AbsDimension x="88" y="32"/>
--        				</Size>
--        				<Anchors>
--        					<Anchor point="LEFT" relativeTo="$parentLeftDisabled" relativePoint="RIGHT"/>
--        				</Anchors>
--					<TexCoords left="0.15625" right="0.84375" top="0" bottom="1.0"/>
--        			</Texture>
--				<Texture name="$parentRightDisabled" file="Interface\PaperDollInfoFrame\UI-Character-ActiveTab">
--        				<Size>
--        					<AbsDimension x="20" y="32"/>
--        				</Size>
--        				<Anchors>
--        					<Anchor point="LEFT" relativeTo="$parentMiddleDisabled" relativePoint="RIGHT"/>
--        				</Anchors>
--					<TexCoords left="0.84375" right="1.0" top="0" bottom="1.0"/>
--        			</Texture>
--				<Texture name="$parentLeft" file="Interface\PaperDollInfoFrame\UI-Character-InActiveTab">
--        				<Size>
--        					<AbsDimension x="20" y="32"/>
--        				</Size>
--        				<Anchors>
--        					<Anchor point="TOPLEFT"/>
--        				</Anchors>
--					<TexCoords left="0" right="0.15625" top="0" bottom="1.0"/>
--        		</Texture>
--				<Texture name="$parentMiddle" file="Interface\PaperDollInfoFrame\UI-Character-InActiveTab">
--        				<Size>
--        				<AbsDimension x="88" y="32"/>
--        				</Size>
--        				<Anchors>
--        					<Anchor point="LEFT" relativeTo="$parentLeft" relativePoint="RIGHT"/>
--        				</Anchors>
--					<TexCoords left="0.15625" right="0.84375" top="0" bottom="1.0"/>
--        		</Texture>
--				<Texture name="$parentRight" file="Interface\PaperDollInfoFrame\UI-Character-InActiveTab">
--        				<Size>
--        					<AbsDimension x="20" y="32"/>
--        				</Size>
--        				<Anchors>
--        					<Anchor point="LEFT" relativeTo="$parentMiddle" relativePoint="RIGHT"/>
--        				</Anchors>
--					<TexCoords left="0.84375" right="1.0" top="0" bottom="1.0"/>
--        		</Texture>
--        	</Layer>
--        </Layers>
--		<Scripts>
--			<OnLoad>
--				this:SetFrameLevel(this:GetFrameLevel() + 4);
--			</OnLoad>
--			<OnClick>
--				PanelTemplates_Tab_OnClick(DBcorpsFrame);
--				DBcorpsFrameTab_OnClick();
--			</OnClick>
--			<OnShow>
--				PanelTemplates_TabResize(0);
--				_G[this:GetName().."HighlightTexture"]:SetWidth(this:GetTextWidth() + 30);
--			</OnShow>
--		</Scripts>
--		<NormalText name="$parentText" inherits="GameFontNormalSmall">
--			<Anchors>
--				<Anchor point="CENTER">
--					<Offset>
--						<AbsDimension x="0" y="2"/>
--					</Offset>
--				</Anchor>
--			</Anchors>
--		</NormalText>
--		<HighlightText name="$parentHighlightText" inherits="GameFontHighlightSmall">
--			<Anchors>
--				<Anchor point="CENTER">
--					<Offset>
--						<AbsDimension x="0" y="2"/>
--					</Offset>
--				</Anchor>
--			</Anchors>
--		</HighlightText>
--		<DisabledText name="$parentDisabledText" inherits="GameFontHighlightSmall">
--			<Anchors>
--				<Anchor point="CENTER">
--					<Offset>
--						<AbsDimension x="0" y="2"/>
--					</Offset>
--				</Anchor>
--			</Anchors>
--		</DisabledText>
--		<HighlightTexture name="$parentHighlightTexture" file="Interface\PaperDollInfoFrame\UI-Character-Tab-Highlight" alphaMode="ADD">
--			<Anchors>
--				<Anchor point="LEFT">
--					<Offset>
--						<AbsDimension x="10" y="2"/>
--					</Offset>
--				</Anchor>
--				<Anchor point="RIGHT">
--					<Offset>
--						<AbsDimension x="-10" y="2"/>
--					</Offset>
--				</Anchor>
--			</Anchors>
--		</HighlightTexture>
--	</Button>

--	<Button name="DBcorpsFrame_ColumnHeaderTemplate" virtual="true">
--		<Size>
--			<AbsDimension x="10" y="24"/>
--		</Size>
--		<Layers>
--			<Layer level="BACKGROUND">
--				<Texture name="$parentLeft" file="Interface\FriendsFrame\WhoFrame-ColumnTabs">
--					<Size>
--						<AbsDimension x="5" y="24"/>
--					</Size>
--					<Anchors>
--						<Anchor point="TOPLEFT"/>
--					</Anchors>
--					<TexCoords left="0" right="0.078125" top="0" bottom="0.75"/>
--				</Texture>
--				<Texture name="$parentMiddle" file="Interface\FriendsFrame\WhoFrame-ColumnTabs">
--					<Size>
--						<AbsDimension x="53" y="24"/>
--					</Size>
--					<Anchors>
--						<Anchor point="LEFT" relativeTo="$parentLeft" relativePoint="RIGHT"/>
--					</Anchors>
--					<TexCoords left="0.078125" right="0.90625" top="0" bottom="0.75"/>
--				</Texture>
--				<Texture name="$parentRight" file="Interface\FriendsFrame\WhoFrame-ColumnTabs">
--					<Size>
--						<AbsDimension x="4" y="24"/>
--					</Size>
--					<Anchors>
--						<Anchor point="LEFT" relativeTo="$parentMiddle" relativePoint="RIGHT"/>
--					</Anchors>
--					<TexCoords left="0.90625" right="0.96875" top="0" bottom="0.75"/>
--				</Texture>
--			</Layer>
--		</Layers>
--		<Scripts>
--			<OnClick>
--			</OnClick>
--		</Scripts>
--		<NormalText inherits="GameFontHighlightSmall">
--			<Anchors>
--				<Anchor point="LEFT">
--					<Offset>
--						<AbsDimension x="8" y="0"/>
--					</Offset>
--				</Anchor>
--			</Anchors>
--		</NormalText>
--	</Button>
	
--		<NormalText name="$parent_Text" inherits="GameFontHighlightSmall">
--		<NormalText name="$parent_Text">

--/script DBCS_recursive_frame("WorldFrame");
--/script DBCS_recursive_frame("Minimap")
--/script DBCS_recursive_frame("MinimapCluster")
--/script DBCS_recursive_frame("UIParent");
--/script DBCS_recursive_frame("DBcorpsFrame_Tooltip1")
--/script DBCS_recursive_frame("GameTooltipTemplate")
--/script _G["ClassTrainerTrainButton"]:Show();
--/script DBCS_recursive_frame("GameTooltipTemplate");
--/script DBCS_recursive_frame("ItemRef");
--/script DBCS_recursive_frame("Item");
--/script DBCS_recursive_frame("ItemRefTooltip");
--/script DBCS_recursive_frame("DBcorpsFrame_Tooltip1");
--/script DBCS_recursive_frame("");
--/script DBCS_recursive_frame("GameTooltip");
--/script DBCS_recursive_frame("DBcorpsFrame");
--/script DBCS_recursive_frame("QuestWatchFrame");

function DBCS_recursive_frame(snomframe)

--	nextFrame = EnumerateFrames({currentFrame})

	if ( snomframe == nil ) then
		return;
	end

	if ( _G[snomframe]:GetName() ) then
		TraceFrame:AddMessage(_G[snomframe]:GetName());
	end
	
	--EnumerateFrames(currentFrame);
	local frame = EnumerateFrames(_G[snomframe]);
	while frame do
		TraceFrame:AddMessage("    "..(frame:GetName() or ""));
		frame = EnumerateFrames(frame);
	end

	local kids = { _G[snomframe]:GetChildren() };
	local child;

	--for _, child in ipairs(kids) do
	--	TraceFrame:AddMessage("    "..(child:GetName() or ""));
	--	--DBCS_recursive_frame(child:GetName());
	--end

end

--/script DBCS_liste_children(WorldFrame);
--/script DBCS_liste_children(WorldMapBlobFrame);
--/script DBCS_liste_children(Minimap);
--/script DBCS_liste_children(MinimapCluster);
--/script DBCS_liste_children(UIParent);
--/script DBCS_liste_children(TargetFrame);
--/script DBCS_liste_children(UIParent:GetParent())
--/script DBCS_liste_children(GameTooltip);
--/script DBCS_liste_children(DBcorpsFrame_Tooltip3);
--/script DBCS_liste_children(ItemRefTooltip);
--/script DBCS_liste_children(DBCS_Model_Viewer_DressUpFrameModel);
--/script DBCS_liste_children(DBCS_Model_Viewer_DressUpFrame_Target_Model);


--/script DEFAULT_CHAT_FRAME:AddMessage(DBcorpsFrame_Tooltip3MoneyFrame1.staticMoney);

local iuserdata = 0;

function DBCS_liste_children(frame,secart)

local frame2;
--local sname;
local i;
--local schildren;
local tchildren = nil;
local tregion = nil;
local smodel;
--local tablo;
local si;
local sval;
local si2;
local sval2;
local stexte;
local x,y,z;
local sval3;
local si4;
local sval4;
local imin;
local imax;

	if ( secart == nil ) then
		secart = "";
	end
	if ( frame and frame:GetName() ) then
		TraceFrame:AddMessage(secart.." frame "..frame:GetName());
	else
		TraceFrame:AddMessage(secart.." 1 frame");
	end
	if ( frame ) then
		TraceFrame:AddMessage(secart.." type objet : "..frame:GetObjectType());
		for si, sval in pairs(frame) do
			TraceFrame:AddMessage(secart.."si = "..si..", type = "..type(sval));
			if ( type(sval) == "string" ) then
				TraceFrame:AddMessage(secart.."si = "..si..", sval = "..sval);
			elseif ( type(sval) == "number" ) then
				TraceFrame:AddMessage(secart.."si = "..si..", sval = "..sval);
			--elseif ( type(sval) == "userdata" ) then
				--DBCS_liste_children(sval,secart.."----|");
				--for si2, sval2 in pairs(sval) do
				--	TraceFrame:AddMessage("si2 = "..si2..", type2 = "..type(sval2));
				--	if ( type(sval2) == "string" ) then
				--		TraceFrame:AddMessage("si2 = "..si2..", sval2 = "..sval2);
				--	elseif ( type(sval2) == "number" ) then
				--		TraceFrame:AddMessage("si2 = "..si2..", sval2 = "..sval2);
				--	end
				--end
			elseif ( type(sval) == "table" ) then
				for si2, sval2 in pairs(sval) do
					TraceFrame:AddMessage(secart.."si2 = "..si2..", type2 = "..type(sval2));
					if ( type(sval2) == "string" ) then
						TraceFrame:AddMessage(secart.."si2 = "..si2..", sval2 = "..sval2);
					elseif ( type(sval2) == "number" ) then
						TraceFrame:AddMessage(secart.."si2 = "..si2..", sval2 = "..sval2);
					end
				end
			elseif ( type(sval) == "userdata" ) then
				sval3 = getmetatable(frame,sval);
				for si2, sval2 in pairs(sval3) do
					TraceFrame:AddMessage(secart.."si2 = "..si2..", type2 = "..type(sval2));
					if ( type(sval2) == "string" ) then
						TraceFrame:AddMessage(secart.."si2 = "..si2..", sval2 = "..sval2);
					elseif ( type(sval2) == "number" ) then
						TraceFrame:AddMessage(secart.."si2 = "..si2..", sval2 = "..sval2);
					elseif ( type(sval2) == "table" ) then
						for si4, sval4 in pairs(sval2) do
							TraceFrame:AddMessage(secart.."si4 = "..si4..", type4 = "..type(sval4));
							if ( type(sval4) == "string" ) then
								TraceFrame:AddMessage(secart.."si4 = "..si4..", sval4 = "..sval4);
							elseif ( type(sval4) == "number" ) then
								TraceFrame:AddMessage(secart.."si7 = "..si4..", sval4 = "..sval4);
							elseif ( type(sval4) == "function" ) then
								if ( 1 == 0 ) then
								--elseif ( si4 == "GetID" ) then
								--	imin = frame:GetID();
								--	TraceFrame:AddMessage(secart.."ID = "..imin);
								elseif ( si4 == "GetMinMaxValues" ) then
									imin, imax = frame:GetMinMaxValues();
									TraceFrame:AddMessage(secart.."min = "..imin..", max = "..imax);
								end
							end
						end
					end
				end
			else
			--iuserdata = iuserdata + 1;
			--DBCS_titre_pet_locs[iuserdata] = sval;
			--TraceFrame:AddMessage("si = "..si);	--..", sval = "..sval);
			end
		end
	else
		return nil;
	end
	if ( frame ) then
	--if ( frame and frame:GetRegions() ) then
		tregion = { frame:GetRegions() };
	--end
	else
		tregion = nil;
	end
	if ( tregion ) then
		--for i = 1, select("#", frame:GetRegions()) do
		for i, frame2 in pairs(tregion) do
			--frame2 = select(i, frame:GetRegions());
			frame2 = tregion[i];
			if ( frame2 ) then
				TraceFrame:AddMessage(secart.." region "..i.." = "..frame2:GetObjectType());
				if ( frame2:GetObjectType() == "Texture" ) then
					stexture = frame2:GetTexture();
					if ( stexture ) then
						TraceFrame:AddMessage(secart.." texture = "..stexture);
					else
						TraceFrame:AddMessage(secart.." texture introuvable");
					end
				elseif ( frame2:GetObjectType() == "FontString" ) then
					stexte = frame2:GetText();
					if ( stexte ) then
						TraceFrame:AddMessage(secart.." texte = "..stexte);
					else
						TraceFrame:AddMessage(secart.." texte = -----");
					end
				end
			else
				TraceFrame:AddMessage(secart.." region "..i);
			end
			if ( frame2 and frame2:GetName() ) then
				TraceFrame:AddMessage(secart.." region "..frame2:GetName());
			end
			--DBCS_liste_children(frame2,secart.."----|");
		end
	end
	--schildren = {frame:GetChildren()};
	if ( frame ) then
		tchildren = { frame:GetChildren() };
	else
		tchildren = nil;
	end
	--if ( frame:GetChildren() ) then
	if ( tchildren ) then
		--for i = 1, select("#", frame:GetChildren()) do
		for i, _ in pairs(tchildren) do
			--frame2 = select(i, frame:GetChildren());
			frame2 = tchildren[i];
			if ( frame2 ) then
				TraceFrame:AddMessage(secart.." children "..i.." = "..frame2:GetObjectType());
				if ( frame2:GetObjectType() == "Model" ) then
					smodel = frame2:GetModel();
					if ( smodel ) then
						if ( type(smodel) == "string" ) then
							TraceFrame:AddMessage(secart.." model = "..smodel);
						else
							TraceFrame:AddMessage(secart.." model = "..type(smodel));
						end
					else
						TraceFrame:AddMessage(secart.." model introuvable");
					end
					x,y,z = frame2:GetPosition();
					if ( x and y and z ) then
						TraceFrame:AddMessage(secart.." x = "..x..", y = "..y..", z = "..z);
					end
					x = frame2:GetLeft();
					if ( x ) then
						TraceFrame:AddMessage(" position x = "..x);
					end
					y = frame2:GetTop();
					if ( y ) then
						TraceFrame:AddMessage(" position y = "..y);
					end
				end
			else
				TraceFrame:AddMessage(secart.." children "..i);
			end
			if ( frame2 and frame2:GetName() ) then
				TraceFrame:AddMessage(secart.." children "..frame2:GetName());
			end
			DBCS_liste_children(frame2,secart.."----|");
		end
	end

end

--/script ChannelToggleAnnouncements("recherchegroupe");

--/script DEFAULT_CHAT_FRAME:AddMessage(Minimap:GetWidth())
--/script DEFAULT_CHAT_FRAME:AddMessage(Minimap:GetHeight())
--
--function Minimap_SetPing(x, y, playSound)
--/script DEFAULT_CHAT_FRAME:AddMessage(Minimap:GetEffectiveScale())
--/script DEFAULT_CHAT_FRAME:AddMessage()

--/script Minimap:PingLocation(0,0)
--/script DEFAULT_CHAT_FRAME:AddMessage(Minimap:GetPingPosition())
--/script DEFAULT_CHAT_FRAME:AddMessage(0.77857421875/0.12976236979167)

--/script DEFAULT_CHAT_FRAME:AddMessage(0.3434394299984/0.04371047019958)

--/script DEFAULT_CHAT_FRAME:AddMessage(11.066964181615*287)		--	3176.2187201235
--/script DEFAULT_CHAT_FRAME:AddMessage(7.3794648925552*421)		--	3106.7547197657

--/script DEFAULT_CHAT_FRAME:AddMessage(3176.2187201235/2.799107497705)
--/script DEFAULT_CHAT_FRAME:AddMessage(3176.2187201235/11.571432231877)

--/script DEFAULT_CHAT_FRAME:AddMessage(24.88+25.85+22.43+17.21+12.83+22.41+23.14+13.82+11.47+15.62+10.44+6.04)

--/script DBCS_loclongue();
function DBCS_loclongue()

local a,b;
local x,y;

	a , b = GetPlayerMapPosition("player");
	x = a * 100;
	y = b * 100;
	TraceFrame:AddMessage("x = "..x);
	TraceFrame:AddMessage("y = "..y);

end

--/script DBCS_pingloclongue();
function DBCS_pingloclongue()

local x,y;

	x , y , _ = Minimap:GetPingPosition();
	TraceFrame:AddMessage("x = "..x);
	TraceFrame:AddMessage("y = "..y);

end

--/script DBCS_position100_regioncontinent();
function DBCS_position100_regioncontinent()

local a,b;
local x,y;
local imultiple_r = 10^3;
local imultiple_c = 10^6;
local icontinent;

	--SetMapToCurrentZone();	--20121031
	a,b = GetPlayerMapPosition("player");
	x = floor((a*100*imultiple_r)+.5);
	y = floor((b*100*imultiple_r)+.5);
	x = x/imultiple_r;
	y = y/imultiple_r;
TraceFrame:AddMessage("region : x = "..x.." , y = "..y);
	icontinent = GetCurrentMapContinent();
	--SetMapZoom(icontinent);	-- ,0	--20121031
	--SetMapToCurrentZone();
	a,b = GetPlayerMapPosition("player");
	x = floor((a*100*imultiple_c)+.5);
	y = floor((b*100*imultiple_c)+.5);
	x = x/imultiple_c;
	y = y/imultiple_c;
TraceFrame:AddMessage("continent : x = "..x.." , y = "..y);

end

local DBCS_minimapinit_origx;
local DBCS_minimapinit_origy;

local DBCS_minimapinit_arriveea;
local DBCS_minimapinit_arriveeb;

local DBCS_minimapinit_arriveex;
local DBCS_minimapinit_arriveey;

--/script DBCS_minimapinit_origin();
function DBCS_minimapinit_origin()

	Minimap:PingLocation(0,0);
	DBCS_minimapinit_origx , DBCS_minimapinit_origy = GetPlayerMapPosition("player");
	TraceFrame:AddMessage("DBCS_minimapinit_origx = "..DBCS_minimapinit_origx);
	TraceFrame:AddMessage("DBCS_minimapinit_origy = "..DBCS_minimapinit_origy);

end

--/script DBCS_position100_regioncontinent();
--/script DBCS_minimapinit_origin();
--/script DBCS_minimapinit_arrivee();
function DBCS_minimapinit_arrivee()

local diffx;
local diffy;

	DBCS_minimapinit_arriveea , DBCS_minimapinit_arriveeb , _ = Minimap:GetPingPosition();
	TraceFrame:AddMessage("DBCS_minimapinit_arriveea = "..DBCS_minimapinit_arriveea);
	TraceFrame:AddMessage("DBCS_minimapinit_arriveeb = "..DBCS_minimapinit_arriveeb);
	DBCS_minimapinit_arriveea = abs(DBCS_minimapinit_arriveea);
	DBCS_minimapinit_arriveeb = abs(DBCS_minimapinit_arriveeb);
	DBCS_minimapinit_arriveex , DBCS_minimapinit_arriveey = GetPlayerMapPosition("player");
	TraceFrame:AddMessage("DBCS_minimapinit_arriveex = "..DBCS_minimapinit_arriveex);
	TraceFrame:AddMessage("DBCS_minimapinit_arriveey = "..DBCS_minimapinit_arriveey);

	diffx = abs(abs(DBCS_minimapinit_origx)-abs(DBCS_minimapinit_arriveex));
	diffy = abs(abs(DBCS_minimapinit_origy)-abs(DBCS_minimapinit_arriveey));
	TraceFrame:AddMessage("diffx = "..diffx);
	TraceFrame:AddMessage("diffy = "..diffy);

	TraceFrame:AddMessage("coeffx = "..(DBCS_minimapinit_arriveea/diffx));
	TraceFrame:AddMessage("coeffy = "..(DBCS_minimapinit_arriveeb/diffy));

end

--/script DEFAULT_CHAT_FRAME:AddMessage("Cryptes Auchena\195\175");
--						<Size>
--							<AbsDimension x="200" y ="20"/>
--						</Size>

function DBcorpsFrame_HDVFrame_Criteres_Rarity_OnLoad()

	UIDropDownMenu_Initialize(DBcorpsFrame_HDVFrame_Criteres_Rarity, DBcorpsFrame_HDVFrame_Criteres_Rarity_Initialize);

end

function DBcorpsFrame_HDVFrame_Criteres_Rarity_Initialize()

	local r,g,b,hex;

	info = {};
	info.text = ALL;
	info.value = -1;
	info.func = DBcorpsFrame_HDVFrame_Criteres_Rarity_OnClick;
	UIDropDownMenu_AddButton(info);
	for i=0, getn(ITEM_QUALITY_COLORS)  do
		info = {};
		info.text = _G["ITEM_QUALITY"..i.."_DESC"];
		r,g,b,hex = GetItemQualityColor(i);
		--info.hasColorSwatch = 1;
		if ( r ) then
			info.textR = r;
			info.textG = g;
			info.textB = b;
		end
		info.value = i;
		info.func = DBcorpsFrame_HDVFrame_Criteres_Rarity_OnClick;
		UIDropDownMenu_AddButton(info);
	end

end

function DBcorpsFrame_HDVFrame_Criteres_Rarity_OnClick(self)

	UIDropDownMenu_SetSelectedValue(DBcorpsFrame_HDVFrame_Criteres_Rarity, self.value);

end

function DBcorpsFrame_HDVFrame_Criteres_Type_OnLoad()

	UIDropDownMenu_Initialize(DBcorpsFrame_HDVFrame_Criteres_Type, DBcorpsFrame_HDVFrame_Criteres_Type_Initialize);

end

function DBcorpsFrame_HDVFrame_Criteres_Type_Initialize()

	local r,g,b,hex;

	info = {};
	info.text = ALL;
	info.value = -1;
	info.func = DBcorpsFrame_HDVFrame_Criteres_Type_OnClick;
	UIDropDownMenu_AddButton(info);
	info = {};
	info.text = "Aucuns";
	info.value = 0;
	info.func = DBcorpsFrame_HDVFrame_Criteres_Type_OnClick;
	UIDropDownMenu_AddButton(info);
	for i=1, getn(DBCS_objet_type)  do
		info = {};
		info.text = DBCS_objet_type[i].name;
		info.value = DBCS_objet_type[i].index;
		info.func = DBcorpsFrame_HDVFrame_Criteres_Type_OnClick;
		UIDropDownMenu_AddButton(info);
	end

end

function DBcorpsFrame_HDVFrame_Criteres_Type_OnClick(self)

	UIDropDownMenu_SetSelectedValue(DBcorpsFrame_HDVFrame_Criteres_Type, self.value);
	DBcorpsFrame_HDVFrame_Criteres_SubType_OnLoad();
	UIDropDownMenu_SetSelectedValue(DBcorpsFrame_HDVFrame_Criteres_SubType,-1);

end

function DBcorpsFrame_HDVFrame_Criteres_SubType_OnLoad()

	UIDropDownMenu_Initialize(DBcorpsFrame_HDVFrame_Criteres_SubType, DBcorpsFrame_HDVFrame_Criteres_SubType_Initialize);

end

function DBcorpsFrame_HDVFrame_Criteres_SubType_Initialize()

	local r,g,b,hex;
	local tablo;

	info = {};
	info.text = ALL;
	info.value = -1;
	info.func = DBcorpsFrame_HDVFrame_Criteres_SubType_OnClick;
	UIDropDownMenu_AddButton(info);
	tablo = DBCS_objet_type_subtype[UIDropDownMenu_GetSelectedValue(DBcorpsFrame_HDVFrame_Criteres_Type)];
	info = {};
	info.text = "Aucuns";
	info.value = 0;
	info.func = DBcorpsFrame_HDVFrame_Criteres_SubType_OnClick;
	UIDropDownMenu_AddButton(info);
	if ( tablo ) then
		for i=1, getn(tablo)  do
			info = {};
			info.text = DBCS_objet_subtype_index[tablo[i]];
			info.value = tablo[i];
			info.func = DBcorpsFrame_HDVFrame_Criteres_SubType_OnClick;
			UIDropDownMenu_AddButton(info);
		end
	end
	DBcorpsFrame_HDVFrame_Criteres_SubTypeMiddle:SetWidth(200);

end

function DBcorpsFrame_HDVFrame_Criteres_SubType_OnClick(self)

	UIDropDownMenu_SetSelectedValue(DBcorpsFrame_HDVFrame_Criteres_SubType, self.value);

end

function DBcorpsFrame_HDVFrame_Criteres_Equiploc_OnLoad()

	UIDropDownMenu_Initialize(DBcorpsFrame_HDVFrame_Criteres_Equiploc, DBcorpsFrame_HDVFrame_Criteres_Equiploc_Initialize);

end

function DBcorpsFrame_HDVFrame_Criteres_Equiploc_Initialize()

	local r,g,b,hex;

	info = {};
	info.text = ALL;
	info.value = -1;
	info.func = DBcorpsFrame_HDVFrame_Criteres_Equiploc_OnClick;
	UIDropDownMenu_AddButton(info);
	info = {};
	info.text = "Aucuns";
	info.value = 0;
	info.func = DBcorpsFrame_HDVFrame_Criteres_Equiploc_OnClick;
	UIDropDownMenu_AddButton(info);
	for i=1, getn(DBCS_objet_equiploc)  do
		info = {};
		info.text = DBCS_objet_equiploc[i].traduc;
		info.value = DBCS_objet_equiploc[i].index;
		info.func = DBcorpsFrame_HDVFrame_Criteres_Equiploc_OnClick;
		UIDropDownMenu_AddButton(info);
	end
	--DBcorpsFrame_ObjetsFrame_Criteres_EquiplocMiddle:SetWidth(200);

end

function DBcorpsFrame_HDVFrame_Criteres_Equiploc_OnClick(self)

	UIDropDownMenu_SetSelectedValue(DBcorpsFrame_HDVFrame_Criteres_Equiploc, self.value);

end

function DBcorpsFrame_HDV_stats_Frame_Criteres_Rarity_OnLoad()

	UIDropDownMenu_Initialize(DBcorpsFrame_HDV_stats_Frame_Criteres_Rarity, DBcorpsFrame_HDV_stats_Frame_Criteres_Rarity_Initialize);

end

function DBcorpsFrame_HDV_stats_Frame_Criteres_Rarity_Initialize()

	local r,g,b,hex;

	info = {};
	info.text = ALL;
	info.value = -1;
	info.func = DBcorpsFrame_HDV_stats_Frame_Criteres_Rarity_OnClick;
	UIDropDownMenu_AddButton(info);
	for i=0, getn(ITEM_QUALITY_COLORS)  do
		info = {};
		info.text = _G["ITEM_QUALITY"..i.."_DESC"];
		r,g,b,hex = GetItemQualityColor(i);
		--info.hasColorSwatch = 1;
		if ( r ) then
			info.textR = r;
			info.textG = g;
			info.textB = b;
		end
		info.value = i;
		info.func = DBcorpsFrame_HDV_stats_Frame_Criteres_Rarity_OnClick;
		UIDropDownMenu_AddButton(info);
	end

end

function DBcorpsFrame_HDV_stats_Frame_Criteres_Rarity_OnClick(self)

	UIDropDownMenu_SetSelectedValue(DBcorpsFrame_HDV_stats_Frame_Criteres_Rarity, self.value);

end

function DBcorpsFrame_HDV_stats_Frame_Criteres_Type_OnLoad()

	UIDropDownMenu_Initialize(DBcorpsFrame_HDV_stats_Frame_Criteres_Type, DBcorpsFrame_HDV_stats_Frame_Criteres_Type_Initialize);

end

function DBcorpsFrame_HDV_stats_Frame_Criteres_Type_Initialize()

	local r,g,b,hex;

	info = {};
	info.text = ALL;
	info.value = -1;
	info.func = DBcorpsFrame_HDV_stats_Frame_Criteres_Type_OnClick;
	UIDropDownMenu_AddButton(info);
	info = {};
	info.text = "Aucuns";
	info.value = 0;
	info.func = DBcorpsFrame_HDV_stats_Frame_Criteres_Type_OnClick;
	UIDropDownMenu_AddButton(info);
	for i=1, getn(DBCS_objet_type)  do
		info = {};
		info.text = DBCS_objet_type[i].name;
		info.value = DBCS_objet_type[i].index;
		info.func = DBcorpsFrame_HDV_stats_Frame_Criteres_Type_OnClick;
		UIDropDownMenu_AddButton(info);
	end

end

function DBcorpsFrame_HDV_stats_Frame_Criteres_Type_OnClick(self)

	UIDropDownMenu_SetSelectedValue(DBcorpsFrame_HDV_stats_Frame_Criteres_Type, self.value);
	DBcorpsFrame_HDV_stats_Frame_Criteres_SubType_OnLoad();
	UIDropDownMenu_SetSelectedValue(DBcorpsFrame_HDV_stats_Frame_Criteres_SubType,-1);

end

function DBcorpsFrame_HDV_stats_Frame_Criteres_SubType_OnLoad()

	UIDropDownMenu_Initialize(DBcorpsFrame_HDV_stats_Frame_Criteres_SubType, DBcorpsFrame_HDV_stats_Frame_Criteres_SubType_Initialize);

end

function DBcorpsFrame_HDV_stats_Frame_Criteres_SubType_Initialize()

	local r,g,b,hex;
	local tablo;

	info = {};
	info.text = ALL;
	info.value = -1;
	info.func = DBcorpsFrame_HDV_stats_Frame_Criteres_SubType_OnClick;
	UIDropDownMenu_AddButton(info);
	tablo = DBCS_objet_type_subtype[UIDropDownMenu_GetSelectedValue(DBcorpsFrame_HDV_stats_Frame_Criteres_Type)];
	info = {};
	info.text = "Aucuns";
	info.value = 0;
	info.func = DBcorpsFrame_HDV_stats_Frame_Criteres_SubType_OnClick;
	UIDropDownMenu_AddButton(info);
	if ( tablo ) then
		for i=1, getn(tablo)  do
			info = {};
			info.text = DBCS_objet_subtype_index[tablo[i]];
			info.value = tablo[i];
			info.func = DBcorpsFrame_HDV_stats_Frame_Criteres_SubType_OnClick;
			UIDropDownMenu_AddButton(info);
		end
	end
	DBcorpsFrame_HDV_stats_Frame_Criteres_SubTypeMiddle:SetWidth(200);

end

function DBcorpsFrame_HDV_stats_Frame_Criteres_SubType_OnClick(self)

	UIDropDownMenu_SetSelectedValue(DBcorpsFrame_HDV_stats_Frame_Criteres_SubType, self.value);

end

function DBcorpsFrame_HDV_stats_Frame_Criteres_Equiploc_OnLoad()

	UIDropDownMenu_Initialize(DBcorpsFrame_HDV_stats_Frame_Criteres_Equiploc, DBcorpsFrame_HDV_stats_Frame_Criteres_Equiploc_Initialize);

end

function DBcorpsFrame_HDV_stats_Frame_Criteres_Equiploc_Initialize()

	local r,g,b,hex;

	info = {};
	info.text = ALL;
	info.value = -1;
	info.func = DBcorpsFrame_HDV_stats_Frame_Criteres_Equiploc_OnClick;
	UIDropDownMenu_AddButton(info);
	info = {};
	info.text = "Aucuns";
	info.value = 0;
	info.func = DBcorpsFrame_HDV_stats_Frame_Criteres_Equiploc_OnClick;
	UIDropDownMenu_AddButton(info);
	for i=1, getn(DBCS_objet_equiploc)  do
		info = {};
		info.text = DBCS_objet_equiploc[i].traduc;
		info.value = DBCS_objet_equiploc[i].index;
		info.func = DBcorpsFrame_HDV_stats_Frame_Criteres_Equiploc_OnClick;
		UIDropDownMenu_AddButton(info);
	end
	--DBcorpsFrame_ObjetsFrame_Criteres_EquiplocMiddle:SetWidth(200);

end

function DBcorpsFrame_HDV_stats_Frame_Criteres_Equiploc_OnClick(self)

	UIDropDownMenu_SetSelectedValue(DBcorpsFrame_HDV_stats_Frame_Criteres_Equiploc, self.value);

end

function DBcorps_ListHDV_histo_Trier()

end

function DBCS_HDV_histo_Scroll_Update()

end
