function janelaPop(url,alt,lar,texto) {
	janela = null;
	cima = (window.screen.height - alt)/2; 
	lado = (window.screen.width - lar)/2; 
	if(janela == null) {
		janela = window.open("","galeria","width="+lar+",height="+alt+",top="+cima+",left="+lado+",toolbar=no");
		janela.document.write("<html><head><title>"+texto+"</title></head><body style=\"margin: 0px\">");
		janela.document.write("<img src='"+url+"' width="+lar+" height="+alt+" alt='Versão Ampliada'>");
		janela.document.write("</body></html>");
	}
}
function janelaPopHtm(url,alt,lar,texto) {
	janela = null;
	cima = (window.screen.height - alt)/2; 
	lado = (window.screen.width - lar)/2; 
	if(janela == null) {
		janela = window.open("","","width="+lar+",height="+alt+",top="+cima+",left="+lado+",toolbar=no");
		janela.document.write("<html><head><title>"+texto+"</title></head><body style=\'margin: 0px\'>");
		janela.document.write("<iframe src='"+url+"' width="+lar+" height="+alt+" style=\'margin: 0px\' alt='Versão Ampliada'></iframe>");
		janela.document.write("</body></html>");
	}
}
function janelaPopAtleta(img,alt,lar,nome,local,dtNascimento,posicao,caracteristica,altura,peso) {
	janela = null;
	cima = (window.screen.height - alt)/2; 
	lado = (window.screen.width - lar)/2; 
	if(janela == null) {
		janela = window.open("","galeria","width="+lar+",height="+alt+",top="+cima+",left="+lado+",toolbar=no");
		janela.document.write("<html><head><title>"+nome+"</title></head><body style='margin: 0px; padding: opx; '>");
		janela.document.write("<div id='foto' style='float: left; width: 250px; border: 1px solid #ccc; margin-left: 4px !important; margin-left: 4px; text-align: center; margin-top: 10px; padding: 10px; color: #333; font: 11px Tahoma, 'Trebuchet MS', Arial, Verdana;'>");
		janela.document.write("<img src="+img+"></img>");
		janela.document.write("</div>");
		janela.document.write("<div id='descricao' style='float: left; width: 330px; height: 322px; border: 1px solid #ccc; margin-left: 4px !important; margin-left: 4px; margin-top: 10px; padding: 5px; color: #333; background-image: url(img/marcaDagua.jpg); background-position: center; background-repeat: no-repeat; font: 11px Tahoma, 'Trebuchet MS', Arial, Verdana;'>");
		janela.document.write("<strong>Nome / Name:</strong> "+nome+".<br />");
		janela.document.write("<strong>Local de nascimento / birth place:</strong> "+local+".<br />");
		janela.document.write("<strong>Data de nascimento / date of birth:</strong> "+dtNascimento+".<br />");
		janela.document.write("<strong>Posição de jogo / game position:</strong> "+posicao+".<br />");
		janela.document.write("<strong>Características / characteristics:</strong> "+caracteristica+".<br />");
		janela.document.write("<strong>Altura / height:</strong> "+altura+" - <strong>Peso / weight:</strong> "+peso+".<br />");
		janela.document.write("</div>");
		janela.document.write("</body></html>");
	}
}

function janelaPopComissao(img,alt,lar,nome,funcao) {
	janela = null;
	cima = (window.screen.height - alt)/2; 
	lado = (window.screen.width - lar)/2; 
	if(janela == null) {
		janela = window.open("","galeria","width="+lar+",height="+alt+",top="+cima+",left="+lado+",toolbar=no");
		janela.document.write("<html><head><title>"+nome+"</title></head><body style='margin: 0px; padding: opx; '>");
		janela.document.write("<div id='foto' style='float: left; width: 250px; border: 1px solid #ccc; margin-left: 4px !important; margin-left: 4px; text-align: center; margin-top: 10px; padding: 10px; color: #333; font: 11px Tahoma, 'Trebuchet MS', Arial, Verdana;'>");
		janela.document.write("<img src="+img+"></img>");
		janela.document.write("</div>");
		janela.document.write("<div id='descricao' style='float: left; width: 330px; height: 320px; border: 1px solid #ccc; margin-left: 4px !important; margin-left: 4px; margin-top: 10px; padding: 5px; color: #333; background-image: url(img/marcaDagua.jpg); background-position: center; background-repeat: no-repeat; font: 11px Tahoma, 'Trebuchet MS', Arial, Verdana;'>");
		janela.document.write("<strong>Nome / Name:</strong> "+nome+".<br />");
		janela.document.write("<strong>Função / Function:</strong> "+funcao+".<br />");
		janela.document.write("</div>");
		janela.document.write("</body></html>");
	}
}

function popup(funcao, titulo) {
	//titulo
	var divTitulo = document.getElementById('divTitulo');
	var titulo = document.createTextNode(titulo);
	if (!divTitulo.hasChildNodes()) {
		divTitulo.appendChild(titulo);
	}
	
	//conteudo IFRAME
	//var divConteudo = document.getElementById('divConteudo');
	//divConteudo.innerHTML='<iframe src='+pagina+' style="margin:10px; padding:0; width:98%; height: 85%"></iframe>'
	
	//funções
	if(funcao=="abrir"){
		document.getElementById("fundoComAlpha").style.display = "";
		document.getElementById("quadro").style.display = "";
	}else if(funcao=="fechar"){
		document.getElementById("fundoComAlpha").style.display = "none";
		document.getElementById("quadro").style.display = "none";
	}
}

function popupCadastro(funcao, pagina) {
	
	//conteudo IFRAME
	var divConteudo = document.getElementById('form_cadastro');
	divConteudo.innerHTML='<iframe src='+pagina+' style="margin:10px; padding:0; width: 480px; height: 385px !important; height: 355px;"></iframe>'

	//funções
	if(funcao=="abrir"){
		document.getElementById("fundoComAlpha").style.display = "";
		document.getElementById("popupForm").style.display = "";
	}else if(funcao=="fechar"){
		document.getElementById("fundoComAlpha").style.display = "none";
		document.getElementById("popupForm").style.display = "none";
	}
}