function fFormataCampoData(event, obj, nextField) {
obj.maxLength = 10;
    if (event.keyCode < 48 || event.keyCode > 57) event.returnValue = false;

    if (obj.value.length == 2)
        obj.value += "/";
    if (obj.value.length == 5)
        obj.value += "/";

    if (obj.value.length == 9) {
        if (nextField != null) {
            window.setTimeout("document.getElementById('" + nextField + "').focus();", 10);
        }
    }
}

function fFormataCampoHora(event, obj, nextField) {
 obj.maxLength = 8;
    if (event.keyCode < 48 || event.keyCode > 57) event.returnValue = false;

    if (obj.value.length == 2)
        obj.value += ":";
    if (obj.value.length == 5)
        obj.value += ":";

    if (obj.value.length == 7) {
        if (nextField != null) {
            window.setTimeout("document.getElementById('" + nextField + "').focus();", 10);
        }
    }
}

function fFormataCampoCPF(event, obj, nextField) {
    obj.maxLength = 14;
    if (event.keyCode < 48 || event.keyCode > 57) event.returnValue = false;

    if (obj.value.length == 3)
        obj.value += ".";
    if (obj.value.length == 7)
        obj.value += ".";
    if (obj.value.length == 11)
        obj.value += "-";

    if (obj.value.length == 13) {
        if (nextField != null) {
            window.setTimeout("document.getElementById('" + nextField + "').focus();", 10);
        }
    }
}

//**** função para somente números (onkeypress)
function onlyNumbersForDataTime() {
    if (event.keyCode < 47 || event.keyCode > 58) event.returnValue = false;
}