function QualBrowser(){
	this.ver=navigator.appVersion
	this.agent=navigator.userAgent.toLowerCase()
	this.dom=document.getElementById?1:0
	this.op5=this.agent.indexOf("opera 5")>-1 && window.opera 
  this.op6=this.agent.indexOf("opera 6")>-1 && window.opera 
  this.ie5 = (this.agent.indexOf("msie 5")>-1 && !this.op5 && !this.op6)
  this.ie55 = (this.ie5 && this.agent.indexOf("msie 5.5")>-1)
  this.ie6 = (this.agent.indexOf("msie 6")>-1 && !this.op5 && !this.op6)
	this.ie4=(this.agent.indexOf("msie")>-1 && document.all &&!this.op5 &&!this.op6 &&!this.ie5&&!this.ie6)
  this.ie = (this.ie4 || this.ie5 || this.ie6)
	this.mac=(this.agent.indexOf("mac")>-1)
	this.ns6=(this.agent.indexOf("gecko")>-1 || window.sidebar)
	this.ns4=(!this.dom && document.layers)?1:0;
	this.browser=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.op5 || this.op6)
  this.usedom= this.ns6//Use dom creation
  this.reuse = this.ie||this.usedom //Reuse layers
  this.px=this.dom&&!this.op5?"px":""
	return this
}
function Posiciona() {
  tblW=1000
  maxX=(browser.ie?document.body.clientWidth:window.innerWidth);
  for(i=0;i<menusSegundoNiveltbl.length;i++) {
	if(browser.ns4)this.css=document.layers[menusSegundoNiveltbl[i]]
    else if(browser.ie4)this.css=document.all[menusSegundoNiveltbl[i]].style
    else if(document.getElementById) this.css=document.getElementById(menusSegundoNiveltbl[i]).style
	if(maxX>tblW) pos=(maxX-tblW)/2+menusSegundoNivelOffset[i]
  	if(maxX<=tblW) pos=menusSegundoNivelOffset[i]	
  	this.css.left=pos+'px'
  } 
}

function HideLayer(){ this.css.display="none";}
function ShowLayer(){ this.css.display="";}
function LayerStatus(){ return this.css.display;}

function strCSS(layerName) {
  if(browser.ns4)this.css=document.layers[layerName]
  else if(browser.ie4)this.css=document.all[layerName].style
  else if(document.getElementById) this.css=document.getElementById(layerName).style
  /*maxX=(browser.ie?document.body.clientWidth:window.innerWidth);
  tblW=1000
  if(maxX>tblW) pos=(maxX-tblW)/2+offset
  if(maxX<=tblW) pos=offset	
  this.css.left=pos+'px'*/
  this.mostra=ShowLayer
  this.esconde=HideLayer
  this.status=LayerStatus
  return this
}

function mostraEsconde(layerName) {
	if (eval(layerName + '.status() == styleHidden')) eval(layerName + '.mostra()')
	else eval(layerName + '.esconde()');
}
function escondeTodos() {
	for(i=0;i<menusSegundoNivel.length;i++) eval(menusSegundoNivel[i]+'.esconde()');	
}
function mostra(layerName,offset) {
	escondeTodos();
	eval(layerName + '.mostra()')
}
//----------------------------------------------------------
browser=new QualBrowser()
styleHidden='none'
