function myAlert(txt, labelBotao) {

	//iframe que vai bloquear a tela
	var iframe = document.createElement("iframe");
	iframe.style.position = "absolute";
	iframe.style.left = 0;
	iframe.style.top = 0;
	iframe.width = tela.ww();
	iframe.height = tela.dh();
	iframe.frameBorder = 0;
	iframe.className = "transparent";
	document.body.appendChild(iframe);
	
	//div que vai bloquear a tela
	var divTrava = document.createElement("div");
	divTrava.style.position = "absolute";
	divTrava.style.left = 0;
	divTrava.style.top = 0;
	divTrava.style.width = tela.ww();
	divTrava.style.height = tela.dh();
	divTrava.style.background = "#FFFFFF";
	divTrava.className = "transparent";
	document.body.appendChild(divTrava);

	// cria imagem
	var img = document.createElement("img");
	img.src = "img/alerta.gif";

	// cria div
	div = document.createElement("div");
	div.style.position = "absolute";
	div.align = "center";
	div.className = "myAlertDiv";
	div.style.background = "#ffffff";

	// cria tabela
	var table = document.createElement("table");
	table.border		= 0;
	table.cellPading	= 0;
	table.cellSpacing	= 5;
	// cria linha
	row = table.insertRow(0);
	// cria coluna
	col1 = row.insertCell(0);
	col1.appendChild(img);
	col2 = row.insertCell(1);
	col2.className = "myAlertTd";
	col2.innerHTML = txt;

	div.appendChild(table);
	
	// cria  botao
	var botao = document.createElement("input");
	botao.type = "button";
	botao.onclick = function() {
		document.body.removeChild(divTrava);
		document.body.removeChild(iframe);
		document.body.removeChild(div);
	}
	if(!labelBotao) {
		botao.value = "OK";
	} else {
		botao.value = labelBotao;
	}
	botao.className = "myAlertBotao";
	div.appendChild(botao);
	
	document.body.appendChild(div);

	var left = (tela.ww() / 2) - (div.offsetWidth / 2);
	var top = ((tela.wh() / 2) + tela.sy()) - (div.offsetHeight / 2);

	div.style.left = left;
	div.style.top = top;
	botao.focus();
}

function myConfirm(txt, funcaoRetorno) {

	//iframe que vai bloquear a tela
	var iframe = document.createElement("iframe");
	iframe.style.position = "absolute";
	iframe.style.left = 0;
	iframe.style.top = 0;
	iframe.width = tela.ww();
	iframe.height = tela.dh();
	iframe.frameBorder = 0;
	iframe.className = "transparent";
	document.body.appendChild(iframe);
	
	//div que vai bloquear a tela
	var divTrava = document.createElement("div");
	divTrava.style.position = "absolute";
	divTrava.style.left = 0;
	divTrava.style.top = 0;
	divTrava.style.width = tela.ww();
	divTrava.style.height = tela.dh();
	divTrava.style.background = "#FFFFFF";
	divTrava.className = "transparent";
	document.body.appendChild(divTrava);

	// cria imagem
	var img = document.createElement("img");
	img.src = "img/alerta.gif";

	// cria div
	div = document.createElement("div");
	div.style.position = "absolute";
	div.align = "center";
	div.className = "myAlertDiv";
	div.style.background = "#ffffff";

	// cria tabela
	var table = document.createElement("table");
	table.border		= 0;
	table.cellPading	= 0;
	table.cellSpacing	= 5;
	// cria linha
	row = table.insertRow(0);
	// cria coluna
	col1 = row.insertCell(0);
	col1.appendChild(img);
	col2 = row.insertCell(1);
	col2.className = "myAlertTd";
	col2.innerHTML = txt;

	div.appendChild(table);
	
	// cria  botao de não
	var botao = document.createElement("input");
	botao.type = "button";
	botao.value = "Não";
	botao.onclick = function() {
		document.body.removeChild(divTrava);
		document.body.removeChild(iframe);
		document.body.removeChild(div);
	}
	botao.className = "myAlertBotao";
	div.appendChild(botao);
	
	// cria  botao de sim
	var botao = document.createElement("input");
	botao.type = "button";
	botao.value = "Sim";
	botao.style.marginLeft = "5px";
	botao.onclick = function() {
		document.body.removeChild(divTrava);
		document.body.removeChild(iframe);
		document.body.removeChild(div);
		if(funcaoRetorno != null) {
			funcaoRetorno();
		}
	}
	botao.className = "myAlertBotao";
	div.appendChild(botao);

	document.body.appendChild(div);

	var left = (tela.ww() / 2) - (div.offsetWidth / 2);
	var top = ((tela.wh() / 2) + tela.sy()) - (div.offsetHeight / 2);

	div.style.left = left;
	div.style.top = top;
}