Project = Class.create();

Project.prototype = {
  initialize: function(projectElt, portfolio, ui) {
    this.portfolio = portfolio;
    this.ui = ui;
    this.category = projectElt.getAttribute("category");
    this.name = projectElt.getAttribute("name");
    this.location = projectElt.getAttribute("location");
    this.year = projectElt.getAttribute("year");
    this.photos = new Array();
    var photoElts = $A(projectElt.getElementsByTagName('photo'));
    photoElts.each(this.addPhoto.bind(this));
    //To set the inital photo for each project.
    this.currentPhoto = this.photos[0];
  },

  photos: null,
  location: null,
  year: null,
  categtory: "",
  name: "",
  page: 1,
  currentPhoto: null,

  addPhoto: function(node) {
    var index = this.photos.length;
    this.photos[index] = new Photo(node, index, this, this.ui);
  }
}
