function writePrevNext() {
  if (str.search(/\.c\./) != -1)
    document.write('<p><a href="javascript:showPrev();">前</a> | <a href="javascript:showNext();">後</a></p>');
  else
    document.write('<p><a href="javascript:showPrev();">Previous</a> | <a href="javascript:showNext();">Next</a></p>');
}
function getCurrent() {
  for (i=1; i<=30; i++)
    if ( document.getElementById('o'+i) )
      if ( document.getElementById('o'+i).style.display == 'inline' )
        return i;
  return i;
}
function hideAll () {
  for (i=1; i<=30; i++)
    if ( document.getElementById('o'+i) ) {
      document.getElementById('o'+i).style.display='none';
    } else {
      break;
    }
  return true;
}
function showOriginal (o) {
  hideAll();
  if (o > 0) {
    if ( document.getElementById('o'+o) )
      document.getElementById('o'+o).style.display='inline';
    else
      document.getElementById('o1').style.display='inline';
  } else {
    for (i=30; i>=1; i--) 
      if ( document.getElementById('o'+i) ) {
        document.getElementById('o'+i).style.display='inline';
        break;
      }
  }
}
function showPrev () {
  showOriginal(getCurrent() - 1);
}
function showNext () {
  showOriginal(getCurrent() + 1);
}
window.onload = function() {
  showOriginal(1);
}
document.write('<style type="text/css">#original img {display:none;} #original img#o1 {display:inline;}</style>');

