sub Init()
    mBind(["title", "icon", "itemPoster"])
	
    itemPoster = m.itemPoster.boundingRect()
    itemlabel = m.title.boundingRect()
    icon = m.icon.boundingRect()
    m.title.translation = [100, (itemPoster.height - itemlabel.height) / 2]
    m.icon.translation = [30, (itemPoster.height - icon.height) / 2]
	m.itemContentValues = m.top.itemContent
	
end sub

sub showcontent()
    m.itemContentValues = m.top.itemContent
    m.title.text = m.itemContentValues.title
    m.itemPoster.uri = m.itemContentValues.list_selection
    m.icon.uri = m.itemContentValues.icon
	showfocus()
end sub

sub showfocus()
	if m.top.focusPercent > 0.3 then
        m.title.color = "0xFFFFFF"
        m.itemPoster.uri = m.itemContentValues.list_selection_focus
	else
        m.title.color = "0x000000"
        m.itemPoster.uri = m.itemContentValues.list_selection
	end if
end sub

sub itemHasFocus()
	if m.top.itemContent <> invalid
        if (m.top.itemHasFocus) then
	        m.title.color = "0xFFFFFF"
			m.title.repeatCount = -1
	        m.itemPoster.uri = m.itemContentValues.list_selection_focus
        else
	        m.title.color = "0x000000"
			m.title.repeatCount = 0
	        m.itemPoster.uri = m.itemContentValues.list_selection
        end if
	end if
end sub
