﻿/*
Scripts utilizados pelas páginas do HMT.
Analista/Desenvolvedor: Érico Eustáquio
Data: 19/01/2009
*/

function formatar(src, mask) {
    var i = src.value.length;
    var saida = mask.substring(0, 1);
    var texto = mask.substring(i)

    if (texto.substring(0, 1) != saida) {
        src.value += texto.substring(0, 1);
    }
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
    if (init == true) with (navigator) {
        if ((appName == "Netscape") && (parseInt(appVersion) == 4)) {
            document.MM_pgW = innerWidth; document.MM_pgH = innerHeight; onresize = MM_reloadPage;
        }
    }
    else if (innerWidth != document.MM_pgW || innerHeight != document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function TextBoxCaixaAlta_OnKeyUp(fsValor, foForm, foNome) {
    if (window.event.keyCode >= 65 && window.event.keyCode <= 90) {
        x = new String(document.forms[foForm].elements[foNome].value);
        document.forms[foForm].elements[foNome].value = x.toUpperCase();
    }
}

function TextBoxCaixaAlta_OnBlur(fsValor, foForm, foNome) {
    var tam = 0;
    x = new String(document.forms[foForm].elements[foNome].value);
    while (tam != x.length) {
        tam = x.length;
        x = x.replace('\'', '');
    }
    document.forms[foForm].elements[foNome].value = x.toUpperCase();
}
