function fBusca(intMarca, cid){
	window.location = "busca.asp?cid=" + cid + "&tipo=vei&marca=" + intMarca+ "&busca_marca=1";
}

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_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; }
}
function redireciona()
{
	window.location = "index.asp";
}
function startupload(progressID)
{
	Janela("progress.asp?progressid="+progressID,null,410,200);
}
function Janela(theURL,winName,w,h)
{
	l = (screen.availWidth-10 - w) / 2;
	t = (screen.availHeight-20 - h) / 2;
	features = "width="+w+",height="+h+",left="+l+",top="+t;
	features += ",screenX="+l+",screenY="+t;
	features += ",scrollbars=0,resizable=0,location=0";
	features += ",menubar=0,toolbar=0,status=0";
	window.open(theURL,winName,features);
}
function maiusculas(objeto)
{
	campo = eval (objeto);
	campo.value = campo.value.toUpperCase();
}
function minusculas(objeto)
{
	campo = eval (objeto);
	campo.value = campo.value.toLowerCase();
}
function checkUncheckAll(theElement)
{
	var theForm = theElement.form, z = 0;
	while (theForm[z].type == 'checkbox' && theForm[z].name != 'todos')
	{
		theForm[z].checked = theElement.checked;
		z++;
	}
}
function confirmSubmit(theTextConfirm,theTextError,theElement)
{
	var theForm = theElement.form, z = 0;
	var encontrou = false;
	while (theForm[z].type == 'checkbox')
	{
		if (theForm[z].checked)
			encontrou = true;
		z++;
	}
	if (encontrou)
		return confirm(theTextConfirm);
	else
		alert(theTextError);
	return false;
}
function mascaraNumero(keypress)
{
	if (keypress > 47 && keypress < 58)
		return true;
	return false;
}
function mascaraValor(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
	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;
	if (len < 10)
	{
		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;
	}
	return false;
}
function mascaraAnoModelo(keypress,objeto)
{
	campo = eval (objeto);
	separador = '/'; 
	conjunto = 4;
	if (keypress > 47 && keypress < 58)
	{
		if (campo.value.length == conjunto)
		{
			campo.value = campo.value + separador;
		}
		return true;
	}
	return false;
}
function mascaraData(fld, keypress)
{
	campo = eval (fld);
	separador = '/'; 
	conjunto1 = 2;
	conjunto2 = 5;
	if (keypress > 47 && keypress < 58)
	{
		if (campo.value.length == conjunto1)
		{
			campo.value = campo.value + separador;
		}
		if (campo.value.length == conjunto2)
		{
			campo.value = campo.value + separador;
		}
		return true;
	}
	return false;
}
function mascaraTelefone(keypress,objeto)
{
	campo = eval (objeto);
	separador1 = '(';
	separador2 = ')';
	conjunto1 = 0;
	conjunto2 = 3;
	if (keypress > 47 && keypress < 58)
	{
		if (campo.value.charAt(0) != '(')
			campo.value = '(' + campo.value
		if (campo.value.length == conjunto1)
			campo.value = campo.value + separador1;
		if (campo.value.length == conjunto2)
			campo.value = campo.value + separador2;
		return true;
	}
	else
		return false;
}
function mascaraPlaca(objeto,keypress)
{
	campo = eval (objeto);
	separador = '-'; 
	conjunto = 3;
	if ((keypress > 47 && keypress < 58) || (keypress > 64 && keypress < 91) || (keypress > 96 && keypress < 123))
	{
		if (campo.value.length == conjunto)
		{
			campo.value = campo.value + separador;
		}
		return true;
	}
	return false;
}
function verificaCidade(theForm,cidade_id)
{
	if (theForm.cidade.value == cidade_id)
		return false;
	return true;
}
function verificaCidadeSegmento(theForm,cidade_id,segmento_id)
{
	if (theForm.cidade.value == cidade_id && theForm.segmento.value == segmento_id)
		return false;
	return true;
}
function verificaCategoria(theForm,categoria_id)
{
	if (theForm.categoria.value == categoria_id)
		return false;
	return true;
}
function verificaBuscaVei(theForm)
{
	if (theForm.tipo.selectedIndex == 0 && theForm.marca.selectedIndex == 0 && (theForm.modelo.value == ' digite o modelo' || theForm.modelo.value == '') && (theForm.ano_de.value.substring(0,6) == ' ex.: ' || theForm.ano_de.value == '') && (theForm.ano_ate.value.substring(0,6) == ' ex.: ' || theForm.ano_ate.value == ''))
	{
		alert('Selecione ou digite um critério de pesquisa!');
		theForm.tipo.focus();
		return false;
	}
	return true;
}
function verificaBuscaVen(theForm)
{
	if (theForm.vendedor.selectedIndex == 0)
	{
		alert('Selecione a revenda desejada, ou clique em \'particulares\'!');
		theForm.vendedor.focus();
		return false;
	}
	return true;
}
function verificaBuscaRap(theForm)
{
	if (theForm.modelo.value == ' digite o modelo' || theForm.modelo.value == '')
	{
		alert('Selecione ou digite um critério de pesquisa!');
		theForm.modelo.focus();
		return false;
	}
	return true;
}
function verificaBuscaAva(theForm,theForm1)
{
	var z = 0;
	var encontrou = false;
	var acessor = '';
	while (theForm1[z].type == 'checkbox')
	{
		if (theForm1[z].checked)
		{
			encontrou = true;
			acessor += theForm1[z].value;
		}
		z++;
	}
	theForm.lista_acessorios.value = acessor;
	if (theForm.cidade.selectedIndex == 0 && theForm.tipo.selectedIndex == 0 && theForm.estado.selectedIndex == 0 && theForm.combustivel.selectedIndex == 0 && theForm.cor.selectedIndex == 0 && theForm.ano_de.value == '' && theForm.ano_ate.value == '' && theForm.valor_de.value == '' && theForm.valor_ate.value == '' && theForm.marca.selectedIndex == 0 && (theForm.modelo.value == ' digite o modelo' || theForm.modelo.value == ''))
	{
		if (!encontrou)
		{
			alert('Selecione ou digite um critério de pesquisa!');
			theForm.cidade.focus();
			return false;
		}
	}
	if (theForm.ano_de.value != '' && theForm.ano_de.value.length < 4)
	{
		alert('Digite o ano com 4 dígitos!');
		theForm.ano_de.focus();
		return false;
	}
	if (theForm.ano_ate.value != '' && theForm.ano_ate.value.length < 4)
	{
		alert('Digite o ano com 4 dígitos!');
		theForm.ano_ate.focus();
		return false;
	}
	return true;
}
function verificaBanco(theForm)
{
	if (theForm.nome.value == '')
	{
		alert('Digite seu nome!');
		theForm.nome.focus();
		return false;
	}
	if (theForm.email.value == '')
	{
		alert('Digite seu e-mail!');
		theForm.email.focus();
		return false;
	}
	prim = theForm.email.value.indexOf("@");
	if (prim < 2)
	{
		alert("O e-mail informado não parece estar correto.");
		theForm.email.focus();
		return false;
	}
	if(theForm.email.value.indexOf("@",prim + 1) != -1)
	{
		alert("O e-mail informado não parece estar correto.");
		theForm.email.focus();
		return false;
	}
	if(theForm.email.value.indexOf(".") < 1)
	{
		alert("O e-mail informado não parece estar correto.");
		theForm.email.focus();
		return false;
	}
	if(theForm.email.value.indexOf(" ") != -1)
	{
		alert("O e-mail informado não parece estar correto.");
		theForm.email.focus();
		return false;
	}
	if(theForm.email.value.indexOf(";") > 0)
	{
		alert("O e-mail informado não parece estar correto.");
		theForm.email.focus();
		return false;
	}
	if(theForm.email.value.indexOf(".@") > 0)
	{
		alert("O e-mail informado não parece estar correto.");
		theForm.email.focus();
		return false;
	}
	if(theForm.email.value.indexOf("@.") > 0)
	{
		alert("O e-mail informado não parece estar correto.");
		theForm.email.focus();
		return false;
	}
	if(theForm.email.value.indexOf(".com.br.") > 0)
	{
		alert("O e-mail informado não parece estar correto.");
		theForm.email.focus();
		return false;
	}
	if(theForm.email.value.indexOf("/") > 0)
	{
		alert("O e-mail informado não parece estar correto.");
		theForm.email.focus();
		return false;
	}
	if(theForm.email.value.indexOf("[") > 0)
	{
		alert("O e-mail informado não parece estar correto.");
		theForm.email.focus();
		return false;
	}
	if(theForm.email.value.indexOf("]") > 0)
	{
		alert("O e-mail informado não parece estar correto.");
		theForm.email.focus();
		return false;
	}
	if(theForm.email.value.indexOf("(") > 0)
	{
		alert("O e-mail informado não parece estar correto.");
		theForm.email.focus();
		return false;
	}
	if(theForm.email.value.indexOf(")") > 0)
	{
		alert("O e-mail informado não parece estar correto.");
		theForm.email.focus();
		return false;
	}
	if(theForm.email.value.indexOf("'") > 0)
	{
		alert("O e-mail informado não parece estar correto.");
		theForm.email.focus();
		return false;
	}
	if(theForm.email.value.indexOf("\"") > 0)
	{
		alert("O e-mail informado não parece estar correto.");
		theForm.email.focus();
		return false;
	}
	if(theForm.email.value.indexOf("..") > 0)
	{
		alert("O e-mail informado não parece estar correto.");
		theForm.email.focus();
		return false;
	}
	if (theForm.telefone.value == '')
	{
		alert('Digite seu telefone!');
		theForm.telefone.focus();
		return false;
	}
	if (theForm.telefone.value.length < 11)
	{
		alert('Verifique o telefone!');
		theForm.telefone.focus();
		return false;
	}
	if (theForm.celular.value != '')
	{
		if (theForm.celular.value.length < 11)
		{
			alert('Verifique o celular!');
			theForm.celular.focus();
			return false;
		}
	}
	if (theForm.marca.selectedIndex == 0)
	{
		alert('Selecione a marca do veículo!');
		theForm.marca.focus();
		return false;
	}
	if (theForm.modelo.value == '')
	{
		alert('Digite o modelo do veículo!');
		theForm.modelo.focus();
		return false;
	}
	if (theForm.combustivel.selectedIndex == 0)
	{
		alert('Selecione o combustível do veículo!');
		theForm.combustivel.focus();
		return false;
	}
	return true;
}
function verificaContato(theForm)
{
	if (theForm.nome.value == '')
	{
		alert('Digite seu nome!');
		theForm.nome.focus();
		return false;
	}
	if (theForm.email.value == '')
	{
		alert('Digite seu e-mail!');
		theForm.email.focus();
		return false;
	}
	prim = theForm.email.value.indexOf("@");
	if (prim < 2)
	{
		alert("O e-mail informado não parece estar correto.");
		theForm.email.focus();
		return false;
	}
	if(theForm.email.value.indexOf("@",prim + 1) != -1)
	{
		alert("O e-mail informado não parece estar correto.");
		theForm.email.focus();
		return false;
	}
	if(theForm.email.value.indexOf(".") < 1)
	{
		alert("O e-mail informado não parece estar correto.");
		theForm.email.focus();
		return false;
	}
	if(theForm.email.value.indexOf(" ") != -1)
	{
		alert("O e-mail informado não parece estar correto.");
		theForm.email.focus();
		return false;
	}
	if(theForm.email.value.indexOf(";") > 0)
	{
		alert("O e-mail informado não parece estar correto.");
		theForm.email.focus();
		return false;
	}
	if(theForm.email.value.indexOf(".@") > 0)
	{
		alert("O e-mail informado não parece estar correto.");
		theForm.email.focus();
		return false;
	}
	if(theForm.email.value.indexOf("@.") > 0)
	{
		alert("O e-mail informado não parece estar correto.");
		theForm.email.focus();
		return false;
	}
	if(theForm.email.value.indexOf(".com.br.") > 0)
	{
		alert("O e-mail informado não parece estar correto.");
		theForm.email.focus();
		return false;
	}
	if(theForm.email.value.indexOf("/") > 0)
	{
		alert("O e-mail informado não parece estar correto.");
		theForm.email.focus();
		return false;
	}
	if(theForm.email.value.indexOf("[") > 0)
	{
		alert("O e-mail informado não parece estar correto.");
		theForm.email.focus();
		return false;
	}
	if(theForm.email.value.indexOf("]") > 0)
	{
		alert("O e-mail informado não parece estar correto.");
		theForm.email.focus();
		return false;
	}
	if(theForm.email.value.indexOf("(") > 0)
	{
		alert("O e-mail informado não parece estar correto.");
		theForm.email.focus();
		return false;
	}
	if(theForm.email.value.indexOf(")") > 0)
	{
		alert("O e-mail informado não parece estar correto.");
		theForm.email.focus();
		return false;
	}
	if(theForm.email.value.indexOf("'") > 0)
	{
		alert("O e-mail informado não parece estar correto.");
		theForm.email.focus();
		return false;
	}
	if(theForm.email.value.indexOf("\"") > 0)
	{
		alert("O e-mail informado não parece estar correto.");
		theForm.email.focus();
		return false;
	}
	if(theForm.email.value.indexOf("..") > 0)
	{
		alert("O e-mail informado não parece estar correto.");
		theForm.email.focus();
		return false;
	}
	if (theForm.telefone.value == '')
	{
		alert('Digite seu telefone!');
		theForm.telefone.focus();
		return false;
	}
	if (theForm.telefone.value.length < 11)
	{
		alert('Verifique o telefone!');
		theForm.telefone.focus();
		return false;
	}
	if (theForm.celular.value != '')
	{
		if (theForm.celular.value.length < 11)
		{
			alert('Verifique o celular!');
			theForm.celular.focus();
			return false;
		}
	}
	return true;
}
function verificaTestemunho(theForm)
{
	if (theForm.nome.value == '')
	{
		alert('Digite seu nome!');
		theForm.nome.focus();
		return false;
	}
	if (theForm.email.value == '')
	{
		alert('Digite seu e-mail!');
		theForm.email.focus();
		return false;
	}
	prim = theForm.email.value.indexOf("@");
	if (prim < 2)
	{
		alert("O e-mail informado não parece estar correto.");
		theForm.email.focus();
		return false;
	}
	if(theForm.email.value.indexOf("@",prim + 1) != -1)
	{
		alert("O e-mail informado não parece estar correto.");
		theForm.email.focus();
		return false;
	}
	if(theForm.email.value.indexOf(".") < 1)
	{
		alert("O e-mail informado não parece estar correto.");
		theForm.email.focus();
		return false;
	}
	if(theForm.email.value.indexOf(" ") != -1)
	{
		alert("O e-mail informado não parece estar correto.");
		theForm.email.focus();
		return false;
	}
	if(theForm.email.value.indexOf(";") > 0)
	{
		alert("O e-mail informado não parece estar correto.");
		theForm.email.focus();
		return false;
	}
	if(theForm.email.value.indexOf(".@") > 0)
	{
		alert("O e-mail informado não parece estar correto.");
		theForm.email.focus();
		return false;
	}
	if(theForm.email.value.indexOf("@.") > 0)
	{
		alert("O e-mail informado não parece estar correto.");
		theForm.email.focus();
		return false;
	}
	if(theForm.email.value.indexOf(".com.br.") > 0)
	{
		alert("O e-mail informado não parece estar correto.");
		theForm.email.focus();
		return false;
	}
	if(theForm.email.value.indexOf("/") > 0)
	{
		alert("O e-mail informado não parece estar correto.");
		theForm.email.focus();
		return false;
	}
	if(theForm.email.value.indexOf("[") > 0)
	{
		alert("O e-mail informado não parece estar correto.");
		theForm.email.focus();
		return false;
	}
	if(theForm.email.value.indexOf("]") > 0)
	{
		alert("O e-mail informado não parece estar correto.");
		theForm.email.focus();
		return false;
	}
	if(theForm.email.value.indexOf("(") > 0)
	{
		alert("O e-mail informado não parece estar correto.");
		theForm.email.focus();
		return false;
	}
	if(theForm.email.value.indexOf(")") > 0)
	{
		alert("O e-mail informado não parece estar correto.");
		theForm.email.focus();
		return false;
	}
	if(theForm.email.value.indexOf("'") > 0)
	{
		alert("O e-mail informado não parece estar correto.");
		theForm.email.focus();
		return false;
	}
	if(theForm.email.value.indexOf("\"") > 0)
	{
		alert("O e-mail informado não parece estar correto.");
		theForm.email.focus();
		return false;
	}
	if(theForm.email.value.indexOf("..") > 0)
	{
		alert("O e-mail informado não parece estar correto.");
		theForm.email.focus();
		return false;
	}
	if (theForm.mensagem.value == '')
	{
		alert('Digite seu testemunho!');
		theForm.mensagem.focus();
		return false;
	}
	return true;
}
function verificaFormContato(theForm)
{
	if (theForm.nome.value == '')
	{
		alert('Digite seu nome!');
		theForm.nome.focus();
		return false;
	}
	if (theForm.email.value == '')
	{
		alert('Digite seu email!');
		theForm.email.focus();
		return false;
	}
	else
	{
		prim = theForm.email.value.indexOf("@");
		if (prim < 2)
		{
			alert("O e-mail informado não parece estar correto.");
			theForm.email.focus();
			return false;
		}
		if(theForm.email.value.indexOf("@",prim + 1) != -1)
		{
			alert("O e-mail informado não parece estar correto.");
			theForm.email.focus();
			return false;
		}
		if(theForm.email.value.indexOf(".") < 1)
		{
			alert("O e-mail informado não parece estar correto.");
			theForm.email.focus();
			return false;
		}
		if(theForm.email.value.indexOf(" ") != -1)
		{
			alert("O e-mail informado não parece estar correto.");
			theForm.email.focus();
			return false;
		}
		if(theForm.email.value.indexOf(";") > 0)
		{
			alert("O e-mail informado não parece estar correto.");
			theForm.email.focus();
			return false;
		}
		if(theForm.email.value.indexOf(".@") > 0)
		{
			alert("O e-mail informado não parece estar correto.");
			theForm.email.focus();
			return false;
		}
		if(theForm.email.value.indexOf("@.") > 0)
		{
			alert("O e-mail informado não parece estar correto.");
			theForm.email.focus();
			return false;
		}
		if(theForm.email.value.indexOf(".com.br.") > 0)
		{
			alert("O e-mail informado não parece estar correto.");
			theForm.email.focus();
			return false;
		}
		if(theForm.email.value.indexOf("/") > 0)
		{
			alert("O e-mail informado não parece estar correto.");
			theForm.email.focus();
			return false;
		}
		if(theForm.email.value.indexOf("[") > 0)
		{
			alert("O e-mail informado não parece estar correto.");
			theForm.email.focus();
			return false;
		}
		if(theForm.email.value.indexOf("]") > 0)
		{
			alert("O e-mail informado não parece estar correto.");
			theForm.email.focus();
			return false;
		}
		if(theForm.email.value.indexOf("(") > 0)
		{
			alert("O e-mail informado não parece estar correto.");
			theForm.email.focus();
			return false;
		}
		if(theForm.email.value.indexOf(")") > 0)
		{
			alert("O e-mail informado não parece estar correto.");
			theForm.email.focus();
			return false;
		}
		if(theForm.email.value.indexOf("'") > 0)
		{
			alert("O e-mail informado não parece estar correto.");
			theForm.email.focus();
			return false;
		}
		if(theForm.email.value.indexOf("\"") > 0)
		{
			alert("O e-mail informado não parece estar correto.");
			theForm.email.focus();
			return false;
		}
		if(theForm.email.value.indexOf("..") > 0)
		{
			alert("O e-mail informado não parece estar correto.");
			theForm.email.focus();
			return false;
		}
	}
	if (theForm.telefone.value == '')
	{
		alert('Digite seu telefone!');
		theForm.telefone.focus();
		return false;
	}
	if (theForm.telefone.value.length < 12)
	{
		alert('Verifique o telefone!');
		theForm.telefone.focus();
		return false;
	}
	return true;
}
function verificaSubmitTipo(theForm)
{
	if (theForm.tipo.value == '')
	{
		alert('Digite o tipo!');
		theForm.tipo.focus();
		return false;
	}
	return true;
}
function verificaSubmitCategoria(theForm)
{
	if (theForm.categoria.value == '')
	{
		alert('Digite a categoria do link!');
		theForm.categoria.focus();
		return false;
	}
	return true;
}
function verificaSubmitLink(theForm,progressID)
{
	if (theForm.categoria.selectedIndex == -1)
	{
		alert('Selecione a categoria!');
		theForm.categoria.focus();
		return false;
	}
	if (theForm.link.value == '')
	{
		alert('Digite o nome do link!');
		theForm.link.focus();
		return false;
	}
	if (theForm.url.value == '')
	{
		alert('Digite o endereço do link!');
		theForm.url.focus();
		return false;
	}
	ext = theForm.imagem.value;
	if (ext != '')
	{
		ext = ext.substring(ext.length-3,ext.length);
		ext = ext.toLowerCase();
		if (ext != 'jpg')
		{
			alert('O arquivo selecionado não poderá ser enviado. Formato permitido: JPG!');
			theForm.imagem.focus();
			return false;
		}
		startupload(progressID);
	}
	return true;
}
function verificaSubmitAcessorio(theForm)
{
	if (theForm.acessorio.value == '')
	{
		alert('Digite o acessório!');
		theForm.acessorio.focus();
		return false;
	}
	return true;
}
function verificaSubmitCusto(theForm)
{
	if (theForm.custo.value == '')
	{
		alert('Digite o custo!');
		theForm.custo.focus();
		return false;
	}
	return true;
}
function verificaSubmitTestemunho(theForm)
{
	if (theForm.testemunho.value == '')
	{
		alert('Digite o testemunho!');
		theForm.testemunho.focus();
		return false;
	}
	if (theForm.autor.value == '')
	{
		alert('Digite nome do autor do testemunho!');
		theForm.autor.focus();
		return false;
	}
	return true;
}
function verificaSubmitSegmento(theForm)
{
	if (theForm.segmento.value == '')
	{
		alert('Digite o segmento!');
		theForm.segmento.focus();
		return false;
	}
	return true;
}
function verificaSubmitMarca(theForm)
{
	if (theForm.marca.value == '')
	{
		alert('Digite a marca!');
		theForm.marca.focus();
		return false;
	}
	return true;
}
function verificaSubmitCidade(theForm)
{
	if (theForm.cidade.value == '')
	{
		alert('Digite a cidade!');
		theForm.cidade.focus();
		return false;
	}
	return true;
}
function verificaSubmitDestaque(theForm)
{
	if (theForm.titulo1.value == '')
	{
		alert('Digite o título 1!');
		theForm.titulo1.focus();
		return false;
	}
	if (theForm.texto1.value == '')
	{
		alert('Digite o texto 1!');
		theForm.texto1.focus();
		return false;
	}
	if (theForm.titulo2.value == '')
	{
		alert('Digite o título 2!');
		theForm.titulo2.focus();
		return false;
	}
	if (theForm.texto2.value == '')
	{
		alert('Digite o texto 2!');
		theForm.texto2.focus();
		return false;
	}
	return true;
}
function verificaSubmitAnuncio(access,theForm,progressID)
{
	if (theForm.empresa.value == '')
	{
		alert('Digite o nome da empresa!');
		theForm.empresa.focus();
		return false;
	}
	if (theForm.segmento.selectedIndex == -1)
	{
		alert('Selecione o segmento!');
		theForm.segmento.focus();
		return false;
	}
	if (theForm.acao.value != 'editar')
	{
		if (access != 'cid')
		{
			if (theForm.cidade.selectedIndex == -1)
			{
				alert('Selecione a cidade do anúncio!');
				theForm.cidade.focus();
				return false;
			}
		}
	}
	if (theForm.endereco.value == '')
	{
		alert('Digite o endereço!');
		theForm.endereco.focus();
		return false;
	}
	if (theForm.telefone.value == '')
	{
		alert('Digite o telefone!');
		theForm.telefone.focus();
		return false;
	}
	if (theForm.telefone.value.length < 12)
	{
		alert('Verifique o telefone!');
		theForm.telefone.focus();
		return false;
	}
	if (theForm.email.value != '')
	{
		prim = theForm.email.value.indexOf("@");
		if (prim < 2)
		{
			alert("O e-mail informado não parece estar correto.");
			theForm.email.focus();
			return false;
		}
		if(theForm.email.value.indexOf("@",prim + 1) != -1)
		{
			alert("O e-mail informado não parece estar correto.");
			theForm.email.focus();
			return false;
		}
		if(theForm.email.value.indexOf(".") < 1)
		{
			alert("O e-mail informado não parece estar correto.");
			theForm.email.focus();
			return false;
		}
		if(theForm.email.value.indexOf(" ") != -1)
		{
			alert("O e-mail informado não parece estar correto.");
			theForm.email.focus();
			return false;
		}
		if(theForm.email.value.indexOf(";") > 0)
		{
			alert("O e-mail informado não parece estar correto.");
			theForm.email.focus();
			return false;
		}
		if(theForm.email.value.indexOf(".@") > 0)
		{
			alert("O e-mail informado não parece estar correto.");
			theForm.email.focus();
			return false;
		}
		if(theForm.email.value.indexOf("@.") > 0)
		{
			alert("O e-mail informado não parece estar correto.");
			theForm.email.focus();
			return false;
		}
		if(theForm.email.value.indexOf(".com.br.") > 0)
		{
			alert("O e-mail informado não parece estar correto.");
			theForm.email.focus();
			return false;
		}
		if(theForm.email.value.indexOf("/") > 0)
		{
			alert("O e-mail informado não parece estar correto.");
			theForm.email.focus();
			return false;
		}
		if(theForm.email.value.indexOf("[") > 0)
		{
			alert("O e-mail informado não parece estar correto.");
			theForm.email.focus();
			return false;
		}
		if(theForm.email.value.indexOf("]") > 0)
		{
			alert("O e-mail informado não parece estar correto.");
			theForm.email.focus();
			return false;
		}
		if(theForm.email.value.indexOf("(") > 0)
		{
			alert("O e-mail informado não parece estar correto.");
			theForm.email.focus();
			return false;
		}
		if(theForm.email.value.indexOf(")") > 0)
		{
			alert("O e-mail informado não parece estar correto.");
			theForm.email.focus();
			return false;
		}
		if(theForm.email.value.indexOf("'") > 0)
		{
			alert("O e-mail informado não parece estar correto.");
			theForm.email.focus();
			return false;
		}
		if(theForm.email.value.indexOf("\"") > 0)
		{
			alert("O e-mail informado não parece estar correto.");
			theForm.email.focus();
			return false;
		}
		if(theForm.email.value.indexOf("..") > 0)
		{
			alert("O e-mail informado não parece estar correto.");
			theForm.email.focus();
			return false;
		}
	}
	ext = theForm.imagem.value;
	if (ext != '')
	{
		ext = ext.substring(ext.length-3,ext.length);
		ext = ext.toLowerCase();
		if (ext != 'jpg')
		{
			alert('O arquivo selecionado não poderá ser enviado. Formato permitido: JPG!');
			theForm.imagem.focus();
			return false;
		}
	}
	ext1 = theForm.foto.value;
	if (ext1 != '')
	{
		ext1 = ext1.substring(ext1.length-3,ext1.length);
		ext1 = ext1.toLowerCase();
		if (ext1 != 'jpg')
		{
			alert('O arquivo selecionado não poderá ser enviado. Formato permitido: JPG!');
			theForm.foto.focus();
			return false;
		}
	}
	if (ext != '' || ext1 != '')
		startupload(progressID);
	return true;
}
function verificaSubmitRevenda(access,theForm,progressID)
{
	if (theForm.acao.value != 'editar')
	{
		if (access != 'cid')
		{
			if (theForm.cidade.selectedIndex == -1)
			{
				alert('Selecione a cidade do vendedor!');
				theForm.cidade.focus();
				return false;
			}
		}
		if (theForm.login.value == '')
		{
			alert('Digite o login!');
			theForm.login.focus();
			return false;
		}
		if (theForm.login.value.indexOf(" ") != -1)
		{
			alert("Verifique se há espaços no login!");
			theForm.login.focus();
			return false;
		}
		var nonums = /^[0-9]*$/;
		if (nonums.test(theForm.login.value))
		{
			alert("Digite pelo menos uma letra no login!");
			return false;
		}
	}
	if (theForm.senha.value == '')
	{
		alert('Digite a senha!');
		theForm.senha.focus();
		return false;
	}
	if (theForm.senha.value.indexOf(" ") != -1)
	{
		alert("Verifique se há espaços na senha!");
		theForm.senha.focus();
		return false;
	}
	if (theForm.revenda.value == '')
	{
		alert('Digite o nome do vendedor!');
		theForm.revenda.focus();
		return false;
	}
	if (theForm.endereco.value == '')
	{
		alert('Digite o endereço!');
		theForm.endereco.focus();
		return false;
	}
	if (theForm.telefone.value == '')
	{
		alert('Digite o telefone!');
		theForm.telefone.focus();
		return false;
	}
	if (theForm.telefone.value.length < 12)
	{
		alert('Verifique o telefone!');
		theForm.telefone.focus();
		return false;
	}
	if (theForm.telefone1.value != '')
	{
		if (theForm.telefone1.value.length < 12)
		{
			alert('Verifique o telefone!');
			theForm.telefone1.focus();
			return false;
		}
	}
	if (theForm.contato.value == '')
	{
		alert('Digite o nome do contato!');
		theForm.contato.focus();
		return false;
	}
	if (theForm.email.value != '')
	{
		prim = theForm.email.value.indexOf("@");
		if (prim < 2)
		{
			alert("O e-mail informado não parece estar correto.");
			theForm.email.focus();
			return false;
		}
		if(theForm.email.value.indexOf("@",prim + 1) != -1)
		{
			alert("O e-mail informado não parece estar correto.");
			theForm.email.focus();
			return false;
		}
		if(theForm.email.value.indexOf(".") < 1)
		{
			alert("O e-mail informado não parece estar correto.");
			theForm.email.focus();
			return false;
		}
		if(theForm.email.value.indexOf(" ") != -1)
		{
			alert("O e-mail informado não parece estar correto.");
			theForm.email.focus();
			return false;
		}
		if(theForm.email.value.indexOf(";") > 0)
		{
			alert("O e-mail informado não parece estar correto.");
			theForm.email.focus();
			return false;
		}
		if(theForm.email.value.indexOf(".@") > 0)
		{
			alert("O e-mail informado não parece estar correto.");
			theForm.email.focus();
			return false;
		}
		if(theForm.email.value.indexOf("@.") > 0)
		{
			alert("O e-mail informado não parece estar correto.");
			theForm.email.focus();
			return false;
		}
		if(theForm.email.value.indexOf(".com.br.") > 0)
		{
			alert("O e-mail informado não parece estar correto.");
			theForm.email.focus();
			return false;
		}
		if(theForm.email.value.indexOf("/") > 0)
		{
			alert("O e-mail informado não parece estar correto.");
			theForm.email.focus();
			return false;
		}
		if(theForm.email.value.indexOf("[") > 0)
		{
			alert("O e-mail informado não parece estar correto.");
			theForm.email.focus();
			return false;
		}
		if(theForm.email.value.indexOf("]") > 0)
		{
			alert("O e-mail informado não parece estar correto.");
			theForm.email.focus();
			return false;
		}
		if(theForm.email.value.indexOf("(") > 0)
		{
			alert("O e-mail informado não parece estar correto.");
			theForm.email.focus();
			return false;
		}
		if(theForm.email.value.indexOf(")") > 0)
		{
			alert("O e-mail informado não parece estar correto.");
			theForm.email.focus();
			return false;
		}
		if(theForm.email.value.indexOf("'") > 0)
		{
			alert("O e-mail informado não parece estar correto.");
			theForm.email.focus();
			return false;
		}
		if(theForm.email.value.indexOf("\"") > 0)
		{
			alert("O e-mail informado não parece estar correto.");
			theForm.email.focus();
			return false;
		}
		if(theForm.email.value.indexOf("..") > 0)
		{
			alert("O e-mail informado não parece estar correto.");
			theForm.email.focus();
			return false;
		}
	}
	if (access != 'user' && theForm.quantidade.value == '')
	{
		alert('Digite a quantidade de veículos permitida!');
		theForm.quantidade.focus();
		return false;
	}
	ext = theForm.imagem.value;
	if (ext != '')
	{
		if (theForm.acao.value != 'editar')
		{
			if (theForm.particular.checked)
			{
				alert('Cadastros de pessoas físicas não permitem inserção de imagem!');
				theForm.imagem.focus();
				return false;
			}
		}
		ext = ext.substring(ext.length-3,ext.length);
		ext = ext.toLowerCase();
		if (ext != 'jpg')
		{
			alert('O arquivo selecionado não poderá ser enviado. Formato permitido: JPG!');
			theForm.imagem.focus();
			return false;
		}
	}
	ext1 = theForm.foto.value;
	if (ext1 != '')
	{
		if (theForm.acao.value != 'editar')
		{
			if (theForm.particular.checked)
			{
				alert('Cadastros de pessoas físicas não permitem inserção de imagem!');
				theForm.foto.focus();
				return false;
			}
		}
		ext1 = ext1.substring(ext1.length-3,ext1.length);
		ext1 = ext1.toLowerCase();
		if (ext1 != 'jpg')
		{
			alert('O arquivo selecionado não poderá ser enviado. Formato permitido: JPG!');
			theForm.foto.focus();
			return false;
		}
	}
	if (theForm.acao.value != 'editar')
	{
		ext2 = theForm.imagem_1.value;
		if (ext2 != '')
		{
			if (theForm.particular.checked)
			{
				alert('Cadastros de pessoas físicas não permitem inserção de imagem!');
				theForm.imagem_1.focus();
				return false;
			}
			ext2 = ext2.substring(ext2.length-3,ext2.length);
			ext2 = ext2.toLowerCase();
			if (ext2 != 'jpg' && ext2 != 'swf')
			{
				alert('O arquivo selecionado não poderá ser enviado. Formatos permitidos: JPG ou SWF!');
				theForm.imagem_1.focus();
				return false;
			}
		}
		ext3 = theForm.imagem_2.value;
		if (ext3 != '')
		{
			ext3 = ext3.substring(ext3.length-3,ext3.length);
			ext3 = ext3.toLowerCase();
			if (ext2 == 'swf' || ext3 != 'jpg')
			{
				alert('O arquivo selecionado não poderá ser enviado. Formato permitido: JPG!');
				theForm.imagem_2.focus();
				return false;
			}
		}
		ext4 = theForm.imagem_3.value;
		if (ext4 != '')
		{
			if ((theForm.tem.value == '' && ext2 == '') || (theForm.tem_2.value == '' && ext3 == ''))
			{
				alert('Inclua as imagens na ordem correta!');
				theForm.imagem_2.focus();
				return false;
			}
			ext4 = ext4.substring(ext4.length-3,ext4.length);
			ext4 = ext4.toLowerCase();
			if (ext2 == 'swf' || ext4 != 'jpg')
			{
				alert('O arquivo selecionado não poderá ser enviado. Formato permitido: JPG!');
				theForm.imagem_3.focus();
				return false;
			}
		}
	}
	else
	{
		ext2 = theForm.imagem_1.value;
		if (ext2 != '')
		{
			ext2 = ext2.substring(ext2.length-3,ext2.length);
			ext2 = ext2.toLowerCase();
			if (ext2 != 'jpg' && ext2 != 'swf')
			{
				alert('O arquivo selecionado não poderá ser enviado. Formatos permitidos: JPG ou SWF!');
				theForm.imagem_1.focus();
				return false;
			}
		}
		ext3 = theForm.imagem_2.value;
		if (ext3 != '')
		{
			if (theForm.tem.value == '' && ext2 == '')
			{
				alert('Inclua as imagens na ordem correta!');
				theForm.imagem_2.focus();
				return false;
			}
			ext3 = ext3.substring(ext3.length-3,ext3.length);
			ext3 = ext3.toLowerCase();
			if (ext2 == 'swf' || ext3 != 'jpg')
			{
				alert('O arquivo selecionado não poderá ser enviado. Formato permitido: JPG!');
				theForm.imagem_2.focus();
				return false;
			}
		}
		ext4 = theForm.imagem_3.value;
		if (ext4 != '')
		{
			if ((theForm.tem.value == '' && ext2 == '') || (theForm.tem_2.value == '' && ext3 == ''))
			{
				alert('Inclua as imagens na ordem correta!');
				theForm.imagem_2.focus();
				return false;
			}
			ext4 = ext4.substring(ext4.length-3,ext4.length);
			ext4 = ext4.toLowerCase();
			if (ext == 'swf' || ext4 != 'jpg')
			{
				alert('O arquivo selecionado não poderá ser enviado. Formato permitido: JPG!');
				theForm.imagem_3.focus();
				return false;
			}
		}
	}
	ext5 = theForm.barra.value;
	if (ext5 != '')
	{
		if (theForm.acao.value != 'editar')
		{
			if (theForm.particular.checked)
			{
				alert('Cadastros de pessoas físicas não permitem inserção de imagem!');
				theForm.barra.focus();
				return false;
			}
		}
		ext5 = ext5.substring(ext5.length-3,ext5.length);
		ext5 = ext5.toLowerCase();
		if (ext5 != 'jpg' && ext5 != 'swf')
		{
				alert('O arquivo selecionado não poderá ser enviado. Formatos permitidos: JPG ou SWF!');
				theForm.barra.focus();
				return false;
		}
	}
	if (ext != '' || ext1 != '' || ext2 != '' || ext3 != '' || ext4 != '' || ext5 != '')
		startupload(progressID);
	return true;
}
function verificaSubmitPedidos(theForm)
{
	if (theForm.nome.value == '')
	{
		alert('Digite o nome!');
		theForm.nome.focus();
		return false;
	}
	if (theForm.email.value == '')
	{
		alert('Digite o e-mail!');
		theForm.email.focus();
		return false;
	}
	if (theForm.email.value != '')
	{
		prim = theForm.email.value.indexOf("@");
		if (prim < 2)
		{
			alert("O e-mail informado não parece estar correto.");
			theForm.email.focus();
			return false;
		}
		if(theForm.email.value.indexOf("@",prim + 1) != -1)
		{
			alert("O e-mail informado não parece estar correto.");
			theForm.email.focus();
			return false;
		}
		if(theForm.email.value.indexOf(".") < 1)
		{
			alert("O e-mail informado não parece estar correto.");
			theForm.email.focus();
			return false;
		}
		if(theForm.email.value.indexOf(" ") != -1)
		{
			alert("O e-mail informado não parece estar correto.");
			theForm.email.focus();
			return false;
		}
		if(theForm.email.value.indexOf(";") > 0)
		{
			alert("O e-mail informado não parece estar correto.");
			theForm.email.focus();
			return false;
		}
		if(theForm.email.value.indexOf(".@") > 0)
		{
			alert("O e-mail informado não parece estar correto.");
			theForm.email.focus();
			return false;
		}
		if(theForm.email.value.indexOf("@.") > 0)
		{
			alert("O e-mail informado não parece estar correto.");
			theForm.email.focus();
			return false;
		}
		if(theForm.email.value.indexOf(".com.br.") > 0)
		{
			alert("O e-mail informado não parece estar correto.");
			theForm.email.focus();
			return false;
		}
		if(theForm.email.value.indexOf("/") > 0)
		{
			alert("O e-mail informado não parece estar correto.");
			theForm.email.focus();
			return false;
		}
		if(theForm.email.value.indexOf("[") > 0)
		{
			alert("O e-mail informado não parece estar correto.");
			theForm.email.focus();
			return false;
		}
		if(theForm.email.value.indexOf("]") > 0)
		{
			alert("O e-mail informado não parece estar correto.");
			theForm.email.focus();
			return false;
		}
		if(theForm.email.value.indexOf("(") > 0)
		{
			alert("O e-mail informado não parece estar correto.");
			theForm.email.focus();
			return false;
		}
		if(theForm.email.value.indexOf(")") > 0)
		{
			alert("O e-mail informado não parece estar correto.");
			theForm.email.focus();
			return false;
		}
		if(theForm.email.value.indexOf("'") > 0)
		{
			alert("O e-mail informado não parece estar correto.");
			theForm.email.focus();
			return false;
		}
		if(theForm.email.value.indexOf("\"") > 0)
		{
			alert("O e-mail informado não parece estar correto.");
			theForm.email.focus();
			return false;
		}
		if(theForm.email.value.indexOf("..") > 0)
		{
			alert("O e-mail informado não parece estar correto.");
			theForm.email.focus();
			return false;
		}
	}
	if (theForm.telefone.value == '')
	{
		alert('Digite seu telefone!');
		theForm.telefone.focus();
		return false;
	}
	if (theForm.telefone.value.length < 12)
	{
		alert('Verifique o telefone!');
		theForm.telefone.focus();
		return false;
	}
	if (theForm.celular.value != '')
	{
		if (theForm.telefone.value.length < 12)
		{
			alert('Verifique o celular!');
			theForm.celular.focus();
			return false;
		}
	}
	if (theForm.marca.selectedIndex == 0)
	{
		alert('Selecione a marca do veículo!');
		theForm.marca.focus();
		return false;
	}
	if (theForm.modelo.value == '')
	{
		alert('Digite o modelo do veículo!');
		theForm.modelo.focus();
		return false;
	}
	if (theForm.combustivel.selectedIndex == -1)
	{
		alert('Selecione o combustível do veículo!');
		theForm.combustivel.focus();
		return false;
	}
	return true;
}
function verificaSubmitBanner(access,theForm,progressID)
{
	if (theForm.banner.value == '')
	{
		alert('Digite o nome do banner!');
		theForm.banner.focus();
		return false;
	}
	if (theForm.acao.value != 'editar')
	{
		if (access != 'cid')
		{
			if (theForm.cidade.selectedIndex == -1)
			{
				alert('Selecione a cidade do banner!');
				theForm.cidade.focus();
				return false;
			}
		}
		if (theForm.tipo.selectedIndex == -1)
		{
			alert('Selecione o tipo do banner!');
			theForm.tipo.focus();
			return false;
		}
		ext = theForm.imagem.value;
		if (ext != '')
		{
			ext = ext.substring(ext.length-3,ext.length);
			ext = ext.toLowerCase();
			if (ext != 'jpg' && ext != 'swf')
			{
				alert('O arquivo selecionado não poderá ser enviado. Formatos permitidos: JPG ou SWF!');
				theForm.imagem.focus();
				return false;
			}
		}
		else
		{
			alert('Selecione a imagem do banner!');
			theForm.imagem.focus();
			return false;
		}
		ext_2 = theForm.imagem_2.value;
		if (ext_2 != '')
		{
			ext_2 = ext_2.substring(ext_2.length-3,ext_2.length);
			ext_2 = ext_2.toLowerCase();
			if (ext == 'swf' || ext_2 != 'jpg')
			{
				alert('O arquivo selecionado não poderá ser enviado. Formato permitido: JPG!');
				theForm.imagem_2.focus();
				return false;
			}
		}
		ext_3 = theForm.imagem_3.value;
		if (ext_3 != '')
		{
			if ((theForm.tem.value == '' && ext == '') || (theForm.tem_2.value == '' && ext_2 == ''))
			{
				alert('Inclua as imagens na ordem correta!');
				theForm.imagem_2.focus();
				return false;
			}
			ext_3 = ext_3.substring(ext_3.length-3,ext_3.length);
			ext_3 = ext_3.toLowerCase();
			if (ext == 'swf' || ext_3 != 'jpg')
			{
				alert('O arquivo selecionado não poderá ser enviado. Formato permitido: JPG!');
				theForm.imagem_3.focus();
				return false;
			}
		}
		if (ext != '' || ext_2 != '' || ext_3 != '')
			startupload(progressID);
	}
	else
	{
		ext = theForm.imagem.value;
		if (ext != '')
		{
			ext = ext.substring(ext.length-3,ext.length);
			ext = ext.toLowerCase();
			if (ext != 'jpg' && ext != 'swf')
			{
				alert('O arquivo selecionado não poderá ser enviado. Formatos permitidos: JPG ou SWF!');
				theForm.imagem.focus();
				return false;
			}
		}
		ext_2 = theForm.imagem_2.value;
		if (ext_2 != '')
		{
			if (theForm.tem.value == '' && ext == '')
			{
				alert('Inclua as imagens na ordem correta!');
				theForm.imagem.focus();
				return false;
			}
			ext_2 = ext_2.substring(ext_2.length-3,ext_2.length);
			ext_2 = ext_2.toLowerCase();
			if (ext == 'swf' || ext_2 != 'jpg')
			{
				alert('O arquivo selecionado não poderá ser enviado. Formato permitido: JPG!');
				theForm.imagem_2.focus();
				return false;
			}
		}
		ext_3 = theForm.imagem_3.value;
		if (ext_3 != '')
		{
			if ((theForm.tem.value == '' && ext == '') || (theForm.tem_2.value == '' && ext_2 == ''))
			{
				alert('Inclua as imagens na ordem correta!');
				theForm.imagem_2.focus();
				return false;
			}
			ext_3 = ext_3.substring(ext_3.length-3,ext_3.length);
			ext_3 = ext_3.toLowerCase();
			if (ext == 'swf' || ext_3 != 'jpg')
			{
				alert('O arquivo selecionado não poderá ser enviado. Formato permitido: JPG!');
				theForm.imagem_3.focus();
				return false;
			}
		}
		if (ext != '' || ext_2 != '' || ext_3 != '')
			startupload(progressID);
	}
	return true;
}
function verificaSubmitNoticias(theForm,progressID)
{
	if (theForm.titulo.value == '')
	{
		alert('Digite o título!');
		theForm.titulo.focus();
		return false;
	}
	if (theForm.texto.value == '')
	{
		alert('Digite o texto!');
		theForm.texto.focus();
		return false;
	}
	ext = theForm.foto.value;
	if (theForm.acao.value != 'editar')
	{
		if (ext == '')
		{
			alert('Selecione a imagem!');
			theForm.foto.focus();
			return false;
		}
	}
	if (ext != '')
	{
		ext = ext.substring(ext.length-3,ext.length);
		ext = ext.toLowerCase();
		if (ext != 'jpg')
		{
			alert('O arquivo selecionado não poderá ser enviado. Formato permitido: JPG!');
			theForm.foto.focus();
			return false;
		}
	}
	ext1 = theForm.foto1.value;
	if (ext1 != '')
	{
		ext1 = ext1.substring(ext1.length-3,ext1.length);
		ext1 = ext1.toLowerCase();
		if (ext1 != 'jpg')
		{
			alert('O arquivo selecionado não poderá ser enviado. Formato permitido: JPG!');
			theForm.foto1.focus();
			return false;
		}
	}
	ext2 = theForm.foto2.value;
	if (ext2 != '')
	{
		ext2 = ext2.substring(ext2.length-3,ext2.length);
		ext2 = ext2.toLowerCase();
		if (ext2 != 'jpg')
		{
			alert('O arquivo selecionado não poderá ser enviado. Formato permitido: JPG!');
			theForm.foto2.focus();
			return false;
		}
	}
	ext3 = theForm.foto3.value;
	if (ext3 != '')
	{
		ext3 = ext3.substring(ext3.length-3,ext3.length);
		ext3 = ext3.toLowerCase();
		if (ext3 != 'jpg')
		{
			alert('O arquivo selecionado não poderá ser enviado. Formato permitido: JPG!');
			theForm.foto3.focus();
			return false;
		}
	}
	ext4 = theForm.foto4.value;
	if (ext4 != '')
	{
		ext4 = ext4.substring(ext4.length-3,ext4.length);
		ext4 = ext4.toLowerCase();
		if (ext4 != 'jpg')
		{
			alert('O arquivo selecionado não poderá ser enviado. Formato permitido: JPG!');
			theForm.foto4.focus();
			return false;
		}
	}
	if (ext != '' || ext1 != '' || ext2 != '' || ext3 != '' || ext4 != '')
	    startupload(progressID);
	return true;
}
function verificaSubmitAuto(access,theForm,theForm1,progressID)
{
	var z = 0;
	var encontrou = false;
	var acessor = '';
	while (theForm1[z].type == 'checkbox')
	{
		if (theForm1[z].checked)
		{
			encontrou = true;
			acessor += theForm1[z].value;
		}
		z++;
	}
	theForm.lista_acessorios.value = acessor;
	if (access == 'admin' && theForm.acao.value != 'editar')
	{
		if (theForm.revenda.selectedIndex == -1)
		{
			alert('Selecione a revenda!');
			theForm.revenda.focus();
			return false;
		}
	}
	if (theForm.tipo.selectedIndex == -1)
	{
		alert('Selecione o tipo!');
		theForm.tipo.focus();
		return false;
	}
	if (theForm.marca.selectedIndex == -1)
	{
		alert('Selecione a marca!');
		theForm.marca.focus();
		return false;
	}
	if (theForm.modelo.value == '')
	{
		alert('Digite o modelo!');
		theForm.modelo.focus();
		return false;
	}
	if (theForm.estado.selectedIndex == -1)
	{
		alert('Selecione o estado do veículo!');
		theForm.estado.focus();
		return false;
	}
	if (theForm.ano.value == '')
	{
		alert('Digite o ano/modelo! Formato: AAAA/AAAA');
		theForm.ano.focus();
		return false;
	}
	if (theForm.ano.value.length < 9)
	{
		alert('Digite o ano/modelo! Formato: AAAA/AAAA');
		theForm.ano.focus();
		return false;
	}
	if (theForm.cor.value == '')
	{
		alert('Digite a cor!');
		theForm.cor.focus();
		return false;
	}
	if (theForm.combustivel.selectedIndex == -1)
	{
		alert('Selecione o combustível!');
		theForm.combustivel.focus();
		return false;
	}
	ext_p = theForm.foto_p.value;
	if (ext_p != '')
	{
		ext_p = ext_p.substring(ext_p.length-3,ext_p.length);
		ext_p = ext_p.toLowerCase();
		if (ext_p != 'jpg')
		{
			alert('O arquivo selecionado não poderá ser enviado. Formato permitido: JPG!');
			theForm.foto_p.focus();
			return false;
		}
	}
	ext_1 = theForm.foto_1.value;
	if (ext_1 != '')
	{
		if (theForm.tem_p.value == '' && ext_p == '')
		{
			alert('Inclua as imagens na ordem correta!');
			theForm.foto_p.focus();
			return false;
		}
		ext_1 = ext_1.substring(ext_1.length-3,ext_1.length);
		ext_1 = ext_1.toLowerCase();
		if (ext_1 != 'jpg')
		{
			alert('O arquivo selecionado não poderá ser enviado. Formato permitido: JPG!');
			theForm.foto_1.focus();
			return false;
		}
	}
	ext_2 = theForm.foto_2.value;
	if (ext_2 != '')
	{
		if ((theForm.tem_p.value == '' && ext_p == '') || (theForm.tem_1.value == '' && ext_1 == ''))
		{
			alert('Inclua as imagens na ordem correta!');
			theForm.foto_p.focus();
			return false;
		}
		ext_2 = ext_2.substring(ext_2.length-3,ext_2.length);
		ext_2 = ext_2.toLowerCase();
		if (ext_2 != 'jpg')
		{
			alert('O arquivo selecionado não poderá ser enviado. Formato permitido: JPG!');
			theForm.foto_2.focus();
			return false;
		}
	}
	ext_3 = theForm.foto_3.value;
	if (ext_3 != '')
	{
		if ((theForm.tem_p.value == '' && ext_p == '') || (theForm.tem_1.value == '' && ext_1 == '') || (theForm.tem_2.value == '' && ext_2 == ''))
		{
			alert('Inclua as imagens na ordem correta!');
			theForm.foto_p.focus();
			return false;
		}
		ext_3 = ext_3.substring(ext_3.length-3,ext_3.length);
		ext_3 = ext_3.toLowerCase();
		if (ext_3 != 'jpg')
		{
			alert('O arquivo selecionado não poderá ser enviado. Formato permitido: JPG!');
			theForm.foto_3.focus();
			return false;
		}
	}
	ext_4 = theForm.foto_4.value;
	if (ext_4 != '')
	{
		if ((theForm.tem_p.value == '' && ext_p == '') || (theForm.tem_1.value == '' && ext_1 == '') || (theForm.tem_2.value == '' && ext_2 == '') || (theForm.tem_3.value == '' && ext_3 == ''))
		{
			alert('Inclua as imagens na ordem correta!');
			theForm.foto_p.focus();
			return false;
		}
		ext_4 = ext_4.substring(ext_4.length-3,ext_4.length);
		ext_4 = ext_4.toLowerCase();
		if (ext_4 != 'jpg')
		{
			alert('O arquivo selecionado não poderá ser enviado. Formato permitido: JPG!');
			theForm.foto_4.focus();
			return false;
		}
	}
	ext_5 = theForm.foto_5.value;
	if (ext_5 != '')
	{
		if ((theForm.tem_p.value == '' && ext_p == '') || (theForm.tem_1.value == '' && ext_1 == '') || (theForm.tem_2.value == '' && ext_2 == '') || (theForm.tem_3.value == '' && ext_3 == '') || (theForm.tem_4.value == '' && ext_4 == ''))
		{
			alert('Inclua as imagens na ordem correta!');
			theForm.foto_p.focus();
			return false;
		}
		ext_5 = ext_5.substring(ext_5.length-3,ext_5.length);
		ext_5 = ext_5.toLowerCase();
		if (ext_5 != 'jpg')
		{
			alert('O arquivo selecionado não poderá ser enviado. Formato permitido: JPG!');
			theForm.foto_5.focus();
			return false;
		}
	}
	if (ext_p != '' || ext_1 != '' || ext_2 != '' || ext_3 != '' || ext_4 != '' || ext_5 != '')
		startupload(progressID);
	return true;
}
function verificaSubmitSenha(theForm)
{
	if (theForm.login.value == '')
	{
		alert('Digite o login do usuário!');
		theForm.login.focus();
		return false;
	}
	if (theForm.senha1.value == '')
	{
		alert('Digite a senha!');
		theForm.senha1.focus();
		return false;
	}
	if (theForm.senha2.value == '')
	{
		alert('Confirme a senha!');
		theForm.senha2.focus();
		return false;
	}
	if (theForm.senha1.value != theForm.senha2.value)
	{
		alert('Confirmação de senha não confere!');
		theForm.senha1.focus();
		return false;
	}
	return true;
}
