-- Grimmbart

function onSortCompare(w1, w2)
	local name1 = string.lower(w1.Equipement.getValue());
	local name2 = string.lower(w2.Equipement.getValue());

	-- Champ1 Vide
	if name1 == "" then
		-- Retour
		return true;
	-- Champ2 Vide
	elseif name2 == "" then
		-- Retour
		return false;
	-- Les 2 Champs sont pleins
	else
		-- Retour
		return name1 > name2;
	end
end

function onListRearranged(listchanged)
	local containermapping = {};

	for k, w in ipairs(getWindows()) do
		local entry = {};
		entry.name = w.Equipement.getValue();
		entry.window = w;
		table.insert(containermapping, entry);
	end	
end
