Global("Tooltip", nil)
Global("Container", nil)
Global("L2RDesc", mainForm:GetChildChecked("TooltipContL2R", false):GetWidgetDesc())
mainForm:GetChildChecked("TooltipContL2R", false):DestroyWidget()
Global("L2RIDesc", mainForm:GetChildChecked("L2RInternal", false):GetWidgetDesc())
mainForm:GetChildChecked("L2RInternal", false):DestroyWidget()
Global("TooltipTDesc", mainForm:GetChildChecked("TooltipT", false):GetWidgetDesc())
mainForm:GetChildChecked("TooltipT", false):DestroyWidget()
-- AO game Localization detection new conceptual detection by Ciuine, aesthetically improved by Ramirez.
local function GetGameLocalization()
	local id = options.GetOptionsByCustomType( "interface_option_localization" )[ 0 ]
	if id then
		local values = options.GetOptionInfo( id ).values
		local value = values and values[ 0 ]
		local name = value and value.name
  
		if name then
			return userMods.FromWString( name )
		end
	end
end
local L = ""
local AllodList = {}
local DungList = {}

local function GetAllodName(nField)
	if AllodList[nField] then
		return AllodList[nField]
	else		
		local AllodNames = {
			["eng"] = "Unknown",
			["ger"] = "Unbekannt",
			["rus"] = "Íåèçâåñòíûé",
			["fra"] = "Inconnu",
			["br"] = "Desconhecido",
		}
		local Loc = AllodNames[L] or AllodNames["eng"]
		return Loc
	end
end

local function GetDungName(nField)
	if DungList[nField] then
		return DungList[nField]
	else
		local DungNames = {
			["eng"] = "",
			["ger"] = "Unbekannt",
			["rus"] = "Íåèçâåñòíûé",
			["fra"] = "Inconnu",
			["br"] = "Desconhecido",
		}
		local Loc = DungNames[L] or DungNames["eng"]
		return Loc
	end
end

local function GetEnchantName(nField)
	if nField ~= "UN" then
		local GearNaming = {
			["AG"] = common.GetAddonRelatedGroupText("InnateStats", "ENUM_IS_Agility"),
			["EX"] = common.GetAddonRelatedGroupText("InnateStats", "ENUM_IS_Dexterity"),
			["EN"] = common.GetAddonRelatedGroupText("InnateStats", "ENUM_IS_Hardiness"),
			["IN"] = common.GetAddonRelatedGroupText("InnateStats", "ENUM_IS_Intellect"),
			["PE"] = common.GetAddonRelatedGroupText("InnateStats", "ENUM_IS_Intuition"),
			["RA"] = common.GetAddonRelatedGroupText("InnateStats", "ENUM_IS_Lethality"),
			["FI"] = common.GetAddonRelatedGroupText("InnateStats", "ENUM_IS_Might"),
			["LU"] = common.GetAddonRelatedGroupText("InnateStats", "ENUM_IS_Precision"),
			["WL"] = common.GetAddonRelatedGroupText("InnateStats", "ENUM_IS_Resolve"),
			["WI"] = common.GetAddonRelatedGroupText("InnateStats", "ENUM_IS_Spirit"),
			["ST"] = common.GetAddonRelatedGroupText("InnateStats", "ENUM_IS_Stamina"),
			["SR"] = common.GetAddonRelatedGroupText("InnateStats", "ENUM_IS_Strength"),
			["CO"] = common.GetAddonRelatedGroupText("InnateStats", "ENUM_IS_Will"),
			["FA"] = common.GetAddonRelatedGroupText("InnateStats", "ENUM_IS_Wisdom"),
		}
		return userMods.FromWString(GearNaming[nField])
	else return "Unknown" end
end

local function GetPetName(nField)
	if nField ~= "UN" then
		local PetNaming = {
			["TP"] = "Tank",
			["RP"] = "RangedDD",
			["MP"] = "MeleeDD",
			["HP"] = "Healer",
			["SP"] = "CasterSupport",
			["CP"] = "CasterDD",
		}
		local format =  "<html><t href='/Mechanics/MegaWar/Assistants/%s/MobWorlds/1Grade.Name.txt'/></html>"
		local msg = string.format(format, PetNaming[nField])
		return msg
	else return "Unknown" end
end

local function GetAstralName2(nField)
	if common.LocalDateTime then
		local AstralNaming = {
			["7"] = "Tier1",
			["8"] = "Tier2",
			["9"] = "Tier3",
			["10"] = "Tier3Extreme",
		}
		local AvatarNaming = {
			["D"] = "Tier1",
			["G"] = "Tier2",
			["T"] = "Tier3",
			["A"] = "Tier3Extreme1",
			["B"] = "Tier3Extreme2",
		}
		local EnchantNaming = {
			["MS"] = "IntuDex",
			["AW"] = "Res",
			["WF"] = "Spi",
			["FF"] = "Pre",
			["GS"] = "Wil",
			["EL"] = "Sta",
			["WP"] = "Har",
			["BM"] = "Let",
			["EB"] = "IntStr",
			["MC"] = "Agi",
		}
		local Loc = "<t href='/Mechanics/Ships/TextFragments/"
		if AstralNaming[nField] then
			Loc = Loc.."AstralLevel/"..AstralNaming[nField]..".txt'/>"
		elseif AvatarNaming[nField] then
			Loc = Loc.."AvatarLevel/"..AvatarNaming[nField]..".txt'/>"
		elseif EnchantNaming[nField] then
			Loc = Loc.."EnchantLoot/"..EnchantNaming[nField]..".txt'/>"
		elseif nField == "Sector" then
			Loc = Loc.."Sector.txt'/>"
		else
			Loc = "Unknown"
		end
		return Loc
	else
	local AstralNaming = {
		["eng"] = {
			["7"] = "Taciturn",
			["8"] = "Blossoming",
			["9"] = "Growing",
			["0"] = "Maturing",
			["D"] = "Dim",
			["G"] = "Gleaming",
			["T"] = "Glittering",
			["A"] = "Glaring",
			["B"] = "Blazing",
			["MS"] = "Mental Serenity",
			["AW"] = "Adamant Will",
			["WF"] = "Waterfall",
			["FF"] = "Fortune's Favor",
			["GS"] = "Guiding Star",
			["EL"] = "Eternal Life",
			["WP"] = "Wolf Pack",
			["BM"] = "Bloody Madness",
			["EB"] = "Endless Battle",
			["MC"] = "Moonlight Cat",
			["UN"] = "Unknown",
			["Sector"] = "Sector of the",
		},
		["ger"] = {
			["7"] = "Silent",
			["8"] = "Blooming",
			["9"] = "Growing",
			["0"] = "Withering",
			["D"] = "Dim",
			["G"] = "Gleaming",
			["T"] = "Glittering",
			["A"] = "Glaring",
			["B"] = "Blazing",
			["MS"] = "Mental Serenity",
			["AW"] = "Adamant Will",
			["WF"] = "Waterfall",
			["FF"] = "Fortune's Favor",
			["GS"] = "Guiding Star",
			["EL"] = "Eternal Life",
			["WP"] = "Wolf Pack",
			["BM"] = "Bloody Madness",
			["EB"] = "Endless Battle",
			["MC"] = "Moonlight Cat",
			["UN"] = "Unknown",
			["Sector"] = "Sector of the",
		},
		["rus"] = {
			["7"] = "Silent",
			["8"] = "Blooming",
			["9"] = "Growing",
			["0"] = "Withering",
			["D"] = "Dim",
			["G"] = "Gleaming",
			["T"] = "Glittering",
			["A"] = "Glaring",
			["B"] = "Blazing",
			["MS"] = "Mental Serenity",
			["AW"] = "Adamant Will",
			["WF"] = "Waterfall",
			["FF"] = "Fortune's Favor",
			["GS"] = "Guiding Star",
			["EL"] = "Eternal Life",
			["WP"] = "Wolf Pack",
			["BM"] = "Bloody Madness",
			["EB"] = "Endless Battle",
			["MC"] = "Moonlight Cat",
			["UN"] = "Unknown",
			["Sector"] = "Sector of the",
		},
		["fra"] = {
			["7"] = "Silent",
			["8"] = "Blooming",
			["9"] = "Growing",
			["0"] = "Withering",
			["D"] = "Dim",
			["G"] = "Gleaming",
			["T"] = "Glittering",
			["A"] = "Glaring",
			["B"] = "Blazing",
			["MS"] = "Mental Serenity",
			["AW"] = "Adamant Will",
			["WF"] = "Waterfall",
			["FF"] = "Fortune's Favor",
			["GS"] = "Guiding Star",
			["EL"] = "Eternal Life",
			["WP"] = "Wolf Pack",
			["BM"] = "Bloody Madness",
			["EB"] = "Endless Battle",
			["MC"] = "Moonlight Cat",
			["UN"] = "Unknown",
			["Sector"] = "Sector of the",
		},
		["br"] = {
			["7"] = "Silent",
			["8"] = "Blooming",
			["9"] = "Growing",
			["0"] = "Withering",
			["D"] = "Dim",
			["G"] = "Gleaming",
			["T"] = "Glittering",
			["A"] = "Glaring",
			["B"] = "Blazing",
			["MS"] = "Mental Serenity",
			["AW"] = "Adamant Will",
			["WF"] = "Waterfall",
			["FF"] = "Fortune's Favor",
			["GS"] = "Guiding Star",
			["EL"] = "Eternal Life",
			["WP"] = "Wolf Pack",
			["BM"] = "Bloody Madness",
			["EB"] = "Endless Battle",
			["MC"] = "Moonlight Cat",
			["UN"] = "Unknown",
			["Sector"] = "Sector of the",
		},
	}
	local Loc = AstralNaming[L] or AstralNaming["eng"]
	return Loc[nField]
	end
