/* COLOCAR NO HEAD
<SCRIPT language=JavaScript src="script.js"></SCRIPT>
*/

	function fotoCL(foto, descricao) {
		obj = new efraim(foto);
		obj.background = '#ffffff';
		obj.estilo = 'font-family: Verdana, Arial, Helvetica, sans-serif;\nfont-size: 11px;\ncolor: #ffffff;\ntext-align: left;\nfont-weight: bold;\n';
		obj.descricao = ' &nbsp;&nbsp;&nbsp;' + descricao;
		obj.titulo = ':: OBRAS ONLINE :: Conectando Fornecedores e Construtores ::';
		obj.espaco_comentario = 29;
		obj.exec();
	}
	
	function fotoSL(foto) {
		obj = new efraim(foto);
		obj.background = '';
		obj.estilo = 'font-family: Verdana, Arial, Helvetica, sans-serif;\nfont-size: 9px;\ncolor: #000000;\ntext-align: center;\nfont-weight: bold;\n';
		obj.descricao = '';
		obj.titulo = ':: OBRAS ONLINE :: Conectando Fornecedores e Construtores ::';
		obj.espaco_comentario = 0;
		obj.exec();
	}


    function efraim(foto) {
		this.descricao;
		this.onde = 'down';
		this.estilo = '';
		this.titulo = 'FOTOS';
		this.background = '#FFFFFF';
		this.space = 20;
		this.espaco_comentario = 10;  // QTDE A MAIS SOBRE A ALTURA DA IMAGEM 
		this.espaco_largura    = 10;  // QTDE A MAIS SOBRE A LARGURA DA IMAGEM
		this.rjc = function rjc(objJanela, aumentar) {
			xwidth  = objJanela.document.images[0].width;
			xheight = objJanela.document.images[0].height + this.espaco_comentario;


			if(aumentar)
				xheight += this.space;
				
			objJanela.resizeTo(xwidth + this.espaco_largura, xheight + 20);
			var userWidth  = window.screen.availWidth;
			var userHeight = window.screen.availHeight;
			var pontoEsquerdo = parseInt(userWidth / 2) - parseInt(xwidth / 2);
			var pontoSuperior = parseInt(userHeight / 2) - parseInt(xheight / 2);
			objJanela.moveTo(pontoEsquerdo, pontoSuperior);
		}
		this.exec = function exec() {
			if(this.descricao != '')
				this.aumentar = true;
			else if(this.descricao == '')
				this.aumentar = false;

			this.janela = window.open("","","width=1, height=1");
	        this.janela.document.write('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">\n');
	        this.janela.document.write('<html>\n');
	        this.janela.document.write('<head>\n');
	        this.janela.document.write('<title>' + this.titulo + '</title>\n');
	        this.janela.document.write('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">\n');
	        this.janela.document.write('</head>\n');
	        this.janela.document.write('<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" bgcolor="' + this.background + '">\n');
			if(this.estilo != '') {
				this.janela.document.write('<style type="text/css">\n');
				this.janela.document.write('<!--\n');
				this.janela.document.write('.estiloPadrao {\n');
				this.janela.document.write(this.estilo + '\n');
				this.janela.document.write('}\n');
				this.janela.document.write('-->\n');
				this.janela.document.write('</style>\n');
			}

			if(this.descricao != '' && this.onde == 'up') {
				if(this.estilo == '')
					this.janela.document.write(this.descricao);
				else if(this.estilo != '')
					this.janela.document.write('<font class="estiloPadrao">' + this.descricao + '</font>');
			}
	
	        this.janela.document.write('<div align="center"><img src="' + foto + '" border="0"></div>');
	
			if(this.descricao != '' && this.onde == 'down') {
				if(this.estilo == '')
					this.janela.document.write(this.descricao);
				else if(this.estilo != '')
					this.janela.document.write('<div class="estiloPadrao" style="margin-top:5;">' + this.descricao + '</div>');
			}
	
	        this.janela.document.write('</body>');
	        this.janela.document.write('</html>');
		
			while((this.janela.document.images[0].width < 130) && (this.janela.document.images[0].height + 29 < 130)) {
				this.janela.status = '.';
			}				
			this.rjc(this.janela, this.aumentar);
		}
	}