
   local fhandle = io.open (m_simpleTV.MainScriptDir ..  "user/tvplaylists/tvmenu.ini")   
   if fhandle == nil then return end
   local str = fhandle:read('*a')
   fhandle:close()

   m_simpleTV.User.Triolan.ScanServer = string.match(str,'ScanTriolan=(%d);')
   if m_simpleTV.User.Triolan.ScanServer == nil then m_simpleTV.User.Triolan.ScanServer = 0 end

if m_simpleTV.Control.ChangeAdress ~= 'No' then return end
if not string.match( m_simpleTV.Control.CurrentAdress, '%$triolansvr' ) then return end

local inAdr = m_simpleTV.Control.CurrentAdress
m_simpleTV.Control.ChangeAdress='Yes'
m_simpleTV.Control.CurrentAdress = 'error'

if m_simpleTV.User.Triolan.LastServer ~= nil and m_simpleTV.User.Triolan.ScanServer == '1' then
  if m_simpleTV.User.Triolan.SvrTable == nil then
    dofile(m_simpleTV.MainScriptDir .. "user/tvplaylists/triolan/triolansvr.lua") 
    if m_simpleTV.User.Triolan.SvrTable == nil then return end 
  end
end

if m_simpleTV.User.Triolan.LastServer ==nil then
   if m_simpleTV.User.Triolan.LastCheckServer == nil and m_simpleTV.User.Triolan.ScanServer == '1' then
     dofile(m_simpleTV.MainScriptDir .. "user/tvplaylists/triolan/checktriolansvr.lua") 
   end 
   dofile(m_simpleTV.MainScriptDir .. "user/tvplaylists/triolan/getserver.lua")   
   if m_simpleTV.User.Triolan.LastServer ==nil then return end
end

m_simpleTV.Control.EventPlayingInterval=1000
m_simpleTV.Control.EventTimeOutInterval=5000  
m_simpleTV.Control.CurrentAdress = string.gsub(inAdr,'%$triolansvr',m_simpleTV.User.Triolan.LastServer)
--debug_in_file(m_simpleTV.Control.CurrentAdress .. '\n')