lightbox = {
	abrir : function(box, conteudo, tipo){
		divTudo = FG.E('opacity');
		divZoom = FG.E(box);

		larguraBox = document.getElementById(box).style.width;
		//alturaBox = document.getElementById(box).style.height;
		//alturaBox = alturaBox.replace('px','');
		larguraBox = larguraBox.replace('px','');
		/*if (alturaBox == ''){
			alturaBox = 0;
		}*/
		if (larguraBox == ''){
			larguraBox = 0;
		}
		/*if (box == 'divLightBoxZoom'){
			positionTop = FG.tPg().wh/2 - alturaBox/2 + FG.ScrollP().y - 40;
		}else{
			positionTop = FG.tPg().wh/2 - alturaBox/2 + FG.ScrollP().y + 10;
		}*/
		//positionLeft = FG.tPg().pw/2 - larguraBox/2;
		//document.getElementById(box).style.top = positionTop + 'px';
		//document.getElementById(box).style.left = positionLeft + 'px';
		divTudo.style.height = FG.tPg().ph + 'px';
		divTudo.style.width = FG.tPg().pw + 'px';
		if (document.getElementById('tabela')){
			document.getElementById('tabela').style.width = FG.tPg().ww + 'px';
			document.getElementById('tabela').style.height = FG.tPg().wh + 'px';
			document.getElementById('tabela').style.top = FG.ScrollP().y + 'px';
			FG.E('tabela').style.display = '';
		}
		
		divTudo.style.display = '';
		//divZoom.style.display = '';
		if (document.getElementById('divConteudoLightBox')){
			document.getElementById('divConteudoLightBox').style.display = '';
		}
		if (document.getElementById('divLightBoxContent')){
			document.getElementById('divLightBoxContent').style.display = '';
		}
		if (document.getElementById('divLightBoxContentPod')){
			document.getElementById('divLightBoxContentPod').style.display = '';
		}

		if (tipo == 1){
			document.getElementById('imgPrincipal').src = '_IMG/_IMAGENS/' + conteudo;
		}else if (tipo == 2){
			document.getElementById('divConteudoVideo').innerHTML = document.getElementById('divBoxTemplate').innerHTML;
			document.getElementById('divConteudoVideo').innerHTML = document.getElementById('divConteudoVideo').innerHTML.replace('_ARQUIVO_', conteudo);
			document.getElementById('divConteudoVideo').innerHTML = document.getElementById('divConteudoVideo').innerHTML.replace('_ARQUIVO_', conteudo);
		}else if (tipo == 3){
			document.getElementById(conteudo).style.display = '';
		}

		document.getElementById('opacity').style.filter = 'alpha(opacity=0)';
		document.getElementById('opacity').style.opacity = '0';
		if (navigator.userAgent.toLowerCase().indexOf('gecko/') != -1){
			lightbox.OpacityInicia('opacity',5,0,90,box);
		}else{
			lightbox.OpacityInicia('opacity',15,0,90,box);
		}
	},
	
	fechar : function(box){
		divs = document.getElementById(box).getElementsByTagName('em');
		quantidade = divs.length;
		for(a=0;a<quantidade;a++){
			divs[a].style.display = 'none';
		}
		
		if (document.getElementById('divConteudoVideo')){
			document.getElementById('divConteudoVideo').innerHTML = '';
		}
		if (document.getElementById('imgPrincipal')){
			document.getElementById('imgPrincipal').src = '_IMG/px.gif';
		}
		if (document.getElementById('divErro')){
			document.getElementById('divErro').style.display = 'none';
			document.getElementById('divSucesso').style.display = 'none';
		}
		FG.E('opacity').style.display = 'none';
		FG.E('tabela').style.display = 'none';
		FG.E(box).style.display = 'none';
	},
	
	Opacity_elemento : '',
	Opacity_tamanho_final : 0,
	Opacity_tamanho_atual : 0,
	Opacity_taxa : 0,
	
	OpacityInicia : function(elemento,taxa,inicio,fim,box){
		this.Opacity_elemento = elemento;
		this.Opacity_taxa = taxa;
		this.Opacity_tamanho_final = fim;
		this.Opacity_tamanho_atual = inicio;
		this.OpacityAnima(box);
	},
	
	OpacityAnima : function(box){
		if(this.Opacity_tamanho_final!=this.Opacity_tamanho_atual){
			if(this.Opacity_tamanho_final<this.Opacity_tamanho_atual){
				this.Opacity_tamanho_atual = this.Opacity_tamanho_atual-this.Opacity_taxa ;
			}else{
				this.Opacity_tamanho_atual = this.Opacity_tamanho_atual+this.Opacity_taxa ;
			}
			document.getElementById(this.Opacity_elemento).style.filter = 'alpha(opacity=' + this.Opacity_tamanho_atual + ')';
			document.getElementById(this.Opacity_elemento).style.opacity = this.Opacity_tamanho_atual/100;
			setTimeout("lightbox.OpacityAnima('" + box + "')",1);
		}else{
			if (box != 'undefined'){
				if (navigator.userAgent.toLowerCase().indexOf('gecko/') != -1){
					lightbox.OpacityInicia(box,2,0,100);
				}else{
					lightbox.OpacityInicia(box,10,0,100);
				}
				document.getElementById(box).style.filter = 'alpha(opacity=0)';
				document.getElementById(box).style.opacity = '0';
				document.getElementById(box).style.display = '';
			}
		}
	}
}