function Mostra(id1, id2) {
  if (id1 != '') expMenu(id1);
  if (id2 != '') expMenu(id2);
}
function expMenu(id) {
  var itm = null;
  if (document.getElementById) {
		itm = document.getElementById(id);
  } else if (document.all){
		itm = document.all[id];
  } else if (document.layers){
		itm = document.layers[id];
  }
	
  if (!itm) {
  }
  else if (itm.style) {
		if (itm.style.display == "none") { itm.style.display = ""; }
	else { itm.style.display = "none"; }
    }
  else { itm.visibility = "show"; }
}	

function Busca(tipo) {
if(tipo == "anuncios"){
document.getElementById('busca_anuncios').style.display='';
document.getElementById('busca_classificados').style.display='none';
document.getElementById('busca_materias').style.display='none';
document.getElementById('busca_noticias').style.display='none';
document.getElementById('busca_empregos').style.display='none';
document.getElementById('busca_agenda').style.display='none';
} else if(tipo == "classificados") {
document.getElementById('busca_anuncios').style.display='none';
document.getElementById('busca_classificados').style.display='';
document.getElementById('busca_materias').style.display='none';
document.getElementById('busca_noticias').style.display='none';
document.getElementById('busca_empregos').style.display='none';
document.getElementById('busca_agenda').style.display='none';
} else if(tipo == "materias") {
document.getElementById('busca_anuncios').style.display='none';
document.getElementById('busca_classificados').style.display='none';
document.getElementById('busca_materias').style.display='';
document.getElementById('busca_noticias').style.display='none';
document.getElementById('busca_empregos').style.display='none';
document.getElementById('busca_agenda').style.display='none';
} else if(tipo == "noticias") {
document.getElementById('busca_anuncios').style.display='none';
document.getElementById('busca_classificados').style.display='none';
document.getElementById('busca_materias').style.display='none';
document.getElementById('busca_noticias').style.display='';
document.getElementById('busca_empregos').style.display='none';
document.getElementById('busca_agenda').style.display='none';
} else if(tipo == "empregos") {
document.getElementById('busca_anuncios').style.display='none';
document.getElementById('busca_classificados').style.display='none';
document.getElementById('busca_materias').style.display='none';
document.getElementById('busca_noticias').style.display='none';
document.getElementById('busca_empregos').style.display='';
document.getElementById('busca_agenda').style.display='none';
} else if(tipo == "agenda") {
document.getElementById('busca_anuncios').style.display='none';
document.getElementById('busca_classificados').style.display='none';
document.getElementById('busca_materias').style.display='none';
document.getElementById('busca_noticias').style.display='none';
document.getElementById('busca_empregos').style.display='none';
document.getElementById('busca_agenda').style.display='';

}

}

// Controle Banner Camada
function banner_expansivel(expand) {
if(expand == "exibe"){
document.getElementById('banner').style.height=300;
} else if(expand == "nexibe") {
document.getElementById('banner').style.height=80;
}
}

//Rádio Online
	function pop_radio_online(theURL,winName,features) { 
	  window.open('../arquivos_radio/popup_radio.php','','scrollbars=no,width=315,height=200, top=50,left=50');
	}


//Enquete popup
function votarEnquete() {
	opcao = document.formEnquete.opcaoenqt.value;
	if(opcao == '')
		alert('Selecione uma opção para votar na Enquete!');
	else	
	window.open('../arquivos_enquete/voto.php?tipo=votar&opcao='+opcao, 'enquete', 'width=350, height=400, scrollbars=yes, top=50, left=50');		
}

//Enquetes anteriores
function enqt_anteriores(URL) {
	
   var left = 50;
   var top = 50;

   window.open(URL, 'enquete', 'width=350, height=400, top='+top+', left='+left+', scrollbars=yes, status=no, toolbar=no, location=no, directories=no, menubar=no, resizable=no, fullscreen=no');
}