end

local function GetAstralName(nField)
	local AstralNaming = {
		["eng"] = {
			["D"] = "Dull",
			["B"] = "Brilliant",
			["G"] = "Glittering",
			["S"] = "Sparkling",
			["L"] = "Blazing",
			["Z"] = "Incinerating",
			["4"] = "Light",
			["5"] = "Stormy",
			["6"] = "Dark",
			["7"] = "Twilight",
			["8"] = "Unk",
			["ME"] = "Mercury",
			["LE"] = "Lead",
			["SU"] = "Sulfur",
			["PH"] = "Phosphorous",
			["SI"] = "Silicon",
			["CH"] = "Chromium",
			["IR"] = "Iron",
			["CO"] = "Copper",
			["SL"] = "Silver",
			["TI"] = "Tin",
			["AR"] = "Arsenic",
			["GO"] = "Gold",
			["UN"] = "Unknown",
			["Sector"] = "Sector of",
		},
		["ger"] = {
			["D"] = "Matter",
			["B"] = "Funkelnder",
			["G"] = "Glitzernder",
			["S"] = "Glänzender",
			["L"] = "Glühend",
			["Z"] = "Brutzelnd",
			["4"] = "Licht", 
			["5"] = "Sturm",
			["6"] = "Dunkelheit",
			["7"] = "Dämmerung",
			["8"] = "Unk",
			["ME"] = "Quecksilber",
			["LE"] = "Blei",
			["SU"] = "Schwefel",
			["PH"] = "Phospor",
			["SI"] = "Silizium",
			["CH"] = "Chrom",
			["IR"] = "Eisen",
			["CO"] = "Kupfer",
			["SL"] = "Silber",
			["TI"] = "Zinn",
			["AR"] = "Arsen",
			["GO"] = "Gold",
			["UN"] = "Unbekannt",
			["Sector"] = "Sektor von",
		},
		["rus"] = {
			["D"] = "Òóñêëîãî",
			["B"] = "Áëåñòÿùåãî",
			["G"] = "Ñâåðêàþùåãî",
			["S"] = "Ñèÿþùåãî",
			["L"] = "Ïûëàþùåãî",
			["Z"] = "Èñïåïåëÿþùåãî",
			["D2"] = "Òóñêëîé",
			["B2"] = "Áëåñòÿùåé",
			["G2"] = "Ñâåðêàþùåé",
			["S2"] = "Ñèÿþùåé",
			["L2"] = "Ïûëàþùåé",
			["Z2"] = "Èñïåïåëÿþùåé",
			["4"] = "Ñâåòëûé",
			["5"] = "Áóðíûé",
			["6"] = "Ò¸ìíûé",
			["7"] = "Ñóìåðå÷íûé",
			["8"] = "Unk",
			["ME"] = "Ðòóòè",
			["LE"] = "Ñâèíöà",
			["SU"] = "Ñåðû",
			["PH"] = "Ôîñôîðà",
			["SI"] = "Êðåìíèÿ",
			["CH"] = "Õðîìà",
			["IR"] = "Æåëåçà",
			["CO"] = "Ìåäè",
			["SL"] = "Ñåðåáðà",
			["TI"] = "Îëîâà",
			["AR"] = "Ìûøüÿêà",
			["GO"] = "Çîëîòà",
			["UN"] = "?",
			["Sector"] = "Ñåêòîð",
		},
		["fra"] = {
			["D"] = "Terne",
			["B"] = "Brilliant",
			["G"] = "Scintillant",
			["S"] = "Mousseux",
			["L"] = "Embrasé",
			["Z"] = "Grésille",
			["4"] = "Lumineuse",
			["5"] = "Houleuse",
			["6"] = "Obscure",
			["7"] = "Twilight",
			["8"] = "Unk",
			["ME"] = "Mercure",
			["LE"] = "Lead",
			["SU"] = "Souffre",
			["PH"] = "Phosphore",
			["SI"] = "Silicone",
			["CH"] = "Chrome",
			["IR"] = "Fer",
			["CO"] = "Cuivre",
			["SL"] = "Argent",
			["TI"] = "Etain",
			["AR"] = "Arsenic",
			["GO"] = "Or",
			["UN"] = "Inconnu",
			["Sector"] = "Constellation</tip_golden> <r name='SecLayer'/> <tip_golden>de ",
			["Sector2"] = "Constellation</tip_golden> <r name='SecLayer'/> <tip_golden>d'",
		},
		["br"] = {
			["D"] = "Enfadonho",
			["B"] = "Brilhante",
			["G"] = "Iluminado",
			["S"] = "Cintilante",
			["L"] = "Ardente",
			["Z"] = "Sizzling",
			["4"] = "Luminoso",
			["5"] = "Tempestuoso",
			["6"] = "Escuro",
			["7"] = "Crepúsculo",
			["8"] = "Des",
			["ME"] = "Mercúrio",
			["LE"] = "Chumbo",
			["SU"] = "Enxofre",
			["PH"] = "Fósforo",
			["SI"] = "Silício",
			["CH"] = "Cromo",
			["IR"] = "Ferro",
			["CO"] = "Cobre",
			["SL"] = "Prata",
			["TI"] = "Estanho",
			["AR"] = "Arsênico",
			["GO"] = "Ouro",
			["UN"] = "Desconhecido",
			["Sector"] = "Setor do",
		},
	}
	local Loc = AstralNaming[L] or AstralNaming["eng"]
	return Loc[nField]
