function exec2(action, as, sh) {
  url = '';
  if (location.protocol.indexOf("https") == -1) {
    url = 'https://' + location.host;
  }
  pathname = location.pathname;
  pathname = pathname.substring(0, pathname.indexOf("/", 1) + 1);
  url += pathname + action + "?as=" + as + "&sh=" + sh;
  location.replace(url);
}

function chgProtocol(page) {
  url = '';
  newPage = page;
  if (location.protocol.indexOf("https") >= 0) {
    if (location.pathname.indexOf(".html") == -1) {
      pathname = location.pathname;
      pathname = pathname.substring(0, pathname.indexOf("/",1));
      url = 'http://' + location.host + pathname;
      if (newPage.indexOf("./") == 0) {
        newPage = newPage.substring(1);
      }
    }
  }
  url += newPage;
  location.replace(url);
}
