var title, color,legenda,centralizado ;

/******** COLOQUE ABAIXO AS INFORMAÇÕES *********/

	title = "D'el Conde"; //Títlo da Janela
	color = "#FFFFFF"; //Cor do BG da Janela
	legenda = "Fechar"; //Legenda da Janela
	//legenda = "Close"; //Legenda da Janela Inglês
	//legenda = "Chiudi"; //Legenda da Janela Italiano
	//centralizado = true; //para o pop-up ficar no centro
	centralizado = false; //para o pop-up nao ficar no centro

/*************************************************/

var foto, titulo;

function Carregar(url)
{
	var x,y,z;
	
	z = url.indexOf("/");
	dir = url.substring(0,z+1);
	if (dir == -1){ dir = "" }
	foto = url;
	x = url.indexOf(dir);
	y = url.substring(x+dir.length);
	titulo = y.substring(0,(y.length-4));
	imagens = y;
	imagens = imagens.split(",");
	qtd = imagens.length;
	cover = new Array();
	carregar = new Array();
	cover = new Array();
	carregados = new Array();
	j = 0;
	
	Carregador_Imagens();

}
	function Carregador_Imagens(){
		for(i=0;i<qtd;i++){
			carregar[i] = new Image();
			carregar[i].src = dir+imagens[i];
			carregados[i] = 0;
		}
		Carregador_Checar();
	}
	
	function Carregador_Checar(){
		if(document.all){e = document.all;}else{e = document.getElementById;}
		if(j==qtd){
			FotoMaior(titulo,foto);
		}else{
				for (i=0;i<qtd;i++) {
				if (!carregados[i] && carregar[i].complete) {
					carregados[i] = 1; j++;
					percentagem = Math.round(100/qtd)*j;
					Carregador_Checar();
					return;
				}
			}
			setTimeout("Carregador_Checar()",10);
		}
	}

function FotoMaior(Titulo,URLFoto)
{	
	img1 = new Image(); 
	img1.src = URLFoto;
		
	var altura,largura, local, tt01,tt02;
	
	altura = img1.height + 15;
	largura = img1.width;

	while (Titulo.indexOf("-") != -1) {
		Titulo = Titulo.replace("-", "");
	}
	while (Titulo.indexOf("/") != -1)
	{
		Titulo = Titulo.replace("/", "");
	}
	
	Foto = window.open("", Titulo, "toolbar=0,status=0,menubar=0,scrollbars=0,resizable=0,top=20,left=200,width="+largura+",height="+altura+"");
	Foto.document.open();
	Foto.document.write("<html><head>");
	Foto.document.write("<title>" + title + "</title>");
	Foto.document.write("<link href='estilo.css' rel='stylesheet' type='text/css'>")
	
	if (centralizado) {
		if (parseInt(navigator.appVersion) >= 4) { 
			Foto.window.moveTo((screen.width/2)-(largura/2+10),(screen.height/2)-(altura/2+20));
		}
	}	
	
	Foto.document.write("</head><body leftmargin=0 topmargin=0 bgcolor=" + color + ">");
	Foto.document.write("<center><a href='javascript:window.close();' class='link'>");
	Foto.document.write("<align='center'><IMG border=0 SRC='" + URLFoto + "' alt='Clique aqui para fechar.'>");
	Foto.document.write("<br>");
	Foto.document.write(legenda + "</a></center>");
	Foto.document.write("</body></html>");
	Foto.document.close();

}