//Enquetes Resultados enquete
function enqt_resultados(URL) {
	
   var left = 50;
   var top = 50;

   window.open(URL, 'enquete', 'width=350, height=400, top='+top+', left='+left+', scrollbars=yes, status=no, toolbar=no, location=no, directories=no, menubar=no, resizable=no, fullscreen=no');
}


//Ampliar fotos agenda
function ampliar_agenda(URL, width, height) {
	
   var left = 50;
   var top = 50;

   window.open(URL, 'foto', 'width='+width+', height='+height+', top='+top+', left='+left+', scrollbars=no, status=no, toolbar=no, location=no, directories=no, menubar=no, resizable=no, fullscreen=no');
} 

//Ampliar fotos materias
function ampliar_materias(URL, width, height) {
	
   var left = 50;
   var top = 50;

   window.open(URL, 'foto', 'width='+width+', height='+height+', top='+top+', left='+left+', scrollbars=no, status=no, toolbar=no, location=no, directories=no, menubar=no, resizable=no, fullscreen=no');
} 

//Ampliar fotos noticias
function ampliar_noticias(URL, width, height) {
	
   var left = 50;
   var top = 50;

   window.open(URL, 'foto', 'width='+width+', height='+height+', top='+top+', left='+left+', scrollbars=no, status=no, toolbar=no, location=no, directories=no, menubar=no, resizable=no, fullscreen=no');
} 

//imprimir notícias
function imprimir_noticias(URL) {
	
   var left = 50;
   var top = 50;

   window.open(URL, 'imprimir', 'width=600, height=500, top='+top+', left='+left+', scrollbars=yes, status=no, toolbar=no, location=no, directories=no, menubar=no, resizable=no, fullscreen=no');
}

//imprimir matérias
function imprimir_materias(URL) {
	
   var left = 50;
   var top = 50;

   window.open(URL, 'imprimir', 'width=600, height=500, top='+top+', left='+left+', scrollbars=yes, status=no, toolbar=no, location=no, directories=no, menubar=no, resizable=no, fullscreen=no');
}

//Ampliar fotos do classificado
function ampliar_classificado(URL, width, height) {
	
   var left = 50;
   var top = 50;

   window.open(URL, 'foto_cla', 'width='+width+', height='+height+', top='+top+', left='+left+', scrollbars=auto, status=no, toolbar=no, location=no, directories=no, menubar=no, resizable=no, fullscreen=no');
} 

//imprimir anuncio do classificado
function imprimir_classificado(URL, width, height) {
	
   var left = 50;
   var top = 50;

   window.open(URL, 'imprimir', 'width=600, height=550, top='+top+', left='+left+', scrollbars=auto, status=no, toolbar=no, location=no, directories=no, menubar=no, resizable=no, fullscreen=no');
}

<!--Início Popup Publicidade - opção para quando o cliente tem algo para mostrar
function visualizar_publicidade(URL, width, height) {
	var larguratela = screen.width;
	var alturatela = screen.height;
	var largurajanela = ''+width+'';
	var alturajanela = ''+height+'';
	
	var iniciolargura = (larguratela - largurajanela) / 2;
	var inicioaltura = (alturatela-alturajanela) / 2;

   window.open(URL, 'publicidade_visualizar', 'width='+largurajanela+', height='+alturajanela+', top='+inicioaltura+', left='+iniciolargura+', scrollbars=no, status=no, toolbar=no, location=no, directories=no, menubar=no, resizable=no, fullscreen=no');
}
//-->Termino Popup Publicidade

//Enviar a amigo anuncio do classificado
function enviar_classificado(URL, width, height) {
	var larguratela = screen.width;
	var alturatela = screen.height;
	var largurajanela = 460;
	var alturajanela = 380;
	
	var iniciolargura = (larguratela - largurajanela) / 2;
	var inicioaltura = (alturatela-alturajanela) / 2;

   window.open(URL, 'enviar', 'width='+largurajanela+', height='+alturajanela+', top='+inicioaltura+', left='+iniciolargura+', scrollbars=no, status=no, toolbar=no, location=no, directories=no, menubar=no, resizable=no, fullscreen=no');
}

