<!-- Seg versão -->
function DrawAllMenuBar2(){
  document.write('<table width="100%">');
  for(var i =0 ; i < menuBar.length; i++){
    DrawMenuBar2(i);
  }
  document.write('<TR><TD><IMG src="images/menu001.gif" width="120" height="25"></TD></TR>');
  document.write('</table>');
}
function DrawMenuBar2(index){
  document.write('<TR><TD class="menuBar">');
  document.write('<a class=TheMenuBar >');
  document.write(menuBar[index]+'</a></TD></TR>');
  DrawMenus2(index);
}
function DrawMenus2(index){
  var menu = eval('menu'+index);
  for(var i =0 ; i< menu.length;i++){
    document.write('<TR><TD class="menu" id=menu'+index
	     +' onmouseover="this.style.backgroundColor=\'#3366FF\'"'
	     +' onmouseout="this.style.backgroundColor=\'#3366CC\'"'
	     +'>');
//    alert(eval('3'));
/* 2007-05-08
    document.write('<a class="menuButton" onclick="javascript:submitpag(\''+
	      eval("menuFunction"+index+"[i]")+'\',\'FormMenu\','+
	      index+')">'+menu[i]+'</a>');
*/
    document.write('<a class="menuButton" href="?pagina='
		+eval("menuFunction"+index+"[i]")
		+'">' +menu[i]+'</a>');

//    menuText=menu[i];
    document.write('</TD></TR>');
  }
}
var noBubble = false
function SwitchVisibility(menuid)
{
  var ns6

  ns6=navigator.appName

  if(noBubble == false)
    if(ns6 == "Netscape"){
      if(eval("document.getElementById(\'" + menuid + "\').style.visibility == 'visible'")){
	eval("document.getElementById(\'" + menuid + "\').style.position='absolute'")
	eval("document.getElementById(\'" + menuid + "\').style.visibility='hidden'")
      }
      else{
	eval("document.getElementById(\'" + menuid + "\').style.position='relative'")
	eval("document.getElementById(\'" + menuid + "\').style.visibility='visible'")
      }
    }
    else{
      if(eval("document.all.item(\'" + menuid + "\').style.position == 'absolute'")){
	eval("document.all.item(\'" + menuid + "\').style.position='relative'")
	eval("document.all.item('" + menuid + "').style.display='none'")
	eval("document.all.item(\'" + menuid + "\').style.visibility='hidden'")  
	eval("document.all.item(\'" + menuid + "\').style.display='block'")
	eval("document.all.item(\'" + menuid + "\').style.visibility='visible'")
      }

      if(eval("document.all.item(\'" + menuid + "\').style.visibility == 'visible'")){
	eval("document.all.item(\'" + menuid + "\').style.position='relative'")
	eval("document.all.item('" + menuid + "').style.display='none'")
	eval("document.all.item(\'" + menuid + "\').style.visibility='hidden'")  
      }
      else{
	eval("document.all.item(\'" + menuid + "\').style.display='block'")
	eval("document.all.item(\'" + menuid + "\').style.visibility='visible'")
      }
    }
  else
    noBubble = false
}
function SetVisibility(menuid,visible)
{
  var ns6
  
  ns6=navigator.appName
  if(ns6 == "Netscape"){
    if(eval("visible == 'hidden'")){
      eval("document.getElementById(\'" + menuid + "\').style.position='absolute'")
      eval("document.getElementById(\'" + menuid + "\').style.visibility='hidden'")
    }
    else{
      eval("document.getElementById(\'" + menuid + "\').style.position='relative'")
      eval("document.getElementById(\'" + menuid + "\').style.visibility='visible'")
    }
  }
  else{
    if(eval("document.all.item(\'" + menuid + "\').style.position == 'absolute'")){
      eval("document.all.item(\'" + menuid + "\').style.position='relative'")
      eval("document.all.item('" + menuid + "').style.display='none'")
      eval("document.all.item(\'" + menuid + "\').style.visibility='hidden'")  
      eval("document.all.item(\'" + menuid + "\').style.display='block'")
      eval("document.all.item(\'" + menuid + "\').style.visibility='visible'")
    }
    
    if(eval("visible == 'hidden'")){
      eval("document.all.item(\'" + menuid + "\').style.position='relative'")
      eval("document.all.item('" + menuid + "').style.display='none'")
      eval("document.all.item(\'" + menuid + "\').style.visibility='hidden'")  
    }
    else{
      eval("document.all.item(\'" + menuid + "\').style.display='block'")
      eval("document.all.item(\'" + menuid + "\').style.visibility='visible'")
      
    }
  }
}

