var mouse = false;

function altura() {
	var elm = document.getElementById("menu_2");
	var elm2 = document.getElementById("detalhes");
	var elm3 = document.getElementById("menu_espacamento");
	if( elm.offsetHeight > elm2.offsetHeight ) {
		var x = elm.offsetHeight + 145;
		var h = elm.offsetHeight + 172;
		var y = elm3.offsetHeight + 9;
		var z = elm.offsetHeight - 41;
		} else {
			var x = elm2.offsetHeight + 192;
			var h = elm2.offsetHeight + 217;
			var y = elm3.offsetHeight + elm2.offsetHeight - 386;
			var z = elm2.offsetHeight + 4;
			}
	document.getElementById("rodape").style.top = x + "px";
	document.getElementById("margem").style.height = h + "px";
	document.getElementById("menu_espacamento").style.height = y + "px";
	document.getElementById("barra_cinza").style.height = z + "px";
	}

function submenu(objeto, camada) {
	camada_nome = "submenu_" + camada;
	document.getElementById(camada_nome).style.visibility = 'visible';
	var i = 1;
	while( i <= 8 ) {
		if( i != camada ) {
			camada_nome = "submenu_" + i;
			document.getElementById(camada_nome).style.visibility = 'hidden';
			}
		i++;
		}
	mouse_on = true;
	}

function fechar_submenu() {
	mouse_on = false;
	setTimeout("fechar()", 10);
	}

function fechar() {
	if( !mouse_on ) {
		var i = 1;
		while( i <= 8 ) {
			camada_nome = "submenu_" + i;
			document.getElementById(camada_nome).style.visibility = 'hidden';
			i++;
			}
		}
	}

function imagem(foto, largura, altura) {
	window.open("ver_imagem.php?foto=" + foto + "&w=" + largura + "&h=" + altura, "", "resizable=no,toolbar=no,status=no,menubar=no,maximize=no,scrollbars=no,width=" + largura + ",height=" + altura);
	}

function MM_controlSound(x, _sndObj, sndFile) { //v3.0
  var i, method = "", sndObj = eval(_sndObj);
  if (sndObj != null) {
    if (navigator.appName == 'Netscape') method = "play";
    else {
      if (window.MM_WMP == null) {
        window.MM_WMP = false;
        for(i in sndObj) if (i == "ActiveMovie") {
          window.MM_WMP = true; break;
      } }
      if (window.MM_WMP) method = "play";
      else if (sndObj.FileName) method = "run";
  } }
  if (method) eval(_sndObj+"."+method+"()");
  else window.location = sndFile;
}