function valida_orc(theForm){

	

	var msgErro = document.getElementById("msgErro");

	msgErro.innerHTML = "";

	msgErro.className = "";

	

	var nome = document.getElementById("nome");

	if (theForm.nome.value == ""){

		nome.style.color = "#CC0000";

		theForm.nome.focus();

		msgErro.innerHTML = "Por favor, verifique o preencimento dos campos obrigatorios";

		msgErro.className = "erro";

		return (false);

	}else{

		nome.style.color = "#000000";	

	}

	

//validar email

//validar email
var email = document.getElementById("email");
	if (theForm.email.value == ""){
		email.style.color = "#CC0000";
		theForm.email.focus();
		msgErro.innerHTML = "Por favor, digite seu e-mail";
		msgErro.className = "erro";
		return (false);
	}else{
		email.style.color = "#666666";	
	}
	
	var email = document.getElementById("email");
	var filtro=/^.+@.+\..{2,3}$/;
	if (filtro.test(theForm.email.value) == false){
		email.style.color = "#CC0000";
		theForm.email.focus();
		msgErro.innerHTML = "E-mail inválido";
		msgErro.className = "erro";
		return (false);
	}else{
		email.style.color = "#666666";	
	}

	

	

	var ddd = document.getElementById("ddd");

	if (theForm.ddd.value == ""){

		ddd.style.color = "#CC0000";

		theForm.ddd.focus();

		msgErro.innerHTML = "Por favor, digite seu DDD.";

		msgErro.className = "erro";

		return (false);

	}else{

		ddd.style.color = "#000000";	

	}

	

	var fone = document.getElementById("fone");

	if (theForm.fone.value == ""){

		ddd.style.color = "#CC0000";

		theForm.fone.focus();

		msgErro.innerHTML = "Por favor, digite seu Telefone.";

		msgErro.className = "erro";

		return (false);

	}else{

		fone.style.color = "#000000";	

	}

	

	var cidade = document.getElementById("cidade");

	if (theForm.cidade.value == ""){

		cidade.style.color = "#CC0000";

		theForm.cidade.focus();

		msgErro.innerHTML = "Por favor, digite sua cidade.";

		msgErro.className = "erro";

		return (false);

	}else{

		cidade.style.color = "#000000";	

	}

	



	

	var locatario = document.getElementById("locatario");

	if (theForm.locatario.value == "0"){

		locatario.style.color = "#CC0000";

		theForm.locatario.focus();

		msgErro.innerHTML = "Por favor, escolha o tipo de locatário.";

		msgErro.className = "erro";

		return (false);

	}else{

		locatario.style.color = "#000000";	

	}

	

	var locacao = document.getElementById("locacao");

	if (theForm.locacao.value == "0"){

		locacao.style.color = "#CC0000";

		theForm.locacao.focus();

		msgErro.innerHTML = "Por favor, escolha o tipo de locacăo.";

		msgErro.className = "erro";

		return (false);

	}else{

		locacao.style.color = "#000000";	

	}

	

	var tipo = document.getElementById("tipo");

	if (theForm.tipo.value == "0"){

		tipo.style.color = "#CC0000";

		theForm.tipo.focus();

		msgErro.innerHTML = "Por favor, escolha o tipo do imóvel.";

		msgErro.className = "erro";

		return (false);

	}else{

		tipo.style.color = "#000000";	

	}

	

	var atividade = document.getElementById("atividade");

	if (theForm.atividade.value == "0"){

		atividade.style.color = "#CC0000";

		theForm.atividade.focus();

		msgErro.innerHTML = "Por favor, escolha o atividade.";

		msgErro.className = "erro";

		return (false);

	}else{

		atividade.style.color = "#000000";	

	}

	

}





function amf2005_BecameCurrency(cur,len)

{

   n='__0123456789';

   d=cur.value;

   l=d.length;

   r='';

   if (l > 0)

   {

    z=d.substr(0,l-1);

    s='';

    a=2;

    for (i=0; i < l; i++)

    {

        c=d.charAt(i);

        if (n.indexOf(c) > a)

        {

            a=1;

            s+=c;

        };

    };

    l=s.length;

    t=len-1;

    if (l > t)

    {

        l=t;

        s=s.substr(0,t);

    };

    if (l > 2)

    {

        r=s.substr(0,l-2)+','+s.substr(l-2,2);

    }

    else

    {

        if (l == 2)

        {

            r='0,'+s;

        }

        else

        {

            if (l == 1)

            {

                r='0,0'+s;

            };

        };

    };

    if (r == '')

    {

        r='0,00';

    }

    else

    {

        l=r.length;

        if (l > 6)

        {

            j=l%3;

            w=r.substr(0,j);

            wa=r.substr(j,l-j-6);

            wb=r.substr(l-6,6);

            if (j > 0)

            {

                w+='.';

            };

            k=(l-j)/3-2;

            for (i=0; i < k; i++)

            {

                w+=wa.substr(i*3,3)+'.';

            };

            r=w+wb;

        };

    };

   };

   if (r.length <= len)

   {

    cur.value=r;

   }

   else

   {

    cur.value=z;

   };

   return 'ok';

};