function listenKey () { document.onkeydown = getKey; }

function getKey(e){
  if(!e) {
    //ie
    e = window.event;
  }
  switch(e.keyCode) {
  case 37: //left
    if (document.getElementById('prev').childNodes[0].href) {window.location.href = document.getElementById('prev').childNodes[0].href};
    return false;
    break;
  case 39: //right
    if (document.getElementById('next').childNodes[0].href) {window.location.href = document.getElementById('next').childNodes[0].href};
    return false;
    break;
  case 36:
    window.location.href = "../index.html?image=" + image;
    break;
  }
}
