<!--
// ----------------------------------------  Scripts do Dreamweaver
function MM_reloadPage(init){  //reloads the window if Nav4 resized
	if (init==true) with (navigator){
		if ((appName=="Netscape")&&(parseInt(appVersion)==4)){
			document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage;
		}
	}else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_swapImgRestore(){ //v3.0
	var i,x,a=document.MM_sr;
	for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages(){ //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d){ //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length){
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage(){ //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_showHideLayers(){ //v6.0
	var i,p,v,obj,args=MM_showHideLayers.arguments;
	for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null){
		v=args[i+2];
		if (obj.style){
			obj=obj.style;
			v=(v=='show')?'visible':(v=='hide')?'hidden':v;
		}
		obj.visibility=v;
	}
}

// função para abrir janela popup
function MM_openBrWindow(theURL,winName,features){ //v2.0
	window.open(theURL,winName,features);
}

// função para apresentar um texto na barra de status
function MM_displayStatusMsg(msgStr){ //v1.0
	status=msgStr;
	document.MM_returnValue = true;
}

// ----------------------------------------- Data atual
function data(obj1){
	var time = new Date();
	var dia = time.getDate();
	var mes = time.getMonth()+1;
	var ano = time.getYear();
	var temp = dia + '/' + mes + '/' + ano;
	obj1.value = temp;
	document.write(temp);
}

// -----------------------------------------  Escrever a data da atualização dos arquivos em diversos idiomas
function expatual (idioma){
	data = "28/07/2008";
	idioma == "pt"? document.write ("Última atualização em " + data) : document.write ("Last updat at " + data);
	/* idioma == "pt"? document.write ("<br />Expositores da 39&ordf; Feninjer, realizada entre os dias 10 e 13 de Agosto de 2004.<br /><br />") : document.write ("<br />Exhibitors of the 39<sup>th</sup> Feninjer, held from the 10<sup>th</sup> to the 13<sup>th</sup> of August, 2004.<br /><br />");*/
	/* idioma == "pt"? document.write ("<br />Empresas Participantes da 38º Feninjer<br /><br />") : document.write ("<br />Empresas Participantes da 38º Feninjer<br /><br />")*/
}

// ----------------------------------------- Campo com letras maiúsculas
function maiuscula(obj){obj.value = obj.value.toUpperCase();}

// ----------------------------------------- Campo com letras maiúsculas
function minuscula(obj){obj.value = obj.value.toLowerCase();}

// ----------------------------------------- Login e senha automaticas
/*
	obj base:
	<p><label for="nome_cracha" style="margin-right: 10px;">Nome Fantasia:</label> <input type="text" name="nome_cracha" size="40" onchange="campologin(this.value); getPassword(6);" /></p>
	
	campologin(this) -> escolha do campo a ser utilizado do formulario para criar o login
	getPassword(length) -> tamanho da senha a ser criada;

	obj fixos no formulario - tem q existir:
	<p><label for="login" style="margin-right: 63px;">Login:</label> <input type="text" name="flogin" id="flogin" size="40" disabled="disabled" /> <input type="hidden" name="login" id="login" /></p>
	<p><label for="senha" style="margin-right: 58px;">Senha:</label> <input type="text" name="fsenha" id="fsenha" size="40" disabled="disabled" /> <input type="hidden" name="senha" id="senha" /></p>
*/

/* funcao para criar login com base em algum campo do formulario pre-determinado */
function campologin(obj){

	obj = obj.value;
	
	if ((obj == "") || (obj == "undefined") || (!obj)) {

		alert ("Campo 'Nome Fantasia' não poder estar em branco!\n\n\rFavor Preenchê-lo!");
		return false;

	} else {
	
		logins = obj.split(" ",1);
		if (!logins) logins = obj.value;
	
		logins = logins.toString();
		logins = logins.toLowerCase();
	
		var expReg1 = /[^a-zA-Z0-9]/gi;
		logins = logins.replace(expReg1,'');
	
		tamanho = logins.length;
	
		if (tamanho < 7){
			tamanho = 7-tamanho;
			senha = "";
			for (i=1;i<=tamanho;i++){
				senha += getRandomChar();
			}
			logins += senha;
		}
		
		logins = logins.substr(0,6);
		numero = parseInt(Math.random(9)*128);
		numero = numero.toString();
		logins += numero;
		
		document.getElementById('flogin').value = logins;
		document.getElementById('login').value = logins;

		return true;
	}
}

/* funcoes para criar senha aleatoria alpha numerica	*/
function getRandomNum(lbound, ubound) {
	return (Math.floor(Math.random() * (ubound - lbound)) + lbound);
}

function getRandomChar() {
	var charSet = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
	return charSet.charAt(getRandomNum(0, charSet.length));
}

function getPassword(length) {
	var rc = "";
	if (length > 0) rc = rc + getRandomChar();
	for (var idx = 1; idx < length; ++idx) {
		rc = rc + getRandomChar();
	}
	//return rc;

	document.getElementById('fsenha').value = rc;
	document.getElementById('senha').value = rc;
}
//getPassword(10);

// ----------------------------------------- Funcao para efetuar tab automatico
/*
<form name="form1">
	<input type="text" name="first" size=4 onKeyup="autotab(this, document.form1.second)" maxlength=3> 
	<input type="text" name="second" size=4 maxlength=3>
</form>
*/
function autotab(atual,destino){
	if ((atual.getAttribute && atual.value.length) == atual.getAttribute("maxlength")) destino.focus();
}

// ----------------------------------------- Limitacao para campos textos e textareas
/*
<form method="POST">
	<input type="text" size=15 onkeypress="return limitechar(this, 10)"><br />
</form>
*/
function limitechar(obj,limite){
	if (obj.value.length>=limite)	return false;
}

// ----------------------------------------- Descreve o codigo ansi do teclado
function tipotecla(){
	var isNS4 = (navigator.appName=="Netscape")?1:0;
	if(!isNS4){
		alert(event.keyCode);
	}else{
		alert(event.which);
	}
}

// ----------------------------------------- Limitacao para campos textos e textareas
//onKeyDown="tipodedados('numeros');"
function tipodedados(obj){
	var isNS4 = (navigator.appName=="Netscape")?1:0;
	function passar(){
		if (event.keyCode == 8 || event.keyCode == 9 || event.keyCode == 46) event.returnValue = true; //escape - tab
		if (event.which == 8 || event.which == 9 || event.which == 46) return true; //escape - tab
		if (event.keyCode >= 37 && event.keyCode <= 40) event.returnValue = true; //numpad
		if (event.which >= 37 && event.which <=40) return true; //numpad
	}
	switch (obj){
		 case "numeros" :
		 		// somente numeros
				if(!isNS4){
					if (event.keyCode < 48 || event.keyCode > 57) event.returnValue = false;
					if (event.keyCode >=96 && event.keyCode <= 105) event.returnValue = true;
					passar();
				}else{
					if (event.which < 48 || event.which > 57) return false;
					if (event.which >= 96 && event.which <= 105) return true;
					passar();
				}
				break;
		 case "numeroseletras" :
		 		// numeros e letras
				if(!isNS4){
					if ((event.keyCode < 48 || event.keyCode > 57)&&(event.keyCode < 65 || event.keyCode > 90)&&(event.keyCode < 97 || event.keyCode > 122)) event.returnValue = false;
					passar();
				}else{
					if ((event.which < 48 || event.which > 57)&&(event.which < 65 || event.which > 90)&&(event.which < 97 || event.which > 122)) return false;
					passar();
				}
				break;
		 case "letras" :
				// somente letras
				if(!isNS4){
					if ((event.keyCode < 65 || event.keyCode > 90)&&(event.keyCode < 97 || event.keyCode > 122)&&(event.keyCode != 32)) event.returnValue = false;
					passar();
				}else{
					if ((event.which < 65 || event.which > 90)&&(event.which < 97 || event.which > 122)&&(event.which != 32)) return false;
					passar();
				}
				break;
		 case "semaspas" :
		 		// sem aspas
				if(!isNS4){
					if (event.keyCode==34 || event.keyCode==39) event.returnValue = false;
					passar();
				}else{
					if (event.which==34 || event.which==39) return false;
					passar();
				}
				break;
		 case "semespacos" :
		 		// sem espaços
				if(!isNS4){
					if (event.keyCode==32) event.returnValue = false;
					passar();
				}else{
					if (event.which==32) return false;
					passar();
				}
				break;
		 default : 
		 		"letras";
	} 
}

// ----------------------------------------- Preencher e apagar todo o formulario para teste
var palavra = new Array ("testatudo","apagartudo","resetatudo","versenhas","traduzatudo");
var conteudo = new Array ("teste","");
var acao = new Array (true,false);
var letras = 0;

function getKey(tecla){
	var isNetscape=(navigator.appName=="Netscape");
	var evento = (isNetscape) ? tecla.which : event.keyCode;
	var which = String.fromCharCode(evento).toLowerCase(); //converção do codigo da tecla pressionada para uma string no formato minusculo, guardada na variavel which
	var total = document.forms.length; // total de formulario no documento
	//status = evento; // mostra o codigo na barra de status
	if (which == palavra[0].charAt(letras)){ //verifica se a letra bate com o caracter na posicao indicada da palavra, no caso vetor
		letras++;
		if (letras == palavra[0].length){ // verifica se a quantidade de letras conferem com a da palavra
			for (a=0; a<total; a++){
				preencherform(document.forms[a],conteudo[0],acao[0]); // executa a funcao para preenchimento do formulario seguinto os parametros indicados
			}
		}
	}else if (which == palavra[1].charAt(letras)){
		letras++;
		if (letras == palavra[1].length){
			for (a=0; a<total; a++){
				preencherform(document.forms[a],conteudo[1],acao[1]);
			}
		}
	}else if (which == palavra[2].charAt(letras)){
		letras++;
		if (letras == palavra[2].length){
			for (a=0; a<total; a++){
				document.forms[a].reset();
			}
		}
	}else if (which == palavra[3].charAt(letras)){
		letras++;
		if (letras == palavra[3].length){
			// redireciona para uma págia especifica
			document.location.href="/admin";
		}
	}else if (which == palavra[4].charAt(letras)){
		letras++;
		if (letras == palavra[4].length){
			// verifica qual pagina se ele pertence para criar menu da esquerda
			var endereco = document.URL;
			// expressoes especificas para validacao de formulario
			var expressao = new Array();
			var parametro = "gi";
			expressao[0] = new RegExp("/pt/",parametro);	// pagina index
			expressao[1] = new RegExp("/en/",parametro);	// pagina produtos
			
			// verificacao de qual expressao contem as palavras sitadas para saber qual sessao ela pertence
			for (i in expressao) {
				resultado = expressao[i].test(endereco);
				if (resultado == true) {
					mudapagina (i);
					break;
				}
			}

			function mudapagina (obj) {
				valor = obj;
				if (valor == 0) {
					endereco = endereco.replace ('/pt/','/en/');
					document.location.href=endereco;
				} else {
					endereco = endereco.replace ('/en/','/pt/');
					document.location.href=endereco;
				}
			}
		}
	}
	else letras = 0;
}
document.onkeypress = getKey;

// preencher todos os campos do formulario com a palavra teste
function preencherform(obj,conteudo,acao){
	with(obj){
		if (conteudo == "teste"){
			numero = "551199999999";
			cep = "99999999";
			email = "teste@teste.com.br";
			website = "http://www.teste.com.br";
			uf = "SP";
			controle = false; // verificacao de radios - controle de repeticao
			for(i=0;i<obj.elements.length;i++){
				if ((obj.elements[i].type=="text")||(obj.elements[i].type=="textarea")) obj.elements[i].value = conteudo;
				if (obj.elements[i].type=="checkbox") obj.elements[i].checked = acao;
				if (obj.elements[i].type=="radio"){
					if (!controle){
						obj.elements[i].checked = true;
						controle = true;
					}
					else{obj.elements[i].checked = false;}
				}
				if(obj.elements[i].name=="CEP") obj.elements[i].value = cep;
				if((obj.elements[i].name=="Telefone")||(obj.elements[i].name=="Outrotelefone")||(obj.elements[i].name=="Fax")||(obj.elements[i].name=="Celular")) obj.elements[i].value = numero;
				if(obj.elements[i].name=="Email")obj.elements[i].value = email;
				if(obj.elements[i].name=="Website") obj.elements[i].value = website;
				if((obj.elements[i].name=="UF")||(obj.elements[i].name=="uf")) obj.elements[i].value = uf;
			}
		} else if (conteudo == ""){
			for(i=0;i<obj.elements.length;i++){
				if ((obj.elements[i].type=="text")|| (obj.elements[i].type=="textarea")) obj.elements[i].value = conteudo;
				if (obj.elements[i].type=="checkbox") obj.elements[i].checked = acao;
				if (obj.elements[i].type=="radio") obj.elements[i].checked = acao;
			}
		}
	}
}

// ----------------------------------------- Para lista de expositores
function swapForm(form,obj){
	if(obj.value) form.submit();
}

/* -----------------------------------------
			Popups e Mensagens
----------------------------------------- */

// função para abrir popups aleatorios
var popUpWin=0;
function popups(URLStr,width,height){
	var styleStr = 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=yes,width='+width+',height='+height+'';
 	if(popUpWin){
		if(!popUpWin.closed) popUpWin.close();
	}
	popUpWin = window.open(URLStr,'popUpWin',styleStr);
}

// função para abrir popup centralizado
var popUpWin=0;
function popup(URLStr,width,height){
	var left = (screen.width/2) - width/2;
	var top = (screen.height/2) - height/2;
	var styleStr = 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'';
	if(popUpWin){
		if(!popUpWin.closed) popUpWin.close();
	}
	popUpWin = window.open(URLStr,'popUpWin',styleStr);
}

// função para abrir popup com propriedades especificas
function popuptipo(URLStr,width,height,tipotools,tipomenu,tiposcroll,tiporesize,tipofullscreen){
	var left = (screen.width/2) - width/2;
	var top = (screen.height/2) - height/2;
	if(tipotools!=1) tipotools=0;
	if(tipomenu!=1) tipomenu=0;
	if(tiposcroll!=1) tiposcroll=0;
	if(tiporesize!=1) tiporesize=0;
	if(tipofullscreen!=1) tipofullscreen=0;
	var styleStr = 'toolbar='+tipotools+',location=no,directories=no,status=no,menubar='+tipomenu+',scrollbars='+tiposcroll+',resizable='+tiporesize+',fullscreen='+tipofullscreen+',copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'';
	if(popUpWin){
		if(!popUpWin.closed) popUpWin.close();
	}
	popUpWin = window.open(URLStr, 'popUpWin', styleStr);
}

// funcao para fechar um popup já existente
function fechapopup(){
	if(popUpWin){
		if(!popUpWin.closed) popUpWin.close();
	}
}

// popup que passa uma mensagens escrita
function mensagens(titulo,mensagem,botao){
	var width=300; height=150;
	var left = (screen.width/2) - width/2;
	var top = (screen.height/2) - height/2;
	var styleStr = 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,fullscreen=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'';
	if (botao == 1){botao="Close";}
	else botao="Fechar";
	var fechar = '<form><input type=button value="'+botao+'" onClick="window.close();"></form>';
	if(popUpWin){
		if(!popUpWin.closed) popUpWin.close();
	}
	popUpWin = window.open('','popUpWin',styleStr);
	var head = '<head><title>'+titulo+'</title></head>';
	var body = '<center>'+mensagem+'<br /><p>'+fechar+'</p></center>';
	popUpWin.document.write(head + body);
}

//função para a troca de página localizada abaixo da atual (popup) de um popup q possui um link como <a href="javascript:trocapagina('http://www.url.html');">link da página</a>
function trocapagina(obj,cond){
	if (cond == 1){
		window.opener.location = obj;
		window.close();
	}
	else{window.opener.location = obj;}
}

/* -----------------------------------------
			Mensagens de Erro
----------------------------------------- */ 
var errors;
var erro = "Informe corretamente este campo.";
var erro1 = "Escolha pelo menos um campo.";
var erro2 = "Pelo umas das opções deve ser selecionada.";

function MM_validateForm(){ //v4.0
	var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
	for (i=0; i<(args.length-2); i+=3){
		test=args[i+2];
		val=MM_findObj(args[i]);
		if (val){
			nm=val.name;
			if ((val=val.value)!=""){
				if (test.indexOf('isEmail')!=-1){
					p=val.indexOf('@');
					if (p<1 || p==(val.length-1)) errors+='- '+nm+' deve conter um endereço de e-mail válido.\n';
				}else if (test!='R'){
					num = parseFloat(val);
					if (isNaN(val)) errors+='- '+nm+' deve conter somente números.\n';
					if (test.indexOf('inRange') != -1){
						p=test.indexOf(':');
						min=test.substring(8,p);
						max=test.substring(p+1);
						if (num<min || max<num) errors+='- '+nm+' deve conter um número entre '+min+' and '+max+'.\n';
					}
				}
			}else if (test.charAt(0) == 'R') errors += '- '+nm+' é requirido.\n';
		}
	}if (errors) alert('O(s) seguinte(s) erro(s) ocorreu(ram):\n'+errors);
	document.MM_returnValue = (errors == '');
}

/* -----------------------------------------
			Checagem dos campos  de formas distintas
----------------------------------------- */

//campo possui somente numeros
function numeros(obj){
	teste = parseInt(obj.value);
	if (isNaN(teste)){obj.value = erro;}
}

//campo com tamanho mínimo
function tamanho(obj,minimo){
	minimo = parseInt(minimo);
	teste = obj.value.length;
	if (teste < minimo){
		errors = erro;
		alert (errors);
	}
}

//seleção de um mínimo de checkboxs
//exemplo: onSubmit="MM_validateForm('Nome','','R','Editoria','','R'); return verchecks(document.form1,'Datas do evento.'); return document.MM_returnValue">
function vercheckbox(obj,inicio,fim,minimo){
	cont=0;
	minimo = parseInt(minimo);
	for (i=inicio; i<=fim; i++){
		checar = obj.getElementById(i);
		if (checar.checked == true){cont++}
	}
	if (cont < minimo){
		errors = erro1;
		alert (errors);
		return false;
	}
}

// verifica checkbox especifico
// exemplo: onSubmit="MM_validateForm('Nome','','R','Editoria','','R'); return verchecks(document.form1,'Datas do evento.'); return document.MM_returnValue">
function verchecks(obj,local){
	a=0;
	for(i=0;i<obj.elements.length;i++){
		if(obj.elements[i].type=="checkbox"){
			if(obj.elements[i].checked) a++;
		}
	}
	if(a<1){
		errors = erro2 +"\rPor favor, verifique a opção "+local; 
		alert (errors);
		return false;
	}
}
		
// verifica radios especificos
// exemplo: onSubmit="MM_validateForm('Nome','','R','Editoria','','R'); return verchecks(document.form1,'Datas do evento.'); return document.MM_returnValue">
function verradios(obj,local){
	a=0;
	for(i=0;i<obj.elements.length;i++){
		if(obj.elements[i].type=="radio"){
			if(obj.elements[i].checked) a++;
		}
	}
	if(a<1){
		errors = erro2 +"\rPor favor, selecione uma das opções em "+local;
		alert (errors);
		return false;
	}
	//else obj.submit();
}

// verifica e-mail
function validaemail(obj){
	minuscula(obj);
	teste1 = obj.value.length;
	teste2 = obj.value.indexOf('@');
	teste3 = obj.value.indexOf('.');
	if (teste2<1 || teste1<6 || teste3<1){
		errors = erro;
		alert(errors);
		return false;
	}
}

/* -----------------------------------------
			Cookies
----------------------------------------- */

// função de cookie para mapear por onde o usuario passou pelo site
function readCookie(name){
	var cookieValue = "";
	var search = name + "=";
	if(document.cookie.length > 0){
		offset = document.cookie.indexOf(search);
		if (offset != -1){
			offset += search.length;
			end = document.cookie.indexOf(";", offset);
			if (end == -1) end = document.cookie.length;
			cookieValue = unescape(document.cookie.substring(offset, end));
		}
	}
	return cookieValue;
}

// função para escrever/criar cookies
function writeCookie(name, value, hours){
	var expire = "";
	if(hours != null){
		expire = new Date((new Date()).getTime() + hours * 3600000);
		expire = "; expires=" + expire.toGMTString();
	}
	document.cookie = name + "=" + escape(value) + expire;
}

// função para armazenar a lista de endereços por onde ele passou
function addHistory(){
	maximo=5;
	getCookie=readCookie("Feninjer");
	if(!document.cookie){
		nameList=new Array();
		nameList[0]=document.location;
	}else{
		nameList = getCookie.split(",");
		nameList.push(document.location);
		if(nameList.length>maximo) nameList.shift();
	}
	writeCookie("Feninjer", nameList, 24);
}
//addHistory();

// função apra resgatar os endereços armazenados
function getHistory(){
	str=new String();
	for (i=nameList.length-1; i >=0; i--){
		nome=new String(nameList[i]).split("/");
		nome1=new String(nome[nome.length-1]).split(".");
		str+="<a href=\""+nameList[i]+"\">"+nome1[nome1.length-2]+"</a><br />\r\n";
	}
	document.write(str);
}

/* -----------------------------------------
	validação de campos de datas
----------------------------------------- */

//	<input  name="texto" type="text" size="3" maxlength="2" onChange="validacampodata(document.form1.dia1, document.form1.mes1, document.form1.ano1);">
function validacampodata(campo1,campo2,campo3){
	obj1 = new Number(campo1.value);
	obj2 = new Number(campo2.value)-1;
	obj3 = new Number(campo3.value);
	obj0 = new Date (obj3,obj2,obj1);
	objdia = obj0.getDate();
	objmes = obj0.getMonth()+1;
	objano = obj0.getYear();
	objdia = objdia.toString();
	objmes = objmes.toString();
	objano = document.all ? objano : objano+1900;
	campo1.value = objdia.length == 1 ? "0" + objdia : objdia;
	campo2.value = objmes.length == 1 ? "0" + objmes : objmes;
	campo3.value = objano;
}

function enviacracha(formulario,valor){
	var a = 0;
	formulario.acao.value = valor;
	nome = new String(document.location).split("/");
	nome = new String(nome[nome.length-1]);
	formulario.url.value = nome;
	if(valor=='editar' || valor=='excluir'){
		for(i=0;i<formulario.elements.length;i++){
			if(formulario.elements[i].type=='checkbox'){
				element = formulario.elements[i];
				if(element.checked && element.name=='box[]')
				a++;
			}
		}
		if(a==0) alert('Favor selecionar algum campo para '+valor+'.');
		else formulario.submit();
	}
	else formulario.submit();
}

function mmLoadMenus() {
  
  //menu faq
  if (window.mm_menu_0926170455_0) return;
  window.mm_menu_0926170455_0 = new Menu("root",174,18,"Verdana, Arial, Helvetica, sans-serif",10,"#9B1C77","#D92BA9","#ffffff","#EFA7DB","left","middle",4,0,500,0,0,true,true,true,0,true,true);
  mm_menu_0926170455_0.addMenuItem("visitação","location='faq-visitacao.html'");
  mm_menu_0926170455_0.addMenuItem("cadastro","location='faq-precadastro.html'");
  mm_menu_0926170455_0.addMenuItem("convidados&nbsp;VIP&nbsp;GOLD","location='faq-vipgold.html'");
  mm_menu_0926170455_0.addMenuItem("convidados&nbsp;VIP","location='faq-vip.html'");
  mm_menu_0926170455_0.addMenuItem("convidados&nbsp;internacionais","location='faq-inter.html'");
  mm_menu_0926170455_0.addMenuItem("pagamento&nbsp;das&nbsp;compras","location='faq-pagamento.html'");
  mm_menu_0926170455_0.addMenuItem("transporte&nbsp;a&eacute;reo","location='faq-transporteaereo.html'");
  mm_menu_0926170455_0.addMenuItem("hospedagem","location='faq-flats.html'");
  mm_menu_0926170455_0.addMenuItem("servi&ccedil;o gratuito de vans","location='serv_vans.html'");
  mm_menu_0926170455_0.addMenuItem("acesso de Metr&ocirc;","location='serv_metro.html'");
  mm_menu_0926170455_0.addMenuItem("acessos dos aeroportos","location='acesso_aeroporto.html'");
  mm_menu_0926170455_0.addMenuItem("guarda-volumes","location='faq-guardavolumes.html'");
  mm_menu_0926170455_0.addMenuItem("lanches e refeições","location='faq-alimentacao.html'");
  mm_menu_0926170455_0.addMenuItem("atualiza&ccedil;&atilde;o&nbsp;de&nbsp;cadastro","location='faq-atualizacao.html'");
   mm_menu_0926170455_0.hideOnMouseOut=true;
   mm_menu_0926170455_0.menuBorder=0;
   mm_menu_0926170455_0.menuLiteBgColor='#ffffff';
   mm_menu_0926170455_0.menuBorderBgColor='#ffffff';
   mm_menu_0926170455_0.bgColor='#1AA4AB';
 
   //menu inf
  window.mm_menu_0926165508_0 = new Menu("root",150,18,"Verdana, Arial, Helvetica, sans-serif",10,"#9B1C77","#D92BA9","#ffffff","#EFA7DB","left","middle",4,0,500,0,0,true,true,true,0,true,true);
  
  mm_menu_0926165508_0.addMenuItem("promo&ccedil;&atilde;o","location='organizacao.html'");
  mm_menu_0926165508_0.addMenuItem("data&nbsp;e&nbsp;local","location='data.html'");
  mm_menu_0926165508_0.addMenuItem("relação&nbsp;de&nbsp;expositores","location='lista.html'");
  mm_menu_0926165508_0.addMenuItem("mapa&nbsp;de&nbsp;localização","location='comochegar.html'");
   mm_menu_0926165508_0.hideOnMouseOut=true;
   mm_menu_0926165508_0.menuBorder=0;
   mm_menu_0926165508_0.menuLiteBgColor='#ffffff';
   mm_menu_0926165508_0.menuBorderBgColor='#ffffff';
   mm_menu_0926165508_0.bgColor='#1AA4AB';
   
   //menu fotos
   window.mm_menu_0926185502_0 = new Menu("root",130,18,"Verdana, Arial, Helvetica, sans-serif",10,"#9B1C77","#D92BA9","#ffffff","#EFA7DB","left","middle",4,0,500,0,0,true,true,true,0,true,true);
  
  mm_menu_0926185502_0.addMenuItem("FOTOS | 38ª&nbsp;BIJÓIAS","location='fotos_38.html'");
  mm_menu_0926185502_0.addMenuItem("FATOS | 38ª&nbsp;BIJÓIAS","location='fatos.html'");
   mm_menu_0926185502_0.hideOnMouseOut=true;
   mm_menu_0926185502_0.menuBorder=0;
   mm_menu_0926185502_0.menuLiteBgColor='#ffffff';
   mm_menu_0926185502_0.menuBorderBgColor='#ffffff';
   mm_menu_0926185502_0.bgColor='#1AA4AB';

   //menu agenda
   window.mm_menu_0926183309_0 = new Menu("root",120,18,"Verdana, Arial, Helvetica, sans-serif",10,"#9B1C77","#D92BA9","#ffffff","#EFA7DB","left","middle",4,0,500,0,0,true,true,true,0,true,true);
  
  //mm_menu_0926183309_0.addMenuItem("38ª&nbsp;BIJÓIAS","location='sp/index.htm'");
  mm_menu_0926183309_0.addMenuItem("AGENDA 2007","location='agenda.html'");
   mm_menu_0926183309_0.hideOnMouseOut=true;
   mm_menu_0926183309_0.menuBorder=0;
   mm_menu_0926183309_0.menuLiteBgColor='#ffffff';
   mm_menu_0926183309_0.menuBorderBgColor='#ffffff';
   mm_menu_0926183309_0.bgColor='#1AA4AB';

  mm_menu_0926183309_0.writeMenus();
}

function Menu(label, mw, mh, fnt, fs, fclr, fhclr, bg, bgh, halgn, valgn, pad, space, to, sx, sy, srel, opq, vert, idt, aw, ah) 
{
	this.version = "020320 [Menu; mm_menu.js]";
	this.type = "Menu";
	this.menuWidth = mw;
	this.menuItemHeight = mh;
	this.fontSize = fs;
	this.fontWeight = "plain";
	this.fontFamily = fnt;
	this.fontColor = fclr;
	this.fontColorHilite = fhclr;
	this.bgColor = "#555555";
	this.menuBorder = 1;
	this.menuBgOpaque=opq;
	this.menuItemBorder = 1;
	this.menuItemIndent = idt;
	this.menuItemBgColor = bg;
	this.menuItemVAlign = valgn;
	this.menuItemHAlign = halgn;
	this.menuItemPadding = pad;
	this.menuItemSpacing = space;
	this.menuLiteBgColor = "#ffffff";
	this.menuBorderBgColor = "#777777";
	this.menuHiliteBgColor = bgh;
	this.menuContainerBgColor = "#cccccc";
	this.childMenuIcon = "arrows.gif";
	this.submenuXOffset = sx;
	this.submenuYOffset = sy;
	this.submenuRelativeToItem = srel;
	this.vertical = vert;
	this.items = new Array();
	this.actions = new Array();
	this.childMenus = new Array();
	this.hideOnMouseOut = true;
	this.hideTimeout = to;
	this.addMenuItem = addMenuItem;
	this.writeMenus = writeMenus;
	this.MM_showMenu = MM_showMenu;
	this.onMenuItemOver = onMenuItemOver;
	this.onMenuItemAction = onMenuItemAction;
	this.hideMenu = hideMenu;
	this.hideChildMenu = hideChildMenu;
	if (!window.menus) window.menus = new Array();
	this.label = " " + label;
	window.menus[this.label] = this;
	window.menus[window.menus.length] = this;
	if (!window.activeMenus) window.activeMenus = new Array();
}

function addMenuItem(label, action) {
	this.items[this.items.length] = label;
	this.actions[this.actions.length] = action;
}

function FIND(item) {
	if( window.mmIsOpera ) return(document.getElementById(item));
	if (document.all) return(document.all[item]);
	if (document.getElementById) return(document.getElementById(item));
	return(false);
}

function writeMenus(container) {
	if (window.triedToWriteMenus) return;
	var agt = navigator.userAgent.toLowerCase();
	window.mmIsOpera = agt.indexOf("opera") != -1;
	if (!container && document.layers) {
		window.delayWriteMenus = this.writeMenus;
		var timer = setTimeout('delayWriteMenus()', 500);
		container = new Layer(100);
		clearTimeout(timer);
	} else if (document.all || document.hasChildNodes || window.mmIsOpera) {
		document.writeln('<span id="menuContainer"></span>');
		container = FIND("menuContainer");
	}

	window.mmHideMenuTimer = null;
	if (!container) return;	
	window.triedToWriteMenus = true; 
	container.isContainer = true;
	container.menus = new Array();
	for (var i=0; i<window.menus.length; i++) 
		container.menus[i] = window.menus[i];
	window.menus.length = 0;
	var countMenus = 0;
	var countItems = 0;
	var top = 0;
	var content = '';
	var lrs = false;
	var theStat = "";
	var tsc = 0;
	if (document.layers) lrs = true;
	for (var i=0; i<container.menus.length; i++, countMenus++) {
		var menu = container.menus[i];
		if (menu.bgImageUp || !menu.menuBgOpaque) {
			menu.menuBorder = 0;
			menu.menuItemBorder = 0;
		}
		if (lrs) {
			var menuLayer = new Layer(100, container);
			var lite = new Layer(100, menuLayer);
			lite.top = menu.menuBorder;
			lite.left = menu.menuBorder;
			var body = new Layer(100, lite);
			body.top = menu.menuBorder;
			body.left = menu.menuBorder;
		} else {
			content += ''+
			'<div id="menuLayer'+ countMenus +'" style="position:absolute;z-index:1;left:10px;top:'+ (i * 100) +'px;visibility:hidden;color:' +  menu.menuBorderBgColor + ';">\n'+
			'  <div id="menuLite'+ countMenus +'" style="position:absolute;z-index:1;left:'+ menu.menuBorder +'px;top:'+ menu.menuBorder +'px;visibility:hide;" onmouseout="mouseoutMenu();">\n'+
			'	 <div id="menuFg'+ countMenus +'" style="position:absolute;left:'+ menu.menuBorder +'px;top:'+ menu.menuBorder +'px;visibility:hide;">\n'+
			'';
		}
		var x=i;
		for (var i=0; i<menu.items.length; i++) {
			var item = menu.items[i];
			var childMenu = false;
			var defaultHeight = menu.fontSize+2*menu.menuItemPadding;
			if (item.label) {
				item = item.label;
				childMenu = true;
			}
			menu.menuItemHeight = menu.menuItemHeight || defaultHeight;
			var itemProps = '';
			if( menu.fontFamily != '' ) itemProps += 'font-family:' + menu.fontFamily +';';
			itemProps += 'font-weight:' + menu.fontWeight + ';fontSize:' + menu.fontSize + 'px;';
			if (menu.fontStyle) itemProps += 'font-style:' + menu.fontStyle + ';';
			if (document.all || window.mmIsOpera) 
				itemProps += 'font-size:' + menu.fontSize + 'px;" onmouseover="onMenuItemOver(null,this);" onclick="onMenuItemAction(null,this);';
			else if (!document.layers) {
				itemProps += 'font-size:' + menu.fontSize + 'px;';
			}
			var l;
			if (lrs) {
				var lw = menu.menuWidth;
				if( menu.menuItemHAlign == 'right' ) lw -= menu.menuItemPadding;
				l = new Layer(lw,body);
			}
			var itemLeft = 0;
			var itemTop = i*menu.menuItemHeight;
			if( !menu.vertical ) {
				itemLeft = i*menu.menuWidth;
				itemTop = 0;
			}
			var dTag = '<div id="menuItem'+ countItems +'" style="position:absolute;left:' + itemLeft + 'px;top:'+ itemTop +'px;'+ itemProps +'">';
			var dClose = '</div>'
			if (menu.bgImageUp) dTag = '<div id="menuItem'+ countItems +'" style="background:url(../+menu.bgImageUp+);position:absolute;left:' + itemLeft + 'px;top:'+ itemTop +'px;'+ itemProps +'">';

			var left = 0, top = 0, right = 0, bottom = 0;
			left = 1 + menu.menuItemPadding + menu.menuItemIndent;
			right = left + menu.menuWidth - 2*menu.menuItemPadding - menu.menuItemIndent;
			if( menu.menuItemVAlign == 'top' ) top = menu.menuItemPadding;
			if( menu.menuItemVAlign == 'bottom' ) top = menu.menuItemHeight-menu.fontSize-1-menu.menuItemPadding;
			if( menu.menuItemVAlign == 'middle' ) top = ((menu.menuItemHeight/2)-(menu.fontSize/2)-1);
			bottom = menu.menuItemHeight - 2*menu.menuItemPadding;
			var textProps = 'position:absolute;left:' + left + 'px;top:' + top + 'px;';
			if (lrs) {
				textProps +=itemProps + 'right:' + right + ';bottom:' + bottom + ';';
				dTag = "";
				dClose = "";
			}
			
			if(document.all && !window.mmIsOpera) {
				item = '<div align="' + menu.menuItemHAlign + '">' + item + '</div>';
			} else if (lrs) {
				item = '<div style="text-align:' + menu.menuItemHAlign + ';">' + item + '</div>';
			} else {
				var hitem = null;
				if( menu.menuItemHAlign != 'left' ) {
					if(window.mmIsOpera) {
						var operaWidth = menu.menuItemHAlign == 'center' ? -(menu.menuWidth-2*menu.menuItemPadding) : (menu.menuWidth-6*menu.menuItemPadding);
						hitem = '<div id="menuItemHilite' + countItems + 'Shim" style="position:absolute;top:1px;left:' + menu.menuItemPadding + 'px;width:' + operaWidth + 'px;text-align:' 
							+ menu.menuItemHAlign + ';visibility:visible;">' + item + '</div>';
						item = '<div id="menuItemText' + countItems + 'Shim" style="position:absolute;top:1px;left:' + menu.menuItemPadding + 'px;width:' + operaWidth + 'px;text-align:' 
							+ menu.menuItemHAlign + ';visibility:visible;">' + item + '</div>';
					} else {
						hitem = '<div id="menuItemHilite' + countItems + 'Shim" style="position:absolute;top:1px;left:1px;right:-' + (left+menu.menuWidth-3*menu.menuItemPadding) + 'px;text-align:' 
							+ menu.menuItemHAlign + ';visibility:visible;">' + item + '</div>';
						item = '<div id="menuItemText' + countItems + 'Shim" style="position:absolute;top:1px;left:1px;right:-' + (left+menu.menuWidth-3*menu.menuItemPadding) + 'px;text-align:' 
							+ menu.menuItemHAlign + ';visibility:visible;">' + item + '</div>';
					}
				} else hitem = null;
			}
			if(document.all && !window.mmIsOpera) item = '<div id="menuItemShim' + countItems + '" style="position:absolute;left:0px;top:0px;">' + item + '</div>';
			var dText	= '<div id="menuItemText'+ countItems +'" style="' + textProps + 'color:'+ menu.fontColor +';">'+ item +'&nbsp</div>\n'
						+ '<div id="menuItemHilite'+ countItems +'" style="' + textProps + 'color:'+ menu.fontColorHilite +';visibility:hidden;">' 
						+ (hitem||item) +'&nbsp</div>';
			if (childMenu) content += ( dTag + dText + '<div id="childMenu'+ countItems +'" style="position:absolute;left:0px;top:3px;"><img src="../'+ menu.childMenuIcon +'"></div>\n' + dClose);
			else content += ( dTag + dText + dClose);
			if (lrs) {
				l.document.open("text/html");
				l.document.writeln(content);
				l.document.close();	
				content = '';
				theStat += "-";
				tsc++;
				if (tsc > 50) {
					tsc = 0;
					theStat = "";
				}
				status = theStat;
			}
			countItems++;  
		}
		if (lrs) {
			var focusItem = new Layer(100, body);
			focusItem.visiblity="hidden";
			focusItem.document.open("text/html");
			focusItem.document.writeln(" ");
			focusItem.document.close();	
		} else {
		  content += '	  <div id="focusItem'+ countMenus +'" style="position:absolute;left:0px;top:0px;visibility:hide;" onclick="onMenuItemAction(null,this);"> </div>\n';
		  content += '   </div>\n  </div>\n</div>\n';
		}
		i=x;
	}
	if (document.layers) {		
		container.clip.width = window.innerWidth;
		container.clip.height = window.innerHeight;
		container.onmouseout = mouseoutMenu;
		container.menuContainerBgColor = this.menuContainerBgColor;
		for (var i=0; i<container.document.layers.length; i++) {
			proto = container.menus[i];
			var menu = container.document.layers[i];
			container.menus[i].menuLayer = menu;
			container.menus[i].menuLayer.Menu = container.menus[i];
			container.menus[i].menuLayer.Menu.container = container;
			var body = menu.document.layers[0].document.layers[0];
			body.clip.width = proto.menuWidth || body.clip.width;
			body.clip.height = proto.menuHeight || body.clip.height;
			for (var n=0; n<body.document.layers.length-1; n++) {
				var l = body.document.layers[n];
				l.Menu = container.menus[i];
				l.menuHiliteBgColor = proto.menuHiliteBgColor;
				l.document.bgColor = proto.menuItemBgColor;
				l.saveColor = proto.menuItemBgColor;
				l.onmouseover = proto.onMenuItemOver;
				l.onclick = proto.onMenuItemAction;
				l.mmaction = container.menus[i].actions[n];
				l.focusItem = body.document.layers[body.document.layers.length-1];
				l.clip.width = proto.menuWidth || body.clip.width;
				l.clip.height = proto.menuItemHeight || l.clip.height;
				if (n>0) {
					if( l.Menu.vertical ) l.top = body.document.layers[n-1].top + body.document.layers[n-1].clip.height + proto.menuItemBorder + proto.menuItemSpacing;
					else l.left = body.document.layers[n-1].left + body.document.layers[n-1].clip.width + proto.menuItemBorder + proto.menuItemSpacing;
				}
				l.hilite = l.document.layers[1];
				if (proto.bgImageUp) l.background.src = proto.bgImageUp;
				l.document.layers[1].isHilite = true;
				if (l.document.layers.length > 2) {
					l.childMenu = container.menus[i].items[n].menuLayer;
					l.document.layers[2].left = l.clip.width -13;
					l.document.layers[2].top = (l.clip.height / 2) -4;
					l.document.layers[2].clip.left += 3;
					l.Menu.childMenus[l.Menu.childMenus.length] = l.childMenu;
				}
			}
			if( proto.menuBgOpaque ) body.document.bgColor = proto.bgColor;
			if( proto.vertical ) {
				body.clip.width  = l.clip.width +proto.menuBorder;
				body.clip.height = l.top + l.clip.height +proto.menuBorder;
			} else {
				body.clip.height  = l.clip.height +proto.menuBorder;
				body.clip.width = l.left + l.clip.width  +proto.menuBorder;
				if( body.clip.width > window.innerWidth ) body.clip.width = window.innerWidth;
			}
			var focusItem = body.document.layers[n];
			focusItem.clip.width = body.clip.width;
			focusItem.Menu = l.Menu;
			focusItem.top = -30;
            focusItem.captureEvents(Event.MOUSEDOWN);
            focusItem.onmousedown = onMenuItemDown;
			if( proto.menuBgOpaque ) menu.document.bgColor = proto.menuBorderBgColor;
			var lite = menu.document.layers[0];
			if( proto.menuBgOpaque ) lite.document.bgColor = proto.menuLiteBgColor;
			lite.clip.width = body.clip.width +1;
			lite.clip.height = body.clip.height +1;
			menu.clip.width = body.clip.width + (proto.menuBorder * 3) ;
			menu.clip.height = body.clip.height + (proto.menuBorder * 3);
		}
	} else {
		if ((!document.all) && (container.hasChildNodes) && !window.mmIsOpera) {
			container.innerHTML=content;
		} else {
			container.document.open("text/html");
			container.document.writeln(content);
			container.document.close();	
		}
		if (!FIND("menuLayer0")) return;
		var menuCount = 0;
		for (var x=0; x<container.menus.length; x++) {
			var menuLayer = FIND("menuLayer" + x);
			container.menus[x].menuLayer = "menuLayer" + x;
			menuLayer.Menu = container.menus[x];
			menuLayer.Menu.container = "menuLayer" + x;
			menuLayer.style.zindex = 1;
		    var s = menuLayer.style;
			s.pixeltop = -1300;
			s.pixelleft = -300;
			s.top = '-300px';
			s.left = '-300px';

			var menu = container.menus[x];
			menu.menuItemWidth = menu.menuWidth || menu.menuIEWidth || 140;
			if( menu.menuBgOpaque ) menuLayer.style.backgroundColor = menu.menuBorderBgColor;
			var top = 0;
			var left = 0;
			menu.menuItemLayers = new Array();
			for (var i=0; i<container.menus[x].items.length; i++) {
				var l = FIND("menuItem" + menuCount);
				l.Menu = container.menus[x];
				l.Menu.menuItemLayers[l.Menu.menuItemLayers.length] = l;
				if (l.addEventListener || window.mmIsOpera) {
					l.style.width = menu.menuItemWidth + 'px';
					l.style.height = menu.menuItemHeight + 'px';
					l.style.pixelWidth = menu.menuItemWidth;
					l.style.pixelHeight = menu.menuItemHeight;
					l.style.top = top + 'px';
					l.style.left = left + 'px';
					if(l.addEventListener) {
						l.addEventListener("mouseover", onMenuItemOver, false);
						l.addEventListener("click", onMenuItemAction, false);
						l.addEventListener("mouseout", mouseoutMenu, false);
					}
					if( menu.menuItemHAlign != 'left' ) {
						l.hiliteShim = FIND("menuItemHilite" + menuCount + "Shim");
						l.hiliteShim.style.visibility = "inherit";
						l.textShim = FIND("menuItemText" + menuCount + "Shim");
						l.hiliteShim.style.pixelWidth = menu.menuItemWidth - 2*menu.menuItemPadding - menu.menuItemIndent;
						l.hiliteShim.style.width = l.hiliteShim.style.pixelWidth;
						l.textShim.style.pixelWidth = menu.menuItemWidth - 2*menu.menuItemPadding - menu.menuItemIndent;
						l.textShim.style.width = l.textShim.style.pixelWidth;	
					}
				} else {
					l.style.pixelWidth = menu.menuItemWidth;
					l.style.pixelHeight = menu.menuItemHeight;
					l.style.pixelTop = top;
					l.style.pixelLeft = left;
					if( menu.menuItemHAlign != 'left' ) {
						var shim = FIND("menuItemShim" + menuCount);
						shim[0].style.pixelWidth = menu.menuItemWidth - 2*menu.menuItemPadding - menu.menuItemIndent;
						shim[1].style.pixelWidth = menu.menuItemWidth - 2*menu.menuItemPadding - menu.menuItemIndent;
						shim[0].style.width = shim[0].style.pixelWidth + 'px';
						shim[1].style.width = shim[1].style.pixelWidth + 'px';
					}
				}
				if( menu.vertical ) top = top + menu.menuItemHeight+menu.menuItemBorder+menu.menuItemSpacing;
				else left = left + menu.menuItemWidth+menu.menuItemBorder+menu.menuItemSpacing;
				l.style.fontSize = menu.fontSize + 'px';
				l.style.backgroundColor = menu.menuItemBgColor;
				l.style.visibility = "inherit";
				l.saveColor = menu.menuItemBgColor;
				l.menuHiliteBgColor = menu.menuHiliteBgColor;
				l.mmaction = container.menus[x].actions[i];
				l.hilite = FIND("menuItemHilite" + menuCount);
				l.focusItem = FIND("focusItem" + x);
				l.focusItem.style.pixelTop = -30;
				l.focusItem.style.top = '-30px';
				var childItem = FIND("childMenu" + menuCount);
				if (childItem) {
					l.childMenu = container.menus[x].items[i].menuLayer;
					childItem.style.pixelLeft = menu.menuItemWidth -11;
					childItem.style.left = childItem.style.pixelLeft + 'px';
					childItem.style.pixelTop = (menu.menuItemHeight /2) -4;
					childItem.style.top = childItem.style.pixelTop + 'px';
					l.Menu.childMenus[l.Menu.childMenus.length] = l.childMenu;
				}
				l.style.cursor = "hand";
				menuCount++;
			}
			if( menu.vertical ) {
				menu.menuHeight = top-1-menu.menuItemSpacing;
				menu.menuWidth = menu.menuItemWidth;
			} else {
				menu.menuHeight = menu.menuItemHeight;
				menu.menuWidth = left-1-menu.menuItemSpacing;
			}

			var lite = FIND("menuLite" + x);
			var s = lite.style;
			s.pixelHeight = menu.menuHeight +(menu.menuBorder * 2);
			s.height = s.pixelHeight + 'px';
			s.pixelWidth = menu.menuWidth + (menu.menuBorder * 2);
			s.width = s.pixelWidth + 'px';
			if( menu.menuBgOpaque ) s.backgroundColor = menu.menuLiteBgColor;

			var body = FIND("menuFg" + x);
			s = body.style;
			s.pixelHeight = menu.menuHeight + menu.menuBorder;
			s.height = s.pixelHeight + 'px';
			s.pixelWidth = menu.menuWidth + menu.menuBorder;
			s.width = s.pixelWidth + 'px';
			if( menu.menuBgOpaque ) s.backgroundColor = menu.bgColor;

			s = menuLayer.style;
			s.pixelWidth  = menu.menuWidth + (menu.menuBorder * 4);
			s.width = s.pixelWidth + 'px';
			s.pixelHeight  = menu.menuHeight+(menu.menuBorder*4);
			s.height = s.pixelHeight + 'px';
		}
	}
	if (document.captureEvents) document.captureEvents(Event.MOUSEUP);
	if (document.addEventListener) document.addEventListener("mouseup", onMenuItemOver, false);
	if (document.layers && window.innerWidth) {
		window.onresize = NS4resize;
		window.NS4sIW = window.innerWidth;
		window.NS4sIH = window.innerHeight;
		setTimeout("NS4resize()",500);
	}
	document.onmouseup = mouseupMenu;
	window.mmWroteMenu = true;
	status = "";
}

function NS4resize() {
	if (NS4sIW != window.innerWidth || NS4sIH != window.innerHeight) window.location.reload();
}

function onMenuItemOver(e, l) {
	MM_clearTimeout();
	l = l || this;
	a = window.ActiveMenuItem;
	if (document.layers) {
		if (a) {
			a.document.bgColor = a.saveColor;
			if (a.hilite) a.hilite.visibility = "hidden";
			if (a.Menu.bgImageOver) a.background.src = a.Menu.bgImageUp;
			a.focusItem.top = -100;
			a.clicked = false;
		}
		if (l.hilite) {
			l.document.bgColor = l.menuHiliteBgColor;
			l.zIndex = 1;
			l.hilite.visibility = "inherit";
			l.hilite.zIndex = 2;
			l.document.layers[1].zIndex = 1;
			l.focusItem.zIndex = this.zIndex +2;
		}
		if (l.Menu.bgImageOver) l.background.src = l.Menu.bgImageOver;
		l.focusItem.top = this.top;
		l.focusItem.left = this.left;
		l.focusItem.clip.width = l.clip.width;
		l.focusItem.clip.height = l.clip.height;
		l.Menu.hideChildMenu(l);
	} else if (l.style && l.Menu) {
		if (a) {
			a.style.backgroundColor = a.saveColor;
			if (a.hilite) a.hilite.style.visibility = "hidden";
			if (a.hiliteShim) a.hiliteShim.style.visibility = "inherit";
			if (a.Menu.bgImageUp) a.style.background = "url(" + a.Menu.bgImageUp +")";;
		} 
		l.style.backgroundColor = l.menuHiliteBgColor;
		l.zIndex = 1;
		if (l.Menu.bgImageOver) l.style.background = "url(" + l.Menu.bgImageOver +")";
		if (l.hilite) {
			l.hilite.style.visibility = "inherit";
			if( l.hiliteShim ) l.hiliteShim.style.visibility = "visible";
		}
		l.focusItem.style.pixelTop = l.style.pixelTop;
		l.focusItem.style.top = l.focusItem.style.pixelTop + 'px';
		l.focusItem.style.pixelLeft = l.style.pixelLeft;
		l.focusItem.style.left = l.focusItem.style.pixelLeft + 'px';
		l.focusItem.style.zIndex = l.zIndex +1;
		l.Menu.hideChildMenu(l);
	} else return;
	window.ActiveMenuItem = l;
}

function onMenuItemAction(e, l) {
	l = window.ActiveMenuItem;
	if (!l) return;
	hideActiveMenus();
	if (l.mmaction) eval("" + l.mmaction);
	window.ActiveMenuItem = 0;
}

function MM_clearTimeout() {
	if (mmHideMenuTimer) clearTimeout(mmHideMenuTimer);
	mmHideMenuTimer = null;
	mmDHFlag = false;
}

function MM_startTimeout() {
	if( window.ActiveMenu ) {
		mmStart = new Date();
		mmDHFlag = true;
		mmHideMenuTimer = setTimeout("mmDoHide()", window.ActiveMenu.Menu.hideTimeout);
	}
}

function mmDoHide() {
	if (!mmDHFlag || !window.ActiveMenu) return;
	var elapsed = new Date() - mmStart;
	var timeout = window.ActiveMenu.Menu.hideTimeout;
	if (elapsed < timeout) {
		mmHideMenuTimer = setTimeout("mmDoHide()", timeout+100-elapsed);
		return;
	}
	mmDHFlag = false;
	hideActiveMenus();
	window.ActiveMenuItem = 0;
}
//-->