//Abrir janela popup para visualização de anuncio no classificados
function abrir_popup_classificados(URL) {
	
   var left = 50;
   var top = 50;

   window.open(URL, 'popup_classificados', 'width=600, height=500, top='+top+', left='+left+', scrollbars=no, status=no, toolbar=no, location=no, directories=no, menubar=no, resizable=no, fullscreen=no');
}

//Ampliar fotos ex: fotos da cidade
function ampliar(URL, width, height) {
	
   var left = 50;
   var top = 50;

   window.open(URL, 'ampliado', 'width='+width+', height='+height+', top='+top+', left='+left+', scrollbars=no, status=no, toolbar=no, location=no, directories=no, menubar=no, resizable=no, fullscreen=no');
}

//Abrir janela popup para visualização da galeria
function abrir_popup_galeria(URL) {
   var width = 650;
   var height = 550;

   var left = 50;
   var top = 50;

   window.open(URL, 'galeria', 'width='+width+', height='+height+', top='+top+', left='+left+', scrollbars=no, status=no, toolbar=no, location=no, directories=no, menubar=no, resizable=no, fullscreen=no');
}

//Ampliar fotos da galeria
function ampliar_foto_galeria(URL, width, height) {
	
   var left = 50;
   var top = 50;

   window.open(URL, 'foto', 'width='+width+', height='+height+', top='+top+', left='+left+', scrollbars=no, status=no, toolbar=no, location=no, directories=no, menubar=no, resizable=no, fullscreen=no');
} 


//enviar e-mail para anunciantes do site
function enviar_email(URL) {
	var larguratela = screen.width;
	var alturatela = screen.height;
	var largurajanela = 460;
	var alturajanela = 400;
	
	var iniciolargura = (larguratela - largurajanela) / 2;
	var inicioaltura = (alturatela-alturajanela) / 2;

   window.open(URL, 'email', 'width='+largurajanela+', height='+alturajanela+', top='+inicioaltura+', left='+iniciolargura+', scrollbars=no, status=no, toolbar=no, location=no, directories=no, menubar=no, resizable=no, fullscreen=no');
}

//pop_up para imprimir cartão com login e senha etc...
function imprimir_cartao(URL) {
	var larguratela = screen.width;
	var alturatela = screen.height;
	var largurajanela = 400;
	var alturajanela = 300;
		
	var iniciolargura = (larguratela - largurajanela) / 2;
	var inicioaltura = (alturatela-alturajanela) / 2;

   window.open(URL, 'cartao', 'width='+largurajanela+', height='+alturajanela+', top='+inicioaltura+', left='+iniciolargura+', scrollbars=no, status=no, toolbar=no, location=no, directories=no, menubar=no, resizable=no, fullscreen=no');
}

//pop_up para exibir o cupom do sistema de anuncios de empresas
function exibir_cupom(URL) {
	var larguratela = screen.width;
	var alturatela = screen.height;
	var largurajanela = 450;
	var alturajanela = 350;
	
	var iniciolargura = (larguratela - largurajanela) / 2;
	var inicioaltura = (alturatela-alturajanela) / 2;
	
   window.open(URL, 'cupom', 'width='+largurajanela+', height='+alturajanela+', top='+inicioaltura+', left='+iniciolargura+', scrollbars=no, status=no, toolbar=no, location=no, directories=no, menubar=no, resizable=no, fullscreen=no');
}

//pop_up para demostracao da posição dos banner's no website
function exibir_demo_banner(URL) {
	var larguratela = screen.width;
	var alturatela = screen.height;
	var largurajanela = 640;
	var alturajanela = 480;
	
	var iniciolargura = (larguratela - largurajanela) / 2;
	var inicioaltura = (alturatela-alturajanela) / 2;
	
   window.open(URL, 'banner', 'width='+largurajanela+', height='+alturajanela+', top='+inicioaltura+', left='+iniciolargura+', scrollbars=no, status=no, toolbar=no, location=no, directories=no, menubar=no, resizable=no, fullscreen=no');
}

