function lembrar_senha()
{
    document.getElementById('frm').style.display = "none";
    document.getElementById('frm_email').style.display = "block";
    document.getElementById('div_ajuda').innerHTML = "Você receberá seu login e senha por e-mail. Favor digitar seu e-mail.";    
    document.getElementById('email').focus();
}

//Valida o formulário de login.
function enviar_email()
{
    if (!document.getElementById('email').value.match(/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org)|(\..{2,2}))$)\b/gi)) 
    {
        document.getElementById('div_ajuda').innerHTML = "Digite corretamente o e-mail.";
        document.getElementById('email').focus();
        return false;
    }
    return true;
}

//Valida o formulário de login.
function enviar_login()
{

    if (document.getElementById('login').value.length == 0)
    {
        document.getElementById('div_ajuda').innerHTML = "Digite o login.";
        document.getElementById('login').focus();
        return false;
    }
    if (document.getElementById('senha').value.length == 0) 
    {
        document.getElementById('div_ajuda').innerHTML = "Digite a senha.";
        document.getElementById('senha').focus();
        return false;
    }
    if (document.getElementById('img_seta').src.indexOf('ck_1') != -1)
    {
        input = document.createElement('input');
        input.setAttribute('type', 'hidden');
        input.setAttribute('name', 'lembrar_senha');
        input.setAttribute('value', '1');

        frm = document.getElementById('frm');
        frm.appendChild(input);
    }

    return true;
}

function focus_input()
{
    document.getElementById('login').focus();
}


function muda_imagem(obj)
{
    obj.src = (obj.src.indexOf('ck_0') != -1) ? 'site_imgs/ck_1.gif':'site_imgs/ck_0.gif';
}

window.onload = focus_input;

/*
HTMLElement.prototype.onload setter = function (str) {

}
*/