﻿// JScript File

function MascData(txt){
    var strData = ''; 
    strData = strData + txt.value; 
    if (strData.length == 2){ 
    strData = strData + '/'; 
    txt.value = strData; 
    } 
    if (strData.length == 5){ 
        strData = strData + '/'; 
    txt.value = strData; 
     } 

}
function MascTelefone(txt){
     var strTelefone = '';
       strTelefone = strTelefone + txt.value;
       if (strTelefone.length == 1) {
          strTelefone = '(' + strTelefone;
          txt.value = strTelefone;
        }
       if (strTelefone.length == 3) {
          strTelefone = strTelefone + ')';
          txt.value = strTelefone;
        }
         if (strTelefone.length == 7) {
          strTelefone = strTelefone + '-';
          txt.value = strTelefone;
        }
        if (strTelefone.length == 13) {
          strTelefone = strTelefone.replace('-','');
          strTelefone = strTelefone.substring(0,8) + '-' + strTelefone.substring(8);
          txt.value = strTelefone;
        }
      
   }

function MascCPF(txt)
     {
       var mycpf = '';
       mycpf = mycpf + txt.value;
       if (mycpf.length == 3) {
          mycpf = mycpf + '.';
          txt.value = mycpf;
        }
       if (mycpf.length == 7) {
          mycpf = mycpf + '.';
          txt.value = mycpf;
        }
       if (mycpf.length == 11) {
          mycpf = mycpf + '-';
          txt.value = mycpf;
        }
       if (mycpf.length == 14) {
        }
     }
