//-----------        Fator Conexo       e  ------------------//

// Tratar a leitura de menus

// tratador do conteudo

//---------------------------------------------------------//



/*____________ Construção do Layout principal____________________*/



function Produtos()

{	

	this.displayImagem="id_Imagem";

	this.trabalhos = new Array(9);

	this.Descricoes = new Array(9);

	this.id_produto = null;

	this.id_descricao = null;

	this.count= 0;

	this.countDesc= 0;

	this.TratarClick = function(id)

	{

		this.id_produto = id;	

		this.escreverImagem(this.trabalhos[id][1]);				

		

	}		

	this.CarregaImagem = function(id)

	{

		this.displayImagem = "id_ImgIndex";

		this.id_produto = id;	

		this.escreverImagem(this.trabalhos[id][1]);				

		

	}		



	this.escreverImagem = function (UmaImagem)

	{

		dply=this.getDisplayImagem();

		dply.innerHTML = UmaImagem;

		

	}

	this.getDisplayImagem = function()

	{

		return document.getElementById(this.displayImagem);

		

	}

	this.AddProduto= function(UmaImagem,UmaDescricao,uTop)

	{

		this.trabalhos[this.count] = new Array(2);

		this.trabalhos[this.count][0] = UmaDescricao; 

		this.trabalhos[this.count][1] ="<img class='gabinetes' style='top:"+uTop+"px;' src=\""+UmaImagem+"\"></img>";

		this.count++;

		

	}

	this.TratarDescrClick = function()

	{

		//this.escreverTitulo("");

		if(this.id_produto!=null)

		{

			document.getElementById("id_Descricao").innerHTML="VER Foto";

			this.escreverImagem(this.Descricoes[this.id_produto][0]);

			this.id_descricao=this.id_produto;

			this.id_produto=null;

			

		}

		else

		{

			this.TratarClick(this.id_descricao);

			this.id_descricao = null;

		}

				

		

	}		

};

function nro_aleatorio()

{

	return Math.round(Math.random()*4)

}

	



