function RegisterEventHandlers( handlers )
	for event, handler in handlers do
		common.RegisterEventHandler( handler, event )
	end
end

function RegisterReactionHandlers( handlers )
	for event, handler in handlers do
		common.RegisterReactionHandler( handler, event )
	end
end

function SendAddon()
	local SetVal = { val = userMods.ToWString("") }
	local params = { header = SetVal, ptype = "button", size = 22, icon = wtIcon } 
	userMods.SendEvent( "AOPANEL_SEND_ADDON", { name = "Fitting Room", sysName = "FittingRoom", param = params } )
end

function alt_z()
	local stw = stateMainForm:GetChildUnchecked("ContextBag",false)
	if stw then
		stw:AddChild(mainForm)
	end
end

-- AO game Localization detection by SLA. Version 2011-02-10.
function GetGameLocalization()
	local B = cartographer.GetMapBlocks()
	local T = { rus="\203\232\227\224", eng="Holy Land", ger="Heiliges Land",
	fra="Terre Sacr\233e", br="Terra Sagrada", jpn="\131\74\131\106\131\65" }
	for b in B do for l,t in T do
	if userMods.FromWString( cartographer.GetMapBlockInfo(B [b] ).name ) == t
	then return l end; end; end; return "eng"
end

function GetTextLocalized( strTextName )
	return common.GetAddonRelatedTextGroup( localization ):GetText( strTextName )
end
-------------------------------------------------------------