// Propriedades do Slideshow 'Imóveis em Destaque'
var _speedD = 5000;
var _max;
var _indexD=3;
var _rowD=0;
/*
  Método que inicializa o Slideshow 'Imóveis em Destaque'.
*/
function init_slideD(_maxD)
{
  this._max=_maxD;
  setTimeout("play_slideD();",  _speedD)
}
/*
  Método que configura as configurações do Slideshow 'Imóveis em Destaque'.
*/
function play_slideD()
{
  change_slideD(_arrayD, _rowD, _indexD, document.getElementById("_controlD").value);
  _indexD++;
  if(_indexD > (_arrayD[0].length-1)) _indexD=0;
  _rowD++;
  if(_rowD == _max) _rowD=0;
  setTimeout('play_slideD()', _speedD);
  
}
// Propriedades do Slideshow 'Imóveis mais Recentes'
var _speedMR = 5000;
var _max;
var _indexMR=3;
var _rowMR=0;
/*
  Método que inicializa o Slideshow 'Imóveis mais Recentes'.
*/
function init_slideMR(_maxMR)
{
  this._max=_maxMR;
  setTimeout("play_slideMR();",  _speedMR)
}
/*
  Método que configura as configurações do Slideshow 'Imóveis mais Recentes'.
*/
function play_slideMR()
{
  change_slideD(_arrayMR, _rowMR, _indexMR, document.getElementById("_controlMR").value);
  _indexMR++;
  if(_indexMR > (_arrayMR[0].length-1)) _indexMR=0;
  _rowMR++;
  if(_rowMR == _max) _rowMR=0;
  setTimeout('play_slideMR()', _speedMR);
}
/*
  Método que permite actualizar a informação de um determinado item do Slideshow.
*/
function change_slideD(_array, _row, _index, _client)
{
  var __uc=_client+_row;
  // Hyperlinks
  document.getElementById(__uc+"_lnkTop").href = "/Default.aspx?tabid="+document.getElementById("_tabid").value+"&idImo="+_array[0][_index]+"&language="+document.getElementById("_idioma").value;
  document.getElementById(__uc+"_lnkMiddle").href = document.getElementById(__uc+"_lnkTop").href;
  document.getElementById(__uc+"_lnkLeft").href = document.getElementById(__uc+"_lnkTop").href;
  document.getElementById(__uc+"_lnkRight").href = document.getElementById(__uc+"_lnkTop").href;
  
  var _image = document.getElementById(__uc+"_imgThumb");
  if(document.all && !window.opera) {
  	_image.style.filter="blendTrans(duration=2)";
	  _image.style.filter="blendTrans(duration=crossFadeDuration)";
	  _image.filters.blendTrans.Apply();
	  // Actualiza as características do imóvel
	  document.getElementById(__uc+"_lblTipo").innerText = _array[3][_index];
    document.getElementById(__uc+"_lblLocal").innerText = _array[6][_index];
    document.getElementById(__uc+"_lblFinalidade").innerText = _array[4][_index];
    document.getElementById(__uc+"_lblPreco").innerText = _array[5][_index] + " " +String.fromCharCode(0x20ac);
  } else {
	  // Actualiza as características do imóvel
	  document.getElementById(__uc+"_lblTipo").textContent = _array[3][_index];
    document.getElementById(__uc+"_lblLocal").textContent = _array[6][_index];
    document.getElementById(__uc+"_lblFinalidade").textContent = _array[4][_index];
    document.getElementById(__uc+"_lblPreco").textContent = _array[5][_index] + " " +String.fromCharCode(0x20ac);  
  }
  // Thumbnail
  document.getElementById(__uc+"_imgThumb").src = _array[1][_index]; 
  // ToolTip
  document.getElementById(__uc+"_imgThumb").title = _array[2][_index];

  // Aplica a transformação da imagem
  if(document.all && !window.opera) {
    document.getElementById(__uc+"_imgThumb").filters.blendTrans.Play();
  }
}





// Propriedades do Slideshow 'Empreendimentos em Destaque'
var _speedE = 5000;
var _maxE;
var _rowE=0;
var _indexE;
/*
  Método que inicializa o Slideshow 'Empreendimentos em Destaque'.
*/
function init_slideE(_maxE)
{
  this._maxE = _maxE;
  this._indexE = this._maxE;
  setTimeout("play_slideE();",  _speedE)
}
/*
  Método que configura as configurações do Slideshow 'Empreendimentos em Destaque'.
*/
function play_slideE()
{
  change_slideE(_arrayE, _rowE, _indexE, document.getElementById("_controlE").value);
  _indexE++;
  if(_indexE > (_arrayE[0].length-1)) _indexE=0;
  _rowE++;
  if(_rowE == _maxE) _rowE=0;
  setTimeout('play_slideE()', _speedE);
}
/*
  Método que permite actualizar a informação de um determinado item do Slideshow.
*/
function change_slideE(_array, _row, _index, _client)
{
  var __uc=_client+_row;
  // Hyperlinks
  document.getElementById(__uc+"_lnkTop").href = "/Default.aspx?tabid="+document.getElementById("_tabid").value+"&idEmp="+_array[0][_index]+"&language="+document.getElementById("_idioma").value;
  document.getElementById(__uc+"_lnkBottom").href = document.getElementById(__uc+"_lnkTop").href;
  
  var _image = document.getElementById(__uc+"_imgThumb");
  if(document.all && !window.opera) {
  	_image.style.filter="blendTrans(duration=2)";
	_image.style.filter="blendTrans(duration=crossFadeDuration)";
	_image.filters.blendTrans.Apply(); 
    // Actualiza as características do empreendimento
	document.getElementById(__uc+"_lblNome").innerText = _array[3][_index];
    document.getElementById(__uc+"_lblLocal").innerText = _array[4][_index]; 
  } else {
	// Actualiza as características do empreendimento
	document.getElementById(__uc+"_lblNome").textContent = _array[3][_index];
    document.getElementById(__uc+"_lblLocal").textContent = _array[4][_index]; 
  } 
  // Thumbnail
  document.getElementById(__uc+"_imgThumb").src = _array[1][_index]; 
  // ToolTip
  document.getElementById(__uc+"_imgThumb").title = _array[2][_index];

  // Aplica a transformação da imagem
  if(document.all && !window.opera) {
    document.getElementById(__uc+"_imgThumb").filters.blendTrans.Play();
  }
}