//pop_up para demostracao dos Planos de anúncios no website
function exibir_demo_anuncio(URL) {
	var larguratela = screen.width;
	var alturatela = screen.height;
	var largurajanela = 640;
	var alturajanela = 480;
	
	var iniciolargura = (larguratela - largurajanela) / 2;
	var inicioaltura = (alturatela-alturajanela) / 2;
	
   window.open(URL, 'banner', 'width='+largurajanela+', height='+alturajanela+', top='+inicioaltura+', left='+iniciolargura+', scrollbars=no, status=no, toolbar=no, location=no, directories=no, menubar=no, resizable=no, fullscreen=no');
}

//pop_up para ver os Planos de anúncios no Administrador
function exibir_plano(URL) {
	var larguratela = screen.width;
	var alturatela = screen.height;
	var largurajanela = 600;
	var alturajanela = 500;
	
	var iniciolargura = (larguratela - largurajanela) / 2;
	var inicioaltura = (alturatela-alturajanela) / 2;
	
   window.open(URL, 'planos', 'width='+largurajanela+', height='+alturajanela+', top='+inicioaltura+', left='+iniciolargura+', scrollbars=yes, status=no, toolbar=no, location=no, directories=no, menubar=no, resizable=no, fullscreen=no');
}

//pop_up para ver no Administrador os Usuários cadastrads no BD
function exibir_usuarios(URL) {
	var larguratela = screen.width;
	var alturatela = screen.height;
	var largurajanela = 500;
	var alturajanela = 400;
	
	var iniciolargura = (larguratela - largurajanela) / 2;
	var inicioaltura = (alturatela-alturajanela) / 2;
	
   window.open(URL, 'usuarios', 'width='+largurajanela+', height='+alturajanela+', top='+inicioaltura+', left='+iniciolargura+', scrollbars=yes, status=no, toolbar=no, location=no, directories=no, menubar=no, resizable=no, fullscreen=no');
}

//pop_up para Consulta de Multas
function consulta_multas(URL) {
	var larguratela = screen.width;
	var alturatela = screen.height;
	var largurajanela = 650;
	var alturajanela = 550;
	
	var iniciolargura = (larguratela - largurajanela) / 2;
	var inicioaltura = (alturatela-alturajanela) / 2;
	
   window.open(URL, 'consulta', 'width='+largurajanela+', height='+alturajanela+', top='+inicioaltura+', left='+iniciolargura+', scrollbars=yes, status=no, toolbar=no, location=no, directories=no, menubar=no, resizable=no, fullscreen=no');
}

//pop_up para Consulta de Multas
function consulta_ipva(URL) {
	var larguratela = screen.width;
	var alturatela = screen.height;
	var largurajanela = 700;
	var alturajanela = 550;
	
	var iniciolargura = (larguratela - largurajanela) / 2;
	var inicioaltura = (alturatela-alturajanela) / 2;
	
   window.open(URL, 'consulta', 'width='+largurajanela+', height='+alturajanela+', top='+inicioaltura+', left='+iniciolargura+', scrollbars=yes, status=no, toolbar=no, location=no, directories=no, menubar=no, resizable=no, fullscreen=no');
}

//pop_up para form solicitação de orçamento ao O JORNAL -->
function abrir_form_orcamento_ojornal(theURL,winName,features) {
	var larguratela = screen.width;
	var alturatela = screen.height;
	var largurajanela = 500;
	var alturajanela = 360;
	
	var iniciolargura = (larguratela - largurajanela) / 2;
	var inicioaltura = (alturatela-alturajanela) / 2;

   window.open('../arquivos_publicidade/ojornal/form_orcamento.php?opcao=form_orcamento', '', 'width='+largurajanela+', height='+alturajanela+', top='+inicioaltura+', left='+iniciolargura+', scrollbars=no, status=no, toolbar=no, location=no, directories=no, menubar=no, resizable=no, fullscreen=no');
}


