// ipad-gallery.js - m

var ipadGallery = {}

ipadGallery.init = function () {
  ipadGallery.owner = $("#gallery");
  ipadGallery.viewPort = $("#galleryViewPort");
  ipadGallery.content = $("#galleryContent");
  ipadGallery.counter = 0;

  $("#galleryTouchZone").click(ipadGallery.next);
}

ipadGallery.next = function () {
  ipadGallery.counter++;
  if (ipadGallery.counter >= 4) ipadGallery.counter = 0;
  ipadGallery.track( "-" + ipadGallery.counter * 362 );
  return false;
}

ipadGallery.track = function (x) {
  ipadGallery.content.animate({ "left" : x + "px" }, 500);
}

