var m_Version = ''
//--------------------------------------------------------------
function getVals()
{ 
 let retA = {'Enabled': document.getElementById('EnabledID').checked,
             'EnabledGUI':document.getElementById('EnabledGUIID').checked,
             'StartMargin':document.getElementById('StartMarginID').value,             
             'EndMargin':document.getElementById('EndMarginID').value,
             'EnabledOld':document.getElementById('EnabledOldID').checked
             };
  return retA;
}
//--------------------------------------------------------------
function setStartVals(enabled,enabledGUI,startMargin,endMargin,enabledOld)
{ 
 document.getElementById('EnabledID').checked  = enabled;
 document.getElementById('EnabledGUIID').checked  = enabledGUI;
 document.getElementById('StartMarginID').value = startMargin;
 document.getElementById('EndMarginID').value  = endMargin;
 document.getElementById('EnabledOldID').checked  = enabledOld;
}
//--------------------------------------------------------------
//translate
//--------------------------------------------------------------
function tr(str)
{ 
 return new Promise(function(resolve, reject) 
  {
   window.CHtmlDialog.htmlTranslate(str,'simpleTV::httpTimeshift'
        ,function(data)
        {
          resolve(data);
        });
  });
}
//--------------------------------------------------------------
function doTranslate()  
{
 //debugger;
 tr('Option for httpTimeshift').then( data => document.getElementById('LegendID').textContent  = data + ' ' + m_Version); 
 tr('Enable').then( data => document.getElementById('EnabledTextID').textContent = data);
 tr('GUI enable').then( data => document.getElementById('EnabledGUITextID').textContent  = data);
 tr('Time reserve for recording from the start').then( data => document.getElementById('StartMarginTextID').textContent  = data);
 tr('Time reserve for recording from the end').then( data => document.getElementById('EndMarginTextID').textContent  = data); 
 tr('min.').then( data => document.getElementById('StartMarginSufixID').textContent = data);
 tr('min.').then( data => document.getElementById('EndMarginSufixID').textContent = data);
 tr('Enable compatibility with old mode - detecting by address (not recommend)').then(data => document.getElementById('EnabledOldTextID').textContent  = data);
}
//--------------------------------------------------------------
