/**
 * Funções JS para covel
 *
*/

function carregandoAjax(div,mensagem)
{
	document.getElementById(''+div+'').innerHTML = ''+mensagem+'';
}

function selecionaCidades(uf)
{
	carregandoAjax('span_cidades','Carregando...');
	xajax_x_selecionacidades(uf);
}

function limpaForm()
{
	if (document.getElementById('loja'))
		document.getElementById('loja').value          = "";

	if (document.getElementById('forma_pagamento'))
		document.getElementById('forma_pagamento').value = "";

	if (document.getElementById('cor'))
		document.getElementById('cor').value          = "";

	if (document.getElementById('nome'))
		document.getElementById('nome').value          = "";

	if (document.getElementById('email'))
		document.getElementById('email').value         = "";

	if (document.getElementById('ddd_telefone'))
		document.getElementById('ddd_telefone').value  = "";

	if (document.getElementById('telefone'))
		document.getElementById('telefone').value      = "";

	if (document.getElementById('ddd_celular'))
		document.getElementById('ddd_celular').value   = "";

	if (document.getElementById('celular'))
		document.getElementById('celular').value       = "";

	if (document.getElementById('moto'))
		document.getElementById('moto').value          = "";

	if (document.getElementById('ano'))
		document.getElementById('ano').value           = "";

	if (document.getElementById('placa'))
		document.getElementById('placa').value         = "";

	if (document.getElementById('quilometragem'))
		document.getElementById('quilometragem').value = "";

	if (document.getElementById('data'))
		document.getElementById('data').value          = "";

	if (document.getElementById('horario'))
		document.getElementById('horario').value       = "";

	if (document.getElementById('solicitacao'))
		document.getElementById('solicitacao').value   = "";

	if (document.getElementById('uf'))
		document.getElementById('uf').value            = "";

	if (document.getElementById('cidade'))
		document.getElementById('cidade').value        = "";

	if (document.getElementById('observacoes'))
		document.getElementById('observacoes').value   = "";

	if (document.getElementById('marca_usado'))
		document.getElementById('marca_usado').value   = "";

	if (document.getElementById('modelo_usado'))
		document.getElementById('modelo_usado').value   = "";

	if (document.getElementById('ano_usado'))
		document.getElementById('ano_usado').value   = "";

	if (document.getElementById('cor_usado'))
		document.getElementById('cor_usado').value   = "";

	if (document.getElementById('opcionais_usado'))
		document.getElementById('opcionais_usado').value   = "";
}

function formStatus(status)
{
	if (document.getElementById('loja'))
		document.getElementById('loja').disabled          = status;

	if (document.getElementById('cor'))
		document.getElementById('cor').disabled          = status;

	if (document.getElementById('forma_pagamento'))
		document.getElementById('forma_pagamento').disabled = status;

	if (document.getElementById('nome'))
		document.getElementById('nome').disabled          = status;

	if (document.getElementById('email'))
		document.getElementById('email').disabled         = status;

	if (document.getElementById('ddd_telefone'))
		document.getElementById('ddd_telefone').disabled  = status;

	if (document.getElementById('telefone'))
		document.getElementById('telefone').disabled      = status;

	if (document.getElementById('ddd_celular'))
		document.getElementById('ddd_celular').disabled   = status;

	if (document.getElementById('celular'))
		document.getElementById('celular').disabled       = status;

	if (document.getElementById('moto'))
		document.getElementById('moto').disabled          = status;

	if (document.getElementById('ano'))
		document.getElementById('ano').disabled           = status;

	if (document.getElementById('placa'))
		document.getElementById('placa').disabled         = status;

	if (document.getElementById('quilometragem'))
		document.getElementById('quilometragem').disabled = status;

	if (document.getElementById('data'))
		document.getElementById('data').disabled          = status;

	if (document.getElementById('horario'))
		document.getElementById('horario').disabled       = status;

	if (document.getElementById('solicitacao'))
		document.getElementById('solicitacao').disabled   = status;

	if (document.getElementById('uf'))
		document.getElementById('uf').disabled            = status;

	if (document.getElementById('cidade'))
		document.getElementById('cidade').disabled        = status;

	if (document.getElementById('observacoes'))
		document.getElementById('observacoes').disabled   = status;

	if (document.getElementById('marca_usado'))
		document.getElementById('marca_usado').disabled   = status;

	if (document.getElementById('modelo_usado'))
		document.getElementById('modelo_usado').disabled  = status;

	if (document.getElementById('ano_usado'))
		document.getElementById('ano_usado').disabled         = status;

	if (document.getElementById('cor_usado'))
		document.getElementById('cor_usado').disabled         = status;

	if (document.getElementById('opcionais_usado'))
		document.getElementById('opcionais_usado').disabled   = status;
}