  function callPage(form, act, tid) {
    document.forms[form]._A.value = act ;
    document.forms[form]._T.value = tid ;
    document.forms[form].submit() ;
  } // callPage()

  function upload(url, pid, id, fn, img_id) {
    url = url + '?_P=' + pid + '&_T=AAZ01&_ID=' + id + '&_FN=' + fn + '&_IMG_ID=' + img_id + '&_A=ACT_INIT';
    window.open(url, "pictureedit", "width=300,height=300") ;
  } // upload()

  function preview(url, pid, typ, item_seq, offer_seq, com_seq) {
    url = url + '?_P=' + pid + '&_T=ABE09&_A=PREVIEW&_TYP=' + typ + '&_ITEM_SEQ=' + item_seq + '&_OFFER_SEQ=' + offer_seq + '&_COM_SEQ=' + com_seq ;
    window.open(url, "_blank", "left=80, top=50, width=900, height=550, toolbar=yes, scrollbars=yes, menubar=yes, resizable=yes") ;
  } // preview()

  function filter(val) {
    var buf = "" ;
    for (i = 0 ; i < val.length ; i++) {
      var c = val.charAt(i) ;
      switch (c) {
        case '&':
          c = "%26" ;
          break ;
        case '%':
          c = "%25" ;
          break ;
        case '#':
          c = "%23" ;
          break ;
        case '+':
          c = "%2b" ;
          break ;
        case '"':
          c = "%22" ;
          break ;
        default:
          break ;
      }
      buf += c ;
    }
    return buf ;
  } // filter()

  function setParm(form) {
      // id1
      dat = new Date() ;

      yy = digit2(dat.getYear().toString().substring(2, 5)) ;
      mm = digit2((dat.getMonth() + 1).toString()) ;
      dd = digit2(dat.getDate().toString()) ;
      hh = digit2(dat.getHours().toString());
      mi = digit2(dat.getMinutes().toString());
      ss = digit2(dat.getSeconds().toString());

      SABCDE = (yy + mm + dd) * 3 ;
      FGHIJK = (hh + mi + ss) * 3 ;

      SABCDE = digit6("" + SABCDE) ;    // 6桁揃え
      FGHIJK = digit6("" + FGHIJK) ;

      S = parseInt(SABCDE.substring(0, 1)) ;
      A = parseInt(SABCDE.substring(1, 2)) ;
      B = parseInt(SABCDE.substring(2, 3)) ;
      C = parseInt(SABCDE.substring(3, 4)) ;
      D = parseInt(SABCDE.substring(4, 5)) ;
      E = parseInt(SABCDE.substring(5, 6)) ;

      F = parseInt(FGHIJK.substring(0, 1)) ;
      G = parseInt(FGHIJK.substring(1, 2)) ;
      H = parseInt(FGHIJK.substring(2, 3)) ;
      I = parseInt(FGHIJK.substring(3, 4)) ;
      J = parseInt(FGHIJK.substring(4, 5)) ;
      K = parseInt(FGHIJK.substring(5, 6)) ;

      L = (S + A * 3 + B + C * 3 + D + E * 3 + F + G * 3 + H + I * 3 + J + K * 3) % 10 ;

      id1 = SABCDE + FGHIJK + L ;

      // 送信実行
      document.forms[form].id1.value = id1 ;
      document.forms[form].submit() ;
  }

  function digit2(val) {    // 2桁揃え
      if (val.length < 2) {
          val = "0" + val ;
      }
      return val ;
  }

  function digit6(val) {    // 6桁揃え
      len = 6 - val.length ;
      for (i = 0; i < len; i++) {
          val = "0" + val ;
      }
      return val ;
  }

  function multi3(val) {    // ×3して加算
      val10 = Math.floor(val / 10) ;    // 10の位
      val1  = val % 10 * 3 ;            //  1の位 * 3

      return val10 + val1 ;
  }

  function callTop() {
    location.href = location.protocol + "//" + location.host + "/" ;
  } // callPage()