//Confirmar ao excluir dados - site e admin
function confirmaRemocao(URL){
	if(window.confirm("Tem certeza de que deseja remover?")){
		document.location.href=URL;
	}
}

//validação alteracao nos Classificados
function validaAltCla(){
	nome = document.formAltCla.nome.value;
	endereco = document.formAltCla.endereco.value;	
	email = document.formAltCla.email.value;
	telefone = document.formAltCla.telefone.value;
	cidade = document.formAltCla.cidade.value;
	
	erros = '';
	
	if(nome.length < 1)
		erros += '* Nome muito curto.\n';
		
	if(endereco.length < 1)
		erros += '* Endereço muito curto.\n';
		
	if(email.indexOf('@') == -1 || email.indexOf('.') == -1)
		erros += '* E-mail inválido.\n';
	
	if(telefone.length < 7)
		erros += '* Telefone inválido.\n';
		
	if(cidade.value < 1)
		erros += '* Preencha o campo Cidade.\n';
		
	if(erros != ''){
		alert('Erros no formulário:\n'+erros);
		return false;
	} else
	return true;
}

/*
//validação do cadastro na bolsa de empregos
function validaCadEmp(){
	nome = document.formCadEmp.nome.value;
	endereco = document.formCadEmp.endereco.value;	
	email = document.formCadEmp.email.value;
	telefone = document.formCadEmp.fone.value;
	cidade = document.formCadEmp.cidade.value;
	
	erros = '';
	
	if(nome.length < 1)
		erros += '* Preencha o campo Nome.\n';
		
	if(endereco.length < 1)
		erros += '* Preencha o campo Endereço.\n';
		
	if(email.indexOf('@') == -1 || email.indexOf('.') == -1)
		erros += '* E-mail inválido.\n';
		
	if(telefone.length < 7)
		erros += '* Telefone inválido.\n';
		
	if(cidade.value < 1)
		erros += '* Preencha o campo Cidade.\n';
		
if(document.formCadEmp.textoimg.value != document.formCadEmp.txtimg.value)
erros += '* Digite o número correto da Chave de Segurança. ';
		
	if(erros != ''){
		alert('Erros no formulário:\n'+erros);
		return false;
	} else
	return true;
}
*/

//validação cadastro nos Banners
function validaFormBanners(){
	nome = document.formBanners.nome.value;
	cidade = document.formBanners.cidade.value;
	estado = document.formBanners.estado.value;
	telefone = document.formBanners.telefone.value;	
	email = document.formBanners.email.value;
	
	erros = '';
	
	if(nome.length < 2)
		erros += '* Preencha o campo Nome.\n';
		
	if(cidade.value < 2)
		erros += '* Preencha o campo Cidade.\n';
		
	if(estado.length < 1)
		erros += '* Selecione um Estado.\n';
		
	if(telefone.length < 7)
		erros += '* Preencha o campo Telefone com um número válido.\n';	
		
	if(email.indexOf('@') == -1 || email.indexOf('.') == -1)
		erros += '* Preencha o campo E-mail com um endereço válido.\n';
			
	if(erros != ''){
		alert('Erros no formulário:\n'+erros);
		return false;
	} else
	return true;
}


//validação form login - Classificados /  Bolsa de Empregos / Anúncio de Empresas
function validaLogSistema(){
	login = document.form_login_sist.login.value;
	senha = document.form_login_sist.senha.value;
	
	if(login.length < 1){
		alert('Informe o Login.');
		form_login_sist.login.focus();
		return false;
	} else if(senha.length < 1){
		alert('Informe a Senha!');
		form_login_sist.senha.focus();
		return false;
	} else
		return true;

}

//validação do recuperar senha
function validaRecSenha(){
	login = document.form_rec_senha.login.value;
	
	if(login.length < 1){
		alert('Informe o Login.');
		form_rec_senha.login.focus();
		return false;
	} else
		return true;
}

