
function OnNavigateComplete(Object)


local value=m_simpleTV.Config.GetConfigString(m_simpleTV.Defines.ID_EXT_INETCOM_LOGIN)

  if value~=nil then  m_simpleTV.Config.SetElementValueString(Object,'Login',value) end

  value=m_simpleTV.Config.GetConfigString(m_simpleTV.Defines.ID_EXT_INETCOM_PASS)
  if value~=nil then m_simpleTV.Config.SetElementValueString(Object,'Pass1',value) end

  value=m_simpleTV.Config.GetConfigInt(m_simpleTV.Defines.ID_EXT_INETCOM_STATE)
  if value~=nil then m_simpleTV.Config.SetCheckBoxValue(Object,'CheckboxUse',value) end

m_simpleTV.Config.AddEventHandler(Object,'OnClick','ButtonRefreshPlst','OnClickButtonRefreshPlst')


end
------------------------------------------------------------------
function OnOk(Object)

local value = m_simpleTV.Config.GetCheckBoxValue(Object,'CheckboxUse')
if value==nil then value=0 end
if value~=0 then  value=1 end
m_simpleTV.Config.SetConfigInt(m_simpleTV.Defines.ID_EXT_INETCOM_STATE,value)

 value = m_simpleTV.Config.GetElementValueString(Object,'Login')
 if value~=nil then m_simpleTV.Config.SetConfigString(m_simpleTV.Defines.ID_EXT_INETCOM_LOGIN,value) end

 value = m_simpleTV.Config.GetElementValueString(Object,'Pass1')
 if value~=nil then m_simpleTV.Config.SetConfigString(m_simpleTV.Defines.ID_EXT_INETCOM_PASS,value) end

dofile (m_simpleTV.MainScriptDir .. "user\\inetcom\\init.lua")
inetcomcore.InetcomLogOut()

m_simpleTV.user.inetcom.init = nil
dofile (m_simpleTV.MainScriptDir .. "user\\inetcom\\init.lua")

end
------------------------------------------------------------------
function OnClickButtonRefreshPlst(Object)

OnOk(Object)

 local value = m_simpleTV.Config.GetCheckBoxValue(Object,'CheckboxIp')
 if value == nil or value==0 then 
	value=false
  else 
	value=true
 end
	
 if inetcomcore.LoadPlstM3U(value) == true then
    m_simpleTV.OSD.ShowMessage("Каналы обновлены",0xFF00,5)
 end


end
------------------------------------------------------------------