function submitpag(pag,form,menu,auxValue){
//  alert(pag + ' -- ' + form);
  if(eval("document.forms."+form+".openmenu != null"))
  eval("document.forms."+form+".openmenu.value = \""+menu+"\"");
  if(eval("document.forms."+form+".auxvalue != null"))
  eval("document.forms."+form+".auxvalue.value = \""+auxValue+"\"");
  eval("document.forms."+form+".pagina.value = \""+pag+"\"");
  eval("document.forms."+form+".submit()");
}
var layerWidth = 1;
var ThelayerName ="";
function ShowLayer(layerName){
//  eval("document.all.item(\'" + layerName + "\').style.visibility='visible'");
//width:236px; height:181px

  layerWidth = 50;
  clearTimeout();
  ThelayerName=layerName;

  var theLayer
  var theLayer2

  if(navigator.appName == "Netscape"){
    theLayer=document.getElementById(ThelayerName)
    theLayer2=document.getElementById(ThelayerName+'2')
  }else{
    theLayer=document.all.item(ThelayerName)
    theLayer2=document.all.item(ThelayerName+'2')
  }
  theLayer.style.width=layerWidth*2-20;
  theLayer.style.height=(layerWidth);
  theLayer.style.background="";
  theLayer2.style.visibility='hidden';
  theLayer.style.visibility='visible';

  setTimeout("sizeLayer()",1);
//  alert("FIM - "+theLayer.style.height);
}
function sizeLayer(){
  var theLayer
  var theLayer2
  if(navigator.appName == "Netscape"){
    theLayer=document.getElementById(ThelayerName)
    theLayer2=document.getElementById(ThelayerName+'2')
  }else{
    theLayer=document.all.item(ThelayerName)
    theLayer2=document.all.item(ThelayerName+'2')
  }
  if(layerWidth<120){
    layerWidth+=4;
    theLayer.style.width=layerWidth*2;
    theLayer.style.height=layerWidth;
    setTimeout("sizeLayer()",1);
  }else{
    theLayer2.style.width=theLayer.style.width;
    theLayer2.style.height=theLayer.style.height;
    theLayer2.style.visibility='visible';
//    theLayer2.style.background='#CCCCCC';
  }
}
function setVisible(TheLayerName,visiblility){
  var theLayer
  var theLayer2
  if(navigator.appName == "Netscape"){
    theLayer=document.getElementById(ThelayerName)
    theLayer2=document.getElementById(ThelayerName+'2')
  }else{
    theLayer=document.all.item(ThelayerName)
    theLayer2=document.all.item(ThelayerName+'2')
  }
  theLayer.style.visibility=visiblility;
  theLayer2.style.visibility=visiblility;
}

