local hour = Hour();

local backgrounds = {
	Day = {"_amazing","_ocean","_skyline","_strip"},
	Dusk = {"_brilliant","_cloud","_dusk","_sun"},
	Night = {"_brightlight","_nightfront","_nightlights","_pool"}
};

local background = 0;
local index = math.random(1,4);

-- time checks
if (hour >= 0 and hour <= 6) or (hour >= 20) then
	-- nighttime.
	index = math.random(1,#backgrounds['Night']);
	background = "night/"..backgrounds['Night'][index];
elseif (hour >= 7 and hour <= 17) then
	-- daytime.
	index = math.random(1,#backgrounds['Day']);
	background = "day/"..backgrounds['Day'][index];
else
	-- dusk.
	index = math.random(1,#backgrounds['Dusk']);
	background = "dusk/"..backgrounds['Dusk'][index];
end;

--Trace("AJ DEBUG [_shared bg]: index = ".. index);

local t = Def.ActorFrame{
	LoadActor( THEME:GetPathB("","_white") );
	
	LoadActor(background)..{
		InitCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y;scaletocover,0,0,SCREEN_WIDTH,SCREEN_HEIGHT;diffuseshift;effectcolor1,color("1,1,1,0.08");effectcolor2,color("1,1,1,0.12");effectperiod,5);
	};
};

return t;