    function isData(pVal) {
        alert(1);
        valor = document.getElementById(pVal).value;
        alert(valor);
        var reTipo = /^\d{1,2}\/\d{1,2}\/\d{1,4}$/;

        if (! reTipo.test(valor)) {
            alert('Data Invalida!');
            document.getElementById(pVal).focus();
            return;
        }
    }

    function isEmail(pVal) {
        valor = document.getElementById(pVal).value;
    
	    var reTipo = /^[\w!#$%&'*+\/=?^`{|}~-]+(\.[\w!#$%&'*+\/=?^`{|}~-]+)*@(([\w-]+\.)+[A-Za-z]{2,6}|\[\d{1,3}(\.\d{1,3}){3}\])$/;
	    if (! reTipo.test(valor)) {
            alert('E-mail Invalido!');
            document.getElementById(pVal).focus();
            return;
        }
    }

    function isCPF(pVal) {
        var i;

        s = document.getElementById(pVal).value;
        var c = s.substr(0,9);
        var dv = s.substr(9,2);
        var d1 = 0;

        for (i = 0; i < 9; i++) {
            d1 += c.charAt(i)*(10-i);
        }

        if (d1 == 0) {
            alert("CPF Invalido");
            document.getElementById(pVal).focus();
            return;
        }

        d1 = 11 - (d1 % 11);
        if (d1 > 9) d1 = 0;

        if (dv.charAt(0) != d1) {
            alert("CPF Invalido");
            document.getElementById(pVal).focus();
            return;
        }

        d1 *= 2;
        for (i = 0; i < 9; i++) {
             d1 += c.charAt(i)*(11-i);
        }

        d1 = 11 - (d1 % 11);

        if (d1 > 9) d1 = 0;

        if (dv.charAt(1) != d1) {
            alert("CPF Invalido");
            document.getElementById(pVal).focus();
            return;
        }

        return true;
    }
    
    function formatMask(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);
		}
	}

