

function expande(x) {  
    //linha=eval('document.all.' + x + '.style;'); 
    linha=document.getElementById(x).style; 
    imagem=document.getElementById("img" + x); 
    if (linha) {
	    if(linha.display=='') {
		    linha.display='none';
		    if (imagem) {	
	            	imagem.src='/SiteBNDES/bndes/system/modules/br.gov.bndes.prototipo/resources/imagens/plus.gif';
		    }
	    } else {
		    linha.display='';	
		    if (imagem) {	
		            imagem.src='/SiteBNDES/bndes/system/modules/br.gov.bndes.prototipo/resources/imagens/minus.gif';
		    }
	    }
    }
}



  function formataCGC(valor) {
	document.write(valor.substring(0,2) + "." + valor.substring(2,5) + "." + valor.substring(5,8) + "/" + valor.substring(8,12) + "-" + valor.substring(12,14));
  }




// aumentar/ diminuir fonte
/*
*var tgs = new Array( 'div' , 'table' , 'td', 'th', 'tr', 'p', 'span', 'h1','h2','h3', 'h4', 'h5', 'h6', 'a');
*
*var szs = new Array( '9','10','11','12','13' ,'14', '15', '16', '17');
*
*var startSz = 3;
*function ts( trgt,inc ) {
*	if (!document.getElementById) return
*	var d = document,cEl = null,sz = startSz,i,j,cTags;
*	sz += inc;
*	if ( sz < 0 ) sz = 0;
*	if ( sz > 8 ) sz = 8;
*	startSz = sz;
*	if ( !( cEl = d.getElementById( trgt ) ) ) cEl = d.getElementsByTagName( trgt )[ 0 ];
*
*	cEl.style.fontSize = szs[ sz ];
*
*	for ( i = 0; i < tgs.length; i++ ) {
*		cTags = cEl.getElementsByTagName( tgs[ i ] );
*		for ( j = 0; j < cTags.length; j++ ) cTags[ j ].style.fontSize = szs[ sz ];
*	}
*}
*/
function resizeFont(inc) {
  var sz = document.body.style.fontSize;
  if (sz == "") {
    sz = "1.0em";
  }
  sz = parseFloat(sz) + inc;
  if(sz < 0) sz = 0;
  if(sz > 8) sz = 8;
  document.body.style.fontSize = sz + "em";
}

//Invoca um banco de questoes via ajax em 'urlDestino'
//ex: geraQuestao('/SiteBNDES/bndes/questoes/questoes.html', false, 'questao', 'resp_questao')
// NO MOMENTO APENAS CHAMADAS SINCRONAS SAO FEITAS.
// - idElemDesabilitar eh opcional
function geraQuestao(urlDestino, boolAsync, idElemPreecherInner, idElemDesabilitar){

   //boolAsync nao suportado por enquanto

   var elemDesab = null;

   if(idElemDesabilitar != undefined){
      elemDesab = document.getElementById(idElemDesabilitar);
   }

   if(elemDesab != null){
      elemDesab.disabled = true;
   }

   var xmlhttp;

   if (window.XMLHttpRequest)
   {// code for IE7+, Firefox, Chrome, Opera, Safari
      xmlhttp=new XMLHttpRequest();
   }
   else
   {// code for IE6, IE5
      xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
   }
   //xmlhttp.open("GET", urlDestino, boolAsync);
   //concatenar parametro randomico para evitar caching no web server
   xmlhttp.open("GET", urlDestino + "?" + Math.random(), false);
   xmlhttp.send();

   var xmlDoc=xmlhttp.responseText;

   var elem = document.getElementById(idElemPreecherInner);
   if(elem != null){
      elem.innerHTML = xmlDoc;
   }

   if(elemDesab != null){
      elemDesab.disabled = false;
   }
}

