function validaPromocao() {
	var formu=document.forminsc;
	if(formu.nome.value.length==0) {
		alert('Preencha o campo de NOME!');
		formu.nome.style.backgroundColor='#FFE8E8';
		return false
	}
	else if(formu.email.value.length==0) {
		alert('Preencha o campo de E-MAIL!');
		formu.email.style.backgroundColor='#FFE8E8';
		return false
	}
	else if(formu.cidade.value.length==0) {
		alert('Preencha o campo de CIDADE/UF!');
		formu.cidade.style.backgroundColor='#FFE8E8';
		return false
	}
	else if(formu.telefone.value.length==0) {
		alert('Preencha o campo de TELEFONE!');
		formu.telefone.style.backgroundColor='#FFE8E8';
		return false
	}
	else if(formu.unidade.value.length==0) {
		alert('Preencha o campo de UNIDADE!');
		formu.unidade.style.backgroundColor='#FFE8E8';
		return false
	}
	else if(formu.comentarios.value.length==0) {
		alert('Preencha o campo de COMENTÁRIOS!');
		formu.comentarios.style.backgroundColor='#FFE8E8';
		return false
	}
	
}
function validaFsf() {
	var formu=document.forminsc;
	if(formu.nome.value.length==0) {
		alert('Preencha o campo de NOME!');
		formu.nome.style.backgroundColor='#FFE8E8';
		return false
	}
	else if(formu.sobrenome.value.length==0) {
		alert('Preencha o campo de SOBRENOME!');
		formu.sobrenome.style.backgroundColor='#FFE8E8';
		return false
	}
	else if(formu.cidade.value.length==0) {
		alert('Preencha o campo de CIDADE/UF!');
		formu.cidade.style.backgroundColor='#FFE8E8';
		return false
	}
	else if(formu.telefone.value.length==0) {
		alert('Preencha o campo de TELEFONE!');
		formu.telefone.style.backgroundColor='#FFE8E8';
		return false
	}
	else if(formu.email.value.length==0) {
		alert('Preencha o campo de E-MAIL!');
		formu.email.style.backgroundColor='#FFE8E8';
		return false
	}
}
function validaPds() {
	var formu=document.forminsc;
	if(formu.nome.value.length==0) {
		alert('Preencha o campo de NOME!');
		formu.nome.style.backgroundColor='#FFE8E8';
		return false
	}
	else if(formu.empresa.value.length==0) {
		alert('Preencha o campo de EMPRESA/ENTIDADE!');
		formu.empresa.style.backgroundColor='#FFE8E8';
		return false
	}
	else if(formu.email.value.length==0) {
		alert('Preencha o campo de E-MAIL!');
		formu.email.style.backgroundColor='#FFE8E8';
		return false
	}
	else if(formu.telefone.value.length==0) {
		alert('Preencha o campo de TELEFONE!');
		formu.telefone.style.backgroundColor='#FFE8E8';
		return false
	}
	else if(formu.cidade.value.length==0) {
		alert('Preencha o campo de CIDADE/UF!');
		formu.cidade.style.backgroundColor='#FFE8E8';
		return false
	}
	else if(formu.unidade.value.length==0) {
		alert('Preencha o campo de UNIDADE!');
		formu.unidade.style.backgroundColor='#FFE8E8';
		return false
	}
	else if(formu.parceria.value.length==0) {
		alert('Preencha o campo de PARCEIRO IDEAL!');
		formu.parceria.style.backgroundColor='#FFE8E8';
		return false
	}
	else if(formu.msg.value.length==0) {
		alert('Preencha o campo de COMENTÁRIO!');
		formu.msg.style.backgroundColor='#FFE8E8';
		return false
	}
}
function validaAge() {
	var formu=document.forminsc;
	if(formu.nome.value.length==0) {
		alert('Preencha o campo de NOME!');
		formu.nome.style.backgroundColor='#FFE8E8';
		return false
	}
	else if(formu.empresa.value.length==0) {
		alert('Preencha o campo de EMPRESA/ENTIDADE!');
		formu.empresa.style.backgroundColor='#FFE8E8';
		return false
	}
	else if(formu.email.value.length==0) {
		alert('Preencha o campo de E-MAIL!');
		formu.email.style.backgroundColor='#FFE8E8';
		return false
	}
	else if(formu.telefone.value.length==0) {
		alert('Preencha o campo de TELEFONE!');
		formu.telefone.style.backgroundColor='#FFE8E8';
		return false
	}
	else if(formu.cidade.value.length==0) {
		alert('Preencha o campo de CIDADE/UF!');
		formu.cidade.style.backgroundColor='#FFE8E8';
		return false
	}
	else if(formu.unidade.value.length==0) {
		alert('Preencha o campo de UNIDADE!');
		formu.unidade.style.backgroundColor='#FFE8E8';
		return false
	}
	else if(formu.consulta.value.length==0) {
		alert('Preencha o campo de CONSULTA!');
		formu.consulta.style.backgroundColor='#FFE8E8';
		return false
	}
	else if(formu.msg.value.length==0) {
		alert('Preencha o campo de COMENTÁRIO!');
		formu.msg.style.backgroundColor='#FFE8E8';
		return false
	}
}
function divAltera(img,id) {
	if(id=="d1") {
		document.getElementById(id).style.display='block';
		document.getElementById('d2').style.display='none';
		document.getElementById('d3').style.display='none';
		img.src='imagens/home/box_2/promocao_.jpg';
		document.getElementById('i2').src='imagens/home/box_2/agenda.jpg';
		document.getElementById('i3').src='imagens/home/box_2/vantagens.jpg';
	}
	else if(id=="d2") {
		document.getElementById(id).style.display='block';
		document.getElementById('d1').style.display='none';
		document.getElementById('d3').style.display='none';
		img.src='imagens/home/box_2/agenda_.jpg';
		document.getElementById('i1').src='imagens/home/box_2/promocao.jpg';
		document.getElementById('i3').src='imagens/home/box_2/vantagens.jpg';
	}
	else if(id=="d3") {
		document.getElementById(id).style.display='block';
		document.getElementById('d2').style.display='none';
		document.getElementById('d1').style.display='none';
		img.src='imagens/home/box_2/vantagens_.jpg';
		document.getElementById('i1').src='imagens/home/box_2/promocao.jpg';
		document.getElementById('i2').src='imagens/home/box_2/agenda.jpg';
	}
}
function caixaCor(campo) {
	campo.style.backgroundColor='#F5F5F5';
	campo.style.color='#333333';
}
function caixaDes(campo) {
	campo.style.backgroundColor='#FFFFFF';
	campo.style.color='#999999';
}
function franqValida() {
	campo=document.franqFormulario;
	if(campo.nome.value.length==0) {
		alert('Complete o campo NOME');
		campo.nome.style.backgroundColor='#FFECEC';
		return false;
	}
	else if(campo.email.value.length==0) {
		alert('Complete o campo E-MAIL');
		campo.email.style.backgroundColor='#FFECEC';
		return false;
	}	
}