end

local function GetPartName(nField)
	if nField ~= "UN" and nField ~= "GO" then
		local PartNaming = {
			["CA"] = "Cannon",
			["SH"] = "Shield",
			["SC"] = "Scaner",
			["VI"] = "Visor",
			["AR"] = "BeamCannon",
			["MO"] = "Engine",
			["TU"] = "EngineV",
			["HE"] = "Rudder",
			["RE"] = "Reactor",
		}
		local format = "<html><t href='/Mechanics/Ships/TextFragments/Names/%s.txt'/></html>"
		local msg = string.format(format, PartNaming[nField])
		return msg
	elseif nField == "GO" then
		local msg = "<html><t href='/Mechanics/Ships/TextFragments/Names/Repair/46.txt'/></html>"
		return msg
	else return "Unknown" end
end

local function GetGearName(nField)
	local GearNaming = {
		["eng"] = {
			["OH"] = "Off-hands",
			["MH"] = "One-hand Weapons",
			["TH"] = "Two-hand Weapons",
			["DW"] = "Dual-wield Weapons",
			["RW"] = "Ranged Weapons",
			["BR"] = "Bracers",
			["BE"] = " Belts",
			["SI"] = "Shirts",
			["SO"] = "Shoulders",
			["HL"] = " Helms",
			["EA"] = "Earrings",
			["RI"] = " Rings",
			["PA"] = " Pants",
			["NE"] = " Necks",
			["CL"] = "Cloaks",
			["GL"] = "Gloves",
			["BO"] = " Boots",
			["CH"] = "Chests",
			["UN"] = "Unknown",
		},
		["ger"] = {
			 ["OH"] = "Nebenhand",
			 ["MH"] = "Einhand waffen",
			 ["TH"] = "Zweihand waffen",
			 ["DW"] = "Doppel waffen",
			 ["RW"] = "Fernkampf waffen",
			 ["BR"] = "Arm schienen",
			 ["BE"] = "Gürtel",
			 ["SI"] = "Hemden",
			 ["SO"] = "Schultern",
			 ["HL"] = " Helme",
			 ["EA"] = "Ohrrine",
			 ["RI"] = " Ringe",
			 ["PA"] = " Hosen",
			 ["NE"] = "Halsketten",
			 ["CL"] = "Umhänge",
			 ["GL"] = "Hand schuhe",
			 ["BO"] = "Schuhe",
			 ["CH"] = " Brust",
			 ["UN"] = "Unbekannt",
		},
		["rus"] = {
			["OH"] = "Äëÿ Ëåâîé Ðóêè",
			["MH"] = "Îäíîðó÷íîå Îðóæèå",
			["TH"] = "Äâóðó÷íîå Îðóæèå",
			["DW"] = "Ïàðíîå Îðóæèå",
			["RW"] = "Ñïåö Îðóæèå",
			["BR"] = "Íàðó÷è",
			["BE"] = " Ïîÿñà",
			["SI"] = "Ðóáàøêà",
			["SO"] = "Íàïëå÷í",
			["HL"] = " Øëåìû",
			["EA"] = "Ñåðüãà",
			["RI"] = "Êîëüöî",
			["PA"] = "Ïîíîæè",
			["NE"] = "Îæåðåëüå",
			["CL"] = " Ïëàùè",
			["GL"] = "Ïåð÷àòêè",
			["BO"] = "Áîòèíêè",
			["CH"] = "Äîñïåõ",
			["UN"] = "?",
		},
		["fra"] = {
			["OH"] = "Main Gauche",
			["MH"] = "Armes à Une Main",
			["TH"] = "Armes à Deux Mains",
			["DW"] = "Paires d'Armes",
			["RW"] = "Armes à Distance",
			["BR"] = "Poignets",
			["BE"] = "Ceinture",
			["SI"] = "Chemise",
			["SO"] = "Epaules",
			["HL"] = " Têtes",
			["EA"] = "Oreilles",
			["RI"] = "Anneaux",
			["PA"] = "Pantalon",
			["NE"] = "  Cou",
			["CL"] = " Cape",
			["GL"] = " Gants",
			["BO"] = "Bottes",
			["CH"] = " Torse",
			["UN"] = "Inconnu",
		},
		["br"] = {
			["OH"] = "Mão Secundária",
			["MH"] = "Arma de Uma Mão",
			["TH"] = "Arma de Duas Mãos",
			["DW"] = "Par de Armas",
			["RW"] = "Arma de Longo Alcance",
			["BR"] = "Pulsos",
			["BE"] = "Cintos",
			["SI"] = "Camisa",
			["SO"] = " Ombro",
			["HL"] = "Cabeça",
			["EA"] = "Brincos",
			["RI"] = " Anéis",
			["PA"] = "Calças",
			["NE"] = " Colar",
			["CL"] = " Capa",
			["GL"] = " Luvas",
			["BO"] = " Botas",
			["CH"] = " Peito",
			["UN"] = "Desconhecido",
		},
	}
	local Loc = GearNaming[L] or GearNaming["eng"]
	return Loc[nField]
end

local function GetMapName() 
	local msg1, msg2
	msg1 = "Unexplored Astral"
	msg2 = userMods.FromWString(userMods.ToWString("<html><t href='/Mechanics/Astral/Addons/Addon03/AstralAddon.txt'/></html>"))
	--msg3 = userMods.FromWString(userMods.ToWString("<html><t href='/Mechanics/Astral/Addons/Addon02/AstralAddon.txt'/>!<t href='/Mechanics/Astral/Addons/Addon03/AstralAddon.txt'/></html>"))
	return {[1] = msg1, [2] = msg2,} 
	
end

local function GetUnkName()
	local UnkName = "Unknown Sector of the Future"
	return UnkName
end

local OverlayMap = mainForm:GetChildChecked("MainPanel", false)
local OverlayMap2 = mainForm:CreateWidgetByDesc(mainForm:GetChildChecked("MainPanel", false):GetWidgetDesc())
OverlayMap:SetName("OverlayMap1")
OverlayMap2:SetName("OverlayMap2")
local TextHeader = stateMainForm:GetChildChecked("AstralMap", false):GetChildChecked("Map", false):GetChildChecked("Frame", false):GetChildChecked("Header", false):GetChildChecked("Label", false)
-------------------------------------------------------------------------------
-- FUNCTION
-------------------------------------------------------------------------------
function STimer()
	local VTtext = TextHeader:GetValuedText()
	local VTWS = common.ExtractWStringFromValuedText(VTtext)
	for j, x in GetMapName() do
		local OType = mainForm:GetChildChecked("OverlayMap"..j, false)
		if userMods.FromWString(VTWS) == x and not OType:IsVisible() then
			OType:Show(true)
		elseif OType:IsVisible() and userMods.FromWString(VTWS) ~= x then
			OType:Show(false)
		end
	end
end

