//-----------        Fator Conexo       e  ------------------//
// Tratar a leitura de menus
// tratador do conteudo
//---------------------------------------------------------//

/*____________ Construção do Layout principal____________________*/

function Produtos()
{	
	this.displayImagem="id_Imagem";
	this.displayDescricao="ttlQrdMeio";				
	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.escreverTitulo(this.trabalhos[id][0]);
		this.escreverImagem(this.trabalhos[id][1]);				
		
	}		
	this.escreverImagem = function (UmaImagem)
	{
		dply=this.getDisplayImagem();
		dply.innerHTML = UmaImagem;
		
	}
	this.escreverTitulo= function(valor)
	{
		dply=this.getDisplayDescricao();
		dply.innerHTML = valor;
	}	
	this.getDisplayImagem = function()
	{
		return document.getElementById(this.displayImagem);
		
	}
	this.getDisplayDescricao = function()
	{
		return document.getElementById(this.displayDescricao);
	}
	this.AddProduto= function(UmaImagem,UmaDescricao)
	{
		this.trabalhos[this.count] = new Array(2);
		this.trabalhos[this.count][0] = UmaDescricao; 
		this.trabalhos[this.count][1] ="<img class='gabinetes' src=\""+UmaImagem+"\" ></img>";
		this.count++;
		
	}
	this.AddDescricao = function(msg)
	{
		this.Descricoes[this.countDesc] = new Array(2);
		this.Descricoes[this.countDesc][0] = msg;
		this.countDesc++;
	}
	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;
		}
				
		
	}		
};
	


