function aparecer(valor)
{
    var valor = valor;
    if(document.getElementById(valor).style.display == 'none') {
		document.getElementById(valor).style.display = '';
	} 
	else {
		document.getElementById(valor).style.display = 'none';
	}
}

function checaDados() {
	if (document.pedido.razao_social.value == "") {
		alert("A Razão Social deve ser preenchida.");
		document.pedido.razao_social.focus();
		return false;
	}
	else if (document.pedido.endereco.value == "") {
		alert("O endereço deve ser preenchido.");
		document.pedido.endereco.focus();
		return false;
	}
	else if (document.pedido.local.value == "") {
		alert("O cep deve ser preenchido.");
		document.pedido.cep.focus();
		return false;
	}
	else if (document.pedido.cnpj.value == "") {
		alert("O cnpj deve ser preenchido.");
		document.pedido.cnpj.focus();
		return false;
	}
	else if (document.pedido.inscr_estadual.value == "") {
		alert("Incrição Estadual deve ser preenchida.");
		document.pedido.inscr_estadual.focus();
		return false;
	}
	else if (document.pedido.dt_entrega_dia.value == "") {
		alert("Dia da data de entrega deve ser preenchido.");
		document.pedido.dt_entrega_dia.focus();
		return false;
	}
	else if (document.pedido.dt_entrega_mes.value == "") {
		alert("Mês de entrega deve ser preenchido.");
		document.pedido.dt_entrega_mes.focus();
		return false;
	}
	else if (document.pedido.dt_entrega_ano.value == "") {
		alert("Ano de entrega deve ser preenchido.");
		document.pedido.dt_entrega_ano.focus();
		return false;
	}
	else if (document.pedido.end_entrega.value == "") {
		alert("Endereço de entrega deve ser preenchido.");
		document.pedido.end_entrega.focus();
		return false;
	}
	else if (document.pedido.pes_entrega.value == "") {
		alert("Pessoa a procurar para entrega\ndeve ser preenchido.");
		document.pedido.pes_entrega.focus();
		return false;
	}
	else if (document.pedido.hr_entrega.value == "") {
		alert("Hora da entrega deve ser preenchido.");
		document.pedido.hr_entrega.focus();
		return false;
	}
	else if (document.pedido.dt_retirada_dia.value == "") {
		alert("Dia da data da retirada deve ser preenchido.");
		document.pedido.dt_retirada_dia.focus();
		return false;
	}
	else if (document.pedido.dt_retirada_mes.value == "") {
		alert("Mês da retirada deve ser preenchido.");
		document.pedido.dt_retirada_mes.focus();
		return false;
	}
	else if (document.pedido.dt_retirada_ano.value == "") {
		alert("Ano da retirada deve ser preenchido.");
		document.pedido.dt_retirada_ano.focus();
		return false;
	}
	else if (document.pedido.end_retirada.value == "") {
		alert("Endereço da retirada deve ser preenchido.");
		document.pedido.end_retirada.focus();
		return false;
	}
	else if (document.pedido.pes_retirada.value == "") {
		alert("Pessoa a procurar para retirada\ndeve ser preenchido.");
		document.pedido.pes_retirada.focus();
		return false;
	}
	else if (document.pedido.hr_retirada.value == "") {
		alert("Hora da retirada deve ser preenchido.");
		document.pedido.hr_retirada.focus();
		return false;
	}
	else {
		return true;
	}
}

function mascaras(formulario){
		document.frmExample.reset();

		oStringMask = new Mask("(##) ####-####");
		oStringMask.attach(document.frmExample.string);

		oDateMask = new Mask("mm/dd/yyyy", "date");
		oDateMask.attach(document.frmExample.date);

		oNumberMask = new Mask("$#,###.00", "number");
		oNumberMask.attach(document.frmExample.number);
}

function formatTel(valor) {
	oStringMask = new Mask("(##) ####-####");
	oStringMask.attach(valor);
}
function formatData(valor) {
	oDateMask = new Mask("dd/mm/yyyy", "date");
	oDateMask.attach(valor);
}
function formatHora(valor) {
	oStringMask = new Mask("##:##");
	oStringMask.attach(valor);
}
function formatCEP(valor) {
	oStringMask = new Mask("#####-###");
	oStringMask.attach(valor);
}
function formatNum(valor) {
	oStringMask = new Mask("########");
	oStringMask.attach(valor);
}


function ativar(valor) {
	var valor = valor;
    	valor.style.backgroundColor = '#ffffff';
    	valor.style.borderColor = 'red';
        valor.style.color = '#000';
	}
	
function desativar(valor) {
	var valor = valor;
		valor.style.backgroundColor = '';
		valor.style.borderColor = '';	
        valor.style.color = '';
}

function verifica() {
	
	f = document.orcamento.empresa.value;
	window.alert(f);

}

