function abrirPopupLayer(){
	
	exibirCamada();
	
	window.scrollTo(0,0);
	/*
	AbrirPopup("","JanelaPopups",500,220);
	document.Formulario.action = "admSalvarReg.asp";
	document.Formulario.target = "JanelaPopups";
	
	*/
	Div = "Popup"
	
	var wd = 400;
	var hg = 235;
	
	window.document.getElementById("Popup").style.display = "block";
	window.document.getElementById("Popup").style.width = wd;
	window.document.getElementById("Popup").style.height = hg;
	
	window.document.getElementById("Popup").style.marginLeft = (wd/2)*(-1);
	window.document.getElementById("Popup").style.marginTop  = (hg/2)*(-1);
	Include("a.html");
	
}

function fecharPopupLayer() {
	esconderCamada ();
	
	window.document.getElementById("Popup").style.display = "none";

	
}

function exibirCamada () {
	window.document.getElementById("Camada").style.display = "block";
	window.document.getElementById("Camada").style.width = document.body.scrollWidth;
	window.document.getElementById("Camada").style.height = document.body.scrollHeight;
}
function esconderCamada () {
	window.document.getElementById("Camada").style.display = "none";
	window.document.getElementById("Camada").style.width = 0;
	window.document.getElementById("Camada").style.height = 0;
}



var xhr;
if (window.XMLHttpRequest) {
    xhr = new XMLHttpRequest();
} else if (window.ActiveXObject) {
    try {
        xhr = new ActiveXObject('Msxml2.XMLHTTP');
    } catch(e) {
        xhr = new ActiveXObject('Microsoft.XMLHTTP');
    }
}

var intervalo;
function appear(content, value) {
	if (typeof value == 'undefined') value = 0;
    if (value > 1) return;
    var property = content.filters ? 'filter' : 'opacity';
    content.style[property] = content.filters ? 'alpha(opacity=' + value*100 + ')' : value;
    intervalo = setTimeout(function () { appear(content, value + .1) } , 50);
}

function updateChange() {
	var content = document.getElementById('content');
	
	if (xhr.readyState == 1) {
		content.style["visibility"] = "visible";
		table_inner = "<table width='400' height='215' border='0' cellspacing='0' cellpadding='0'><tr><td align='center' valign='middle' bgcolor='#FFFFFF'><img src='img/carregando.gif' align='absmiddle' ></td></tr></table>"
		
		content.innerHTML = table_inner;
	}
	
    if (xhr.readyState == 4) {	
		
        if (xhr.status == 200 || xhr.status == 0) {
            content.innerHTML = xhr.responseText;
			content.style["visibility"] = "visible";
			clearTimeout (intervalo)
		   	appear(content, 0);
        } else {
            alert('Error: ' + xhr.status + '!');
        }
    }
		
}

function Include(pg) {
	
	xhr.abort();
	var p = pg.replace(/\//g, '')
	var content = document.getElementById('content');
	content.style["visibility"] = "hidden";
	
	//page = '' + ((pg == '') ? '' : '?' + pg.replace(/\//g, ''));
    page = p
	page = "arquivos_frame.asp?Forn=1"
	xhr.open('get', page, true);
	xhr.onreadystatechange = updateChange;
	xhr.setRequestHeader('Content-Type', 'text/html; charset=iso-8859-1');
    xhr.send('');
	//*/
	
}


