﻿// JScript 文件
var re = /<a id=[\"\']?([-=\w\.\/\?]+)[\"\']? href=[\"\']?([-=\w\.\/\?]+)[\"\']?>[\[\(<]?上一页[\]\)>]?<\/a>/igm;
if (window.document.body.innerHTML.search(re) >= 0) {
  var PREVIOUS_PAGE = RegExp.$2;
}
var re = /<a id=[\"\']?([-=\w\.\/\?]+)[\"\']? href=[\"\']?([-=\w\.\/\?]+)[\"\']?>[\[\(<]?下一页[\]\)>]?<\/a>/igm;
if (window.document.body.innerHTML.search(re) >= 0) {
  var NEXT_PAGE = RegExp.$2;
}

if (typeof PREVIOUS_PAGE == "string" || typeof NEXT_PAGE == "string") {
  document.onkeydown = function() {
    switch (event.srcElement.tagName) {
        case "INPUT":
        case "TEXTAREA":
        case "SELECT":
          break;
        default:
          if (event.keyCode == 37 && typeof PREVIOUS_PAGE == "string") {
            window.location.href = PREVIOUS_PAGE;
          }
          else if (event.keyCode == 39 && typeof NEXT_PAGE == "string") {
            window.location.href = NEXT_PAGE;
          }
    }
  }
}
