
// conmutador visibilidad del menu de segundo nivel

function toggle( targetId1,targetId2,targetId3){
  if (document.getElementById){
  		target1 = document.getElementById( targetId1 );
		target2 = document.getElementById( targetId2 );
		target3 = document.getElementById( targetId3 );
	

		
  			if (target1.style.display == "none"){
  				target1.style.display = "";
  			} else {
  				target1.style.display = "";
			}
			
		if (target2.style.display != "none"){
  				target2.style.display = "none";
  			} 
			if (target3.style.display != "none"){
  				target3.style.display = "none";
  			} 
					
			
  	}
}


// apaga todas las opciones del menu

function apaga( targetId1,targetId2,targetId3){
  if (document.getElementById){
  		target1 = document.getElementById( targetId1 );
		target2 = document.getElementById( targetId2 );
		target3 = document.getElementById( targetId3 );
		


	
	if (target1.style.display != "none"){
target1.style.display = "none";
	}			
		if (target2.style.display != "none"){
  				target2.style.display = "none";
  			} 
			if (target3.style.display != "none"){
  				target3.style.display = "none";
  			} 
			
  	}
}


function menuinterior( targetId1,targetId2,targetId3){
  if (document.getElementById){
  		target1 = document.getElementById( targetId1 );
		target2 = document.getElementById( targetId2 );
		target3 = document.getElementById( targetId3 );

		
  			if (target1.style.display == "none"){
  				target1.style.display = "";
  			} else {
  				target1.style.display = "none";
			}
			
		if (target2.style.display != "none"){
  				target2.style.display = "none";
  			} 
			if (target3.style.display != "none"){
  				target3.style.display = "none";
  			} 
			
					
			
  	}
}


// apaga todas las opciones del menu

function apagainterior( targetId1,targetId2,targetId3){
  if (document.getElementById){
  		target1 = document.getElementById( targetId1 );
		target2 = document.getElementById( targetId2 );
		target3 = document.getElementById( targetId3 );
		

	
	if (target1.style.display != "none"){
target1.style.display = "none";
	}			
		if (target2.style.display != "none"){
  				target2.style.display = "none";
  			} 
			if (target3.style.display != "none"){
  				target3.style.display = "none";
  			} 
			
					
			
  	}
}

	


function recargador() {

if(is.ns4||is.ns6) {
window.location.href = window.location.href;
}
}

// rollover basado en CSS



function menRollover(Idfondo,Idimagen){
if (document.getElementById) {
var fondo=document.getElementById(Idfondo);
//var letras=document.getElementById(Idletras);

fondo.style.backgroundImage='url(imagens/'+Idimagen+')';
//letras.style.color='#00539f';
}
}

function menRollout(Idfondo,Idimagen){
if (document.getElementById) {
var fondo=document.getElementById(Idfondo);
//var letras=document.getElementById(Idletras);

fondo.style.backgroundImage='url(imagens/'+Idimagen+')';
//letras.style.color='#00539f';
}
}



var myimages=new Array()
function preloadimages(){
for (i=0;i<preloadimages.arguments.length;i++){
myimages[i]=new Image()
myimages[i].src=preloadimages.arguments[i]
}
}
preloadimages("imagens/m_grupo_1.gif","imagens/m_activ_1.gif","imagens/m_inter_1.gif","imagens/m_eco_1.gif","imagens/m_priva_1.gif","imagens/m_press_1.gif","imagens/intranscol_01.jpg","imagens/barra_filiais.jpg","imagens/barra_falecom.jpg","imagens/barra_gestao.jpg","imagens/barra_grupo.jpg","imagens/barra_historia.jpg","imagens/barra_diagnostico.jpg","imagens/barra_transporte.jpg","imagens/barra_cindustrial.jpg","imagens/barra_certificacao.jpg","imagens/barra_tratamento.jpg");






function getWindowHeight() {
			var windowHeight = 0;
			if (typeof(window.innerHeight) == 'number') {
				windowHeight = window.innerHeight;
			}
			else {
				if (document.documentElement && document.documentElement.clientHeight) {
					windowHeight = document.documentElement.clientHeight;
				}
				else {
					if (document.body && document.body.clientHeight) {
						windowHeight = document.body.clientHeight;
					}
				}
			}
			return windowHeight;
		}
// redimensiona la página en vertical para que ocupe todo

function escalaVertical() {
if (document.getElementById) {
	var windowHeight=getWindowHeight();
	var contenido=document.getElementById('contenidomain');
	var todaPagina=document.getElementById('contienetodo').offsetHeight;
		if (todaPagina<=windowHeight){
			contenido.style.height=(windowHeight-270)+'px';
		
}
			else{
			contenido.style.height='auto';
		
}
}
}

function escalaVertical2() {
if (document.getElementById) {
	var windowHeight=getWindowHeight();
	var contenido=document.getElementById('contenidomain');
	var todaPagina=document.getElementById('contienetodo').offsetHeight;
		if (todaPagina<=windowHeight){
			contenido.style.height=(windowHeight-248)+'px';
		
}
			else{
			contenido.style.height='auto';
		
}
}
}


function llenadoVertical(elGalibo) {
if (document.getElementById) {
	var windowHeight=getWindowHeight();
	var contenido=document.getElementById('contenidomain');
	var todaPagina=document.getElementById('contienetodo').offsetHeight;
		if (todaPagina<=windowHeight){
			contenido.style.height=(windowHeight-elGalibo)+'px';
		
}
			else{
			contenido.style.height='auto';
		
}
}
}





function abrePopup( sUrl, sName, top, left, width, height)
{
	var oWnd    = null;
	var sParams = "";

	sParams += "top="     + top;
	sParams += ",left="   + left;
	sParams += ",width="  + width;
	sParams += ",height=" + height;
	sParams += ",toolbar=0,location=0,directories=0,menubar=0,resizable=0,scrollbars=0";

	oWnd = window.open( sUrl, sName, sParams );

}




