var janela, w, h, conteudo, titulo, texto, leftP, topP, parametros;

function popUp(w, h, arqFoto, titulo) {
	conteudo = "";
	conteudo += '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\n';
	conteudo += '<html xmlns="http://www.w3.org/1999/xhtml">';
	conteudo += "<head>";
	conteudo += '<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />';
	conteudo += "<title>"+titulo+"</title>";
	conteudo += "</head>";
	
	conteudo += '<style type="text/css">';
	conteudo += '<!--';
	conteudo += 'html, body {margin:0;padding:0;}';
	conteudo += '.foto {position:absolute;left:0;top:0}';
	conteudo += '-->';
	conteudo += '</style>';

	conteudo += "<body>"
	conteudo += "<div class='foto'>";
	conteudo += "<img src="+arqFoto+" alt=''>";
    conteudo += "</div>";

	conteudo += "</body>\n";
	conteudo += "</html>";

	leftP = (screen.width) ? (screen.width-w)/2 : 0;
	topP = (screen.height) ? (screen.height-h)/2 : 0;
	parametros = "height="+h+",width="+w+",top="+topP+",left="+leftP;

	if (!janela || janela.closed) {
		janela = window.open("","janela",parametros);
	} else {
		janela.close();
		janela = window.open("","janela",parametros);
	}

	janela.document.write(conteudo);
	//janela.focus();
}

//
function popUpFlash(arqFoto) {
	w = 700;
	h = 500;
	
	htm = 'popUpFlash.htm?planta='+arqFoto;

	leftP = (screen.width) ? (screen.width-w)/2 : 0;
	topP = (screen.height) ? (screen.height-h)/2 : 0;
	parametros = "height="+h+",width="+w+",top="+topP+",left="+leftP;

	if (!janela || janela.closed) {
		janela = window.open(htm,"janela",parametros);
	} else {
		janela.close();
		janela = window.open(htm,"janela",parametros);
	}

	//janela.focus();
}
