// Copyright 2005 JP7


function atmos_file_view(url){
	if(!atmos_file_download_click)openPopup(url,'atmos_relatorios_popup',640,480,'resizable=1')
}

function mha_changeLang(newlang){
	if(location.toString().indexOf('http://jp')!=-1)var newLocation=location.toString().replace((lang=='pt-br')?'mha/site/':'mha/'+lang+'/',(newlang=='pt-br')?'mha/site/':'mha/'+newlang+'/')
	else var newLocation=location.toString().replace((lang=='pt-br')?'/site/':'/'+lang+'/',(newlang=='pt-br')?'/site/':'/'+newlang+'/')
	var pos1=newLocation.indexOf('?id=')
	if(pos1!=-1){
		var pos2=newLocation.indexOf('&',pos1)
		if(pos2!=-1)newLocation=newLocation.substring(0,pos1)+'?'+newLocation.substring(pos2+1)
		else newLocation=newLocation.substring(0,pos1)
		newLocation+=((newLocation.indexOf('?')!=-1)?'&':'?')+'id_tipo='+((tipos[1])?tipos[1]:tipos[0])
	}
	location.replace(newLocation)
}

function mha_docH(){return d.documentElement.clientHeight}
function mha_winH(){return d.body.clientHeight}

function mha_footer_position(obj,footer){
	var objMain=getElm(obj)
	var objFooter=getElm(footer)
	if(objMain){
		var h=(mha_winH()>mha_docH())?mha_winH():mha_docH()
		var hfooter=objFooter.offsetHeight
		var h_hfooter=h-hfooter
		if(objMain.offsetHeight<=h_hfooter)objMain.style.height=h_hfooter+'px'
	}
	objFooter.style.visibility='visible'
}
