
/* s|slides */
slides {
	position: absolute;
	overflow: hidden;
	height: 100%;
	width: 100%;
	left: 0; right: 0;
	top: 0; bottom: 0;
	margin: 0;
	border-width: 0;
	padding: 0;
	font-family: "MS Gothic", "Arial", sans-serif;
  behavior: expression(function (element) {
    element.currentSlide = 0;

    // h|head { display : none }
    var head = element.getElementsByTagName ('head')[0];
    head.style.display = 'none';

    var pageNumbers = document.createElement ('pageNumbers');
    var currentPageNumber = document.createElement ('currentPageNumber');
    currentPageNumber.innerText = '1';
    pageNumbers.appendChild (currentPageNumber);
    var allPageNumber = document.createElement ('allPageNumber');
    pageNumbers.appendChild (allPageNumber);
    pageNumbers.appendChild (allPageNumber);
    setTimeout (function () {
      pageNumbers.insertBefore (document.createTextNode (' / '), allPageNumber);
      allPageNumber.innerText = document.getElementsByTagName ('slide').length;
    }, 3000);

    pageNumbers.style.display = 'block';
    pageNumbers.style.position = 'absolute';
    pageNumbers.style.bottom = '0.4em';
    pageNumbers.style.right = '0.4em';
    setTimeout (function () {element.appendChild (pageNumbers)}, 1000);

    document.onkeydown = function () {
      var slide = getSlideList ();
      if (event.keyCode == 13 || event.keyCode == 39) {
        element.currentSlide++;
        if (element.currentSlide >= slide.length) element.currentSlide = 0;
        showSlide (element.currentSlide);
        event.returnValue = false;
      } else if (event.keyCode == 8 || event.keyCode == 37) {
        element.currentSlide--;
        if (element.currentSlide < 0) element.currentSlide = slide.length - 1;
        showSlide (element.currentSlide);
        event.returnValue = false;
      }
    } /* keydown */

    element.ondblclick = function () {
      var slide = getSlideList ();
      element.currentSlide++;
      if (element.currentSlide >= slide.length) element.currentSlide = 0;
      showSlide (element.currentSlide);
      event.returnValue = false;
    }

    function showSlide (n) {
      var slide = getSlideList ();
      for (var i = 0; i < slide.length; i++) {
        slide[i].runtimeStyle.display = (i == n) ? 'block' : 'none';
      }
      currentPageNumber.innerText = n + 1;
    }

    function getSlideList () {
      return window.document.getElementsByTagName ('slide');
    }

    runtimeStyle.behavior = 'none';
  } (this)); /* NOTE: See also slide-style-winie.css */
}

/* s|slide */
slide {
  width: 100%;
  height: 100%;
  border: groove 1px #C0C0C0;
  font-size: 200%;
}
