var ns4 = (document.layers)? true:false
var ie4 = (document.all)? true:false

function popup(url,largura,altura) {
	window.open(url,'popup','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,menubar=no,width='+largura+',height='+altura);
}
function popupMax (url, nome, largura, altura, pos, barras) {
	if (pos == 0) {
		posleft = 20;
		postop  = (screen.height) ? (screen.height - altura) / 2 - 50 : 100;
	} else if (pos == 1) {
		posleft = (screen.width) ? (screen.width - largura) / 2 : 100;
		postop  = (screen.height) ? (screen.height - altura) / 2 - 50 : 100;
	} else if (pos == 2) {
		posleft = (screen.width) ? (screen.width - largura) - 28 : 100;
		postop  = (screen.height) ? (screen.height - altura) / 2 - 50 : 100;
	}
	if (barras == true) opbarras = "yes"; else opbarras = "no";

	settings = 'width=' + largura + ', height=' + altura + ', top=' + postop + ', left=' + posleft + ', scrollbars=' + opbarras + ', location=no, directories=no, status=no, menubar=no, toolbar=no, resizable=no';
	window.open(url, nome, settings);
}
function hide(id) {
	if (ns4) document.layers[id].visibility = "hide"
	else document.getElementById(id).style.display="none";
}
function show(id) {
	if (ns4) document.layers[id].visibility = "show"
	else document.getElementById(id).style.display="";
}
function redireciona (obj) {
	if (obj[obj.selectedIndex].value != "") {
		var url = obj[obj.selectedIndex].value;
		self.location = url;
	}
}
function escreve(id,txt) {
    if (ns4) {
        var lyr = document.layers[id].document
        lyr.write(txt)
        lyr.close()
    }
    else document.getElementById(id).innerHTML = txt
}

function im(url) {
	window.open(url, 'im', 'channelmode=no, directories=no, fullscreen=no, height=350, left=100, location=no, menubar=no, resizable=no, scrollbars=no, status=no, titlebar=no, toolbar=no, top=100, width=180');
}

