whois.handle: GAMMA-DSL
whois.name: Gamma DSL Infrastructure
whois.cidrs: 164.39.136.0/22
whois.created: 2023-05-15T00:00:00.000000
whois.updated: 2023-05-15T00:00:00.000000
whois.handle: ORG-GTHL1-RIPE
whois.name: Gamma Telecom Holdings Ltd
whois.address: Arbeta, 11 Northampton Road\nM40 5BP\nManchester\nUNITED KINGDOM
whois.handle: GAC-GB
whois.name: Gamma Abuse Contact
whois.email: abuse@gamma.co.uk
whois.handle: GTRA1-RIPE
whois.name: Gamma Telecom RIPE Admin
whois.email: brian.storey@gamma.co.uk
services.protocol: HTTP
services.transport_protocol: TCP
services.scan_time: 2025-07-28T06:27:17.494376
services.banner: HTTP/1.1 200 OK
  Content-Type: text/html; charset=utf-8
  Content-Length: 66126
  Set-Cookie: JSESSIONID=deleted; Expires=Thu, 01 Jan 1970 00:00:01 GMT; Path=/; HttpOnly
  Connection: keep-alive
  
services.version_selected: TLSv1_2
services.cipher_selected: TLS_RSA_WITH_AES_128_GCM_SHA256
services.ja4s: t120200_009c_2412b79bd618
services.version: TLSv1_2
services.ja4s: t120200_009c_2412b79bd618
services.names: 164.39.137.237 192.168.1.1 tplinkmodem.net
services.issuer_dn: CN=TP-LINK SOHO Router CA, O=Archer VR2100, OU=2887BA6B3880A4243C79F619D2465685C207
services.common_name: TP-LINK SOHO Router CA
services.organization: Archer VR2100
services.organizational_unit: 2887BA6B3880A4243C79F619D2465685C207
services.subject_dn: CN=tplinkmodem.net
services.common_name: tplinkmodem.net
services.scan_time: 2025-07-27T23:06:34.476630
services.value: jquery
services.value: login-page
services.path: /
services.endpoint_type: HTTP
services.scan_time: 2025-07-28T06:27:17.494376
services.uri: https://164.39.137.237/
services.protocol: HTTP/1.1
services.status_reason: OK
services.key: Content-Type
services.headers: text/html; charset=utf-8
services.key: Content-Length
services.headers: 66126
services.key: Set-Cookie
services.headers: JSESSIONID=deleted; Expires=Thu, 01 Jan 1970 00:00:01 GMT; Path=/; HttpOnly
services.key: Connection
services.headers: keep-alive
services.html_tags: <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
services.body: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  <head>
      <link rel="shortcut icon" type="image/x-icon" href="../img/favicon.ico"/>
      <link rel="stylesheet" href="../css/main.css"/>
      <link rel="stylesheet" href="../css/login.css"/>
      <link rel="stylesheet" href="../css/jquery.tpInput.css"/>
      <script type="text/javascript" src="../js/jquery-1.8.3.min.js" ></script>
      <script type="text/javascript" src="../js/lib.js" ></script>
      <script type="text/javascript" src="../locale/language.js"></script>
      <script type="text/javascript" src="../js/oid_str.js"></script>
      <script type="text/javascript" src="../js/locale.js"></script>
      <script type="text/javascript" src="../js/encrypt.js"></script>
      <script type="text/javascript" src="../js/jquery.tpInput.js"></script>
  	<script type="text/javascript" src="../js/cryptoJS.min.js" ></script>
      <script type="text/javascript" src="../js/tpEncrypt.js" ></script>
      <!--[if lte IE 8]>
      <link href="./css/ie.css" rel="stylesheet" type="text/css"/>
      <style type="text/css">
          .input-err-container .input-err-delta, #pc-scroll div.widget-error-tips span.widget-error-tips-delta {
              top: 4px;
              left: 96px;
          }
          .input-container .input-err-container, .button-error-tips {
              left: -11px;
              top: 30px;
          }
          .input-container .input-wrapper {
              border-color: #b3b6b6;
          }
          .input-container.focus .input-wrapper {
              border-color: #74ccd1;
          }
          button.button-button {
              background: url("../img/ie.png") no-repeat -255px -32px;
          }
          button.button-button:hover {
              background: url("../img/ie.png") no-repeat 0px -32px;
          }
          #pc-scroll div.widget-error-tips div.widget-error-tips-wrap, .input-err-container .input-err-content {
              border: 0;
              box-shadow: none;
          }
          .shadow-top {
              background: url("../img/ie-01.png") repeat-x 0 -5px;
              top: -13px;
              left: 0;
              height: 13px;
              margin: 0 17px 0 17px;
          }
          .shadow-bot {
              background: url("../img/ie-01.png") repeat-x center bottom;
              bottom: -13px;
              left: 0;
              height: 13px;
              margin: 0 17px 0 17px;
          }
          .shadow-top-left, .shadow-top-right, .shadow-bot-left, .shadow-bot-right {
              position: absolute;
              width: 17px;
              height: 11px;
              background: url(../img/ie-06.png) no-repeat 0px -56px;
          }
          .shadow-top-left {
              background-position: 0px -56px;
              left: 4px;
              top: 4px;
          }
          .shadow-top-right {
              background-position: 0px -38px;
              right: 0;
              top: 3px;
          }
          .shadow-bot-left {
              background-position: 0px -76px;
              left: 3px;
              bottom: 8px;
          }
          .shadow-bot-right {
              background-position: 0px -95px;
              right: 0;
              bottom: 8px;
          }
          .shadow-left {
              padding-left: 11px;
              background: url(../img/ie-02.png) no-repeat 0px 0px;
          }
          .shadow-right {
              padding-right: 11px;
              background: url(../img/ie-02.png) no-repeat center right;
          }
      </style>
      <![endif]-->
  </head>
  <body>
  <div id="cover" class="nd"></div>
  <div id="mask" class="mask"></div>
  <span class="load" style="display: none">for cache</span>
  <div id="pc-div">
  <div id="pc-top">
      <div id="pc-top-container">
          <a id="pc-top-product" href="http://www.tp-link.com" target="_blank">
              <span class="icon-logo"></span>
          </a>
      </div>
  </div>
  <div id="pc-scroll">
      <div id="pc-arrowBg"></div>
      <div id="pc-main">
          <div class="pc-login-content" id="pc-login">
              <div id="pc-login-forget" class="nd">
                  <h4 id="pc-login-forget-title"></h4>
                  <p id="pc-login-forget-text"></p>
                  <div class="button-container">
                      <form class="pure-form">
                          <button type="submit" class="green T_save pure-button tp-btn-custom" id="pc-login-forget-back">
                              <span class="">Save</span></button>
                      </form>
                  </div>
              </div>
              <div id="pc-login-main">
              <div class="pc-login-field nd" id="pc-login-user-div">
                  <div class="pc-inputarea">
                      <label class="pc-login-username-label">
                          <span class="icon"></span>
                          <span class="text"></span>
                      </label>
                      <input type="text" id="pc-login-user" autocomplete="off">
                  </div>
              </div>
              <div class="pc-login-field">
                  <div class="pc-inputarea">
                      <label class="pc-login-password-label">
                          <span class="icon"></span>
                      </label>
                      <input type="password" id="pc-login-password" autocomplete="off">
                      <span class="pc-forgetPwd"><a href="#" id="pc-login-forgetPwd">For get password</a></span>
                  </div>
              </div>
              <div id="pc-login-submit">
                  <div class="button-wrapper">
                      <button id="pc-login-btn" class="button-button" type="button">
                          <span class="text button-text">Log in</span>
                      </button>
                      <div class="button-error-tips widget-error-tips">
                          <div class="shadow-top-left"></div>
                          <div class="shadow-top"></div>
                          <div class="shadow-top-right"></div>
                          <div class="shadow-left">
                              <div class="shadow-right">
                                  <span class="widget-error-tips-delta"></span>
                                  <div class="widget-error-tips-wrap">
                                      <div class="content error-tips-content">
                                              <span class="errorContent"></span>
                                      </div>
                                  </div>
                              </div>
                          </div>
                          <div class="shadow-bot-left"></div>
                          <div class="shadow-bot"></div>
                          <div class="shadow-bot-right"></div>
                      </div>
                  </div>
              </div>
          </div>
          </div>
          <div class="pc-login-content nd" id="pc-setPwd">
              <div class="pc-login-field">
                  <div class="pc-inputarea">
                      <label class="pc-login-password-label">
                          <span class="icon"></span>
                      </label>
                      <input type="password" id="pc-setPwd-new" autocomplete="off">
                  </div>
              </div>
              <div id="pwdCheck" class="secLevel" style="">
                  <span id="pwdCheck-low" class="level1 ori">Low</span>
                  <span id="pwdCheck-middle" class="level2 ori">Middle</span>
                  <span id="pwdCheck-high" class="level3 ori">High</span>
              </div>
              <div class="pc-login-field">
                  <div class="pc-inputarea">
                      <label class="pc-login-password-label">
                          <span class="icon"></span>
                      </label>
                      <input type="password" id="pc-setPwd-confirm" autocomplete="off">
                  </div>
              </div>
              <div>
                  <div class="button-wrapper">
                      <button id="pc-setPwd-btn" class="button-button" type="button">
                          <span class="text button-text">Log in</span>
                      </button>
                      <div class="button-error-tips widget-error-tips">
                          <div class="shadow-top-left"></div>
                          <div class="shadow-top"></div>
                          <div class="shadow-top-right"></div>
                          <div class="shadow-left">
                              <div class="shadow-right">
                                  <span class="widget-error-tips-delta"></span>
                                  <div class="widget-error-tips-wrap">
                                      <div class="content error-tips-content">
                                          <span class="errorContent"></span>
                                      </div>
                                  </div>
                              </div>
                          </div>
                          <div class="shadow-bot-left"></div>
                          <div class="shadow-bot"></div>
                          <div class="shadow-bot-right"></div>
                      </div>
                  </div>
              </div>
          </div>
          <div id="pc-cloud" class="nd">
              <div id="cloud-bind-main" class="pc-login-content nd" >
  				<div id="login-bind-note-cnt">
                      <span class="text" id="login-bind-note"></span>
                  </div>
                  <div class="login-field">
  				<div id="cloud-bind-user-div" class="pc-login-field nd" >
                      <div class="pc-inputarea">
                          <label class="pc-login-username-label">
                              <span class="icon"></span>
  							<span class="text"></span>
                          </label>
                          <input type="text" id="cloud-bind-user" autocomplete="off">
                      </div>
  				</div>
                  </div>
                  <div class="pc-login-field">
                      <div class="pc-inputarea">
                          <label class="pc-login-password-label">
                              <span class="icon"></span>
  							<span class="text"></span>
                          </label>
                          <input type="password" id="cloud-bind-password" autocomplete="off">
                      </div>
                  </div>
                  <div>
                      <div class="button-wrapper">
                          <button id="cloud-bind-btn" class="button-button" type="button">
                              <span class="text button-text">Bind</span>
                          </button>
                          <div class="button-error-tips widget-error-tips">
                              <div class="shadow-top-left"></div>
                              <div class="shadow-top"></div>
                              <div class="shadow-top-right"></div>
                              <div class="shadow-left">
                                  <div class="shadow-right">
                                      <span class="widget-error-tips-delta"></span>
                                      <div class="widget-error-tips-wrap">
                                          <div class="content error-tips-content">
                                              <span class="errorContent"></span>
                                          </div>
                                      </div>
                                  </div>
                              </div>
                              <div class="shadow-bot-left"></div>
                              <div class="shadow-bot"></div>
                              <div class="shadow-bot-right"></div>
                          </div>
                      </div>
                  </div>
              </div>
  			<div id="bound-error" class="nd">
                  <div class="note"></div>
                  <div class="switch-btn"></div>
              </div>
              <iframe frameborder="0" id="cloud-login" name="cloud-login" scrolling="no" class="nd"></iframe>
          </div>
      </div>
      <div id="pc-bottomContainer">
          <div id="pc-bottom">
              <span id="pc-bot-productName"></span>
              <span id="pc-bot-app"></span>
              <span id="pc-bot-modelDesc"></span>
          </div>
          <div class="pc-bottom-background"></div>
          <div class="qr-code-container login nd" id="qr-code-container">
              <div class="qr-code-container-wrapper">
                  <div class="qr-code">
                      <span id="qr-close-icon" class="close-icon"></span>
                      <div class="characters-illustrate">
                          <span id="characters-illustrate-title" class="characters-illustrate-title"></span>
                          <span id="characters-illustrate-note" class="characters-illustrate-note"></span>
                      </div>
                      <span class="qr-code-picture"></span>
                      <div class="app-download-place">
                          <a href="https://itunes.apple.com/us/app/tp-link-tether/id599496594?ls=1&mt=8" target="_blank"><span class="apple-store"></span></a>
                          <a href="https://play.google.com/store/apps/details?id=com.tplink.tether" target="_blank"><span class="google-play"></span></a>
                      </div>
                  </div>
                  <div class="qr-code-container-delta"></div>
              </div>
          </div>
      </div>
  </div>
  </div>
  <div id="alert-container"
       class="alert-container widget-container msg-container grid-popup-msg msg-container-center">
      <div class="msg-container-wrapper">
          <div class="position-top-left"></div>
          <div class="position-top-center"></div>
          <div class="position-top-right"></div>
          <div class="position-center-left">
              <div class="position-center-right">
                  <div class="msg-wrap"><a class="widget-close msg-close" href="javascript:void(0);"></a>
                      <div class="msg-content-wrap">
                          <div class="widget-content msg-content-container">
                              <div class="grid-warning-msg"><span class="icon"></span><span class="text">The device will reboot. Are you sure to continue?</span>
                              </div>
                          </div>
                      </div>
                  </div>
                  <div class="msg-btn-container">
                      <div class="msg-btn-wrap">
                          <div class="button-container in-line">
                              <button type="button" class="button-button green pure-button btn-msg btn-msg-no btn-confirm"
                                      id="confirm-no">
                                  <span>No</span></button>
                          </div>
                          <div class="button-container in-line">
                              <button type="button" class="button-button green pure-button btn-msg btn-msg-ok btn-confirm"
                                      id="confirm-yes">
                                  <span>Yes</span></button>
                          </div>
                      </div>
                  </div>
              </div>
          </div>
          <div class="position-bottom-left"></div>
          <div class="position-bottom-center"></div>
          <div class="position-bottom-right"></div>
      </div>
  </div>
  <div id="welcome" class="nd">
      <div class="wel-top">
          <div class="icon-router sprite o-network-router"></div>
          <div id="wel-usb" class="sprite icon icon-usb e-welcome-usb"></div>
          <div id="wel-wireless" class="sprite icon icon-wireless e-welcome-wireless"></div>
          <div id="wel-internet" class="sprite icon icon-internet e-welcome-internet"></div>
          <div id="wel-guest" class="sprite icon icon-guest e-welcome-guest"></div>
          <div id="wel-device" class="sprite icon icon-device e-welcome-device"></div>
          <div id="wel-phone" class="sprite icon icon-phone e-welcome-phone"></div>
      </div>
      <div id="wel-logo" class="sprite n-logoPhone"></div>
      <div class="company">TP-Link Corporation Limited.<br>All rights reserved</div>
  </div>
  <div id="ph-div" style="display: none;">
      <div class="ph-header">
          <div class="ph-logo">
          </div>
      </div>
      <div class="ph-form">
          <form id="ph-setPwd">
              <div class="form-line">
                  <span class="sprite c-login-password"></span>
                  <input type="password" id="ph-setPwd-new" class="form-inputText" placeholder="New Password"
                         autocomplete="off">
                  <div class="errDivP mt11 nd">
                      <span class="sprite b-error-alert"></span>
                      <p class="errTextP">errTips</p>
                  </div>
                  <div id="passwordLevelP" class="password-level">
                      <span id="pwdCheckP-low" class="low">Low</span>
                      <span id="pwdCheckP-middle" class="middle">Middle</span>
                      <span id="pwdCheckP-high" class="high">High</span>
                  </div>
              </div>
              <div class="mt11 form-line">
                  <span class="sprite c-login-password"></span>
                  <input type="password" id="ph-setPwd-confirm" class="form-inputText" placeholder="Confirm Password"
                         autocomplete="off">
                  <div class="errDivP mt11 nd">
                      <span class="sprite b-error-alert"></span>
                      <p class="errTextP">errTips</p>
                  </div>
              </div>
              <div class="form-line mt20">
                  <input type="button" id="ph-setPwd-btn" class="form-lgBt" value="Let's Get Started">
                  <div id="ph-setPwd-note" class="noteDivP mt11">
                      <p class="errTextP">errTips</p>
                  </div>
              </div>
          </form>
          <form id="ph-login" class="nd">
              <div class="mt11 form-line nd" id="ph-login-user-div">
                  <span class="sprite c-login-account"></span>
              <input type="text" id="ph-login-user" class="form-inputText" placeholder="Username"
                         autocomplete="off">
                  <div class="errDivP mt11 nd">
                      <span class="sprite b-error-alert"></span>
                      <p class="errTextP"></p>
                  </div>
              </div>
              <div class="mt11 form-line">
                  <span class="sprite c-login-password"></span>
                  <input type="password" id="ph-login-password" class="form-inputText" placeholder="Password"
                         autocomplete="off">
                  <div class="errDivP mt11 nd">
                      <span class="sprite b-error-alert"></span>
                      <p class="errTextP"></p>
                  </div>
              </div>
              <div class="form-line mt20">
                  <input type="button" id="ph-login-btn" class="form-lgBt" value="Login">
                  <div id="ph-login-note" class="errDivP mt11 nd">
                      <span class="sprite b-error-alert"></span>
                      <p class="errTextP">errTips</p>
                  </div>
              </div>
          </form>
          <form id="ph-cloud" class="nd">
              <div class="mt11 form-line" id="ph-cloud-user-div">
                  <span class="sprite c-login-account"></span>
                  <input type="text" id="ph-cloud-user" class="form-inputText" placeholder="Username"
                         autocomplete="off">
                  <div class="errDivP mt11 nd">
                      <span class="sprite b-error-alert"></span>
                      <p class="errTextP"></p>
                  </div>
              </div>
              <div class="mt11 form-line">
                  <span class="sprite c-login-password"></span>
                  <input type="password" id="ph-cloud-password" class="form-inputText" placeholder="Password"
                         autocomplete="off">
                  <div class="errDivP mt11 nd">
                      <span class="sprite b-error-alert"></span>
                      <p class="errTextP"></p>
                  </div>
              </div>
              <div class="form-line mt20">
                  <input type="button" id="ph-cloud-btn" class="form-lgBt" value="Login">
                  <div id="ph-cloud-note" class="errDivP mt11 nd">
                      <span class="sprite b-error-alert"></span>
                      <p class="errTextP">errTips</p>
                  </div>
              </div>
          </form>
      </div>
      <div class="ph-bot">
          <a href="javascript:void(0);" id="pb-phone" class="ph-bot-phone selected"></a>
          <span>|</span>
          <a href="javascript:void(0);" id="pb-pc" class="ph-bot-pc"></a>
      </div>
  </div>
  <script type="text/javascript">
  $(function () {
      var INCLUDE_LOGIN_USERNAME = 0;
  	var isPhoneUI = false;
      var cloudLogined = false;
  	var isCloudBind = false;
      var HTTP_ERR_USER_PWD_NOT_CORRECT = 71233;
  	if(INCLUDE_LOGIN_GDPR_ENCRYPT) {
  		$.newencryptorManager = $.encrypt.encryptManager;
  		$.newencryptorManager.cleanStorage();
  		$.Iencryptor = $.newencryptorManager.genEncryptor();
  	}
      $.userInfo={};
  	localStorage.removeItem("userInfo");
      if (location.protocol != "https:") {
          if ('httpsLocalEnabled'in window && httpsLocalEnabled == '1') {
              window.location.href = "https://" + location.hostname + (('httpsLocalPort' in window && httpsLocalPort == "") ? "" : (":" + httpsLocalPort));
          }
      }
      try {
          $.locale.load(locale_language, null, null, true);
      } catch (e) {
      }
      var timesText = $.tpLang.login.timesText;
      $('#pc-top-product').attr('href', $.su.CHAR.SUPPORT[$.locale.locale.toUpperCase()]);
      $('#pc-login-btn,#pc-cloud-btn').html('<span class="text button-text">' + $.tpLang.login.login + '</span>');
      $('#pc-setPwd-btn').html('<span class="text button-text">' + $.tpLang.login.start + '</span>');
  	$('#cloud-bind-btn').html('<span class="text button-text">' + $.tpLang.login.BIND + '</span>');
      $('#pwdCheck-low').html($.tpLang.login.low);
      $('#pwdCheck-middle').html($.tpLang.login.middle);
      $('#pwdCheck-high').html($.tpLang.login.high);
      $('#pc-login-forget-text').html($.tpLang.login.forgetNote);
      $('#pc-login-forget-title').html($.tpLang.login.forgetPwd);
      $('#pc-login-forget-back').html('<span class="text button-text">' + $.tpLang.m_str.back + '</span>');
      $('#pc-bot-app').html($.tpLang.qrApp.HELP_APP);
      $("span#characters-illustrate-title").html($.tpLang.qrApp.CHARACTERS_ILLUSTRETE_TITLE);
      $("span#characters-illustrate-note").html($.tpLang.qrApp.CHARACTERS_ILLUSTRETE_NOTE);
      $('#qr-close-icon').on('click', function() {
          $('#qr-code-container').slideUp();
          document.cookie = 'qrClose=true';
      });
      $('#pc-bot-app').on('click', function () {
          if (!$('#qr-code-container').is(':visible')) {
              $('#qr-code-container').slideDown();
              $.deleteCookie('qrClose');
          } else {
              $('#qr-code-container').slideUp();
              document.cookie = 'qrClose=true';
          }
      });
      $('#pc-login-password').tpInput({
          placeholder: $.tpLang.login.password,
  		parentClass: null,
  		bubbleError: true
      });
      $('#pc-login-user').tpInput({
          placeholder: $.tpLang.login.userName,
  		parentClass: null,
  		bubbleError: true
      });
      $('#pc-setPwd-new').tpInput({
          placeholder: $.tpLang.login.newPassword,
  		parentClass: null,
  		bubbleError: true
      });
      $('#pc-setPwd-confirm').tpInput({
          placeholder: $.tpLang.login.confirmPassword,
  		parentClass: null,
  		bubbleError: true
      });
      $('#pb-phone').html($.tpLang.login.phone);
      $('#pb-pc').html($.tpLang.login.pc);
      $('#ph-setPwd-new').attr('placeholder', $.tpLang.login.newPassword);
      $('#ph-setPwd-confirm').attr('placeholder', $.tpLang.login.confirmPassword);
      $('#pwdCheckP-low').html($.tpLang.login.low);
      $('#pwdCheckP-middle').html($.tpLang.login.middle);
      $('#pwdCheckP-high').html($.tpLang.login.high);
      $('#ph-setPwd-btn').prop('value', $.tpLang.login.start);
      $('#ph-login-user').attr('placeholder', $.tpLang.login.userName);
      $('#ph-login-password').attr('placeholder', $.tpLang.login.password);
      $('#ph-login-btn').attr('value', $.tpLang.login.login);
      $('#ph-cloud-user').attr('placeholder', $.tpLang.login.email);
      $('#ph-cloud-password').attr('placeholder', $.tpLang.login.password);
      $('#ph-cloud-btn').attr('value', $.tpLang.login.login).on('click', function () {
          cloudSubmit(true);
      });
      var PCSubWin = function () {
      };
      try {
          if (modelName) {
              document.title = modelName;
              $("#pc-bot-productName").html(modelName);
              $("#pc-bot-modelDesc").html(modelDesc || '');
              $("#ph-productName").html(modelName);
          }
      } catch (e) {
      }
      var isLocked = false;
      var isMF = 0;
      $('body').on('keydown', function (event) {
          if (event.keyCode == 13) {
              PCSubWin(isMF);
          }
      });
  	$('#pc-login-password').next('input').on('keydown', function (event) {
          if (event.keyCode == 13) {
              PCSubWin(isMF);
          }
      });
      $('#cloud-bind-password').next('input').on('keydown', function (event) {
          if (event.keyCode == 13) {
              PCSubWin(isMF);
          }
      });
      function buttonError(obj, text, notHide) {
          var tip = $(obj).next('.widget-error-tips');
          if (text === false) {
              tip.hide();
              return;
          }
          if (tip.length == 0) {
              tip = $('<div class="button-error-tips widget-error-tips"><span class="widget-error-tips-delta"></span><div class="widget-error-tips-wrap"><div class="content error-tips-content"><span class="errorContent"></span></div></div></div>').insertAfter($(obj));
          }
          tip.show().find('.errorContent').html(text);
          $('body').off('click.buttonError');
          if (notHide !== true) {
              $('body').on('click.buttonError', function () {
                  tip.hide();
                  $('body').off('click.buttonError');
              });
          }
      }
      var rsaEncrypt = $.rsa.encrypt;
      function lockWeb(bLock) {
          $("#pc-login-password").tpInput('disabled', bLock);
          $("#pc-login-user").tpInput('disabled', bLock);
          $("#ph-login-password").prop('disabled', bLock);
          $("#ph-login-user").prop('disabled', bLock);
          $("#cloud-bind-password").tpInput('disabled', bLock);
          $("#cloud-bind-user").tpInput('disabled', bLock);
          $("#ph-cloud-password").prop('disabled', bLock);
          $("#ph-cloud-user").prop('disabled', bLock);
  		$("#cloud-bind-password").tpInput('disabled', bLock);
      }
      function getHttpObject(hook) {
          var xmlHttp = null;
          try {
              xmlHttp = new XMLHttpRequest();
          } catch (e) {
              try {
                  xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
              } catch (e) {
                  try {
                      xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
                  } catch (e) {
                  }
              }
          }
          xmlHttp.onreadystatechange = function () {
              if (xmlHttp.readyState == 4) {
                  if (hook)
                      hook();
              }
          };
          return xmlHttp;
      }
      var us;
      function getAuthParm() {
          var xmlHttpObj;
          xmlHttpObj = getHttpObject(function () {
              if (xmlHttpObj.status == 200) {
                  return;
              } else {
                  window.location.href = window.location.protocol + "//" + window.location.host;
              }
          });
          xmlHttpObj.open("POST", window.location.protocol + "//" + window.location.host + "/cgi/getParm?_=" + (+new Date()), false);
          xmlHttpObj.send(null);
          eval(xmlHttpObj.responseText);
          $.nn = nn;
          $.ee = ee;
          us = userSetting;
  		if(INCLUDE_LOGIN_GDPR_ENCRYPT){
              $.seq = seq;
              $.Iencryptor.setSeq($.seq);
              $.Iencryptor.setRSAKey($.nn, $.ee);
          }
      }
          function getBusy(callback) {
          var xmlHttpObj;
          var retry = 0;
          var sendCgi = function () {
              xmlHttpObj = getHttpObject(function () {
                  if (xmlHttpObj.status == 200) {
                      eval(xmlHttpObj.responseText);
                      callback.call(null, {
                          isLogined: isLogined,
                          isBusy: isBusy
                      });
                  } else {
                      if (retry < 1) {
                          retry++;
                          sendCgi();
                      } else {
                          window.location.href = window.location.protocol + "//" + window.location.host;
                      }
                  }
              });
              xmlHttpObj.open("POST", window.location.protocol + "//" + window.location.host + "/cgi/getBusy?_=" + (+new Date()), callback ? true : false);
              xmlHttpObj.send(null);
          };
          sendCgi();
          if (callback === undefined) {
              eval(xmlHttpObj.responseText);
              return {
                  isLogined: isLogined,
                  isBusy: isBusy
              }
          }
      }
      $('#pb-pc').on('click', function () {
          document.cookie = 'UserChange=true';
          window.location.href = window.location.protocol + "//" + window.location.host;
      });
      $('#ph-setPwd-new, #ph-setPwd-confirm, #ph-login-user, #ph-login-password, #ph-cloud-user, #ph-cloud-password').on('focus', function () {
          $(this).removeClass('err').next('div.errDivP').hide();
      });
      function inputError(obj, text, isMobile) {
          if (text === false) {
              if (isMobile) {
                  $(obj).removeClass('err').next('div.errDivP').hide();
              } else {
                  $(obj).tpInput('hideError');
              }
          } else {
              if (isMobile === true) {
                  $(obj).addClass('err').next('div.errDivP').show().find('.errTextP').html(text);
              } else {
                  $(obj).tpInput('showError', text);
              }
          }
      }
      $('#pb-phone').on('click', function () {
          $.deleteCookie("UserChange");
      });
      if (document.getElementById("mainBody") != null) {
          (function (domain, port, frame, page) {
              if ($.local) {
                  location.reload(true);
              } else {
                  var ret = window.parent.location.href.match(/(https?):\/\/([^:\/]+)(:\d+)?\/?([^?]*)/);
                  window.parent.location.href = ret[1] + "://" + (domain ? domain : ret[2]) + (port ? ":" + port : (ret[3] ? ret[3] : "")) + "/" + (frame ? frame : (ret[4] ? ret[4] : "")) + (page ? "#__" + page.match(/\w+\.htm$/) : "");
              }
          })();
      }
      var pwdCheckOK = false;
      $('#pc-setPwd-btn').on('click', function () {
          setPwdSubmit();
      });
      $('#pc-setPwd-confirm').on('ev_focus', function () {
          if (pwdCheckOK == false) {
              $('#pc-setPwd-new').tpInput('focus');
              checkPwd();
          }
      });
      $("#pc-setPwd-new").on('keyup', function () {
          checkPwd();
      });
      $('#ph-setPwd-btn').on('click', function () {
          setPwdSubmit(true);
      });
      $('#ph-setPwd-confirm').on('focus', function () {
          if (pwdCheckOK == false) {
              $('#ph-setPwd-new').focus();
              checkPwd(true);
          }
      });
      $("#ph-setPwd-new").on('keyup', function () {
          checkPwd(true);
      });
      function doSetPassword(pwd, callback) {
          var xmlHttpObj;
          if (us != 0 && us != 3) {
              return;
          }
          xmlHttpObj = getHttpObject(function () {
              if (xmlHttpObj.status == 200) {
                  if (callback) {
                      callback();
                  }
              } else
                  return;
          });
  		if ($.nn==undefined){
              getAuthParm();
          }
  		if(INCLUDE_LOGIN_GDPR_ENCRYPT){
              $.Iencryptor.setHash('admin', pwd);
              $.Iencryptor.genAESKey();
              $.newencryptorManager.recordEncryptor();
              var preObj = $.Iencryptor.AESEncrypt(pwd,1);
              xmlHttpObj.open("POST", window.location.protocol + "//" + window.location.host + "/cgi/setPwd?pwd=" + encodeURIComponent(preObj.data)+"&sign="+preObj.sign, true);
          }
  		else{
  			var prePwd = encodeURIComponent(rsaEncrypt($.Base64Encoding(pwd), $.nn, $.ee));
  			xmlHttpObj.open("POST", window.location.protocol + "//" + window.location.host + "/cgi/setPwd?pwd=" + prePwd, true);
          }
  		xmlHttpObj.send(null);
      }
  	var setPwdFlag = 0;
      var setPwdSubmit = function (isMobile) {
          var $password = $("#pc-setPwd-new");
          var $confirm = $("#pc-setPwd-confirm");
          var value = $password.tpInput('val');
          var confirmValue = $confirm.tpInput('val');
          if (isMobile === true) {
              $password = $("#ph-setPwd-new");
              $confirm = $("#ph-setPwd-confirm");
              value = $password.val();
              confirmValue = $confirm.val();
          }
          if (value == "") {
              inputError($password, $.tpLang.login.tipsText, isMobile);
              return;
          }
          if (value.length > 32) {
              inputError($password, $.tpLang.login.tipsTextLength, isMobile);
              return;
          }
          if (confirmValue == "") {
              inputError($confirm, $.tpLang.login.tipsText, isMobile);
              return;
          }
          if (confirmValue != value) {
              inputError($confirm, $.tpLang.login.tipsTextConfirm, isMobile);
              return;
          }
  		if (setPwdFlag == 1) return ;
  		setPwdFlag = 1;
          doSetPassword(value, function () {
  			if ($.nn==undefined){
                  getAuthParm();
              }
              var auth = rsaEncrypt($.Base64Encoding(value), $.nn, $.ee);
              var name = rsaEncrypt('admin', $.nn, $.ee);
              var action = 1;
  			if(INCLUDE_LOGIN_GDPR_ENCRYPT) {
                  auth = $.Iencryptor.AESEncrypt('admin\n'+value, 1);
                  $.newencryptorManager.recordEncryptor();
              }
              doLogin(name, auth, action, isMobile, (isMobile ? $('#ph-setPwd-btn') : $('#pc-setPwd-btn')));
          });
      };
      function checkPwd(isMobile) {
          var $password = $("#pc-setPwd-new");
          var $pwdCheck = $('#pwdCheck');
          var value = $password.tpInput('val');
          if (isMobile === true) {
              $password = $("#ph-setPwd-new");
              $pwdCheck = $('#passwordLevelP');
              value = $password.val();
          }
          var asciiWithoutSpace = /^(?=[^ ]+$)[\x21-\x7f]+$/;
          var upperRe = /[A-Z]/;
          var lowerRe = /[a-z]/;
          var otherRe = /(.[^a-zA-Z0-9])/;
          var digitRe = /\d/;
          var hasUpper = 0;
          var hasLower = 0;
          var hasDigit = 0;
          var hasOther = 0;
          var largeLength = 0;
          var level = 0;
          if (asciiWithoutSpace.test(value) === false) {
              $pwdCheck.removeClass('level1 level2 level3');
              if (value == '') {
                  inputError($password, $.tpLang.login.tipsText, isMobile);
              } else {
                  inputError($password, $.tpLang.login.tipsTextAscii, isMobile);
              }
              pwdCheckOK = false;
              return;
          } else {
              inputError($password, false, isMobile);
              if (upperRe.test(value)) {
                  hasUpper = 1;
              } else {
                  hasUpper = 0;
              }
              if (lowerRe.test(value)) {
                  hasLower = 1;
              } else {
                  hasLower = 0;
              }
              if (digitRe.test(value)) {
                  hasDigit = 1;
              } else {
                  hasDigit = 0;
              }
              if (otherRe.test(value)) {
                  hasOther = 1;
              } else {
                  hasOther = 0;
              }
              if (value.length > 10) {
                  largeLength = 1;
              } else {
                  largeLength = 0;
              }
              level = hasUpper + hasLower + hasDigit + largeLength + hasOther;
              if (value.length <= 5) {
                  if (level <= 2) {
                      $pwdCheck.removeClass('level2 level3').addClass('level1');
                  } else if (level == 3 || level == 4) {
                      $pwdCheck.removeClass('level1 level3').addClass('level2');
                  }
              } else {
                  if (level <= 1) {
                      $pwdCheck.removeClass('level2 level3').addClass('level1');
                  } else if (level == 2 || level == 3) {
                      $pwdCheck.removeClass('level1 level3').addClass('level2');
                  } else if (level >= 4) {
                      $pwdCheck.removeClass('level2 level1').addClass('level3');
                  }
              }
              pwdCheckOK = true;
          }
      }
      function initSetPwd(isMobile) {
          $('#pc-login').addClass('nd');
          $('#pc-cloud').addClass('nd');
          $('#pc-setPwd').removeClass('nd');
          $('#qr-code-container').removeClass('nd');
          buttonError($('#pc-setPwd-btn'), "<span class='red'>" + $.tpLang.login.notePart1 + ":</span> <br />" + $.tpLang.login.notePart2);
          $('#ph-setPwd').removeClass('nd');
          $('#ph-login').addClass('nd');
          $('#ph-cloud').addClass('nd');
          $('#ph-setPwd-note').show().find('.errTextP').html("<span class='red'>" + $.tpLang.login.notePart1 + ":</span> <br />" + $.tpLang.login.notePart2);
      }
      $('#pc-login-password').on('ev_focus', function () {
          if (INCLUDE_LOGIN_USERNAME && $('#pc-login-user').val() == '') {
              inputError($('#pc-login-user'), $.tpLang.login.tipsText);
          }
      });
      $('#pc-login-btn').on('click', function () {
          loginSubmit();
      });
      $('#pc-login-forgetPwd').html($.tpLang.login.forgetPwd).on("click", function (e) {
          $('#pc-login-forget').removeClass('nd');
          $('#pc-login-main').addClass('nd');
      });
      $('#pc-login-forget-back').on("click", function (e) {
          $('#pc-login-forget').addClass('nd');
          $('#pc-login-main').removeClass('nd');
          return false;
      });
      $('#ph-login-password').on('focus', function () {
          if (INCLUDE_LOGIN_USERNAME && $('#ph-login-user').val() == '') {
              inputError($('#pc-login-user'), $.tpLang.login.tipsText, true);
          }
      });
      $('#ph-login-btn').on('click', function () {
          loginSubmit(true);
      });
      function showWelcome() {
          $('#welcome').removeClass('nd');
          $('#ph-div').addClass('nd');
          var icons = ['usb', 'wireless', 'internet', 'guest', 'device', 'phone'];
          for (var i = 0; i < icons.length; i++) {
              (function () {
                  var id = 'wel-' + icons[i];
                  var name = icons[i] + '-show';
                  setTimeout(function () {
                      $('#' + id).addClass(name);
                  }, 100 * (i + 1));
              })();
          }
          setTimeout(function () {
              $('#wel-logo').addClass('logo-show');
          }, 1500);
          setTimeout(function () {
              showLoginMobile();
          }, 3500);
      }
      function showLoginMobile() {
          $('#welcome').addClass('nd');
          $('#ph-div').removeClass('nd');
      }
      function initLogin(isMobile) {
          $('#pc-div').removeClass('nd');
          if (isCloudBind){
              $('#pc-login').addClass('nd');
              $('#pc-cloud').removeClass('nd');
          } else {
              $('#pc-login').removeClass('nd');
              $('#pc-cloud').addClass('nd');
          }
          $('#pc-setPwd').addClass('nd');
          $('#ph-login').removeClass('nd');
          $('#ph-setPwd').addClass('nd');
          $('#ph-cloud').addClass('nd');
          if (isMobile == true && authTimes == 0) {
              showWelcome();
          } else {
              showLoginMobile();
          }
          if (INCLUDE_LOGIN_USERNAME) {
              $('#pc-login-user-div').removeClass('nd');
              $('#ph-login-user-div').removeClass('nd');
  			$('#cloud-bind-user-div').removeClass('nd');
          }
  		if (authTimes == 0) {
  			setErrorShowCookie(0);
  		}
          if (authTimes > 0) {
  			var errorShowFlag = getErrorShowCookie();
              var text = $.tpLang.login.errorText;
              if (INCLUDE_LOGIN_USERNAME) {
                  text = $.tpLang.login.errorText2;
              }
  			if (authTimes > errorShowFlag) {
              	buttonError($('#pc-login-btn'), text);
                  if (isCloudBind)
                      buttonError($('#cloud-bind-btn'), text);
              	inputError($('#ph-login-password'), text, true);
  				setErrorShowCookie(authTimes);
  			}
              if (INCLUDE_LOGIN_USERNAME) {
                  $('#ph-login-password').removeClass('err');
              }
          }
          if (authTimes >= 5) {
              isLocked = true;
              lockWeb(true);
              var count = 600 - forbidTime;
              buttonError($('#pc-login-btn'), timesText.replace('$', count), true);
  			if (isCloudBind)
                  buttonError($('#cloud-bind-btn'), timesText.replace('$', count), true);
              inputError($('#ph-login-password'), timesText.replace('$', count), true);
              if (INCLUDE_LOGIN_USERNAME) {
                  $('#ph-login-password').removeClass('err');
              }
  			setErrorShowCookie(0);
              setTimeout(function () {
                  if (count < 1) {
                      buttonError($('#pc-login-btn'), false);
  					if (isCloudBind)
                          buttonError($('#cloud-bind-btn'), false);
                      inputError($('#ph-login-password'), false, true);
                      isLocked = false;
                      lockWeb(false);
                      if (INCLUDE_LOGIN_USERNAME) {
                          if (isMF) {
                              $('#ph-login-user').focus();
                          } if (isCloudBind){
                              $('#cloud-bind-user').focus();
                          } else {
                              $('#pc-login-user').focus();
                          }
                      } else {
                          if (isMF) {
                              $('#ph-login-password').focus();
                          } if (isCloudBind){
                              $('#cloud-bind-password').focus();
                          } else {
                              $('#pc-login-password').focus();
                          }
                      }
                      window.location.reload();
                      return;
                  }
                  count--;
                  buttonError($('#pc-login-btn'), timesText.replace('$', count), true);
  				if (isCloudBind)
                      buttonError($('#cloud-bind-btn'), timesText.replace('$', count), true);
                  inputError($('#ph-login-password'), timesText.replace('$', count), true);
                  if (INCLUDE_LOGIN_USERNAME) {
                      $('#ph-login-password').removeClass('err');
                  }
                  window.setTimeout(arguments.callee, 1000);
              }, 1000);
          } else {
              if (INCLUDE_LOGIN_USERNAME) {
                  if (isMF) {
                      $('#ph-login-user').focus();
                  } if (isCloudBind){
                      $('#cloud-bind-user').focus();
                  } else {
                      $('#pc-login-user').focus();
                  }
              } else {
                  if (isMF) {
                  } if (isCloudBind){
                      $('#cloud-bind-password').focus();
                  } else {
                      $('#pc-login-password').focus();
                  }
              }
          }
      }
  	var loginFlag = 0;
      var loginSubmit = function (isMobile) {
          if (isLocked == true) {
              return;
          }
          var auth;
          var name;
          var action = 1;
          var $password = $("#pc-login-password");
          var $user = $("#pc-login-user");
          var pwd = $("#pc-login-password").tpInput('val');
          if (isMobile === true) {
              $password = $("#ph-login-password");
              $user = $("#ph-login-user");
              pwd = $password.val();
          }
          var user = $user.val();
          if (INCLUDE_LOGIN_USERNAME && user == '') {
              inputError($user, $.tpLang.login.tipsText, isMobile);
              return;
          }
          if (pwd == "") {
              inputError($password, $.tpLang.login.tipsText, isMobile);
              return;
          }
  		if (pwd.length > 32) {
              inputError($password, $.tpLang.login.tipsTextLength, isMobile);
              return;
          }
  		if ($.nn==undefined){
              getAuthParm();
          }
  		if(loginFlag == 1) 	return;
  		loginFlag = 1;
  		if(INCLUDE_LOGIN_GDPR_ENCRYPT) {
              if (!INCLUDE_LOGIN_USERNAME) {
                  user='admin';
              }
              $.Iencryptor.setHash(user, pwd);
              $.Iencryptor.genAESKey();
              auth = $.Iencryptor.AESEncrypt(user+"\n"+pwd, 1);
              $.newencryptorManager.recordEncryptor();
          }
  		else{
  			auth = rsaEncrypt($.Base64Encoding(pwd), $.nn, $.ee);
  			if (INCLUDE_LOGIN_USERNAME) {
  				name = rsaEncrypt(user, $.nn, $.ee);
  			} else {
  				name = rsaEncrypt('admin', $.nn, $.ee);
  			}
  		}
          doLogin(name, auth, action, isMobile, (isMobile ? $('#ph-login-btn') : $('#pc-login-btn')));
      };
      function doLogin(name, auth, action, isMobile, btn, userInfo) {
          if (!isMobile) {
              $.addLoading(btn);
          } else {
              $.showCover();
          }
          var xmlHttpObj = getHttpObject(function () {
              if (!isMobile) {
                  $.removeLoading();
              } else {
                  $.hideCover();
              }
              eval(xmlHttpObj.responseText);
  			if (HTTP_ERR_USER_PWD_NOT_CORRECT==$.ret) {
                  authTimes = currAuthTimes;
                  forbidTime = currForbidTime;
                  if (!$('#pc-cloud').hasClass('nd')){
                      isCloudBind = true;
                  }else {
                      isCloudBind = false;
                  }
  				initPage(isMobile);
  			} else {
  				if (isMobile) {
                  	window.location.href= window.location.protocol + "//" + window.location.host + "/index.mobile.htm";
              	} else {
  					window.location.href = window.location.protocol + "//" + window.location.host;
  				}
  			}
          });
  		if(INCLUDE_LOGIN_GDPR_ENCRYPT) {
  			  xmlHttpObj.open("POST", window.location.protocol + "//" + window.location.host + "/cgi/login?data=" + 		encodeURIComponent(auth.data) + "&sign=" + auth.sign + "&Action=" + action + "&LoginStatus=0&isMobile=" + (isMobile ? "1" : "0"), true);
  		} else {
              if(userInfo!=undefined) {
                  xmlHttpObj.open("POST", window.location.protocol + "//" + window.location.host + "/cgi/login?UserName=" + name + "&Passwd=" + auth + "&Action=" + action +"&cloudUserName="+ $.Base64Encoding(userInfo.username) + "&Token="+ userInfo.token + "&LoginStatus=0", true);
              } else {
                  xmlHttpObj.open("POST", window.location.protocol + "//" + window.location.host + "/cgi/login?UserName=" + name + "&Passwd=" + auth + "&Action=" + action + "&LoginStatus=0", true);
              }
          }
          getBusy(function (status) {
              if (status.isLogined == 0) {
                  xmlHttpObj.send(null);
              } else {
                  tpConfirm($.tpLang.login.forceLogout, function () {
                      if (!isMobile) {
                          $.addLoading(btn);
                      } else {
                          $.showCover();
                      }
                      if (status.isBusy == 1) {
                          var delay = 1000;
                          var count = 0;
                          var timesTotal = 2;
                          var ask = function () {
                              getBusy(function (status) {
                                  if (status.isBusy == 0 || count >= timesTotal) {
                                      xmlHttpObj.send(null);
                                  } else {
                                      count++;
                                      setTimeout(ask, delay);
                                  }
                              });
                          };
                          setTimeout(ask, delay);
                      } else {
                          xmlHttpObj.send(null);
                      }
                  }, function () {
                      if (!isMobile) {
                          $.removeLoading();
                      } else {
                          $.hideCover();
                      }
                  }, null, $.tpLang.login.login, $.tpLang.m_str.cancel);
              }
          });
      }
      function getErrorShowCookie(){
          var name = "loginErrorShow=";
          var ca = document.cookie.split(";");
          for(var i = 0; i < ca.length; i++){
              var c = ca[i].trim();
              if(c.indexOf(name) == 0){
                  return c.substring(name.length, c.length);
              }
          }
          return "0";
      }
      function setErrorShowCookie(flag){
          document.cookie = "loginErrorShow=" + flag;
      }
      function tpConfirm(str, ok, no, replaceStr, okStr, cancelStr) {
          $('#mask').show();
          var container = $('#alert-container');
          if (isMF) {
              container.addClass('ph');
          } else {
              container.removeClass('ph');
          }
          container.show()
                  .find('.grid-warning-msg span.text').html(str);
          $('#confirm-no').html('<span>' + (cancelStr || $.tpLang.m_str.cancel) + '</span>').off('click').on('click', function () {
              $('#alert-container').hide();
              $('#mask').hide();
              if (no) {
                  no();
              }
          });
          $('#alert-container .msg-close').off('click').on('click', function () {
              $('#alert-container').hide();
              $('#mask').hide();
              if (no) {
                  no();
              }
          });
          $('#confirm-yes').html('<span>' + (okStr || $.tpLang.m_str.ok) + '</span>').off('click').on('click', function () {
              $('#alert-container').hide();
              $('#mask').hide();
              if (ok) {
                  ok();
              }
          });
      }
      var token;
      $('#cloud-bind-btn').on('click', function () {
          cloudSubmit();
      });
      $('#cloud-bind-user').tpInput({
          placeholder: $.tpLang.login.email,
  		parentClass: null,
  		bubbleError: true
      });
      $('#cloud-bind-password').on('ev_focus', function () {
          if ($('#cloud-bind-user').tpInput('val') == '') {
              inputError($('#cloud-bind-user'), $.tpLang.login.tipsText);
          }
      }).tpInput({
          placeholder: $.tpLang.login.password,
  		parentClass: null,
  		bubbleError: true
      });
      $('#pc-cloud-forgetPwd').html($.tpLang.login.forgetPwd).on("click", function (e) {
          e.preventDefault();
          onReceive({data: {eType: "ev_goto", url: "findBackPassword"}, source: null, origin: "_self"});
      });
  	var loginSwitchBtn = $("<div class=\"login-switch-btn\"><span>" + $.tpLang.login.LOGIN_WITH_TPLINK_ID + "</span></div><div class=\"login-switch-note nd\">"+$.tpLang.login.LOGIN_SWITCH_NOTE+"</div>");
  	$('#pc-login-submit').append(loginSwitchBtn);
      $("span#login-bind-note").html($.tpLang.login.BIND_NOTE);
      $("#bound-error .note").text($.tpLang.login.BOUND_ERROR_NOTE);
  	$("#bound-error .switch-btn").text($.tpLang.login.LOGIN_WITH_ROUTER_PASSWORD);
      $("#bound-error .switch-btn").click(function(){
  		$("#bound-error").hide();
  		initLogin(isPhoneUI);
  	});
      $('.login-switch-btn').on("click", function (e) {
          if (isLocked == true) {
              return;
          }
          $.addLoading();
  		if ($.nn==undefined){
              getAuthParm();
          }
  		isCloudBind = false;
          $.checkCloudConn(function(){
              initCloud();
                  e.preventDefault();
                  $(".login-switch-note").hide();
                  onReceive({data: {eType: "ev_goto", url: "login"}, source: null, origin: "_self"});
                  $.removeLoading();
              }, function(){
                  $(".login-switch-note").show();
                  $.removeLoading();
          });
      });
      function getBindStatus(username,token) {
          var xmlHttpObj;
          xmlHttpObj = getHttpObject(function () {
              if (xmlHttpObj.status == 200) {
                  return;
              } else {
                  window.location.href= window.location.protocol + "//" + window.location.host;
              }
          });
          if(INCLUDE_LOGIN_GDPR_ENCRYPT) {
              var info;
              var str = username+"&"+token;
              $.Iencryptor.setHash(username, token);
              $.Iencryptor.genAESKey();
              info = $.Iencryptor.AESEncrypt(str, 1);
              $.newencryptorManager.recordEncryptor();
              xmlHttpObj.open("POST", window.location.protocol + "//" + window.location.host + "/cgi/getBindStatus?data=" + encodeURIComponent(info.data) +"&sign=" + info.sign, false);
          } else {
              xmlHttpObj.open("POST", window.location.protocol + "//" + window.location.host + "/cgi/getBindStatus?cloudUserName="+$.Base64Encoding(username)+"&Token="+token, false);
          }
          xmlHttpObj.send(null);
          eval(xmlHttpObj.responseText);
          $.BindStatus = BindStatus;
          $.Role = Role;
      }
      function initCloud() {
          $('#pc-login').addClass('nd');
          $('#pc-cloud').removeClass('nd');
          $('#pc-setPwd').addClass('nd');
          $('#ph-login').addClass('nd');
          $('#ph-cloud').removeClass('nd');
          $('#ph-setPwd').addClass('nd');
      }
  	var cloudloginFlag = 0;
      var cloudSubmit = function (isMobile) {
          if (isLocked == true) {
              return;
          }
          $.addLoading();
          var auth;
          var name;
          var action = 4;
          var $password = $("#cloud-bind-password");
          var $user = $("#cloud-bind-user");
          var pwd = $password.tpInput('val');
          var user = $user.tpInput('val');
  		var userInfo = $.userInfo;
          if (isMobile === true) {
              $password = $("#ph-cloud-password");
              $user = $("#ph-cloud-user");
              pwd = $password.val();
              user = $user.val();
          }
          if (INCLUDE_LOGIN_USERNAME && user == '') {
              inputError($user, $.tpLang.login.tipsText, isMobile);
              return;
          }
          if (pwd == "") {
              inputError($password, $.tpLang.login.tipsText, isMobile);
              return;
          }
  		if (pwd.length > 32) {
              inputError($password, $.tpLang.login.tipsTextLengthCloud, isMobile);
              return;
          }
  		if (!INCLUDE_LOGIN_USERNAME){
              user="admin";
          }
  		if ($.nn==undefined){
              getAuthParm();
          }
  		if(cloudloginFlag == 1) 	return;
  		cloudloginFlag = 1;
          auth = rsaEncrypt($.Base64Encoding(pwd), $.nn, $.ee);
          name = rsaEncrypt(user, $.nn, $.ee);
  		if(INCLUDE_LOGIN_GDPR_ENCRYPT) {
              var str=user+"\n"+pwd+"\n"+$.userInfo.username+"\n"+$.userInfo.token;
              $.Iencryptor.setHash(user, pwd);
              $.Iencryptor.genAESKey();
              auth = $.Iencryptor.AESEncrypt(str, 1);
              $.newencryptorManager.recordEncryptor();
          }
          localStorage.setItem("userInfo", JSON.stringify(userInfo));
          doLogin(name, auth, action, isMobile, (isMobile ? $('#ph-cloud-btn') : $('#pc-cloud-btn')), userInfo);
      };
      function onReceive(eObject) {
          var e = eObject.originalEvent || eObject;
          if (e.origin !== $.cloudOrigin && e.origin !== "_self" && e.origin != undefined) {
              return;
          }
          var data = e.data;
          if (typeof(e.data) == "string") {
              data = $.parseJSON(data);
          }
          if (data) {
              switch (data.eType) {
                  case "ev_login": {
  					if(data.validate){
                          cloudLogined = true;
                          $.userInfo.username = data.email;
                          $.userInfo.token = data.token;
                          getBusy(function(status) {
                              if (status.isLogined == 0) {
                                  doCloudLogin();
                              } else {
                                  tpConfirm($.tpLang.login.forceLogout, function () {
                                      $.addLoading();
                                      if (status.isBusy == 1) {
                                          var delay = 1000;
                                          var count = 0;
                                          var timesTotal = 2;
                                          var ask = function() {
                                              getBusy(function(status) {
                                                  if (status.isBusy == 0 || count >= timesTotal) {
                                                      doCloudLogin();
                                                  } else {
                                                      count++;
                                                      setTimeout(ask, delay);
                                                  }
                                              });
                                          };
                                          setTimeout(ask, delay);
                                      } else {
                                          doCloudLogin();
                                      }
                                  }, function () {
                                      $.removeLoading();
                                  }, null, $.tpLang.login.login, $.tpLang.m_str.cancel);
                              }
                          });
  					}
                      break;
  				}
                  case "ev_goto":
                  {
                      if (data.url) {
                          $.getToken(data.url, null, false, true);
                      }
                      else {
                          if (data.index == "login_switch") {
                              $("#cloud-login").hide();
  							initLogin(isPhoneUI);
                          }
                      }
                      if ("login" == data.url || "login" == data.index) {
                          $("#cloud-login").show();
                          $("#pc-cloud-form").hide();
                      }
                      else if ("findBackPassword" == data.url || "findBackPassword" == data.index) {
                          $.showLoading();
                      }
                      break;
                  }
                  case "load":
                  {
                      var params = {};
                      params.locale = locale_language || $.locale._findLocale(navigator.language || navigator.browserLanguage);
                      params.force = true;
                      params.model = modelName;
                      params.eType = "ev_init";
                      var str = JSON.stringify(params);
                      window.frames["cloud-login"] && window.frames["cloud-login"].postMessage(str, $.cloudOrigin);
                      $.clearWaitingEvent();
                      $.getDeviceInfo(false);
                      $("#cloud-login").show();
                  }
                  case "ev_reset":
                  {
                      $.iframeResize($("#cloud-login"), data.height);
                      break;
                  }
                  case "ev_error":
                  {
                      $("#cloud-login").attr("src", "../main/offlineError.htm");
                      $("#cloud-login").css({"height": 300});
                      break;
                  }
                  case "ev_windowResize":
                  {
                      var hasFrame = false;
                      try {
                          window.frames["cloud-login"] && window.frames["cloud-login"].name;
                      } catch (error) {
                          hasFrame = true;
                      }
                      if (hasFrame) {
                          var params = {};
                          params.eType = "ev_windowResize";
                          params.windowHeight = $(window).height() - 90;
                          params.windowWidth = $(window).width();
                          params.iframeTop = $("#cloud-login").offset().top
                          var str = JSON.stringify(params);
                          window.frames["cloud-login"].postMessage(str, $.su.url.cloudOrigin);
                      }
                  }
              }
          }
  		function doCloudLogin() {
              $.addLoading();
              setTimeout(function(){
              getBindStatus($.userInfo.username,$.userInfo.token);
              if ($.BindStatus!=undefined){
                  if ($.BindStatus==1){
                      localStorage.setItem("userInfo", JSON.stringify($.userInfo));
                      $.refresh();
                  } else if ($.BindStatus==2){
                      $("#cloud-login").hide();
                      $("#cloud-bind-main").show();
                      $("#bound-error").hide();
                      $.removeLoading();
                  } else if ($.BindStatus==3){
                      if ($.Role == 1){
                          localStorage.setItem("userInfo", JSON.stringify($.userInfo));
                          $.refresh();
                      } else {
                          $("#cloud-login").hide();
                          $("#cloud-bind-main").hide();
                          $("#bound-error").show();
                          $.removeLoading();
                      }
                  } else {
                      $.alert($.tpLang.m_str.unknown);
                      $.removeLoading();
                  }
              }
              },0);
          }
      }
      $(window).on("ev_watingTimeout", function () {
          $.clearWaitingEvent();
          $("#cloud-login").attr("src", "../main/offlineError.htm");
          $("#cloud-login").css({"height": 300});
          $("#cloud-login").show();
          $.removeLoading();
      });
      $(window).on("message", onReceive);
      function initPage(mobile) {
          if (mobile) {
          var setFontSize = document.createElement('script');
          setFontSize.type = 'text/javascript';
          setFontSize.innerHTML = 'var winX = $(window).width();var winY = $(window).height();var fontSize = 27 * ((winX < winY ? winX : winY) / 640);$("html").css("font-size", fontSize + "px");';
          $('head').append(setFontSize);
          $('#pc-div').hide();
          $('#ph-div').show();
          $('body').addClass('phoneBody');
          } else {
          $('#pc-div').show();
          $('#ph-div').hide();
          $('body').removeClass('phoneBody');
          }
          setPwdFlag = loginFlag = cloudloginFlag = 0;
          switch (us) {
              case 0:
              case 3:
                  setErrorShowCookie(1);
                  initSetPwd(mobile);
                  PCSubWin = setPwdSubmit;
                  break;
              case 2:
              case 1:
              default :
                  initLogin(mobile);
                  PCSubWin = loginSubmit;
                  break;
          }
      }
      function isMobile() {
          if (!('hasMobile' in window && hasMobile === '1')) {
              return false;
          }
          var check = false;
          (function (a) {
              if (/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0, 4))) check = true
          })(navigator.userAgent || navigator.vendor || window.opera);
          isMF = check;
          return check;
      }
      function checkPlatform() {
          var meta;
          meta = document.createElement('meta');
          meta.id = "viewport";
          meta.name = "viewport";
          if (isMobile() && (document.cookie.search('UserChange=tr
services.body_hash_sha1: sha1:adac334788d89d1a974c81ccdfcea07e4e222770
services.supported_versions: HTTP/1.1
[binary data, 9 values, 222 bytes]