/**
 * SlideShow com das fotos do Veículo.
 */
function SlideShow() {
    this.index = 0;
    this.imgPrefixID = 'tn_';
    this.tnCount = document.getElementById("totalFoto").innerHTML;
    this.imgCount = document.getElementById("totalFoto").innerHTML;
    this.SelectedVehicle = document.getElementById("atualFoto");
    this.MainContainer = document.getElementById("SlideShowPalco");
    this.MainPhoto = $('#SlideShowPalcoFoto img').get(0); // Pegando a TAG imagem
    this.Thumbnails = document.getElementById("SlideShowThumbs");
    tnCol = this.Thumbnails.getElementsByTagName('li');
};
//select the next image
SlideShow.prototype.next = function() {
    this.index++;
    if (this.index >= this.imgCount) this.index = 0;
    this.select(this.index);
};
//select the previous image
SlideShow.prototype.prev = function() {
    this.index--;
    if (this.index < 0) this.index = this.imgCount - 1;
    this.select(this.index);
};
//highlight the image and swap
SlideShow.prototype.select = function(index) {
    if (index >= 0 && index < this.imgCount) this.index = index;
	this.SelectedVehicle.innerHTML = this.index + 1;
    this.MainPhoto.src = $('#' +this.imgPrefixID + this.index).attr('ref');
};


/* Mostrar o vídeo do Veículo se houver. */
function showVeiculoVideo()
{
	var divVideo = $('#SlideShowPalcoVideo');
	var divFoto = $('#SlideShowPalcoFoto').hide();
	if(divVideo.hasClass('none'))
	{
		divVideo.removeClass('none');
		divVideo.show();
	}
}
/* Esconder o vídeo do Veículo se houver. */
function hideVeiculoVideo()
{
	$('#SlideShowPalcoVideo').addClass('none').hide();
	$('#SlideShowPalcoFoto').show();
}
