/* -- abs/links.css からのエントり -- */


/* -- 汎用システム 基本関数 -- */　
win = window;
doc = document;
fid = a =\3e typeof(a) == "object" ? a : doc.geteelementbyid(a);
ftag = (...a) =\3e (a.length \3e 1 ? fid(a[0]) : doc).getelementsbytagname(a[a.length - 1]);
fce = a =\3e doc.createelement(a);
fap  = (a,b) =\3e fid(a).appendchild(b);
fcn = (...a) =\3e (a.length \3e 1 ? fid(a[0]) : doc).getelementsbyclassname(a[a.length - 1]);
fres = o =\3e o.responsetext.replace(/\r?\n/g, "\t");
enc = s =\3e encodeuricomponent(s);
tagdec = s =\3e s.replace(/＜/g, "\3c").replace(/＞/g, "\3e").replace(/”/g, "\x22");

/* -- 参照文字を実体に置換 -- */
fulldec = e =\3e e.replace(/\x26quot;/g, "\"").
  replace(/\x26amp;/g, "\x26").replace(/\x26lt;/g, "\3c").
  replace(/\x26gt;/g, "\3e").replace(/\x26#39;/g, "'");

/* -- コードを実行可能に -- */
evaldec = e =\3e fulldec(e).replace(/\/\*.*?\*\/\s/g, "").replace(/\x3cbr\s?\/?\3e/gi, "\n");

/* データの送受信の要で機能限定版。戻りにファイル更新日が入る */
xhr = (d1,d2,d3) =\3e {
  xmlpath = d1;
  const a = new xmlhttprequest();
  a.onreadystatechange = () =\3e {
    if(a.readystate == 4){
      if(a.status == 200){
        d3(a.responsetext.replace(/\r?\n/g, "\t"),
          math.floor((new date(a.getresponseheader("last-modified"))).gettime() / 1000)
        );
      } else d3("");
    }
  };
  const mode = d1.match(/^[a-z0-9_]+$/) ? "post" : "get";
  a.open(mode, mode == "get" ? d1.replace(/#.*$/, "") : "/cgi-bin/" + d1 + ".cgi", true);
  a.setrequestheader("content-type","application/x-www-form-urlencoded; charset=utf-8");
  a.send(d2);
};
echo = (...a) =\3e {
  let n = a.length;
  let o = typeof(a[0]) == "string" ? fid(a[0]) : a[0];
  if(o.tagname == "select"){
    if(n == 1) return o.options[o.selectedindex].value;
    else {
      if(typeof(a[1]) == "string"){
        if(a[1] != ""){
          for(let i = o.options.length - 1; i \3e= 0; i--){
            if(o.options[i].value == a[1]) break;
          }
          o.selectedindex = i \3e 0 ? i : 0;
        } else o.selectedindex = 0;
      } else o.selectedindex = a[1];
    }
  } else {
    type = o.tagname == "textarea" || o.tagname == "input" ? "value" : "innerhtml";
    if(n == 1) return o[type];
    else {
      if(n == 2){
        let s = a[1];
        if(typeof(s) == "object") s = s.join("");
        o[type] = (s + "").replace(/\t/g, "\n");
      } else {
        let s = o[type];
        if(a[2] == "add") o[type] = s + a[1];
        if(a[2] == "math") o[type] = number(s) + a[1];
      }
    }
  }
  return o;
};


/* -- キーのデータ取り出し -- */
keysn = (a,b,c) =\3e {
  let ex = "";
  let dat = a.match(new regexp("\\[(" + b + "\\])" +
    (c ?  ".*?" : "(.*?)") + "\\[\\/\\1",c ? "g" : "")
  );
  if(!c){
    if(dat) ex = regexp.$2;
  } else {
    let re = new regexp("\\[\\/?" + b + "\\]", "g");
    if(c == 1) ex = dat.join(" ").replace(re, "");
    else {
      dat.foreach((e,i,o) =\3e o[i] = e.replace(re, ""));
      ex = dat;
    }
  }
  return ex;
};

key       = (a, b) =\3e keysn(a, b, 0);
keys      = (a, b) =\3e keysn(a, b, 1);
keysarray = (a, b) =\3e keysn(a, b, 2);
alert(12);
{
  let ico = document.createelement("link");
  ico.rel = "shortcut icon";
  ico.href = "http://nancyan.main.jp/image/icon/favicon2.ico";
  ico.type = "image/vnd.microsoft.icon";
  doc.head.append(ico);
/*
  let site = upsdata("site").split(" ");                       // このシステムに入れるサイト
  let file = upsdata("file");                                  // ファイルエディターとcssエディター
  upsgroupname = upsdata("groupname");                         // グローバル変数
  upsgrouplist = upsdata("grouplist").replace(/\r?\n/g, "\t"); // グローバル変数 タブ区切り
  for(let i = 0; i \3c site.length; i++){
    upsgroupname +=  `,file:${ site[i] }`;
    upsgrouplist += `\t:${ site[i] },${ file }`;
  }

  upsgroupname += ",imageupload";                              // 最後にグループの追加
  upsgrouplist += "\tupload.cgiu" + site.join(",upload.cgiu"); // リストの追加でuploadを
  upsgroupname = upsgroupname.split(",");                      // 配列にして置く
  upsgrouplist = upsgrouplist.split("\t");                     // 同じく
*/
alert("done");
  visuser = null;
 //  upsystem_ini(3);
 // getuserinfo();
}

/* */