function SecHover(r)
	local AstralSectors = {
		[1] = "D41927CASCBROHBE104100GBMEP", --1 SectorType, 1 SectorLayer, 2 Allod1, 2 Allod2,
		[2] = "D42521MOREPACLGL104100GBLEP", --2 Part, 2 Part, 2 Gear, 2 Gear, 2 Gear, 
		[3] = "D42717HESCRWRIHL104100GBSUP", --2 Loot Multiplier (unnecessary), 3 Demon Level,
		[4] = "D41619SHVISIEASO104750GBPHP", --1 Buff Count (unnecessary), 1 Normal Quality (unnecessary),
		[5] = "D41722CARECHBODW104900GBCHP", --1 Rare Quality, 2 SectorName, 1 Very Rare Quality (unnecessary),
		[6] = "B42120SHMOPACLGL104751BPSIO", --Potential for third allod additions that occur later.
		[7] = "D52118VIARMHTHNE155250GBPHP",
		[8] = "B42829CASCBROHBE104701BPCOO",
		[9] = "B52624GOTURWRIHL155201BPMEO",
		[10] = "B52129MORESIEASO155401BPIRO",
		[11] = "B52820SHVICHBODW155801BPCOO",
		[12] = "D52129SCHEOHEARI155850GBCHP",
		[13] = "G61519RECASIEASO206003POMEO",
		[14] = "B62326VIARMHNETH206201BPSLO",
		[15] = "G42217GOCAPACLGL105403POIRO",
		[16] = "G52823MOSHTHNEMH155253POSLO",
		[17] = "G62315SHVICHBODW206753POCOO",
		[18] = "G41720MOREBROHBE104203POTIO",
		[19] = "G61622CASCRWRIHL206853POTIO",
		[20] = "D61718SCHECHTHMH206850GBARP",
		[21] = "B62224RECAOHEARI206901BPCHO",
		[22] = "S61924SCCASIEASO206604OOPHO",
		[23] = "S62523VIARPACLGL207074OOLEO",
		[24] = "S62826TUGOBROHBE207104OOGOO",
		[25] = "S72729SHVIOHEARI257124OOCHO",
		[26] = "S62223MOREMHNETH206654OOLEO",
		[27] = "S71823SHMORWRIHL257304OOSLO",
		[28] = "S72523CARECHBODW257004OOGOO",--?
		[29] = "L73031CASHSOSIEA107525MMIRM",--?
		[30] = "L63233HETUGLCLPA106005MMCOM",--?
		[31] = "G71819ARUNRWRIHL257573POIRO",--?
		[32] = "L73033GOUNBRBEOH107005MMGOM",--?
		[33] = "Z63534VISHMHNETH106306MMTIM",--?
		[34] = "Z73537VIARRWRIHL107206MMCHM",--?
		[35] = "Z74034MORECHBODW107806MMMEM",--?
	}
	local AstralSectors2 = {
		["m1"] = "D74142WIFICARETP5500GMS03", --1 SectorType, 1 SectorLayer, 2 Allod1, 2 Allod2,
		["m2"] = "D73942EXPEMORERP5500GWF01", --2 Glyph, 2 Part, 2 Part, 2 Pet, 
		["m3"] = "D73943LUNAGOTUMP5500GFF02", --3 Demon Level,
		["m4"] = "D73644WLNASCHEHP5500GAW04", --1 Buff Count (unnecessary), 1 Normal Quality (unnecessary),
		["m5"] = "D73644SRINCARESP5500GEBUN", --2 SectorName, 2 Allod3, 2 Glyph
		["m6"] = "D73847ENNAMOSHSP5500GWP03", --BCM 43, EI 41, DH 47, Ja 39, DR 42, SR 44 
		["m7"] = "D73641STNAVISHCP5500GEL03", --TI 38, FF 36 
		["m8"] = "D73847AGNAARVIHP5500GMC01",
		["m9"] = "D74247RANAGOTURP5500GBMUN",
		["m10"] = "D73843CONASCARCP5500GGS04",
		["m11"] = "G84143ENNACAREMP8291BWP04",
		["m12"] = "G84147STNACARETP8291BEL04",
		["m13"] = "G83943WIFISCHEMP8291BMS03",
		["m14"] = "G83647LUNAMOSHHP8291BFF02",
		["m15"] = "G84344WLNAVISHSP8291BAW03",
		["m16"] = "G83644EXPEARVICP8291BWF02",
		["m17"] = "G83842AGNAGOTUTP8291BMC02",
		["m18"] = "G84344WIFIHESCRP8291BMSUN",
		["m19"] = "G83843SRINCAREHP8291BEB04",
		["m20"] = "G83843RANACARECP8291BBM03",
		["m21"] = "G83641CONAMORERP8291BGS04",
		["m22"] = "T93644WLNAGOTURP9350PAW04",
		["m23"] = "T9UNUNWLNASCHEMP9350PAW02",
		["m24"] = "T93643CONAVISHMP9350PGS03",
		["m25"] = "T9UN44STNAMOSHSP9350PEL01",
		["m26"] = "T94142EXPEVISHCP9350PWF04",
		["m27"] = "A94142SRINGOTUCP9350PEB03",
		["m28"] = "T94142AGNACARESP9350PMC04",
		["m29"] = "T94142WIFIMORECP9350PMS04",
		["m30"] = "T94142ENNACASCTP9350PWP03",
		["m31"] = "T94142ENNAGOTUMP9350PWP01",
		["m32"] = "T94142AGNASCHEHP9350PMCUN",
		["m33"] = "A94142LUNAMORESP9350PFF04",
		["m34"] = "T94142WIFIMOSHMP9350PMS01",
		["m35"] = "T94142RANAVISHHP9350PBM01",
		["m36"] = "T94142AGNAARVISP9350PMC03",
		["m37"] = "T94142STNACASCRP9350PEL04",
		["m38"] = "T94142WLNAARVITP9350PAW01",
		["m39"] = "A94142WLNAUNUNUN1020PAWUN",
		["m40"] = "B94142STNAUNUNUN1020PELUN",
		["m41"] = "A94142AGNAUNUNUN1020PMCUN",
		["m42"] = "A94142ENNAUNUNUN1020OWPUN",
		["m43"] = "A94142WIFIUNUNUN1020OMSUN",
		["m44"] = "A94142RANAUNUNUN1020OBMUN",
		["m45"] = "A04142EXPEUNUNUN1020OWFUN",
		["m46"] = "A04142EXPEUNUNUN1020OWFUN",
		["m47"] = "A84142ENNAUNUNUN1020OWPUN",
		["m48"] = "A94142LUNAUNUNUN1020OFFUN",
		["m49"] = "A94142RANAUNUNUN1020OBMUN",
		["m50"] = "A04142AGNAUNUNUN1020OMCUN",
		["m51"] = "A04142CONAUNUNUN1020OGSUN",
		["m52"] = "A04142SRINUNUNUN1020OEBUN",
		["m53"] = "A04142LUNAUNUNUN1020OFFUN",
		["m54"] = "A04142SRINUNUNUN1020OEBUN",
		["m55"] = "B94142WIFIUNUNUN1050OMSUN",
		["m56"] = "B94142EXPEUNUNUN1050OWFUN",
		["m57"] = "B94142SRINUNUNUN1050OEBUN",
		["m58"] = "B04142LUNAUNUNUN1050OFFUN",
		["m59"] = "B04142RANAUNUNUN1050OBMUN",
		["m60"] = "B04142CONAUNUNUN1050OGSUN",
		["m61"] = "B04142STNAUNUNUN1050OELUN",
		["m62"] = "B04142EXPEUNUNUN1050OWFUN",
		["m63"] = "B04142CONAUNUNUN1050OGSUN",
	}
	if not string.find(r.sender, "m") then

	for i, v in AstralSectors do
		if tonumber(r.sender) == i then
			local P = Tooltip:GetPlacementPlain()
			local T = r.widget:GetPlacementPlain()
			P.alignX = WIDGET_ALIGN_CENTER
			P.alignY = WIDGET_ALIGN_CENTER
			P.posX = 200+T.posX
			P.posY = 100+T.posY
			Tooltip:SetPlacementPlain(P)
			Container:RemoveItems()
			if string.len(v) == 27 then
				local SecType = string.sub(v,1,1)
				local SecLayer = string.sub(v,2,2)
				local SecName = string.sub(v,25,26)
				local Allods = {
					[1] = GetAllodName(string.sub(v,3,4)),
					[2] = GetAllodName(string.sub(v,5,6)),
				}
				local Extras = {
					[1] = tonumber(string.sub(v,19,21))/100,
					[2] = "x"..tonumber(string.sub(v,17,18))/10,
					[3] = "x"..string.sub(v,22,22),
				}
				local LColor = string.sub(v,23,23)
				local RTColor = string.sub(v,24,24)
				local RBColor = string.sub(v,27,27)
				local TText = mainForm:CreateWidgetByDesc(TooltipTDesc)
				local colorS = "FFAA00"
				if SecLayer == "5" then
					colorS = "AAFF00"
				elseif SecLayer == "6" then
					colorS = "FF00AA"
				elseif SecLayer == "7" then
					colorS = "AA00FF"
				end
				local SColor = "Black"
				if SecType == "B" then
					SColor = "Yellow"
				elseif SecType == "G" then
					SColor = "White"
				elseif SecType == "S" then
					SColor = "Magenta"
				elseif SecType == "L" then
					SColor = "Blue"
				elseif SecType == "Z" then
					SColor = "Red"
				end
				if L == "rus" then
					if SecName == "ME" or SecName == "CO" or SecName == "SU" then
						SecType = SecType..2
					end
				end
				local SecFormat = userMods.ToWString("<html fontsize='16' fontstyle='AllodsFantasy' color='0xFF"..colorS.."' outline='1' shadow='2'><tip_golden>"..i.."</tip_golden> "..GetAstralName(SecLayer).."<tip_golden> "..GetAstralName("Sector").." <LogColor"..SColor..">"..GetAstralName(SecType).."</LogColor"..SColor.."> "..GetAstralName(SecName).."</tip_golden></html>")
				if L == "fra" then
					SecFormat = userMods.ToWString("<html fontsize='16' fontstyle='AllodsFantasy' color='0xFF"..colorS.."' outline='1' shadow='2'><tip_golden>"..i.." "..GetAstralName("Sector")..GetAstralName(SecName).." <LogColor"..SColor..">"..GetAstralName(SecType).."</LogColor"..SColor.."></tip_golden></html>")
					if SecName == "SL" or SecName == "TI" or SecName == "AR" or SecName == "GO" then
						SecFormat = userMods.ToWString("<html fontsize='16' fontstyle='AllodsFantasy' color='0xFF"..colorS.."' outline='1' shadow='2'><tip_golden>"..i.." "..GetAstralName("Sector2")..GetAstralName(SecName).." <LogColor"..SColor..">"..GetAstralName(SecType).."</LogColor"..SColor.."></tip_golden></html>")
					end
				end
				TText:SetFormat(SecFormat)
				if L == "fra" then
					TText:SetVal("SecLayer", userMods.ToWString(GetAstralName(SecLayer)))
				end
				Container:PushBack(TText)
				local Cont = mainForm:CreateWidgetByDesc(L2RIDesc)
				Cont:GetChildChecked("L2RIcon", false):DestroyWidget()
				Cont:GetChildChecked("TooltipT", false):DestroyWidget()
				local P = Cont:GetPlacementPlain()
				P.sizeY = 70
				Cont:SetPlacementPlain(P)
				for j = 1, 5 do
					local sN = string.sub(v,5+(2*j),6+(2*j))
					local x
					if j < 3 then
						x = GetPartName(sN)
					else
						x = GetGearName(sN)
					end
					local ContInt = mainForm:CreateWidgetByDesc(L2RIDesc)
					ContInt:Show(true)
					local P = ContInt:GetChildChecked("L2RIcon", false):GetPlacementPlain()
					P.posX = 0
					P.alignX = WIDGET_ALIGN_CENTER
					ContInt:GetChildChecked("L2RIcon", false):SetPlacementPlain(P)
					local FormatT = "<html alignx='center' color='0xFFFFFFFF' outline='1' fontsize='10' shadow='1'><rs class='name'>"..x.."</rs></html>"
					if SecType ~= "D" and j > 2 then
						if SecType == "L" or SecType == "Z" then
							FormatT = "<html alignx='center' color='0xFFFFFFFF' outline='1' fontsize='10' outlinecolor='0x00990099' shadow='1'><rs class='name'>"..x.."</rs></html>"
						else
							FormatT = "<html alignx='center' color='0xFFFFFFFF' outline='1' fontsize='10' outlinecolor='0x99000099' shadow='1'><rs class='name'>"..x.."</rs></html>"
						end
					end
					ContInt:GetChildChecked("TooltipT", false):SetFormat(userMods.ToWString(FormatT))
					local P = ContInt:GetChildChecked("TooltipT", false):GetPlacementPlain()
					P.posY = 39
					P.sizeX = 63
					P.alignX = WIDGET_ALIGN_CENTER
					ContInt:GetChildChecked("TooltipT", false):SetPlacementPlain(P)
					Cont:AddChild(ContInt)
					if sN ~= "UN" then
						if j > 2 then
							local BackColor = {
								["O"] = {r=1;b=0;g=.5;a=1},
								["P"] = {r=.4;b=.8;g=0;a=1},
								["G"] = {r=0;b=0;g=.4;a=1},
								["B"] = {r=0;b=.9;g=.2;a=1},
								["M"] = {r=0;b=.6;g=1;a=1},
							}
							local newContIcon = mainForm:CreateWidgetByDesc(ContInt:GetChildChecked("L2RIcon", false):GetWidgetDesc())
							local newContIcon2 = mainForm:CreateWidgetByDesc(ContInt:GetChildChecked("L2RIcon", false):GetWidgetDesc())
							local newContIcon3 = mainForm:CreateWidgetByDesc(ContInt:GetChildChecked("L2RIcon", false):GetWidgetDesc())
							newContIcon:SetName("1")
							newContIcon2:SetName("2")
							newContIcon3:SetName("3")
							ContInt:AddChild(newContIcon)
							ContInt:AddChild(newContIcon2)
							ContInt:AddChild(newContIcon3)
							local P = newContIcon:GetPlacementPlain()
							P.posX = 0
							P.alignX = WIDGET_ALIGN_CENTER
							newContIcon:SetPlacementPlain(P)
							P.posX = 10
							P.sizeX = 19
							P.sizeY = 30
							newContIcon2:SetPlacementPlain(P)
							P.sizeY = 10
							P.posY = 30
							newContIcon3:SetPlacementPlain(P)
							newContIcon:SetForegroundTexture(nil)
							newContIcon2:SetForegroundTexture(nil)
							newContIcon3:SetForegroundTexture(nil)
							newContIcon:SetForegroundColor(BackColor[LColor])
							newContIcon2:SetForegroundColor(BackColor[RTColor])
							newContIcon3:SetForegroundColor(BackColor[RBColor])
							ContInt:GetChildChecked("L2RIcon", false):SetPriority(1)
							if SecType ~= "D" then
								if SecType == "L" or SecType == "Z" then
									ContInt:GetChildChecked("L2RIcon", false):SetForegroundColor({r=.5;g=.8;b=.5;a=1})
								else
									ContInt:GetChildChecked("L2RIcon", false):SetForegroundColor({r=.8;g=.5;b=.5;a=1})
								end
							end
						end
						local P = ContInt:GetChildChecked("L2RIcon", false):GetPlacementPlain()
							P.posX = 0
							P.sizeX = 36
							P.posY = 2
							P.sizeY = 36
							P.alignX = WIDGET_ALIGN_CENTER
							ContInt:GetChildChecked("L2RIcon", false):SetPlacementPlain(P)
						ContInt:GetChildChecked("L2RIcon", false):SetForegroundTexture(common.GetAddonRelatedTexture(sN))
					end
					local P = ContInt:GetPlacementPlain()
					P.posX = 60*(j-1)
					ContInt:SetPlacementPlain(P)
				end
				Container:PushBack(Cont)
				for j, x in Allods do
					local TText1 = mainForm:CreateWidgetByDesc(TooltipTDesc)
					TText1:SetFormat(userMods.ToWString("<html fontsize='13'>"..x.."</html>"))
					Container:PushBack(TText1)
				end
				local Cont2 = mainForm:CreateWidgetByDesc(L2RIDesc)
				Cont2:GetChildChecked("L2RIcon", false):DestroyWidget()
				Cont2:GetChildChecked("TooltipT", false):DestroyWidget()
				for j, x in Extras do
					local ContInt = mainForm:CreateWidgetByDesc(L2RIDesc)
					Cont2:AddChild(ContInt)
					ContInt:Show(true)
					local P = ContInt:GetChildChecked("TooltipT", false):GetPlacementPlain()
					P.posX = 40
					P.posY = 5
					P.sizeX = 40
					ContInt:GetChildChecked("TooltipT", false):SetPlacementPlain(P)
					local FormatT = "<html alignx='middle' fontsize='15'>"..x.."</html>"
					if j == 2 then
						FormatT = "<html alignx='middle' fontsize='15' outline='1' color='0xFF"..colorS.."'>"..x.."</html>"
					elseif j == 3 then
						FormatT = "<html alignx='middle' fontsize='15' outline='1'><LogColor"..SColor..">"..x.."</LogColor"..SColor.."></html>"
					end
					ContInt:GetChildChecked("TooltipT", false):SetFormat(userMods.ToWString(FormatT))
					P = ContInt:GetPlacementPlain()
					P.posX = 100*(j-1)
					P.sizeX = 100
					P.sizeY = 30
					ContInt:SetPlacementPlain(P)
					P = ContInt:GetChildChecked("L2RIcon", false):GetPlacementPlain()
					P.posY = 0
					P.sizeY = 30
					P.sizeX = 30
					ContInt:GetChildChecked("L2RIcon", false):SetPlacementPlain(P)
					local LTexture = {
						[1] = "Level",
						[2] = "Loot",
						[3] = "Buff",
					}
					ContInt:GetChildChecked("L2RIcon", false):SetBackgroundTexture(common.GetAddonRelatedTexture(LTexture[j]))
					ContInt:GetChildChecked("L2RIcon", false):SetForegroundTexture(common.GetAddonRelatedTexture(LTexture[j]))
				end
				local P = Cont2:GetPlacementPlain()
				P.sizeY = 35
				Cont2:SetPlacementPlain(P)
				Container:PushBack(Cont2)
				P = Container:GetPlacementPlain()
				if P.sizeY < 130 then
					P.sizingY = WIDGET_SIZING_DEFAULT
					P.sizeY = 190
				end
				Container:SetPlacementPlain(P)
			else
				local testText = mainForm:CreateWidgetByDesc(TooltipTDesc)
				testText:SetFormat(userMods.ToWString("<html fontsize='16'>"..i.." "..GetUnkName().."</html>"))
				Container:PushBack(testText)
			end
		end
	end
	else

	for i, v in AstralSectors2 do
		if r.sender == i then
			local P = Tooltip:GetPlacementPlain()
			local T = r.widget:GetPlacementPlain()
			P.alignX = WIDGET_ALIGN_CENTER
			P.alignY = WIDGET_ALIGN_CENTER
			P.posX = 200+T.posX
			P.posY = 100+T.posY
			Tooltip:SetPlacementPlain(P)
			Container:RemoveItems()
			if string.len(v) == 25 then
				local SecType = string.sub(v,1,1)
				local SecLayer = string.sub(v,2,2)
				local SecName = string.sub(v,22,23)
				local Allods = {
					[1] = GetAllodName(string.sub(v,3,4)),
					[2] = GetAllodName(string.sub(v,5,6)),
					[3] = GetDungName(string.sub(v,24,25)),
				}
				local Extras = {
					[1] = tonumber(string.sub(v,17,19))/100,
					[2] = "x"..string.sub(v,20,20),
					[3] = "VII"
				}
				if tonumber(string.sub(i, 2)) >= 39 then
					Extras[1] = tonumber(string.sub(v,17,19))/10
				end
				local Color = string.sub(v,21,21)
				local TText = mainForm:CreateWidgetByDesc(TooltipTDesc)
				local colorS = "FFAA00"
				if SecLayer == "8" then
					colorS = "AAFF00"
					Extras[3] = "VIII"
				elseif SecLayer == "9" then
					colorS = "FF00AA"
					Extras[3] = "IX"
				elseif SecLayer == "0" then
					colorS = "AA00FF"
					Extras[3] = "X"
				end
				local SColor = "Black"
				if SecType == "G" then
					SColor = "Yellow"
				elseif SecType == "T" then
					SColor = "White"
				elseif SecType == "A" then
					SColor = "Magenta"
				elseif SecType == "B" then
					SColor = "Blue"
				end
				local SecFormat = userMods.ToWString("<html fontsize='16' fontstyle='AllodsFantasy' color='0xFF"..colorS.."' outline='1' shadow='2'><tip_golden>"..string.sub(i,2, string.len(i)).."</tip_golden> "..GetAstralName2(SecLayer).."<tip_golden> "..GetAstralName2("Sector").." <LogColor"..SColor..">"..GetAstralName2(SecType).."</LogColor"..SColor.."> "..GetAstralName2(SecName).."</tip_golden></html>")
				if L == "fra" then
					SecFormat = userMods.ToWString("<html fontsize='16' fontstyle='AllodsFantasy' color='0xFF"..colorS.."' outline='1' shadow='2'><tip_golden>"..string.sub(i,2, string.len(i)).." "..GetAstralName2("Sector")..GetAstralName2(SecName).." <LogColor"..SColor..">"..GetAstralName2(SecType).."</LogColor"..SColor.."></tip_golden></html>")
					if SecName == "SL" or SecName == "TI" or SecName == "AR" or SecName == "GO" then
						SecFormat = userMods.ToWString("<html fontsize='16' fontstyle='AllodsFantasy' color='0xFF"..colorS.."' outline='1' shadow='2'><tip_golden>"..string.sub(i,2, string.len(i)).." "..GetAstralName2("Sector2")..GetAstralName2(SecName).." <LogColor"..SColor..">"..GetAstralName2(SecType).."</LogColor"..SColor.."></tip_golden></html>")
					end
				end
				TText:SetFormat(SecFormat)
				if L == "fra" then
					TText:SetVal("SecLayer", userMods.ToWString(GetAstralName2(SecLayer)))
				end
				Container:PushBack(TText)
				local Cont = mainForm:CreateWidgetByDesc(L2RIDesc)
				Cont:GetChildChecked("L2RIcon", false):DestroyWidget()
				Cont:GetChildChecked("TooltipT", false):DestroyWidget()
				local P = Cont:GetPlacementPlain()
				P.sizeY = 70
				Cont:SetPlacementPlain(P)
				local adjustP = 0
				for j = 1, 5 do
					local sN = string.sub(v,5+(2*j),6+(2*j))
					if sN == "NA" then
						adjustP = 1
					else
					local x
					if j == 5 then
						x = GetPetName(sN)
					elseif j < 3 then
						x = GetEnchantName(sN)
					else
						x = GetPartName(sN)
					end
					local ContInt = mainForm:CreateWidgetByDesc(L2RIDesc)
					ContInt:Show(true)
					local P = ContInt:GetChildChecked("L2RIcon", false):GetPlacementPlain()
					P.posX = 0
					P.alignX = WIDGET_ALIGN_CENTER
					ContInt:GetChildChecked("L2RIcon", false):SetPlacementPlain(P)
					local FormatT = "<html alignx='center' color='0xFFFFFFFF' outline='1' fontsize='10' shadow='1'><rs class='name'>"..x.."</rs></html>"
					ContInt:GetChildChecked("TooltipT", false):SetFormat(userMods.ToWString(FormatT))
					local P = ContInt:GetChildChecked("TooltipT", false):GetPlacementPlain()
					P.posY = 39
					P.sizeX = 63
					P.alignX = WIDGET_ALIGN_CENTER
					ContInt:GetChildChecked("TooltipT", false):SetPlacementPlain(P)
					Cont:AddChild(ContInt)
					if sN ~= "UN" then
						if j == 5 then
							local BackColor = {
								["O"] = {r=1;b=0;g=.5;a=1},
								["P"] = {r=.4;b=.8;g=0;a=1},
								["G"] = {r=0;b=0;g=.4;a=1},
								["B"] = {r=0;b=.9;g=.2;a=1},
								["M"] = {r=0;b=.6;g=1;a=1},
							}
							local newContIcon = mainForm:CreateWidgetByDesc(ContInt:GetChildChecked("L2RIcon", false):GetWidgetDesc())
							newContIcon:SetName("1")
							ContInt:AddChild(newContIcon)
							local P = newContIcon:GetPlacementPlain()
							P.posX = 0
							P.alignX = WIDGET_ALIGN_CENTER
							newContIcon:SetPlacementPlain(P)
							newContIcon:SetForegroundTexture(nil)
							newContIcon:SetForegroundColor(BackColor[Color])
							ContInt:GetChildChecked("L2RIcon", false):SetPriority(1)
						end
						local P = ContInt:GetChildChecked("L2RIcon", false):GetPlacementPlain()
							P.posX = 0
							P.sizeX = 36
							P.posY = 2
							P.sizeY = 36
							P.alignX = WIDGET_ALIGN_CENTER
							ContInt:GetChildChecked("L2RIcon", false):SetPlacementPlain(P)
						ContInt:GetChildChecked("L2RIcon", false):SetForegroundTexture(common.GetAddonRelatedTexture(sN))
						ContInt:GetChildChecked("L2RIcon", false):SetBackgroundTexture(common.GetAddonRelatedTexture(sN))
						if j < 3 then
							local BackColor = {
								["O"] = {r=1;b=0;g=.5;a=1},
								["P"] = {r=.4;b=.8;g=0;a=1},
								["G"] = {r=0;b=0;g=.4;a=1},
								["B"] = {r=0;b=.9;g=.2;a=1},
								["M"] = {r=0;b=.6;g=1;a=1},
							}
							ContInt:GetChildChecked("L2RIcon", false):SetForegroundBlendEffect(BLEND_EFFECT_HIGHLIGHT)
							ContInt:GetChildChecked("L2RIcon", false):SetForegroundColor(BackColor[Color])
						end
					end
					local P = ContInt:GetPlacementPlain()
					P.posX = 60*(j-1-adjustP)
					ContInt:SetPlacementPlain(P)
					end
				end
				Container:PushBack(Cont)
				for j, x in Allods do
					if x ~= "" then
						local TText1 = mainForm:CreateWidgetByDesc(TooltipTDesc)
						TText1:SetFormat(userMods.ToWString("<html fontsize='13'>"..x.."</html>"))
						Container:PushBack(TText1)
					end
				end
				local Cont2 = mainForm:CreateWidgetByDesc(L2RIDesc)
				Cont2:GetChildChecked("L2RIcon", false):DestroyWidget()
				Cont2:GetChildChecked("TooltipT", false):DestroyWidget()
				for j, x in Extras do
					local ContInt = mainForm:CreateWidgetByDesc(L2RIDesc)
					Cont2:AddChild(ContInt)
					ContInt:Show(true)
					local P = ContInt:GetChildChecked("TooltipT", false):GetPlacementPlain()
					P.posX = 40
					P.posY = 5
					P.sizeX = 40
					ContInt:GetChildChecked("TooltipT", false):SetPlacementPlain(P)
					local FormatT = "<html alignx='middle' fontsize='15'>"..x.."</html>"
					if j == 3 then
						FormatT = "<html alignx='middle' fontsize='15' outline='1' color='0xFF"..colorS.."'>"..x.."</html>"
					elseif j == 2 then
						FormatT = "<html alignx='middle' fontsize='15' outline='1'><LogColor"..SColor..">"..x.."</LogColor"..SColor.."></html>"
					end
					ContInt:GetChildChecked("TooltipT", false):SetFormat(userMods.ToWString(FormatT))
					P = ContInt:GetPlacementPlain()
					P.posX = 100*(j-1)
					P.sizeX = 100
					P.sizeY = 30
					ContInt:SetPlacementPlain(P)
					P = ContInt:GetChildChecked("L2RIcon", false):GetPlacementPlain()
					P.posY = 0
					P.sizeY = 30
					P.sizeX = 30
					ContInt:GetChildChecked("L2RIcon", false):SetPlacementPlain(P)
					local LTexture = {
						[1] = "Level",
						[3] = "Loot",
						[2] = "Buff",
					}
					ContInt:GetChildChecked("L2RIcon", false):SetBackgroundTexture(common.GetAddonRelatedTexture(LTexture[j]))
					ContInt:GetChildChecked("L2RIcon", false):SetForegroundTexture(common.GetAddonRelatedTexture(LTexture[j]))
				end
				local P = Cont2:GetPlacementPlain()
				P.sizeY = 35
				Cont2:SetPlacementPlain(P)
				Container:PushBack(Cont2)
				P = Container:GetPlacementPlain()
				if P.sizeY < 100 then
					P.sizingY = WIDGET_SIZING_DEFAULT
					P.sizeY = 200
				end
				Container:SetPlacementPlain(P)
			else
				local testText = mainForm:CreateWidgetByDesc(TooltipTDesc)
				testText:SetFormat(userMods.ToWString("<html fontsize='16'>"..i.." "..GetUnkName().."</html>"))
				Container:PushBack(testText)
			end
		end
	end
	end
	Tooltip:Show(r.active)
