/**
 * Documentacion de Galeria
 *
 * @class Galeria
 * @author Lucio 
 **/
var Galeria = function (container, width, total, actual)
{
  this._container = container;  
  this._width = width;
  
  if(total!=undefined)
    this.total = total;
  if(actual!=undefined)
  {
    this._count = actual;
    this.pos = parseInt(actual.html());
  }
  else
    this.pos = 1;
}
Galeria.prototype =
{
  init: function()
  {

  },
  prevElement: function()
  {    
    if(this.pos > 1)
    {
      this._container.animate({left: '+='+this._width});
      if(this.pos!=undefined)      
        this.pos--;
      this._updateCount(this.pos);
    }
  },
  nextElement: function()
  {    
    if(this.pos < this.total)
    {
      this._container.animate({left: '-='+this._width});
      if(this.pos!=undefined)     
        this.pos++;      
      this._updateCount(this.pos);
    }
  },
  _updateCount: function(pos)
  {
    if(this._count!=undefined)
      this._count.html(pos);
  }
}


