﻿function openDiv(elName) { var theElemenet = document.getElementById(elName); if (theElemenet) { theElemenet.style.display = "block"; } }
function closeDiv(elName) { var theElemenet = document.getElementById(elName); if (theElemenet) { theElemenet.style.display = "none"; } }


function openDiv(elName, estilo) {
    var theElemenet = document.getElementById(elName);
    if (theElemenet) {
        theElemenet.style.display = "block";
        theElemenet.setAttribute("class", estilo);
    }
}
function closeDiv(elName, estilo) {
    var theElemenet = document.getElementById(elName);
    if (theElemenet) {
        theElemenet.style.display = "none";
        theElemenet.setAttribute("class", estilo);
    }
}
function TextBoxWatermark(idinputText, mascara, cssOnFocus, cssOnBlur) {
    if (!cssOnFocus)
        cssOnFocus = ""; if (!cssOnBlur)
        cssOnBlur = ""; idinputText = "#" + idinputText; $(idinputText).val(mascara); $(idinputText).focus(function () { $(this).filter(function () { return $(this).val() == "" || $(this).val() == mascara; }).removeClass(cssOnBlur).addClass(cssOnFocus).val(""); }); $(idinputText).blur(function () { $(this).filter(function () { return $(this).val() == ""; }).removeClass(cssOnFocus).addClass(cssOnBlur).val(mascara); })
}
function formatar_mascara(src, mascara) {
    var campo = src.value.length;
    var saida = mascara.substring(0, 1);
    var texto = mascara.substring(campo);
    if (texto.substring(0, 1) != saida) {
        src.value += texto.substring(0, 1);
    }
}