end
--------------------------------------------------------------------------------
-- INITIALIZATION
--------------------------------------------------------------------------------
function Init()
	local AstralSectors = {
		[1] = {x=10,y=-15},--1
		[2] = {x=-65,y=-15},--3
		[3] = {x=-25,y=-65},--6
		[4] = {x=-25,y=55},--5
		[5] = {x=-80,y=-85},--8
		[6] = {x=62,y=35},--2
		[7] = {x=28,y=-135},--11
		[8] = {x=130,y=-75},--9
		[9] = {x=-160,y=-110},--12
		[10] = {x=-160,y=80},--16
		[11] = {x=85,y=125},--17
		[12] = {x=-50,y=165},--18
		[13] = {x=115,y=-160},--19
		[14] = {x=-155,y=-195},--22
		[15] = {x=205,y=20},--7
		[16] = {x=220,y=-115},
		[17] = {x=150,y=190},
		[18] = {x=-315,y=-30},
		[19] = {x=-215,y=-235},
		[20] = {x=-60,y=-310},
		[21] = {x=100,y=-285},
		[22] = {x=-265,y=170},
		[23] = {x=245,y=140},
		[24] = {x=-300,y=130},
		[25] = {x=-255,y=-255},
		[26] = {x=240,y=-215},
		[27] = {x=-255,y=220},
		[28] = {x=210,y=-260},
		[29] = {x=230,y=230},
		[30] = {x=305,y=130},
		[31] = {x=150,y=-340},
		[32] = {x=-320,y=200},
		[33] = {x=-200,y=315},
		[34] = {x=-330,y=-260},
		[35] = {x=250,y=-295},
	}
	L = GetGameLocalization()
	Tooltip = mainForm:CreateWidgetByDesc(stateMainForm:GetChildChecked("ContextTooltip", true):GetChildChecked("Tooltip", false):GetWidgetDesc())
	Container = Tooltip:GetChildChecked("Container", false)
	local P = Container:GetPlacementPlain()
	P.sizingY = WIDGET_SIZING_INTERNAL
	Container:SetPlacementPlain(P)
	Tooltip:Show(false)
	common.RegisterEventHandler(STimer, "EVENT_SECOND_TIMER")
	mainForm:SetPriority(30000)
	mainForm:GetChildChecked("OverlayMap1", false):Show(false)
	local OverlayPanel = mainForm:GetChildChecked("HoverPanel", false)
	for i, v in AstralSectors do
		local widget = mainForm:CreateWidgetByDesc(OverlayPanel:GetWidgetDesc())
		local P = widget:GetPlacementPlain()
		P.alignY = WIDGET_ALIGN_CENTER
		P.alignX = WIDGET_ALIGN_CENTER
		P.posY = v.y
		P.posX = v.x
		widget:SetPlacementPlain(P)
		widget:SetName(""..i)
		mainForm:GetChildChecked("OverlayMap1", false):AddChild(widget)
	end
		local AstralSectors2 = {
		[1] = {x=-55,y=-75},--S1MS
		[2] = {x=85,y=-75},--S1WF
		[3] = {x=-130,y=-40},--S1FF
		[4] = {x=10,y=-40},--S1MC
		[5] = {x=-200,y=-5},--S1EB
		[6] = {x=-60,y=-5},--S1WP
		[7] = {x=-130,y=30},--S1BM
		[8] = {x=10,y=30},--S1AW
		[9] = {x=-130,y=-110},--S1EL
		[10] = {x=-200,y=65},--S1GS
		
		[11] = {x=-55,y=-145},
		[12] = {x=85,y=-145},
		[13] = {x=10,y=-110},
		[14] = {x=155,y=-110},
		[15] = {x=85,y=65},
		[16] = {x=220,y=65},
		[17] = {x=-130,y=100},
		[18] = {x=155,y=100},
		[19] = {x=-130,y=-250},
		[20] = {x=-200,y=-215},--R2BM
		[21] = {x=85,y=-215},
		
		[22] = {x=225,y=-75},
		[23] = {x=-270,y=-40},
		[24] = {x=295,y=-40},
		[25] = {x=225,y=-5},
		[26] = {x=-270,y=30},
		[27] = {x=-340,y=-145},--
		[28] = {x=225,y=-145},
		[29] = {x=-270,y=-110},
		[30] = {x=-270,y=100},
		[31] = {x=225,y=-215},
		[32] = {x=10,y=-180},
		[33] = {x=295,y=-180},
		[34] = {x=-200,y=135},
		[35] = {x=-60,y=135},
		[36] = {x=85,y=135},
		[37] = {x=-270,y=170},
		[38] = {x=-130,y=170},
		
		[39] = {x=-340,y=-75},--
		[40] = {x=-415,y=-40},--RX2EL
		[41] = {x=-340,y=-5},--
		[42] = {x=295,y=30},--
		[43] = {x=295,y=-110},--
		[44] = {x=-340,y=65},--
		[45] = {x=10,y=-250},--
		[46] = {x=295,y=-250},--
		[47] = {x=-340,y=-215},--
		[48] = {x=-340,y=135},--
		[49] = {x=295,y=170},--
		[50] = {x=-340,y=210},--
		[51] = {x=-200,y=210},--WX1MC
		[52] = {x=-60,y=210},--WX1EB
		[53] = {x=85,y=210},--
		[54] = {x=225,y=210},--
		
		[55] = {x=365,y=-5},--RX2MS
		[56] = {x=-415,y=30},--WX2GS
		[57] = {x=365,y=-145},--WX2EL
		[58] = {x=-415,y=-250},--WX2WF
		[59] = {x=365,y=-215},--WX2GS
		[60] = {x=-415,y=-180},--RX2WF
		[61] = {x=365,y=135},--RX2EB
		[62] = {x=-415,y=170},--WX2FF
		[63] = {x=365,y=210},--WX2BM
	}
	for i, v in stateMainForm:GetChildUnchecked("MapTextPanel", true):GetNamedChildren() do
		if string.find(v:GetName(), "AstralIsland") then
			local mapid = cartographer.GetZonesMapId(v:GetName())
			if mapid then
				local mapinfo = cartographer.GetZonesMapInfo(mapid)
				if mapinfo and mapinfo.mapBlockId then
					local AllodName = userMods.FromWString(cartographer.GetZonesMapInfo(mapid).name)
					AllodList[string.sub(v:GetName(), 13)] = AllodName
				end
			end
		elseif string.find(v:GetName(), "AstralDungeon") then
			local mapid = cartographer.GetZonesMapId(v:GetName())
			if mapid then
				local mapinfo = cartographer.GetZonesMapInfo(mapid)
				if mapinfo and mapinfo.mapBlockId then
					local DungName = userMods.FromWString(cartographer.GetZonesMapInfo(mapid).name)
					DungList[string.sub(v:GetName(), 14)] = DungName
				end
			end
		end
	end
	mainForm:GetChildChecked("OverlayMap2", false):Show(false)
	for i, v in AstralSectors2 do
		local widget = mainForm:CreateWidgetByDesc(OverlayPanel:GetWidgetDesc())
		local P = widget:GetPlacementPlain()
		P.alignY = WIDGET_ALIGN_CENTER
		P.alignX = WIDGET_ALIGN_CENTER
		P.posY = v.y
		P.posX = v.x
		widget:SetName("m"..i)
		widget:SetPlacementPlain(P)
		mainForm:GetChildChecked("OverlayMap2", false):AddChild(widget)
	end
	OverlayPanel:DestroyWidget()
	common.RegisterReactionHandler(SecHover, "SecHover")
end
--------------------------------------------------------------------------------
common.RegisterEventHandler( Init, "EVENT_AVATAR_CREATED")
if avatar.IsExist() then
Init()
end
--------------------------------------------------------------------------------