function chooseLanguage(e) {
  translator.szCurLanguage != e && ChangeFrameLanguage(e),
  $('#laCurrentLanguage').html($('#' + e).html()),
  $('#divLanguageChoose').hide()
}
function UnloadPage(e, t) {
  if ($.cookie('page', e + '%' + t), 1 == t && (window.parent.$('.fishmodechoose').length > 0 && window.parent.$('#dvFishModeChoose').remove(), window.parent.$('#dvChangeSize').hide()), 2 == t && (m_DownWindow && m_DownWindow.open && !m_DownWindow.closed && m_DownWindow.close(), m_PictureDownWindow && m_PictureDownWindow.open && !m_PictureDownWindow.closed && m_PictureDownWindow.close(), $('#playbackbar').empty()), 4 == t) try {
    g_bEnableDPCCoorection && ia(DPC).beforeLeave()
  } catch (n) {
  }
  try {
    HWP.Stop(0),
    $('#main_plugin').empty(),
    '#main_plugin' !== g_szPluginBoxName && $(g_szPluginBoxName).empty()
  } catch (n) {
  }
}
function parseXmlFromFile(e) {
  return $.ajax({
    url: e + '?version=' + ('undefined' != typeof global_config ? global_config.web_version : window.parent.global_config.web_version),
    dataType: 'xml',
    type: 'get',
    async: !1
  }).responseXML
}
function parseXmlFromStr(e) {
  if (null == e || '' == e) return null;
  e = e.replace(/&(?!lt;|amp;|gt;|apos;|quot;)/g, '&amp;');
  var t = new createxmlDoc;
  if ('Netscape' === navigator.appName || 'Opera' === navigator.appName) {
    var n = new DOMParser;
    t = n.parseFromString(e, 'text/xml')
  } else t.loadXML(e);
  return t
}
function xmlToStr(e) {
  if (null != e) {
    var t = '';
    try {
      var n = new XMLSerializer;
      t = n.serializeToString(e)
    } catch (a) {
      try {
        t = e.xml
      } catch (a) {
        return ''
      }
    }
    return - 1 == t.indexOf('<?xml') && (t = '<?xml version=\'1.0\' encoding=\'utf-8\'?>' + t),
    t
  }
}
function checkPlugin(e, t, n, a, r, i) {
  var o = 1;
  ('' != r && 'undefined' != typeof r || null != r) && (o = r);
  var s = '#main_plugin';
  if ('undefined' != typeof i && '' != i && (s = '#' + i, g_szPluginBoxName = s), g_bIsIE) {
    if ('' !== $(s).html() && 0 !== $('#PreviewActiveX').length && null !== $('#PreviewActiveX') [0].object) {
      var l = 0;
      switch (a) {
        case 'normal':
          break;
        case 'motiondetect':
          l = 1;
          break;
        case 'tamperdetect':
          l = 2;
          break;
        case 'privacymask':
          l = 3;
          break;
        case 'textoverlay':
          l = 4;
          break;
        case 'osdsetting':
          l = 5;
          break;
        case 'snapdraw':
          l = 6;
          break;
        case 'fisheye':
          l = 7;
          break;
        case 'linedetect':
          l = 8;
          break;
        case 'fielddetect':
          l = 9
      }
      return HWP.SetPlayModeType(l),
      !0
    }
    $(s).html('<object classid=\'clsid:E7EF736D-B4E6-4A5A-BA94-732D71107808\' codebase=\'\' standby=\'Waiting...\' id=\'PreviewActiveX\' width=\'100%\' height=\'100%\' name=\'ocx\' align=\'center\' ><param name=\'wndtype\' value=\'' + n + '\'><param name=\'playmode\' value=\'' + a + '\'><param name=\'needborder\' value=\'' + o + '\'></object>');
    var u = document.getElementById('PreviewActiveX');
    if (null == u || null == u.object) return 'Win32' == navigator.platform ? (t = getNodeValue('laPlugin'), $(s).html('<label name=\'laPlugin\' onclick=\'window.open("../../codebase/WebComponents.exe","_self")\' class=\'pluginLink\' onMouseOver=\'this.className ="pluginLinkSel"\' onMouseOut=\'this.className ="pluginLink"\'>' + t + '<label>'))  : (t = getNodeValue('laNotWin32Plugin'), $(s).html('<label name=\'laNotWin32Plugin\' onclick=\'\' class=\'pluginLink\' style=\'cursor:default; text-decoration:none;\'>' + t + '<label>')),
    !1
  } else {
    if ('' !== $(s).html() && 0 !== $('#PreviewActiveX').length) {
      var l = 0;
      switch (a) {
        case 'normal':
          break;
        case 'motiondetect':
          l = 1;
          break;
        case 'tamperdetect':
          l = 2;
          break;
        case 'privacymask':
          l = 3;
          break;
        case 'textoverlay':
          l = 4;
          break;
        case 'osdsetting':
          l = 5;
          break;
        case 'snapdraw':
          l = 6;
          break;
        case 'fisheye':
          l = 7;
          break;
        case 'linedetect':
          l = 8;
          break;
        case 'fielddetect':
          l = 9
      }
      return HWP.SetPlayModeType(l),
      !0
    }
    for (var d = !1, p = 0, c = navigator.mimeTypes.length; c > p; p++) if ('application/hwp-webvideo-plugin' == navigator.mimeTypes[p].type.toLowerCase()) {
      d = !0,
      '0' == e ? ($(s).html('<embed type=\'application/hwp-webvideo-plugin\' id=\'PreviewActiveX\' width=\'1\' height=\'1\' name=\'PreviewActiveX\' align=\'center\' wndtype=\'' + n + '\' playmode=\'' + a + '\' needborder=\'' + o + '\'>'), setTimeout(function () {
        $('#PreviewActiveX').css('height', '0px')
      }, 10))  : '1' == e ? $(s).html('<embed type=\'application/hwp-webvideo-plugin\' id=\'PreviewActiveX\' width=\'352\' height=\'288\' name=\'PreviewActiveX\' align=\'center\' wndtype=\'' + n + '\' playmode=\'' + a + '\' needborder=\'' + o + '\'>')  : $(s).html('<embed type=\'application/hwp-webvideo-plugin\' id=\'PreviewActiveX\' width=\'100%\' height=\'100%\' name=\'PreviewActiveX\' align=\'center\' wndtype=\'' + n + '\' playmode=\'' + a + '\' needborder=\'' + o + '\'>'),
      $('#PreviewActiveX').css('width', '99.999999%');
      break
    }
    if (!d) return 'Win32' == navigator.platform ? (t = getNodeValue('laPlugin'), $(s).html('<label name=\'laPlugin\' onclick=\'window.open("../../codebase/WebComponents.exe","_self")\' class=\'pluginLink\' onMouseOver=\'this.className ="pluginLinkSel"\' onMouseOut=\'this.className ="pluginLink"\'>' + t + '</label>'))  : 'Mac68K' == navigator.platform || 'MacPPC' == navigator.platform || 'Macintosh' == navigator.platform ? (t = getNodeValue('laNotWin32Plugin'), $(s).html('<label name=\'laNotWin32Plugin\' onclick=\'\' class=\'pluginLink\' style=\'cursor:default; text-decoration:none;\'>' + t + '</label>'))  : (t = getNodeValue('laNotWin32Plugin'), $(s).html('<label name=\'laNotWin32Plugin\' onclick=\'\' class=\'pluginLink\' style=\'cursor:default; text-decoration:none;\'>' + t + '</label>')),
    !1
  }
  return !0
}
function CompareFileVersion() {
  var e = document.getElementById('PreviewActiveX');
  if (null == e) return !1;
  var t = parseXmlFromFile('../xml/version.xml'),
  n = xmlToStr(t),
  a = !1;
  try {
    return a = !e.HWP_CheckPluginUpdate(n)
  } catch (r) {
    if ('Netscape' != m_szBrowser) {
      if (1 == CompareVersion('WebVideoActiveX.ocx')) return !1
    } else if (1 == CompareVersion('npWebVideoPlugin.dll')) return !1;
    return 1 == CompareVersion('PlayCtrl.dll') ? !1 : 1 == CompareVersion('StreamTransClient.dll') ? !1 : 1 == CompareVersion('NetStream.dll') ? !1 : 1 == CompareVersion('SystemTransform.dll') ? !1 : !0
  }
}
function CompareVersion(e) {
  var t = parseXmlFromFile('../xml/version.xml'),
  n = m_PreviewOCX.GetFileVersion(e, 'FileVersion'),
  a = t.documentElement.getElementsByTagName(e) [0].childNodes[0].nodeValue;
  if ('hpr.dll' == e) var r = '.';
   else var r = ',';
  for (var i = n.split(r), o = a.split(r), s = 0; 4 > s; s++) {
    if (parseInt(i[s]) > parseInt(o[s])) return - 1;
    if (parseInt(i[s]) < parseInt(o[s])) return 1
  }
  return 0
}
function getXMLHttpRequest() {
  var e = null;
  return window.XMLHttpRequest ? e = new XMLHttpRequest : window.ActiveXObject && (e = new ActiveXObject('Microsoft.XMLHTTP')),
  e
}
function createxmlDoc() {
  for (var e, t = [
    'MSXML2.DOMDocument',
    'MSXML2.DOMDocument.5.0',
    'MSXML2.DOMDocument.4.0',
    'MSXML2.DOMDocument.3.0',
    'Microsoft.XmlDom'
  ], n = 0; n < t.length; n++) try {
    e = new ActiveXObject(t[n]);
    break
  } catch (a) {
    e = document.implementation.createDocument('', '', null);
    break
  }
  return e.async = 'false',
  e
}
function GoAway() {
  if (Warning = confirm(contentframe.window.m_szExit)) {
    g_oWebSession.removeItem('userInfo'),
    $.cookie('page', null);
    var e = new Date;
    window.location.href = 'login.asp?_' + e.getTime()
  }
}
function get_previoussibling(e) {
  for (var t = e.previousSibling; 1 != t.nodeType; ) t = t.previousSibling;
  return t
}
function browseFilePath(e, t, n) {
  if (void 0 === n && (n = ''), null != m_PreviewOCX) {
    var a = HWP.OpenFileBrowser(t, n);
    if ('' == a || null == a) return;
    if (1 == t) {
      if (a.length > 100) return alert(getNodeValue('tipsTooLong')),
      void 0
    } else if (a.length > 130) return alert(getNodeValue('tipsTooLong')),
    void 0;
    document.getElementById(e).value = a
  }
}
function CreateCalendar(e, t) {
  var n = '';
  'zh' == parent.translator.szCurLanguage ? n = 'zh-cn' : 'zh_TW' == parent.translator.szCurLanguage ? n = 'zh-tw' : ($.each(parent.translator.languages, function () {
    this.value === parent.translator.szCurLanguage && (n = this.value)
  }), '' === n && (n = 'en')),
  0 == e ? WdatePicker({
    startDate: '%y-%M-%d %h:%m:%s',
    dateFmt: 'yyyy-MM-dd HH:mm:ss',
    alwaysUseStartDate: !1,
    minDate: '1970-01-01 00:00:00',
    maxDate: '2037-12-31 23:59:59',
    readOnly: !0,
    lang: n,
    isShowClear: !1
  })  : 2 == e ? WdatePicker({
    dateFmt: 'HH:mm:ss',
    alwaysUseStartDate: !1,
    readOnly: !0,
    lang: n,
    isShowClear: !1
  })  : 3 == e ? WdatePicker({
    onpicked: function () {
      'function' == typeof t && t()
    },
    startDate: '%y-%M-%d',
    dateFmt: 'yyyy-MM-dd',
    alwaysUseStartDate: !1,
    minDate: '1970-01-01',
    maxDate: '2037-12-31',
    readOnly: !0,
    lang: n,
    isShowClear: !1
  })  : WdatePicker({
    startDate: '%y-%M-%d %h:%m:%s',
    dateFmt: 'yyyy-MM-ddTHH:mm:ss',
    alwaysUseStartDate: !1,
    minDate: '1970-01-01 00:00:00',
    maxDate: '2037-12-31 23:59:59',
    readOnly: !0,
    lang: n,
    isShowClear: !1
  })
}
function getNodeValue(e) {
  if (parent != this) var t = parent.translator;
   else var t = translator;
  return null !== t.s_lastLanguageXmlDoc ? t.translateNodeByLastLxd(e)  : void 0
}
function DayAdd(e, t) {
  var n = new Date(Date.parse(e.replace(/\-/g, '/'))),
  a = new Date(n.getTime() + 1000 * 60 * 60 * 24 * t);
  return a.Format('yyyy-MM-dd hh:mm:ss')
}
function convertToLocalTime(e, t) {
  'undefined' == typeof t && (t = 0);
  var n = 'yyyy-MM-dd hh:mm:ss',
  a = e.split(' ') [0].split('-'),
  r = parseInt(a[0], 10),
  i = parseInt(a[1], 10) - 1,
  o = parseInt(a[2], 10),
  s = e.split(' ') [1].split(':'),
  l = parseInt(s[0], 10),
  u = parseInt(s[1], 10),
  d = parseInt(s[2], 10),
  p = new Date(Date.UTC(r, i, o, l, u, d));
  return p.setTime(p.getTime() + t),
  p.Format(n)
}
function convertToUTCTime(e, t) {
  'undefined' == typeof t && (t = 'yyyy-MM-dd hh:mm:ss');
  var n = new Date(Date.parse(e.replace(/-/g, '/')));
  return n.utcFormat(t)
}
function getUPnPInfo() {
  var e = !1;
  if ( - 1 == m_szHostName.indexOf('[')) {
    var t = !1;
    $.ajax({
      type: 'GET',
      url: m_lHttp + m_szHostName + ':' + m_lHttpPort + '/ISAPI/System/Network/PPPoE/1/status',
      async: !1,
      success: function (e) {
        t = 'true' == $(e).find('enabled').eq(0).text(),
        t = $(e).find('ipAddress').length > 0 ? '0.0.0.0' != $(e).find('ipAddress').eq(0).text() ? !0 : !1 : $(e).find('ipv6Address').length > 0 ? '::' != $(e).find('ipv6Address').eq(0).text() ? !0 : !1 : !1
      }
    }),
    t || $.ajax({
      type: 'GET',
      url: m_lHttp + m_szHostName + ':' + m_lHttpPort + '/ISAPI/System/Network/interfaces',
      async: !1,
      success: function (t) {
        for (var n = [
        ], a = $(t).find('NetworkInterface'), r = 0; r < a.length; r++) n.push(a.eq(r).find('IPAddress').eq(0).find('ipAddress').eq(0).text());
        - 1 == $.inArray(m_szHostName, n) && $.ajax({
          type: 'GET',
          url: m_lHttp + m_szHostName + ':' + m_lHttpPort + '/ISAPI/System/Network/UPnP/ports/status',
          async: !1,
          success: function (t) {
            e = !0;
            for (var n = $(t).find('portStatus'), a = 0; a < n.length; a++) if ('rtsp' == n.eq(a).find('internalPort').eq(0).text()) {
              m_lRtspPort = n.eq(a).find('externalPort').eq(0).text();
              break
            }
          }
        })
      }
    })
  }
  $.ajax({
    type: 'GET',
    url: m_lHttp + m_szHostName + ':' + m_lHttpPort + '/ISAPI/Security/adminAccesses',
    async: !1,
    success: function (t) {
      for (var n = $(t).find('AdminAccessProtocol'), a = 0; a < n.length; a++) switch (n.eq(a).find('protocol').eq(0).text()) {
        case 'HTTP':
          'https://' == m_lHttp && (g_szHttpPort = n.eq(a).find('portNo').eq(0).text());
          break;
        case 'RTSP':
          e || (m_lRtspPort = n.eq(a).find('portNo').eq(0).text())
      }
    }
  }), HWP = null, HWP = new Plugin(1, m_szHostName, g_szHttpPort, m_lRtspPort)
}
function addMutiChanList(parentPanes, initFun) {
  m_iPicinform = 1;
  var szObj = '#' + parentPanes,
  oName = $(szObj).find('.needmutichan').eq(0),
  oSel = $(szObj).find('select[mutiChan=\'selMutiChan\']').eq(0),
  iChanID = 1;
  if (g_iChanNum > 1) {
    if (0 == oSel.find('option').length) {
      for (var szList = '', i = 0; g_iChanNum > i; i++) iChanID = i + 1,
      szList += '<option value=' + iChanID + '>' + getNodeValue('laChanTitleName') + ' ' + iChanID + '</option>';
      '' != szList && oSel.append($(szList))
    }
    oSel.val(1),
    oName.show()
  } else oName.hide();
  if ('' != initFun && 'undefined' != typeof initFun) {
    oSel.unbind().bind('change', function () {
      getInitInfoByMutiChan($(szObj).get(0), this.value, initFun)
    });
    try {
      eval(initFun + '()')
    } catch (e) {
    }
  }
}
function getInitInfoByMutiChan(oPane, iChannel, fFunctionName) {
  if (fFunctionName && oPane) {
    m_iPicinform = parseInt(iChannel, 10),
    disableChoses(!1, oPane);
    try {
      eval(fFunctionName + '(' + m_iPicinform + ')')
    } catch (e) {
    }
  }
}
function UpdateTips() {
  var e = $.cookie('updateTips'),
  t = '';
  'true' == e && ('Win32' == navigator.platform ? (t = getNodeValue('jsUpdatePlugin'), Warning = confirm(t), Warning ? window.open('../../codebase/WebComponents.exe', '_self')  : $.cookie('updateTips', 'false'))  : (t = getNodeValue('jsUpdateNotWin32'), setTimeout(function () {
    alert(t)
  }, 20), $.cookie('updateTips', 'false')))
}
function isIPv6Add(e) {
  return /:/.test(e) && e.match(/:/g).length < 8 && /::/.test(e) ? 1 == e.match(/::/g).length && /^::$|^(::)?([\da-f]{1,4}(:|::))*[\da-f]{1,4}(:|::)?$/i.test(e)  : /^([\da-f]{1,4}:){7}[\da-f]{1,4}$/i.test(e)
}
function getDeviceMinusLocalTime() {
  var e = 0;
  return $.ajax({
    type: 'GET',
    url: m_lHttp + m_szHostName + ':' + m_lHttpPort + '/ISAPI/System/time',
    async: !1,
    success: function (t) {
      var n = $(t).find('localTime').eq(0).text().substring(0, 19),
      a = n.match(/(\d+)-(\d+)-(\d+)(\D+)(\d+):(\d+):(\d+)/);
      if (8 === a.length) {
        var r = new Date(a[1], a[2] - 1, a[3], a[5], a[6], a[7]),
        i = $(t).find('timeZone').eq(0).text(),
        o = 0,
        s = i.indexOf('DST');
        if ( - 1 != s) {
          var l = new Date(r.getTime());
          l.setMinutes(0),
          l.setSeconds(0);
          var u = new Date(r.getTime());
          u.setMinutes(0),
          u.setSeconds(0);
          var d = i.split(',') [1],
          p = i.split(',') [2],
          c = parseInt(d.split('.') [0].replace('M', ''), 10);
          l.setMonth(c - 1);
          var g = parseInt(d.split('.') [1], 10),
          m = parseInt(d.split('.') [2].split('/') [0]),
          h = parseInt(d.split('.') [2].split('/') [1].split(':') [0], 10);
          l.setHours(h);
          for (var f = 0, v = 0, w = 1; 31 >= w && (l.setDate(w), l.getMonth() === c - 1) && (l.getDay() != m || (f++, v = w, f != g)); w++);
          l.setDate(v),
          l.setMonth(c - 1);
          var N = parseInt(p.split('.') [0].replace('M', ''), 10);
          u.setMonth(N - 1),
          u.setYear(u.getFullYear() + (c > N ? 1 : 0));
          var y = parseInt(p.split('.') [1], 10),
          T = parseInt(p.split('.') [2].split('/') [0]),
          _ = parseInt(p.split('.') [2].split('/') [1].split(':') [0], 10);
          u.setHours(_),
          f = 0,
          v = 0;
          for (var w = 1; 31 >= w && (u.setDate(w), u.getMonth() === N - 1) && (u.getDay() != T || (f++, v = w, f != y)); w++);
          if (u.setDate(v), u.setMonth(N - 1), r.getTime() >= l.getTime() && r.getTime() <= u.getTime()) {
            var C = i.substring(s + 3, s + 11);
            o = 60 * parseInt(C.split(':') [0], 10) + parseInt(C.split(':') [1], 10)
          }
        }
        var P = i.match(/\D+([+-])(\d+):(\d+):(\d+)/);
        if (5 == P.length) {
          var b = new Date,
          S = b.getTimezoneOffset(),
          V = 60 * parseInt(P[2]) + parseInt(P[3]);
          V = '+' === P[1] ? V : - V,
          e = S - V + o
        }
      }
    }
  }),
  e
}
function webSession() {
  this._bSupportSession = 'object' == typeof sessionStorage,
  this._bSupportSession || document.documentElement.addBehavior('#default#userdata')
}
function SubPageFirstDo(e, t) {
  window.parent.$('#dvErrorTips').hide().html(''),
  $('#SetResultTips').html(''),
  $('#SaveConfigBtn').hide(),
  clearTimeout(m_iShowSaveCfgBtnTimer),
  m_iShowSaveCfgBtnTimer = - 1,
  !0 === t && HWP.destory(),
  e && ($('#SaveConfigBtn').prop('disabled', !1), m_iShowSaveCfgBtnTimer = setTimeout(function () {
    $('#SaveConfigBtn').show()
  }, 300))
}
function getChannels() {
  var e = [
  ];
  return $.ajax({
    type: 'GET',
    url: m_lHttp + m_szHostName + ':' + m_lHttpPort + '/ISAPI/System/Video/inputs/channels',
    async: !1,
    success: function (t) {
      g_iChanNum = $(t).find('VideoInputChannel').length,
      $(t).find('VideoInputChannel').each(function () {
        e.push({
          id: parseInt($(this).find('id').text(), 10),
          name: $(this).find('name').text()
        })
      })
    },
    error: function () {
    }
  }),
  e
}
function getHostName() {
  var e = '';
  return e = m_szHostName.indexOf('[') < 0 ? m_szHostName : m_szHostName.substring(1, m_szHostName.length - 1).replaceAll(':', '.')
}
function CheckPasswordComplexity(e, t) {
  var n = 0;
  return e.match(/[a-z]/g) && n++,
  e.match(/[A-Z]/g) && (n += n ? 2 : 1),
  e.match(/[0-9]/g) && n++,
  e.match(/[^a-zA-Z0-9]/g) && (n += n ? 2 : 1),
  (e.length < 8 || e === t || e === t.split('').reverse().join('')) && (n = 0),
  n && n--,
  n = n > 3 ? 3 : n
}
var m_PreviewOCX = null,
m_szHostName = '',
m_lHttpPort = '80',
m_lHttp = 'http://',
m_lRtspPort = '554',
m_szUserPwdValue = '',
m_iStreamType = 0,
g_szHttpPort = '80',
g_szCopyRight = 'wqlIaWt2aXNpb24gRGlnaXRhbCBUZWNobm9sb2d5IENvLiwgTHRkLiBBbGwgUmlnaHRzIFJlc2VydmVkLg==',
g_bIsIE = !0,
g_bIsIPv6 = !1;
m_lHttp = location.protocol + '//',
m_szHostName = location.hostname;
var m_iShowSaveCfgBtnTimer = - 1;
isIPv6Add(m_szHostName) && (m_szHostName = '[' + m_szHostName + ']', g_bIsIPv6 = !0),
'' != location.port ? m_lHttpPort = location.port : 'https://' == m_lHttp && (m_lHttpPort = '443'),
g_szHttpPort = m_lHttpPort;
var g_szPluginBoxName = '#main_plugin',
HWP = null,
g_iChanNum = 1,
m_iPicinform = 1;
g_bIsIE = !(null == /(msie\s|trident.*rv:)([\w.]+)/.exec(navigator.userAgent.toLowerCase())),
$.ajaxSetup({
  timeout: 30000,
  beforeSend: function (e) {
    e.setRequestHeader('If-Modified-Since', '0')
  },
  statusCode: {
    401: function () {
    },
    403: function (e) {
      if ('notActivated' == $(e).find('subStatusCode').text()) {
        var t = new Date;
        window.top.location.href = 'login.asp?_' + t.getTime()
      }
    }
  }
}),
String.prototype.replaceAll = function (e, t) {
  return this.replace(new RegExp(e, 'g'), t)
},
String.prototype.toHex = function () {
  for (var e = '', t = 0; t < this.length; t++) e += this.charCodeAt(t).toString(16);
  return e
};
var Base64 = {
  _keyStr: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=',
  encode: function (e) {
    var t,
    n,
    a,
    r,
    i,
    o,
    s,
    l = '',
    u = 0;
    for (e = Base64._utf8_encode(e); u < e.length; ) t = e.charCodeAt(u++),
    n = e.charCodeAt(u++),
    a = e.charCodeAt(u++),
    r = t >> 2,
    i = (3 & t) << 4 | n >> 4,
    o = (15 & n) << 2 | a >> 6,
    s = 63 & a,
    isNaN(n) ? o = s = 64 : isNaN(a) && (s = 64),
    l = l + this._keyStr.charAt(r) + this._keyStr.charAt(i) + this._keyStr.charAt(o) + this._keyStr.charAt(s);
    return l
  },
  decode: function (e) {
    var t,
    n,
    a,
    r,
    i,
    o,
    s,
    l = '',
    u = 0;
    for (e = e.replace(/[^A-Za-z0-9\+\/\=]/g, ''); u < e.length; ) r = this._keyStr.indexOf(e.charAt(u++)),
    i = this._keyStr.indexOf(e.charAt(u++)),
    o = this._keyStr.indexOf(e.charAt(u++)),
    s = this._keyStr.indexOf(e.charAt(u++)),
    t = r << 2 | i >> 4,
    n = (15 & i) << 4 | o >> 2,
    a = (3 & o) << 6 | s,
    l += String.fromCharCode(t),
    64 != o && (l += String.fromCharCode(n)),
    64 != s && (l += String.fromCharCode(a));
    return l = Base64._utf8_decode(l)
  },
  _utf8_encode: function (e) {
    e = e.replace(/\r\n/g, '\n');
    for (var t = '', n = 0; n < e.length; n++) {
      var a = e.charCodeAt(n);
      128 > a ? t += String.fromCharCode(a)  : a > 127 && 2048 > a ? (t += String.fromCharCode(192 | a >> 6), t += String.fromCharCode(128 | 63 & a))  : (t += String.fromCharCode(224 | a >> 12), t += String.fromCharCode(128 | 63 & a >> 6), t += String.fromCharCode(128 | 63 & a))
    }
    return t
  },
  _utf8_decode: function (e) {
    for (var t = '', n = 0, a = c1 = c2 = 0; n < e.length; ) a = e.charCodeAt(n),
    128 > a ? (t += String.fromCharCode(a), n++)  : a > 191 && 224 > a ? (c2 = e.charCodeAt(n + 1), t += String.fromCharCode((31 & a) << 6 | 63 & c2), n += 2)  : (c2 = e.charCodeAt(n + 1), c3 = e.charCodeAt(n + 2), t += String.fromCharCode((15 & a) << 12 | (63 & c2) << 6 | 63 & c3), n += 3);
    return t
  }
};
Date.prototype.Format = function (e) {
  var t = {
    'M+': this.getMonth() + 1,
    'd+': this.getDate(),
    'h+': this.getHours(),
    'm+': this.getMinutes(),
    's+': this.getSeconds(),
    'q+': Math.floor((this.getMonth() + 3) / 3),
    S: this.getMilliseconds()
  };
  /(y+)/.test(e) && (e = e.replace(RegExp.$1, (this.getFullYear() + '').substr(4 - RegExp.$1.length)));
  for (var n in t) new RegExp('(' + n + ')').test(e) && (e = e.replace(RegExp.$1, 1 == RegExp.$1.length ? t[n] : ('00' + t[n]).substr(('' + t[n]).length)));
  return e
},
Date.prototype.utcFormat = function (e) {
  var t = {
    'M+': this.getUTCMonth() + 1,
    'd+': this.getUTCDate(),
    'h+': this.getUTCHours(),
    'm+': this.getUTCMinutes(),
    's+': this.getUTCSeconds(),
    'q+': Math.floor((this.getUTCMonth() + 3) / 3),
    S: this.getUTCMilliseconds()
  };
  /(y+)/.test(e) && (e = e.replace(RegExp.$1, (this.getUTCFullYear() + '').substr(4 - RegExp.$1.length)));
  for (var n in t) new RegExp('(' + n + ')').test(e) && (e = e.replace(RegExp.$1, 1 == RegExp.$1.length ? t[n] : ('00' + t[n]).substr(('' + t[n]).length)));
  return e
},
webSession.prototype.getItem = function (szAttr) {
  with (this) {
    if (_bSupportSession) return sessionStorage.getItem(szAttr);
    with (document.documentElement) try {
      return load(szAttr),
      getAttribute('value')
    } catch (ex) {
      return null
    }
  }
},
webSession.prototype.setItem = function (szAttr, szVal) {
  with (this) {
    if (_bSupportSession) return sessionStorage.setItem(szAttr, szVal);
    with (document.documentElement) try {
      return load(szAttr),
      setAttribute('value', szVal),
      save(szAttr),
      getAttribute('value')
    } catch (ex) {
      return null
    }
  }
},
webSession.prototype.removeItem = function (szAttr) {
  with (this) if (_bSupportSession) sessionStorage.removeItem(szAttr);
   else with (document.documentElement) try {
    load(szAttr),
    expires = new Date(630892799000).toUTCString(),
    save(szAttr)
  } catch (ex) {
  }
},
g_oWebSession = new webSession,
webSession.prototype.getUNamePWD = function (e) {
  var t = [
    '',
    ''
  ];
  if (e) {
    var n = Base64.decode(e);
    ':' === n.charAt(0) && (n = n.substring(1));
    var a = n.indexOf(':');
    a > 0 && (t[0] = n.substring(0, a), t[1] = n.substring(a + 1))
  }
  return t
},
Array.prototype.removeByValue = function (e) {
  var t = this.length;
  if (0 >= t) return !1;
  for (var n = null, a = 0; t > a; a++) this[a] === e && (n = this.splice(a, 1), delete n, n = null)
};
