
function toggleLayer(_w,_h) {

   var isIE=document.all?true:false;
   var isDOM=document.getElementById?true:false;
   var isNS4=document.layers?true:false;

  if (isDOM)
  {
    if (_h=='s') { document.getElementById(_w).style.display = 'block'; document.getElementById(_w).style.visibility='visible'; }
    if (_h=='h') { document.getElementById(_w).style.display = 'none'; document.getElementById(_w).style.visibility='hidden'; }
  }
  else if (isIE) {
    if (_h=='s') { eval("document.all."+_w+".style.display='block';"); eval("document.all."+_w+".style.visibility='visible';"); }
    if (_h=='h') { eval("document.all."+_w+".style.display='none';"); eval("document.all."+_w+".style.visibility='hidden';"); }
  }
  else if(isNS4)
  {
    if (_h=='s') { eval("document.layers['"+_w+"'].display='block';"); eval("document.layers['"+_w+"'].visibility='show';"); }
    if (_h=='h') { eval("document.layers['"+_w+"'].display='none';"); eval("document.layers['"+_w+"'].visibility='hide';"); }
  }
}

// Rollover
// ------------------------------------
var btn_on='';

function m_click(btn,lang) {
  if (btn_on!='') document.images[btn_on].src = 'imagens/'+lang+'/menu1/'+btn_on+'.gif';
  if (btn) {
     document.images[btn].src = 'imagens/'+lang+'/menu1/'+btn+'_on'+'.gif';
     btn_on=btn;
	 }
  return 1; 
  }

function m_over(btn,lang) {
  if (btn_on!=btn) document.images[btn].src = 'imagens/'+lang+'/menu1/'+btn+'_on.gif';
  return 1; 
  }  

function m_out(btn,lang) {
  if (btn_on==btn) document.images[btn].src = 'imagens/'+lang+'/menu1/'+btn_on+'_on.gif';
  else document.images[btn].src = 'imagens/'+lang+'/menu1/'+btn+'.gif';
  return 1; 
  }
// ------------------------------------
function submitSearch() {
   document.fpesq.submit();
  }
// ------------------------------------
var clockTimeoutID;

function barraAbre() {
 clearTimeout(clockTimeoutID);
 barraclipTo(122);
}

function barraFecha() {
   clockTimeoutID=setTimeout("barraclipTo(22)",1000); 
}

function barraclipTo(num) {
   objDiv = barragetObj('DIVmenu1');
   objDiv.clip='rect(0,860,'+num+',0)';
}

function barragetObj(str) {
   if (document.layers) {
      return document.layers[str];
      } else if (document.all && !document.getElementById) {
      return document.all[str].style;
      } else {
      return document.getElementById(str).style;
      }
}

function winImg(imagem){
 var au=window.open('','imgwin','width=400,height=400');
 au.document.write('<'+'html><'+'head><'+'title>NDS<'+'/title><'+'sc'+'ript language="Ja'+'vasc'+'ript">self.focus();<'+'/sc'+'ript><'+'/head><'+'body topmargin=0 leftmargin=0 marginwidth=0 marginheight=0 bgcolor="#FF8C00"><'+'center>');
 au.document.write('<'+'img border="0" onLoad="window.resizeTo(this.width+10, this.height+59);" src="'+imagem+'">');
 au.document.write('<'+'/center><'+'/body><'+'/html>');
}

function setBkOn(idTd){
	aux=document.getElementById(idTd);
	if(aux.style){
		aux.setAttribute('background','images/bk_boxOn.gif');
	}
}
function setBkOff(idTd){
	aux=document.getElementById(idTd);
	if(aux.style){
		aux.setAttribute('background','images/bk_box.gif');
	}
}

function setBkOn2(idTd,grp){
	aux=document.getElementById(idTd);
	if(aux.style){
		aux.setAttribute('background','images/box/bk_box'+grp+'On.gif');
	}
}
function setBkOff2(idTd,grp){
	aux=document.getElementById(idTd);
	if(aux.style){
		aux.setAttribute('background','images/box/bk_box'+grp+'.gif');
	}
}

var BkMenuArr=new Array();

function setBkMenuOver(num){
	aux=document.getElementById('bk'+num);
	if(aux.style){
		aux.setAttribute('background','images/menus/bk_red.jpg');
	}
}

function setBkMenuOut(num){
	aux=document.getElementById('bk'+num);
	if(aux.style){
		aux.setAttribute('background','images/menus/bk_'+BkMenuArr[num]+'.jpg');
	}
}

var BkMenuArr2=new Array();
var BkMenuArr2Over=new Array();

function setBkMenu2Over(num){
	aux=document.getElementById('bk'+num);
	if(aux.style){
		aux.setAttribute('background','images/menus/bk_'+BkMenuArr2Over[num]+'.jpg');
	}
}

function setBkMenu2Out(num){
	aux=document.getElementById('bk'+num);
	if(aux.style){
		aux.setAttribute('background','images/menus/bk_'+BkMenuArr2[num]+'.jpg');
	}
}