/* This file contains some shared functions */

/* About */
function About_onload() {
  appname_element = document.getElementById('ApplicationName');
  ApplicationName.innerText = external.GetAppName();
  ApplicationSlogan.innerText = external.LS('banner_slogan');
  ver_element = document.getElementById('VersionInAbout');
  var AffID = external.Method0('M_GetAffID');
  if (AffID != null) AffID = ' (AffID: ' + AffID + ')'; else AffID = '';
  ver_element.innerHTML = external.GetAppVersionUserStr() + AffID;
  Close_button.value = external.LS('COMMAND_CLOSE');
  //------------------------------------------------------------
  LinkToSite.innerText = external.GetAppDomain();
}
/* End About */

/* Statistics */
function Statistics_onload() {
  var table_length = stat_body.children.length;
  var usagestat = external.method0('M_GetThisHardwareIDUsageStatistics');
  // alert(usagestat);//!!
  var stat7day = usagestat.method0Own('M_Create7DayStat');
  var stat30day = usagestat.method0Own('M_Create30DayStat');
  var statold = usagestat.method0Own('M_CreateOldStat');
  Column1.innerText = external.LS('Statistics_Caption_1');
  Column2.innerText = external.LS('Statistics_Caption_2');
  Column3.innerText = external.LS('Statistics_Caption_3');
  Column4.innerText = external.LS('Statistics_Caption_4');
  Refresh_button.value = external.LS('Statistics_Refresh_Button');
  Close_button.value = external.LS('button_close_window');
  PVInfo.value = external.LS('Statistics_PV_Info');
  for (i = 0; i < table_length; i++) {
    var sa = stat_body.children(i).getAttribute('_sa');
    if (sa != null) {
      stat_body.children(i).children(0).innerHTML = external.LS(sa);
      stat_body.children(i).children(1).innerHTML = stat7day.method1ID('M_GetStatAttrStr', sa);
      stat_body.children(i).children(2).innerHTML = stat30day.method1ID('M_GetStatAttrStr', sa);
      stat_body.children(i).children(3).innerHTML = statold.method1ID('M_GetStatAttrStr', sa);
    }
  }
}
/* End Statistics */
