--TV Playlist OSD menu 

 local conf = io.open(m_simpleTV.MainScriptDir .. "user/tvplaylists/tvmenu.ini","r")
 if conf == nil then 
	   m_simpleTV.OSD.ShowMessage("TV Playlist OSD menu error - Customize the menu in Preferences",255,10)
	   return
 end

 local value = conf:read("*all")
 conf:close()

 local t ={}
 local i=1
 local name,scr
 
 for w in string.gmatch(value,'<(.-)>') do
 
    name,scr= string.match(w,'"(.-)","(.-)"')
    if name == nil or scr == nil then break end
 
      t[i] = {}
      t[i].Id   =  i
      t[i].Name =  name
      t[i].Adress  = ''
      t[i].Action  = scr
 --debug_in_file(t[i].Name .. '  ' .. t[i].Action .. '\n\n')
 i=i+1

end

if i>1 then
    local ret,id = m_simpleTV.OSD.ShowSelect('Select menu item',0,t,10000,1+4+8)
	    if ret==1 then 
               if t[id].Action ~= '' then
		dofile(m_simpleTV.MainScriptDir .. t[id].Action)
                else
		 return
	       end
            end
end