//validação form login - Newsletter
function validaFormNewsletter(){
	nome = document.form_login_newsletter.nome.value;
	email = document.form_login_newsletter.email.value;
	
	if(nome.length < 1){
		alert('Preencha o campo Nome.');
		form_login_newsletter.nome.focus();
		return false;
	//} else if(email.length < 1)
	} else if(email.indexOf('@') == -1 || email.indexOf('.') == -1){
		alert('Preencha o campo E-mail com um endereço válido.');
		form_login_newsletter.email.focus();
		return false;
	} else
		return true;

}

//Validação do campo busca Produtos e Serviços
function ValidaBuscaAnuncios(){
	var palavra = document.form_busca_anuncios.palavra.value;
	if(palavra.length < 3){
		alert('Digite uma palavra no campo de busca, contendo no mínimo 3 caracteres!');
		form_busca_anuncios.palavra.focus();
		return false;
	} else {
		return true;
	}
} 

//Validação do campo busca Matérias
function ValidaBuscaMaterias(){
	var palavra = document.form_busca_materias.palavra.value;
	if(palavra.length < 3){
		alert('Digite uma palavra no campo de busca, contendo no mínimo 3 caracteres!');
		form_busca_materias.palavra.focus();
		return false;
	} else {
		return true;
	}
}

//Validação do campo busca Notícias
function ValidaBuscaNoticias(){
	var palavra = document.form_busca_noticias.palavra.value;
	if(palavra.length < 3){
		alert('Digite uma palavra no campo de busca, contendo no mínimo 3 caracteres!');
		form_busca_noticias.palavra.focus();
		return false;
	} else {
		return true;
	}
}

//Validação do campo busca Classificados
function ValidaBuscaClassificados(){
	var buscar = document.form_busca_classificados.buscar.value;
	if(buscar.length < 3){
		alert('Digite uma palavra no campo de busca, contendo no mínimo 3 caracteres!');
		form_busca_classificados.buscar.focus();		
		return false;
	} else {
		return true;
	}
}

//Validação do campo busca Empregos
function ValidaBuscaEmpregos(){
if(document.form_busca_empregos.palavra.value < 2){
alert('Digite uma palavra no campo de busca e selecione uma Categoria!');
form_busca_empregos.palavra.focus();
return false;
} else if(document.form_busca_empregos.categoria.value == ""){
alert('É preciso selecionar uma Categoria!');
form_busca_empregos.categoria.focus();
return false;
} else {
return true;
}
}

//Validação do campo busca Agenda
function ValidaBuscaAgenda(){
	var palavra = document.form_busca_agenda.palavra.value;
	if(palavra.length < 3){
		alert('Digite uma palavra no campo de busca, contendo no mínimo 3 caracteres!');
		form_busca_agenda.palavra.focus();
		return false;
	} else {
		return true;
	}
}


<!-- Conta Caracteres Descrição Classificados  -->
function ContaCaracteresClass()
{ 
intCaracteres = 250 - document.form1.descricao.value.length; 
if (intCaracteres > 0)
{ 
document.form1.caracteres.value = intCaracteres; 
return true; 
} 
else 
{ 
document.form1.caracteres.value = 0; 
document.form1.descricao.value = document.form1.descricao.value.substr(0,250)
alert('Número máximo de 250 caracteres atingido!');  
return false; 
} 
}

<!-- Conta Caracteres Descrição Agenda  -->
function ContaCaracteresAgenda()
{ 
intCaracteres = 250 - document.formagenda.descricao.value.length; 
if (intCaracteres > 0)
{ 
document.formagenda.caracteres.value = intCaracteres; 
return true; 
} 
else 
{ 
document.formagenda.caracteres.value = 0; 
document.formagenda.descricao.value = document.formagenda.descricao.value.substr(0,250)
alert('Número máximo de 250 caracteres atingido!');  
return false; 
} 
}

