
    function ManejaCar(tipo, b, val, thiss) {
        //N = solo numeros					, si b = 1 permite negativos
        //D = numeros decimales			, si b = 1 permite negativos
        //J = solo letras Mayusculas       , si b = 1 permite espacio en blanco
        //A = Alfanumericos Mayusculas	    , si b = 1 permite espacio en blanco
        //a = Alfanumericos Minusculas	    , si b = 1 permite espacio en blanco
        //C = Solo letras Mayusculas		, si b = 1 permite espacio en blanco
        //c = Solo letras Minusculas		, si b = 1 permite espacio en blanco
        //P = Alfanumericos				, si b = 1 permite espacio en blanco. Permite punto, coma, comillas y guiones
        //F = Fechas						, solo numeros y "/" no se valida el valor de b
        //B = Cuentas de banco				, enteros y "-", si b = 1 NO permite el guion
        //R = Direcciones de Internet      , alfanumericos minusculas, punto y diagonal
        //M = Email                        , alfanumericos minusculas, punto, guion bajo, medio y arroba


        // Habilitar botton Actualizar  dnn$ctr428$ViewnavegacionCatalogo$Rptctrl$ctl00$  
        //                              dnn_ctr428_ViewnavegacionCatalogo_Rptctrl_idid_0

            var linea = new String(thiss.name);

            lista = linea.split("$")
          //  var nombrebtnupdate = new String(lista[0] + '$' + lista[1] + '$' + lista[2] + '$' + lista[3] + '$'  + 'ImgActualizar');
           
           var nombrebtnupdate =  'dnn$ctr428$ViewnavegacionCatalogo$Rptctrl$' + lista[4] + '$ImgActualizar';

            var control = document.getElementsByTagName('input');

            for (var i = 0; i < control.length; i++) 
            {
                if (control[i].name == nombrebtnupdate && control[i].type != 'hidden' && control[i].type != 'text') 
                {
                    control[i].disabled = false;
                    control[i].src = 'DesktopModules/viacoop.navegacionCatalogo/img/actualizar_on.gif';
                    i = control.length;
                }
            }





        var band = false;
        var c = event.keyCode;
        var str = new String(val);

        switch (tipo) {
            case 'N':
                if (c >= 48 && c <= 57) { band = true; }
                if (c == 45 && str == '' && b == 1) { band = true; }
                break;
            case 'D':
                if (c >= 48 && c <= 57) { band = true; }
                if (c == 46 && str.indexOf('.', 0) == -1 && str.length > 0) { band = true; }
                if (c == 45 && str == '' && b == 1) { band = true; }
                break;
            case 'A':
                if ((c >= 65 && c <= 90) || (c >= 97 && c <= 122) || (c == 241) || (c == 209)) { band = true; }
                if (c >= 48 && c <= 57) { band = true; }
                if ((c >= 97 && c <= 122) || (c == 241)) { event.keyCode = c - 32; }
                if (c == 32 && b == 1) { band = true; }
                if ((c > 192) && (c < 255)) { band = true; }
                break;
            case 'J':
                if ((c >= 65 && c <= 90) || (c >= 97 && c <= 122) || (c == 241) || (c == 209)) { band = true; }
                if ((c >= 97 && c <= 122) || (c == 241)) { event.keyCode = c - 32; }
                if (c == 32 && b == 1) { band = true; }
                break;
            case 'a':
                if ((c >= 65 && c <= 90) || (c >= 97 && c <= 122) || (c == 241) || (c == 209)) { band = true; }
                if (c >= 48 && c <= 57) { band = true; }
                if (c == 32 && b == 1) { band = true; }
                if ((c > 192) && (c < 255)) { band = true; }
                break;
            case 'C':
                if ((c >= 65 && c <= 90) || (c >= 97 && c <= 122) || (c == 241) || (c == 209)) { band = true; }
                if ((c >= 97 && c <= 122) || (c == 241)) { event.keyCode = c - 32; }
                if (c == 32 && b == 1) { band = true; }
                if ((c > 192) && (c < 255)) { band = true; }
                break;
            case 'c':
                if ((c >= 65 && c <= 90) || (c >= 97 && c <= 122) || (c == 241) || (c == 209)) { band = true; }
                if (c == 32 && b == 1) { band = true; }
                if ((c > 192) && (c < 255)) { band = true; }
                break;

            case 'F':
                if ((c >= 48 && c <= 57) || (c == 47)) { band = true; }
                break;

            case 'B':
                if (c >= 48 && c <= 57) { band = true; }
                if (c == 45 && b == 0) { band = true; }
                break;

            case 'P':
                if ((c >= 65 && c <= 90) || (c >= 97 && c <= 122) || (c == 241) || (c == 209) || (c == 165)) { band = true; }
                if (c >= 48 && c <= 57) { band = true; }
                if (c == 32 && b == 1) { band = true; }
                if ((c == 46) || (c == 44) || (c == 34) || (c == 45) || (c == 95) || (c == 38) || (c == 64) || (c == 58) || (c == 59)) { band = true; }
                if ((c >= 97 && c <= 122) || (c == 241)) { event.keyCode = c - 32; }
                if (c == 47 && b == 1) { band = true; }
                if ((c > 192) && (c < 255)) { band = true; }
                break;

            case 'p':
                if ((c >= 65 && c <= 90) || (c >= 97 && c <= 122) || (c == 241) || (c == 209)) { band = true; }
                if (c >= 48 && c <= 57) { band = true; }
                if (c == 32 && b == 1) { band = true; }
                if ((c == 46) || (c == 44) || (c == 34) || (c == 45) || (c == 95) || (c == 38) || (c == 64)) { band = true; }
                if ((c >= 65 && c <= 90) || (c == 241)) { event.keyCode = c + 32; }
                if (c == 165) { event.keyCode = c - 1; }
                if (c == 47) { band = true; }
                break;

            case 'R':
                if ((c >= 65 && c <= 90) || (c >= 97 && c <= 122) || (c == 241) || (c == 209)) { band = true; }
                if (c >= 48 && c <= 57) { band = true; }
                if (c == 32 && b == 1) { band = true; }
                if ((c == 46) || (c == 47)) { band = true; }
                break;
            case 'M':
                if (c >= 97 && c <= 122) { band = true; }
                if (c >= 48 && c <= 57) { band = true; }
                if ((c == 46) || (c == 64)) { band = true; }
                if ((c == 95) || (c == 45)) { band = true; }
                break;

        }
        event.returnValue = band;
    }


