sub init()
    m.itemPoster = m.top.findNode("itemPoster")
    m.itemText = m.top.findNode("itemText")
end sub

sub itemContentChanged()
    itemData = m.top.itemContent
    m.itemText.text = itemData.labelText
    m.itemPoster.uri = "pkg:/images/list_selection.png"
    m.itemText.color = "#FFFFFF"
    showfocus()
end sub

sub showfocus()
	if m.top.focusPercent > 0.3 then
        m.itemText.color = "0xFFFFFF"
        m.itemPoster.uri = "pkg:/images/list_selection_focus.png"
	else
        m.itemText.color = "0x000000"
        m.itemPoster.uri = "pkg:/images/list_selection.png"
	end if
end sub

sub itemHasFocus()
	if m.top.itemContent <> invalid
        if (m.top.itemHasFocus) then
	        m.itemText.color = "0xFFFFFF"
	        m.itemPoster.uri = "pkg:/images/list_selection_focus.png"
        else
	        m.itemText.color = "0x000000"
	        m.itemPoster.uri = "pkg:/images/list_selection.png"
        end if
	end if
end sub