function DrawBorderTable(bitmap,backGColor,bodyString,toClose){
  document.write("<TABLE width=\"100%\" height=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">");
  document.write("<TR><TD width=\"1\" height=\"1\"><IMG src=\"images/"+bitmap+"TL.gif\"></TD>");
  document.write("<TD background=\"images/"+bitmap+"T.gif\">&nbsp;</TD>");
  document.write("<TD width=\"1\"><IMG src=\"images/"+bitmap+((toClose=="")?"":"X")+"TR.gif\""+
	    ((toClose=="")?"":"onClick=\"setVisible('"+toClose+"','hidden')\"")+"></TD>");
  document.write("</TR><TR align=\"center\" valign=\"top\"><TD background=\"images/"+bitmap+"L.gif\">&nbsp;</TD>");
  document.write("<TD nowrap width=\"99%\" bgcolor=\""+backGColor+"\">"+eval(bodyString)+"</TD>");
  document.write("<TD background=\"images/"+bitmap+"R.gif\">&nbsp;</TD>");
  document.write("</TR><TR><TD width=\"1\" height=\"1\"><IMG src=\"images/"+bitmap+"BL.gif\"></TD>");
  document.write("<TD background=\"images/"+bitmap+"B.gif\">&nbsp;</TD>");
  document.write("<TD width=\"1\"><IMG src=\"images/"+bitmap+"BR.gif\"></TD>");
  document.write("</TR></TABLE>");
}
function DrawLoginForm(){
  if(navigator.appName == "Netscape"){
    theLayer=document.getElementById(ThelayerName)
    theLayer2=document.getElementById(ThelayerName+'2')
  }else{
    theLayer=document.all.item(ThelayerName)
    theLayer2=document.all.item(ThelayerName+'2')
  }
  toReturn=""
//  toReturn+="<FORM name=\"form2\" method=\"post\" action=\"\">";
  toReturn+="<TABLE width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
  toReturn+="<TR><TD>&nbsp;</TD><TD align=\"center\" colspan=\"2\" nowrap><B>";
  toReturn+="<FONT face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"-1\">";
  toReturn+="Area Cliente</FONT> </B></TD><TD>&nbsp;</TD></TR>";
//  toReturn+="<TR><TD colspan=\"4\">&nbsp;</TD></TR>";
  toReturn+="<TR><TD width=\"20%\">&nbsp;</TD>";
  toReturn+="<TD nowrap><B><FONT face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"-2\">";
  toReturn+="Login</FONT></B></TD>";
  toReturn+="<TD><INPUT class=form type=\"text\" id=\"user\" name=\"user\"></TD>";
  toReturn+="<TD width=\"20%\">&nbsp;</TD></TR><TR><TD>&nbsp;</TD>";
  toReturn+="<TD nowrap><B><FONT face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"-2\">";
  toReturn+="Password&nbsp;</FONT></B></TD>";
  toReturn+="<TD><INPUT class=form type=\"password\" id=\"password\" name=\"password\"></TD><TD>&nbsp;</TD></TR>";
  toReturn+="<TR><TD>&nbsp;</TD><TD align=\"center\" colspan=\"2\">";
  toReturn+="<INPUT class=form type=\"Button\" value=\"OK\" onClick='submitpag(\"login\",\"FormMenu\",";
  if(navigator.appName == "Netscape"){
    toReturn+="document.getElementById(\"user\").value,document.getElementById(\"password\").value)\'>";
  }else{
    toReturn+="document.all.user.value,document.all.password.value)\'>";
  }
  
//  toReturn+="<INPUT class=form type=\"button\" value=\"OK\" onClick='alert(\"FormMenu\")'>";
  toReturn+="</TD><TD>&nbsp;</TD></TR></TABLE>";
//  toReturn+="</FORM>";
//  alert(toReturn)
  return(toReturn);
}
function DrawCaixa(textBody,tableWidth,celWidth,bitmap,theClass){
  toReturn="<TABLE width=\""+tableWidth+"\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"";

  toReturn+="<TR><TD class="+theClass+" width=\""+celWidth+"\"><IMG src=\""+bitmap+"TL.gif\"></TD>";
  toReturn+="<TD class="+theClass+" background=\""+bitmap+"T.gif\">&nbsp;</TD>";
  toReturn+="<TD class="+theClass+" width=\""+celWidth+"\"><IMG src=\""+bitmap+"TR.gif\"></TD></TR>";

  toReturn+="<TR ><TD class="+theClass+" background=\""+bitmap+"L.gif\" width=\""+celWidth+"\">&nbsp;</TD>";
  toReturn+="<TD class="+theClass+"Body background=\""+bitmap+"T.gif\">"+textBody+"</TD>";
  toReturn+="<TD class="+theClass+" background=\""+bitmap+"R.gif\" width=\""+celWidth+"\">&nbsp;</TD></TR>";

  toReturn+="<TR><TD class="+theClass+" width=\""+celWidth+"\"><IMG src=\""+bitmap+"BL.gif\"></TD>";
  toReturn+="<TD class="+theClass+" background=\""+bitmap+"B.gif\">&nbsp;</TD>";
  toReturn+="<TD class="+theClass+" width=\""+celWidth+"\"><IMG src=\""+bitmap+"BR.gif\"></TD></TR>";

  toReturn+="</TABLE>";
  return   (toReturn);
}


//--!>
