
/* ********************************* */
/*      intégration photos           */
/* ********************************* */

function ImgGal()
{
  /* valeurs initiales */
  this.arraySmallImg = new Array();
  this.arrayBigImg = new Array();
  this.residenceTxt = '';
  this.residenceName = '';
  this.pathImg = '';
  this.debug = true;

  this.setPathImg = function(name)
  {
    this.pathImg = name;
  }
  this.setResidenceName = function(name)
  {
    this.residenceName = name;
  }
  this.setResidenceTxt = function(txt)
  {
    this.residenceTxt = txt;
  }
  this.addSmallImg = function(img)
  {
    this.arraySmallImg.push(img);
  }
  this.addBigImg = function(img)
  {
    this.arrayBigImg.push(img);
  }
  this.getBigImg = function()
  {
    retour = '';
    if (this.arrayBigImg.length >= 1)
    {
      for (var i = 0; i < this.arraySmallImg.length; ++i)
      {
        if (i == 0)
        {
          retour += '<img alt="' + this.residenceTxt + '[' + this.residenceName + ']" src="' + this.pathImg + this.arrayBigImg[i] + '" class="img_big" />';
        }
        else
        {
          retour += '<img alt="' + this.residenceTxt + '[' + this.residenceName + ']" src="' + this.pathImg + this.arrayBigImg[i] + '" style="display: none;"/>';
        }
      }
    }
    return retour;
  }
  this.getSmallImg = function()
  {
    retour = '';
    if (this.arrayBigImg.length >= 1)
    {
      for (var i = 0; i < this.arraySmallImg.length; ++i)
      {
        retour += '<a href="#"><img alt="[' + this.residenceName + ']" src="' + this.pathImg + this.arraySmallImg[i] + '" style="z-index: 1; margin-top: 17px; height: 34px; width: 46px;" />';
      }
    }
    return retour;
  }
}
/*
* changer les differentes images dans le masque
*/
function writeGal(id)
{
  obj = eval('gal_' + id);
  $('galerie_big_' + id).innerHTML = obj.getBigImg();
  $('galerie_small_' + id).innerHTML = obj.getSmallImg();
  //$('titreGal').innerHTML = obj.residenceName;
}