var navegador = navigator.appName.toLowerCase();
var mozilla = navegador.indexOf("netscape")+1;
function sonum(evento) {
	tecla = mozilla ? evento.which : evento.keyCode;
	if ( !(tecla >= 48 && tecla <= 57) && (tecla!=8) && (tecla!=46) ) {
		return false;
	}
}
function vld_contato(campo) {
	cp=campo;
	if(cp.nome.value.length==0) {
		alert('Complete o campo NOME!');
		cp.nome.style.backgroundColor="#FFF0F0";
		return false;
	}
	else if(cp.empresa.value.length==0) {
		alert('Complete o campo EMPRESA!');
		cp.empresa.style.backgroundColor="#FFF0F0";
		return false;
	}
	else if(cp.email.value.length==0) {
		alert('Complete o campo E-MAIL!');
		cp.email.style.backgroundColor="#FFF0F0";
		return false;
	}
	else if(cp.cidade.value.length==0) {
		alert('Complete o campo CIDADE!');
		cp.cidade.style.backgroundColor="#FFF0F0";
		return false;
	}
	else if(cp.estado.value.length==0) {
		alert('Complete o campo ESTADO!');
		cp.estado.style.backgroundColor="#FFF0F0";
		return false;
	}
	else if(cp.ddd.value.length==0) {
		alert('Complete o campo TELEFONE!');
		cp.ddd.style.backgroundColor="#FFF0F0";
		return false;
	}
	else if(cp.tel.value.length==0) {
		alert('Complete o campo TELEFONE!');
		cp.tel.style.backgroundColor="#FFF0F0";
		return false;
	}
	else if(cp.cel.value.length==0) {
		alert('Complete o campo CELULAR!');
		cp.cel.style.backgroundColor="#FFF0F0";
		return false;
	}
	else if(cp.msg.value.length==0) {
		alert('Complete o campo MENSAGEM!');
		cp.msg.style.backgroundColor="#FFF0F0";
		return false;
	}
}
/* deleta */
function site(campo) {
	if(campo=="si") {
		document.admin.url.disabled=false;
		document.admin.url.style.backgroundColor='#f8f8f8';
	}
	else {
		document.admin.url.disabled=true;
		document.admin.url.style.backgroundColor='#CCCCCC';
	}
	
}
function maiusc(campo) {
	campo.value=campo.value.toUpperCase();
}
function res(textof) {
	var texto=textof;
	texto=texto.replace("[neg]","<b>");
	texto=texto.replace("[/neg]","</b>");
	texto=texto.replace("[sub]","<u>");
	texto=texto.replace("[/sub]","</u>");
	texto=texto.replace("[ita]","<i>");
	texto=texto.replace("[/ita]","</i>");
	texto=texto.replace("[top]","<font color=\"#FF9900\"><b>");
	texto=texto.replace("[/top]","</font></b>");
	texto=texto.replace("[ico]","<img src=\"images/marcadorLaranja.gif\" border=\"0\">");
	document.write('a'+texto);

}
function formata(oque) {
	var campo=document.admin.texto;
	if(oque=="neg") {
		var jt=campo.value;
		campo.value=jt+"[neg] ESCREVA_AQUI_EM_NEGRITO [/neg]";
	}
	if(oque=="sub") {
		var jt=campo.value;
		campo.value=jt+"[sub] ESCREVA_AQUI_SUBLINHADO [/sub]";
	}
	if(oque=="ita") {
		var jt=campo.value;
		campo.value=jt+"[ita] ESCREVA_AQUI_EM_ITÁLICO [/ita]";
	}
	if(oque=="top") {
		var jt=campo.value;
		campo.value=jt+"[top] ESCREVA_AQUI_O_TÓPICO [/top]";
	}
	if(oque=="ico") {
		var jt=campo.value;
		campo.value=jt+"\n[ico]";
	}
	if(oque=="link") {
		var jt=campo.value;
		nome=prompt("Digite o nome do link:","");
		url=prompt("Digite a URL do link:","http://");
		janela=confirm("Abrir em uma nova Janela ?");
		if(janela) var blank=' target=blank';
		else blank='';
		if(url=="" || nome=="") return false;
		else {
			campo.value=jt+ "\n[link='"+url+"'/l"+blank+"][neg][sub]"+nome+"[/neg][/sub][/link]";
		}
	}
	if(oque=="table") {
		var jt=campo.value;
		var colunas=prompt("Digite o número de colunas","");
		var linhas=prompt("Digite o número de linhas", "");
		var show="";
		for(l=0;l<linhas;l++) {
			show+="[tabela]\n";
			show+="[linha]\n";
			for(c=0;c<colunas;c++) {
				var ll=l+1;
				var cc=c+1;
				show+="[col] CÉLULA "+ll+"."+cc+" [/col]\n";
			}
			show+="[/linha]\n";
			show+="[/tabela]\n";
		}
		campo.value=jt+"\n"+show;
	}
	document.getElementById('texto').focus();
	return false;
}
function pop(pagina,nome,larg,altu,scrollbar) {
  PosIniX=((screen.availWidth/2)-(larg/2));
  PosIniY=((screen.availHeight/2)-(altu/2));
  window.open(pagina,nome,'toolbar=no,location=no,directories=no,menubar=no,scrollbars='+scrollbar+',resizable=no,top='+PosIniY+',left='+PosIniX+',width='+larg+',height='+altu+'');
  window.refresh;
}
function most(tabela_id) {
	if(document.getElementById(tabela_id).style.display=="") {
		document.getElementById(tabela_id).style.display='none';
	}
	else document.getElementById(tabela_id).style.display='';
	return false;
}
function redimen() {
	var ifram = document.getElementById('meio');
	var altura = ifram.contentWindow.document.body.scrollHeight;
	if(altura > 10)	ifram.style.height = altura;
	else ifram.style.height = 10;
}
function mostadm(tabela_id,qts) {
	for(var xx=1;xx<=qts;xx++) {
		if(tabela_id!=xx) document.getElementById(xx).style.display='none';	
	}
	document.getElementById(tabela_id).style.display='';
}
 onclick="document.location.href='index.php?op=11'" 
