$(document).ready(function() {
  $('#photos a').lightBox();
  if(/MSIE 6/i.test(navigator.userAgent)) {
    $('.shadowed').removeClass('shadowed');
  }
});

$(window).keydown(function (e) {
  if ($('#jquery-lightbox').size() == 0) {
    if (e.keyCode == 39) {
      moveRight();
    } else if (e.keyCode == 37) {
      moveLeft();
    }
  }
});

var currentWindow = 1;
var maxWindows = 4;

function moveLeft() {
  if (currentWindow > 1) {
    $('#photos').animate({ left: "+=920px" }, 500);
    currentWindow--;
    $('#move_right').show();
  }
  if (currentWindow == 1)
    $('#move_left').hide();
}

function moveRight() {
  if (currentWindow < maxWindows) {
    $('#photos').animate({ left: "-=920px"}, 500);
    currentWindow++;
    $('#move_left').show();
  }
  if (currentWindow == maxWindows)
    $('#move_right').hide();
}
