function widget:GetInfo()
	return {
	name	= "Select at Start",
	desc	= "Selects the commanding units at game start.",
	author	= "Argh",
	date	= "August 26, 2008",
	license = "(C) Wolfe Games, 2008",
	layer	= 0,
	enabled = true	--	loaded by default?
	}
end
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------

local GetPlayerInfo = Spring.GetPlayerInfo
local GetGameSeconds = Spring.GetGameSeconds
local GetMyTeamID = Spring.GetMyTeamID
local GetUnitDefID = Spring.GetUnitDefID
local GetTeamUnits = Spring.GetTeamUnits
local GetUnitPosition = Spring.GetUnitPosition
local SetCameraTarget = Spring.SetCameraTarget
local SelectUnitArray = Spring.SelectUnitArray
local center = true
local select = true
local unitArray = {}
local spSetCameraOffset      = Spring.SetCameraOffset

local CommanderList = {}

function widget:Initialize()
	for ud,_ in pairs(UnitDefs) do
		if UnitDefs[ud].customParams.is_commander == 'yes' then
			table.insert(CommanderList,ud,1)
		end
	end
end

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
function widget:GameFrame(f)
	if f == 1 then
		_, _, spectator = GetPlayerInfo(GetMyTeamID())
		if (spectator) then
			widgetHandler:RemoveWidget()
		else
			unitArray = GetTeamUnits(GetMyTeamID())
			for _,unitID in ipairs (unitArray) do
				id = GetUnitDefID(unitID)
				if CommanderList[id] then
				local x, y, z = GetUnitPosition(unitID)
				--SetCameraTarget(x, y, z)

				local cs = Spring.GetCameraState()
				--[[for a,b in pairs(cs) do
					Spring.Echo("CameraState",a,b)
				end]]
				cs.px = x
				cs.pz = z

				cs.height = 750

				--cs.name = 'free'

				Spring.SetCameraState(cs, 0)

				SelectUnitArray({unitID},true)

				end
			end
		end
	end
	if f == 2 then
		widgetHandler:RemoveWidget()
	end
end


--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
