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"; }
}	

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

//carregador para o banner_expansivel 
function carrega_banner_expansivel() {
document.getElementById('banner_expansivel').style.display='block';
}
// Final Controle Banner Camada

//Ampliar fotos do classificado
function ampliar_classificado(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, 'foto_cla', 'width='+largurajanela+', height='+alturajanela+', top='+inicioaltura+', left='+iniciolargura+', scrollbars=no, status=no, toolbar=no, location=no, directories=no, menubar=no, resizable=no, fullscreen=no');
}

//Exibir Slide das fotos do classificado
function exibir_slide(URL, width, height) {
	var larguratela = screen.width;
	var alturatela = screen.height;
	var largurajanela = 678;
	var alturajanela = 530;
	
	var iniciolargura = (larguratela - largurajanela) / 2;
	var inicioaltura = (alturatela-alturajanela) / 2;

   window.open(URL, 'fotos_slide', 'width='+largurajanela+', height='+alturajanela+', top='+inicioaltura+', left='+iniciolargura+', scrollbars=no, 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=680, height=550, top='+top+', left='+left+', scrollbars=yes, 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=650, height=500, top='+top+', left='+left+', scrollbars=yes, status=no, toolbar=no, location=no, directories=no, menubar=no, resizable=no, fullscreen=no');
}


//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 - exclusivo revendas
function abrir_popup_ver_veiculo(URL, width, height) {
	var larguratela = screen.width;
	var alturatela = screen.height;
	var largurajanela = 650;
	var alturajanela = 500;
	
	var iniciolargura = (larguratela - largurajanela) / 2;
	var inicioaltura = (alturatela-alturajanela) / 2;

   window.open(URL, 'popup_ver_veiculo', 'width='+largurajanela+', height='+alturajanela+', top='+inicioaltura+', left='+iniciolargura+', scrollbars=yes, 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');
}


//enviar e-mail de indicação
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');
}