<!-- Conta Caracteres Descrição Bolsa de Empregos  -->
function ContaCaracteresBolsaEmpregos()
{ 
intCaracteres = 250 - document.form1.anuncio.value.length; 
if (intCaracteres > 0)
{ 
document.form1.caracteres.value = intCaracteres; 
return true; 
} 
else 
{ 
document.form1.caracteres.value = 0; 
document.form1.anuncio.value = document.form1.anuncio.value.substr(0,250)
alert('Número máximo de 250 caracteres atingido!');  
return false; 
} 
}

<!-- Conta Caracteres Descrição Divulgacao website Admin e Cupom do Divulgacao  -->
function ContaCaracteresDivulgacao()//website
{ 
intCaracteres = 350 - document.formdivulgacao.descricao.value.length; 
if (intCaracteres > 0)
{ 
document.formdivulgacao.caracteres.value = intCaracteres; 
return true; 
} 
else 
{ 
document.formdivulgacao.caracteres.value = 0; 
document.formdivulgacao.descricao.value = document.formdivulgacao.descricao.value.substr(0,350)
alert('Número máximo de 350 caracteres atingido!');  
return false; 
} 
}

function ContaCaracteresDivulgacaoEditar()//Admin
{ 
intCaracteres = 350 - document.formdivulgacao.an_descricao.value.length; 
if (intCaracteres > 0)
{ 
document.formdivulgacao.caracteres.value = intCaracteres; 
return true; 
} 
else 
{ 
document.formdivulgacao.caracteres.value = 0; 
document.formdivulgacao.an_descricao.value = document.formdivulgacao.an_descricao.value.substr(0,350)
alert('Número máximo de 350 caracteres atingido!');  
return false; 
} 
}

function ContaCaracteresDivulgacaoCupom()//website e Admin
{ 
intCaracteres = 250 - document.formdivulgacao.cupom_desc.value.length; 
if (intCaracteres > 0)
{ 
document.formdivulgacao.caracteres_cupom.value = intCaracteres; 
return true; 
} 
else 
{ 
document.formdivulgacao.caracteres_cupom.value = 0; 
document.formdivulgacao.cupom_desc.value = document.formdivulgacao.cupom_desc.value.substr(0,250)
alert('Número máximo de 250 caracteres atingido!');  
return false; 
} 
}

function ContaCaracteresDivulgacaoPalavrasChave()//website
{ 
intCaracteres = 250 - document.formdivulgacao.palavras_chave.value.length; 
if (intCaracteres > 0)
{ 
document.formdivulgacao.caracteres_palavras_chave.value = intCaracteres; 
return true; 
} 
else 
{ 
document.formdivulgacao.caracteres_palavras_chave.value = 0; 
document.formdivulgacao.palavras_chave.value = document.formdivulgacao.palavras_chave.value.substr(0,250)
alert('Número máximo de 250 caracteres atingido!');  
return false; 
} 
}

function ContaCaracteresDivulgacaoPalavrasChaveEditar()//admin
{ 
intCaracteres = 250 - document.formdivulgacao.an_palavras_chave.value.length; 
if (intCaracteres > 0)
{ 
document.formdivulgacao.caracteres_palavras_chave.value = intCaracteres; 
return true; 
} 
else 
{ 
document.formdivulgacao.caracteres_palavras_chave.value = 0; 
document.formdivulgacao.an_palavras_chave.value = document.formdivulgacao.an_palavras_chave.value.substr(0,250)
alert('Número máximo de 250 caracteres atingido!');  
return false; 
} 
}

function ContaCaracteresGaleriaFotos()//admin
{ 
intCaracteres = 250 - document.formgaleria.descricao.value.length; 
if (intCaracteres > 0)
{ 
document.formgaleria.caracteres_galeria.value = intCaracteres; 
return true; 
} 
else 
{ 
document.formgaleria.caracteres_galeria.value = 0; 
document.formgaleria.descricao.value = document.formgaleria.descricao.value.substr(0,250)
alert('Número máximo de 250 caracteres atingido!');  
return false; 
} 
}

