// $Id: footer.js,v 1.11 2006/01/22 02:17:28 Sakaguchi Exp Sakaguchi $

if (CGI) {
  // Dynamic

} else {
  // Static

  // Last updated
  document.writeln("&#x66F4;&#x65B0;&#x65E5;&#x6642;: " + new Date(document.lastModified).toLocaleString())
}

// Anti-surrogate-pair treatment
{
  var e, i, c, u

  e = document.getElementsByTagName("SPAN")
  for (i = 0; i < e.length; ++i) {
    u = e[i].innerHTML.charCodeAt(0)
    if (u >= 0xd800 && u < 0xdc00) {
      u = sur2pua(u, e[i].innerHTML.charCodeAt(1))
      e[i].innerHTML = String.fromCharCode(u)
    }
  }
}

// Anti-EOT treatment (only on FF/NN 4+)
if (NN >= 4.0) {
  var px, fn
  var e, i, c, u
  var j, p

  // Replace EOT occurrences by bitmap images
  // L-headdings
  e = document.getElementsByTagName("DIV")
  for (i = 0; i < e.length; ++i) {
    c = e[i].getAttribute("CLASS")
    if (c == null) continue
    if (c.indexOf("L") == 0) {
      p = ""
      px = PNGFontSize
      switch (c.charAt(1)) {
      case "T": px *= 4.5; break;
      case "A": px *= 2;   break;
      case "L": px *= 1.4; break;
      case "H": px *= 1.8; break;
      default: continue;
      }
      for (j = 0; j < e[i].innerHTML.length; ++j) {
	u = e[i].innerHTML.charCodeAt(j)
        if (u >= 0x4e00 && u < 0xa000) {
	  p += PNGimage(u, px)
	} else {
	  p += String.fromCharCode(u)
	}
      }
      e[i].innerHTML = p
    }
  }

  // Replace EOT occurrences by bitmap images
  // explicit
  e = document.getElementsByTagName("SPAN")
  for (i = 0; i < e.length; ++i) {
    c = e[i].getAttribute("CLASS")
    if (c == null) continue
    if (c.indexOf("Embed_") == 0) {
      p = ""
      px = c.substring(6)
//    fn = e[i].getAttribute("ID")
      fn = e[i].id
      for (j = 0; j < e[i].innerHTML.length; ++j) {
	u = e[i].innerHTML.charCodeAt(j)
	p += PNGimage(u, px, fn)
      }
      e[i].innerHTML = p
    }
  }

  // Replace EOT occurrences by bitmap images
  // implicit (CJK extensions)
  e = document.getElementsByTagName("SPAN")
  for (i = 0; i < e.length; ++i) {
    u = e[i].innerHTML.charCodeAt(0)
    if (u >= 0x2e80 && u < 0x4e00 || u >= 0xe000 && u < 0xfb00) {
      p = e[i].parentNode.id
      if (p == "None") {
	// within kinfo.html
	px = 28
      } else {
	// within others
	px = PNGFontSize
      }
      e[i].innerHTML = PNGimage(u, px)
    }
  }

}

// Start whats-new blinker
setTimeout("blinknews()", 800)