//enviar proposta para revenda do site
function enviar_proposta(URL) {
	var larguratela = screen.width;
	var alturatela = screen.height;
	var largurajanela = 460;
	var alturajanela = 550;
	
	var iniciolargura = (larguratela - largurajanela) / 2;
	var inicioaltura = (alturatela-alturajanela) / 2;

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

//enviar e-mail solicitando suporte
function solicitar_suporte(URL) {
	var larguratela = screen.width;
	var alturatela = screen.height;
	var largurajanela = 550;
	var alturajanela = 400;
	
	var iniciolargura = (larguratela - largurajanela) / 2;
	var inicioaltura = (alturatela-alturajanela) / 2;

   window.open(URL, 'suporte', '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 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 Atendimento Online
function abrir_atendimento(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, 'atendimento', '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;
	}
}

//Confirmar a liberação - admin
function confirmaLiberar(URL){
	if(window.confirm("Tem certeza de que deseja Liberar?\n\nEstá opção normalmente é escolha da Revenda, só liberar ser tiver certeza disso.")){
		document.location.href=URL;
	}
}

//Confirmar ao excluir veiculos selecionados
function confirmaRemocaoSelecionados(URL){
	if(window.confirm("Tem certeza de que deseja limpar a sua seleção de veículos?")){
		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 form login
function validaLogSistema(){
	var login = document.form_login_sist.login.value;
	var 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(){
	var login = document.form_rec_senha.login.value;
	if(login.length < 1){
		alert('Informe o Login para que a sua senha possa ser enviada no seu email!');
		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 Classificados
function ValidaBuscaClassificados(){
	var buscar = document.form_busca_classificados.buscar.value;
	if(buscar.length < 2 || buscar == ('%%') || buscar == ('%%%') || buscar == ('%%%%') || buscar == ('%%%%%') || buscar == ('%%%%%%') || buscar == ('%%%%%%%') || buscar == ('%%%%%%%%') || buscar == ('%%%%%%%%%') || buscar == ('%%%%%%%%%%')){
		alert('Digite uma palavra no campo de busca, contendo no mínimo 2 caracteres!');
		form_busca_classificados.buscar.focus();		
		return false;
	} else {
		return true;
	}
}

//Validação do campo busca Serviços
function ValidaBuscaAvancada(){
if(document.form_busca_classificados_avancada.marca.value == ""){
alert('É necessário selecionar o Fabricante do veículo!');
form_busca_classificados_avancada.marca.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 < 2){
		alert('Digite uma palavra no campo de busca!');
		form_busca_noticias.palavra.focus();
		return false;
	} else {
		return true;
	}
}

//Validação do campo busca Serviços
function ValidaBuscaServicos(){
	var palavra = document.form_busca_servicos.palavra.value;
	if(palavra.length < 2){
		alert('Digite uma palavra no campo de busca!');
		form_busca_servicos.palavra.focus();
		return false;
	} else {
		return true;
	}
}

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

function ContaCaracteresAdicionais()
{ 
intCaracteres = 300 - document.form1.adicionais.value.length; 
if (intCaracteres > 0)
{ 
document.form1.caracteres_adicionais.value = intCaracteres; 
return true; 
} 
else 
{ 
document.form1.caracteres_adicionais.value = 0; 
document.form1.adicionais.value = document.form1.adicionais.value.substr(0,300)
alert('Número máximo de 300 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] = "70"; <!-- 70 - equivale a fonte 11 em Arial 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


// MENU PRINCIPAL
function MM_findObj(n, d) { //v4.0
	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 && document.getElementById) x=document.getElementById(n);
		return x;
	}

function tmt_findObj(n){
	var x,t;
	if((n.indexOf("?"))>0&&parent.frames.length){
		t=n.split("?");
		x=eval("parent.frames['"+t[1]+"'].document.getElementById('"+t[0]+"')");
	} else {
		x=document.getElementById(n)
	}
	return x;
}

function MM_showHideLayers() { //v3.0A
	var i,p,v,obj,args=MM_showHideLayers.arguments;
	if ( navigator.userAgent.indexOf("Opera")==-1 ) {
		if(document.getElementById){
			for (i=0; i<(args.length-2); i+=3) { 
				obj=tmt_findObj(args[i]);
				v=args[i+2];
				v=(v=='show')?'visible':(v='hide')?'hidden':v;
				if(obj) obj.style.visibility=v;
			}
		} else {
			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;
			}
		}
	}
}

//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\nEste campo é sensível a letras maíusculas e minúsculas.';
function capsError( capsEngaged ) {
		if( capsEngaged ) {
		} else {
		}
	}
	
<!--// Ticker startup
function startTicker()
{
// Define run time values
theCurrentStory     = -1;
theCurrentLength    = 0;
// Locate base objects
if (document.getElementById) {	
		theAnchorObject     = document.getElementById("tickerAnchor");
		runTheTicker();   	
	 }
else {
		document.write("<style>.ticki{display:none;}.ticko{border:0px; padding:0px;}</style>");
		return true;
}
}
// Ticker main run loop
function runTheTicker()
{
var myTimeout;  
// Go for the next story data block
if(theCurrentLength == 0)
{
	theCurrentStory++;
	theCurrentStory      = theCurrentStory % theItemCount;
	theStorySummary      = theSummaries[theCurrentStory].replace(/&quot;/g,'"');		
	theTargetLink        = theSiteLinks[theCurrentStory];
	theAnchorObject.href = theTargetLink;
	thePrefix 	     = "<span class=\"tickls\">" + theLeadString + "</span>";
}
// Stuff the current ticker text into the anchor
theAnchorObject.innerHTML = thePrefix + 
theStorySummary.substring(0,theCurrentLength) + whatWidget();
// Modify the length for the substring and define the timer
if(theCurrentLength != theStorySummary.length)
{
	theCurrentLength++;
	myTimeout = theCharacterTimeout;
}
else
{
	theCurrentLength = 0;
	myTimeout = theStoryTimeout;
}
// Call up the next cycle of the ticker
setTimeout("runTheTicker()", myTimeout);
}
// Widget generator
function whatWidget()
{
if(theCurrentLength == theStorySummary.length)
{
	return theWidgetNone;
}

if((theCurrentLength % 2) == 1)
{
	return theWidgetOne;
}
else
{
	return theWidgetTwo;
}
}
// -->

//inicio carrega flash
function carregaFlash(caminho,largura,altura)
{
document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="'+largura+'" height="'+altura+'">');
document.write('<param name="movie" value="'+caminho+'">');
document.write('<param name="quality" value="high">');
document.write('<param name="loop" value="false">');
document.write('<param name="wmode" value="transparent">');
document.write('<param name="menu" value="false">');
document.write('<embed src="'+caminho+'" quality="high" loop="false" wmode="transparent" menu="false" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+largura+'" height="'+altura+'"></embed>');
document.write('</object>');
}
//final carrega flash

<!--Inicio Mensagem no rodapé da página
 window.defaultStatus = ("VEÍCULOS CONCÓRDIA - O Portal de Veículos da Cidade de Concórdia - SC");
//-->Término Mensagem no rodapé da página