// FUNÇÃO QUE AUMENTA E DIMINUI O TAMANHO DA FONTE NA ÁREA DE NOTICIAS
var intContaTam = 0;
	var vetFonte = new Array ();
	vetFonte [0] = "65"; <!-- 65 - equivale a fonte 10 no td, body-->
	vetFonte [1] = "100";
	vetFonte [2] = "110";
	vetFonte [3] = "120";
	vetFonte [4] = "130";
	
	function areaTexto (strAD) {
		
		if (strAD=="A") {
			intContaTam++;
			if (intContaTam>=vetFonte.length)
				intContaTam = vetFonte.length-1;
			document.all.areaTexto.style.fontSize = vetFonte[intContaTam]+"%";
		} else {
			intContaTam--;
			if (intContaTam<0)
				intContaTam=0;
			document.all.areaTexto.style.fontSize = vetFonte[intContaTam]+"%";
		}
	}

var tam=10;
function mudaFonte(tipo){
if (tipo=="mais"){		
	tam+=5;
}else{
	tam-=5;
} 
	document.getElementById('text').style.fontSize=tam+'px' ;
	
}
//-->

// inicio formata valor nos campos destinados a valor
function FormataValor(fld, milSep, decSep, e) {
var sep = 0;
var key = '';
var i = j = 0;
var len = len2 = 0;
var strCheck = '0123456789';
var aux = aux2 = '';
var whichCode = (window.Event) ? e.which : e.keyCode;
if (whichCode == 13) return true;  // Enter
if (whichCode == 8) return true;
if (whichCode == 46) return true;
key = String.fromCharCode(whichCode);  // Get key value from key code
if (strCheck.indexOf(key) == -1) return false;  // Not a valid key
len = fld.value.length;
for(i = 0; i < len; i++)
if ((fld.value.charAt(i) != '0') && (fld.value.charAt(i) != decSep)) break;
aux = '';
for(; i < len; i++)
if (strCheck.indexOf(fld.value.charAt(i))!=-1) aux += fld.value.charAt(i);
aux += key;
len = aux.length;
if (len == 0) fld.value = '';
if (len == 1) fld.value = '0'+ decSep + '0' + aux;
if (len == 2) fld.value = '0'+ decSep + aux;
if (len > 2) {
aux2 = '';
for (j = 0, i = len - 3; i >= 0; i--) {
if (j == 3) {
aux2 += milSep;
j = 0;
}
aux2 += aux.charAt(i);
j++;
}
fld.value = '';
len2 = aux2.length;
for (i = len2 - 1; i >= 0; i--)
fld.value += aux2.charAt(i);
fld.value += decSep + aux.substr(len - 2, len);
}
return false;
}
// final formata valor nos campos destinados a valor

//DETECTA SE O CAPSLOCK ESTA ATIVADO
function capsDetect( e ) {
	if( !e ) { e = window.event; } if( !e ) { MWJ_say_Caps( false ); return; }
	var theKey = e.which ? e.which : ( e.keyCode ? e.keyCode : ( e.charCode ? e.charCode : 0 ) );
	var theShift = e.shiftKey || ( e.modifiers && ( e.modifiers & 4 ) ); 
	MWJ_say_Caps( ( theKey > 64 && theKey < 91 && !theShift ) || ( theKey > 96 && theKey < 123 && theShift ) );
}
function MWJ_say_Caps( oC ) {
	if( typeof( capsError ) == 'string' ) { if( oC ) { alert( capsError ); } } else { capsError( oC ); }
}
//EXIBE O ALERTA DE CAPSLOCK ESTA ATIVADO
var capsError = 'ATENÇÃO:\n\nA tecla Caps Lock está ativada.\n\nPor favor desative para continuar...';
function capsError( capsEngaged ) {
		if( capsEngaged ) {
		} else {
		}
	}


<!--Inicio Mensagem no rodapé da página
 window.defaultStatus = ("PORTAL SEARA - O Portal da Cidade de Seara - SC");
//-->Término Mensagem no rodapé da página