-- events 

function OnLoad ()
    CacheSound ("sfx/activate_something.ogg");
end;


function OnEnter ()
    PlaySound ("sfx/activate_something.ogg");
	SetUIFocus ("Name"); -- sets the edit box active for text input
	playername = GetProfileStat ("name")
	str = playername;--string.format ("Delete profile '%s'", playername);
	
	SetProperty ("name:label.text", str);
	--SetProperty ("Prof:active", 0);
end;

function OnLeave ()
end;


function OnClick (name)

	if (name == "Delete") then
		DeleteProfile (GetProfile ());
		PopScreen ("DeleteProfile");
		return;
	end;
	
	if (name == "No") then
		PopScreen ("DeleteProfile");
		return;
	end;

end;


function OnUpdate (tdelta)

	SetUIFocus ("Name"); -- temporary hack to keep the text feed focus on the editbox
	
	akey = GetActiveScreenAnimKey ();

	trans = math.sin (0.5*3.1415926535 * GetActiveScreenTransPhase ());
	SetProperty ("panel:position_offset.y", (1-trans) * 20);
	SetProperty ("panel:alpha", trans);
	SetProperty ("fader:alpha", trans + trans * 0.05 * math.sin (2*3.141592*akey));
end;

function OnDraw ()

end;
