function startList(valores) {
    var menus = valores.split(";");
    var t = 0;
    while (t<menus.length){
    	var navItems = document.getElementById(menus[t]).getElementsByTagName("li");

     for (var i=0; i<navItems.length; i++) {
    		if(navItems[i].className == "menuparent") {
       			navItems[i].onmouseover=function() {
                  this.className += " over";
                  var tes = this.getElementsByTagName("ul");
                  var lis = tes[0].getElementsByTagName("li");
                  var tamanho = 0;
                  for (var c=0; c<lis.length; c++) {
                    if(lis[c].className == "menuparent") {
                       var teste = lis[c].getElementsByTagName("ul");
                       tamanho+=teste[0].getElementsByTagName("li").length;
                       //var h = lis[c].id;
                    }
                  }
                 // abreMenu(this,lis.length-tamanho,tes[0].id);
                }
    			navItems[i].onmouseout=function() {
                this.className = "menuparent";
                //document.getElementById("iFrameMenu").style.visibility="hidden";
                }
    		}
    	}
      t++;
    }
    //gira();
}

function aleatorio(inferior,superior){
    numPosibilidades = superior - inferior
    aleat = Math.random() * numPosibilidades
    aleat = Math.round(aleat)
    return parseInt(inferior) + aleat
}

function abreMenu(botao,tamanho,ide) {
//  window.status=ide;
  document.getElementById('textos').value=ide;
  botao.style.zIndex = 4

//  if (browser.isIE) {

    x = getPageOffsetLeft(botao)+149;
    y = getPageOffsetTop(botao);

    w = 150;
    h = (18*tamanho)+1;
//    if (ide>1){
     // x=aleatorio(10,500);
//    }
    frameM = document.getElementById("iFrameMenu");

    frameM.style.left = x + "px";
    frameM.style.top  = y + "px";
    frameM.style.width = w + "px";
    frameM.style.height  = h + "px";

    frameM.style.zIndex = (botao.style.zIndex-1);

    frameM.style.visibility = "visible";
  //}


  botao.className += " menuButtonActive";

 // botao.menu.style.visibility = "hidden";
}


function fechaMenu(botao) {

  botao.className = "menuButton";

  if (botao.menu != null) {

    if (browser.isIE) {

        frameM = document.getElementById("iFrameMenu");

        frameM.style.visibility = "hidden";
      }

    botao.menu.style.visibility = "hidden";
  }
}


function getPageOffsetLeft(el) {

  var x;

  x = el.offsetLeft;
  if (el.offsetParent != null)
    x += getPageOffsetLeft(el.offsetParent);

  return x;
}

function getPageOffsetTop(el) {

  var y;

  y = el.offsetTop;
  if (el.offsetParent != null)
    y += getPageOffsetTop(el.offsetParent);

  return y;
}

  function mudaFoto(foto) {
    document.images.img_show.src = foto;
  }