function menu_over(tabela_id,menu_id) {
	document.getElementById(tabela_id).bgColor='#587596';
	document.getElementById(menu_id).style.color='#FFFFFF';
}
function menu_out(tabela_id,menu_id) {
	document.getElementById(tabela_id).bgColor='#6B8DAB';
	document.getElementById(menu_id).style.color='#053335'; // cor que volta 
}
function menu_click(url,target) {
	if(target=="s") {
		window.open(url,'','');	
	}
	else document.location.href=url;
}
function reseta(oq,oq2) {
	if (oq.value=="" && oq2=="l") oq.value='Seu login';
	if (oq.value=="" && oq2=="s") oq.value='xxxxxx';
}
function apaga(oq) {
	if(oq.value=="Seu login") oq.value="";
}

function form_data(campo) {
	if(campo.value.length==2) campo.value=campo.value+"/";	
	if(campo.value.length==5) campo.value=campo.value+"/";	
}
function admin_1(campo) {
	if(campo.checked){
		document.admin.p_inmetro.disabled=true;	
		document.admin.p_metrologia.disabled=true;	
		document.admin.p_qualidade.disabled=true;	
		document.admin.p_ea_autorizadas.disabled=true;	
		document.admin.p_eventos.disabled=true;	
		document.admin.p_unidades.disabled=true;	
		document.admin.p_vocabulario.disabled=true;	
		document.admin.p_fiscalizacao.disabled=true;	
		document.admin.p_certificacao.disabled=true;	
		document.admin.p_duvidas.disabled=true;	
		document.admin.p_sites.disabled=true;	
		document.admin.p_noticias.disabled=true;	
		document.admin.p_video.disabled=true;	
		document.admin.p_contato.disabled=true;	
		document.admin.p_subpaginas.disabled=true;
	}
	else {
		document.admin.p_inmetro.disabled=false;	
		document.admin.p_metrologia.disabled=false;	
		document.admin.p_qualidade.disabled=false;	
		document.admin.p_ea_autorizadas.disabled=false;	
		document.admin.p_eventos.disabled=false;	
		document.admin.p_unidades.disabled=false;	
		document.admin.p_vocabulario.disabled=false;	
		document.admin.p_fiscalizacao.disabled=false;	
		document.admin.p_certificacao.disabled=false;	
		document.admin.p_duvidas.disabled=false;	
		document.admin.p_sites.disabled=false;	
		document.admin.p_noticias.disabled=false;	
		document.admin.p_video.disabled=false;	
		document.admin.p_contato.disabled=false;
		document.admin.p_subpaginas.disabled=false;
	}
}
