// JavaScript Document
function lastmod(){
		var data, mes, dia, ano;
		data = new String(document.lastModified);
		mes = data.substr(0, 2);
		dia = data.substr(3, 2);
		ano = data.substr(8, 2);
		return "Atualizado em " + dia + "/" + mes + "/" + ano;
		}

function open_win(nome){
		var h = screen.availHeight - 140;
		var v = screen.availWidth - 20;
		eval('window.open(\"' + nome + '\", \"\",\"width=' + v + ',height=' + h + ',top=0,left=0,resizable=yes,location=yes,menubar=yes,status=yes,directories=yes,titlebar=yes,toolbar=yes\");');
		}
		

function detectBrowser(){
	var navi;
	var browser=navigator.appName;
	var b_version=navigator.appVersion;
	var version=parseFloat(b_version);
	if (browser=="Microsoft Internet Explorer") {
		navi = "IE";
	} else if (browser=="Netscape")	{
		navi = "NS";
	} else {
		navi = "ND"; // Undefined
	}
	return navi;
}

function setIframeHeight(h) {
	var pTag1 = document.getElementById('main');
	var navi = detectBrowser();
	var h = h;
	
	if ( navi != "IE" ) {
		
		h_nieh = screen.availHeight - 240;
		h_default = 500;
		h_max = Math.max( h_nieh, h_default);
		
		if ( h < h_max ) {
			h = h_max;
		}
		
		pTag1.scrolling="yes";
		if ( document.getElementById("top") ) {
			document.getElementById("top").style.display = "none";
		}
		
	} else {
		pTag1.scrolling="no";		
	}
	pTag1.setAttribute('height', h);
	window.scrollTo(0,0);
}

function setIframeHeightNoScroll(h) {
	var pTag1 = document.getElementById('main');
	var navi = detectBrowser();
	var h = h;
	
	if ( navi != "IE" ) {
		
		h_nieh = screen.availHeight - 240;
		h_default = 500;
		h_max = Math.max( h_nieh, h_default);
		
		if ( h < h_max ) {
			h = h_max;
		}

		pTag1.scrolling="yes";
	} 
	pTag1.setAttribute('height', h);	
}