﻿function Down() {
    window.scroll(0, 220000)
}

function alerta(mensagem) {
    alert(mensagem);
}

var win = null;
function windowOpen(mypage, myname, w, h, features) {
    var winl = (screen.width - w) / 2;
    var wint = (screen.height - h) / 2;
    if (winl < 0) winl = 0;
    if (wint < 0) wint = 0;
    var settings = 'height=' + h + ',';
    settings += 'width=' + w + ',';
    settings += 'top=' + wint + ',';
    settings += 'left=' + winl + ',';
    settings += 'alwaysRaised=yes,';
    settings += features;
    win = window.open(mypage, myname, settings);
    win.window.focus();
}

function escrever(conteudo) {
    document.write(conteudo);
}
function mascaraData(formato, keypress, objeto) {
    campo = eval(objeto);
    if (formato == 'DATA') {
        caracteres = '01234567890';
        separacoes = 1;
        separacao1 = '/';
        conjuntos = 3;
        conjunto1 = 2;
        conjunto2 = 5;
        if ((caracteres.search(String.fromCharCode(keypress)) != -1) && campo.value.length <
(conjunto1 + conjunto2 + 1)) {
            if (campo.value.length == conjunto1)
                campo.value = campo.value + separacao1;
            if (campo.value.length == conjunto2)
                campo.value = campo.value + separacao1;

        }
        else
            campo.value = campo.value;
    }

    if (formato == 'MESANO') {
        caracteres = '01234567890';
        separacoes = 1;
        separacao1 = '/';
        conjuntos = 2;
        conjunto1 = 2;
        conjunto2 = 4;
        if ((caracteres.search(String.fromCharCode(keypress)) != -1) && campo.value.length <
(conjunto1 + conjunto2 + 1)) {
            if (campo.value.length == conjunto1)
                campo.value = campo.value + separacao1;
        }
        else
            event.returnValue = false;
    }
}