function sendEmailLetter() 
{
    if ((document.all.Formulario.txtemailletter.value == '') || (document.all.Formulario.txtNomeletter == ''))
    {
        alert('Os campos devem ser preenchidos\n\n');
        document.all.Formulario.txtNomeletter.focus();
        return false;
    }
    document.all.Formulario.txtNewsLetter.value = 'NewsLetter';
    document.all.Formulario.submit();
}

function sendEmail() 
{
    if(verifyFields())
    {
        document.all.Formulario.submit();
    }
}

function verifyFields() {
    var ret = true;
    var col = document.all.Formulario.elements("VALIDAR");
    var msg = '';
    var objP = null;
    if(col != null)
    {
        for(i = 0; i < col.length ; i++)
        {
            var obj = col[i];
            if(obj.tagName == "SELECT")
            {
                if(obj.value == '') {
                    objP = obj.parentElement;
                    while(objP.tagName != 'TD') objP = objP.parentElement;
                    if(objP.id != null)
                        msg += (objP.id + '\n');
                    ret = false;
                }
            } else if(obj.tagName == "INPUT") {
                if(obj.type == 'text' || obj.type == 'password' || obj.type == 'textarea')
                {
                    if(obj.value == '') {
                        objP = obj.parentElement;
                        while(objP.tagName != 'TD') objP = objP.parentElement;
                        if(objP.id != null)
                            msg += (objP.id + '\n');
                        ret = false;
                    }
                } else if(obj.type == 'radio') {
                    if(obj.value == 'Reset') ret = false;
                }
            } else if(obj.tagName == "TEXTAREA") {
                if(obj.value == '') {
                    objP = obj.parentElement;
                    while(objP.tagName != 'TD') objP = objP.parentElement;
                    if(objP.id != null)
                        msg += (objP.id + '\n');
                    ret = false;
                }
            }
        }
    } else { ret= false; }
    if(!ret)
    {
        alert('Os seguintes campos devem ser preenchidos\n\n'+msg);
    }
    return ret;
}
