sub init()
    mBind(["itemIcon", "itemLabel", "group", "itemPoster"])
    m.top.id = "markuplistitem"
	m.parent = m.top.getParent()
	m.parent.observeField("itemSelected", "onItemSelectedChanged")
	
end sub

sub showcontent()
    itemcontent = m.top.itemContent
    m.itemlabel.text = itemcontent.title
	showfocus()
end sub

sub showfocus()
    if m.top.focusPercent > 0.3 then
	   m.itemPoster.opacity = m.top.focusPercent
       m.itemlabel.color = "0x000000"
	   m.itemlabel.font = createFont(getTheme().boldFont, getTheme().listLabelFontSize)
    else 
	   m.itemPoster.opacity = m.top.focusPercent
       m.itemlabel.color = "0xFFFFFF"
	   m.itemlabel.font = createFont(getTheme().boldFont, getTheme().listLabelFontSize)
    end if
end sub

sub onItemSelectedChanged()
    itemSelected = m.parent.itemSelected
    m.itemicon.visible = false
    if m.top.index = itemSelected then
        m.itemicon.visible = true
		m.itemicon.uri = "pkg:/images/icons/enable.png"
    end if
end sub