/*(function($) {
*
 * Allows only valid characters to be entered into input boxes.
 * Note: does not validate that the final text is a valid number
 * (that could be done by another script, or server-side)
 *
 * @name     numeric
 * @param    decimal      Decimal separator (e.g. '.' or ',' - default is '.'). Pass false for integers
 * @param    callback     A function that runs if the number is not valid (fires onblur)
 * @author   Sam Collett (http://www.texotela.co.uk)
 * @example  $(".numeric").numeric();
 * @example  $(".numeric").numeric(",");
 * @example  $(".numeric").numeric(null, callback);
 *
 *
$.fn.numeric = function(decimal, callback)
{
	decimal = (decimal === false) ? "" : decimal || ".";
	callback = typeof callback == "function" ? callback : function(){};
	return this.data("numeric.decimal", decimal).data("numeric.callback", callback).keypress($.fn.numeric.keypress).blur($.fn.numeric.blur);
}

$.fn.numeric.keypress = function(e)
{
	var decimal = $.data(this, "numeric.decimal");
	var key = e.charCode ? e.charCode : e.keyCode ? e.keyCode : 0;
	// allow enter/return key (only when in an input box)
	if(key == 13 && this.nodeName.toLowerCase() == "input")
	{
		return true;
	}
	else if(key == 13)
	{
		return false;
	}
	var allow = false;
	// allow Ctrl+A
	if((e.ctrlKey && key == 97 ) || (e.ctrlKey && key == 65) ) return true;
	// allow Ctrl+X (cut)
	if((e.ctrlKey && key == 120 ) || (e.ctrlKey && key == 88) ) return true;
	// allow Ctrl+C (copy)
	if((e.ctrlKey && key == 99 ) || (e.ctrlKey && key == 67) ) return true;
	// allow Ctrl+Z (undo)
	if((e.ctrlKey && key == 122 ) || (e.ctrlKey && key == 90) ) return true;
	// allow or deny Ctrl+V (paste), Shift+Ins
	if((e.ctrlKey && key == 118 ) || (e.ctrlKey && key == 86) 
	|| (e.shiftKey && key == 45)) return true;
	// if a number was not pressed
	if(key < 48 || key > 57)
	{

		if(key == 45 && this.value.length == 0) return true;
		if(decimal && key == decimal.charCodeAt(0) && this.value.indexOf(decimal) != -1)
		{
			allow = false;
		}
		// check for other keys that have special purposes
		if(
			key != 8  &&
			key != 9  &&
			key != 13 &&
			key != 35 &&
			key != 36 &&
			key != 37 &&
			key != 39 &&
			key != 46 
		)
		{
			allow = false;
		}
		else
		{
			// for detecting special keys (listed above)
			// IE does not support 'charCode' and ignores them in keypress anyway
			if(typeof e.charCode != "undefined")
			{
				// special keys have 'keyCode' and 'which' the same (e.g. backspace)
				if(e.keyCode == e.which && e.which != 0)
				{
					allow = true;
					// . and delete share the same code, don't allow . (will be set to true later if it is the decimal point)
					if(e.which == 46) allow = false;
				}
				// or keyCode != 0 and 'charCode'/'which' = 0
				else if(e.keyCode != 0 && e.charCode == 0 && e.which == 0)
				{
					allow = true;
				}
			}
		}
		// if key pressed is the decimal and it is not already in the field
		if(decimal && key == decimal.charCodeAt(0))
		{
			if(this.value.indexOf(decimal) == -1)
			{
				allow = true;
			}
			else
			{
				allow = false;
			}
		}
	}
	else
	{
		allow = true;
	}
	return allow;
}

$.fn.numeric.blur = function()
{
	var decimal = $.data(this, "numeric.decimal");
	var callback = $.data(this, "numeric.callback");
	var val = $(this).val();
	if(val != "")
	{
		var re = new RegExp("^\\d+$|\\d*" + decimal + "\\d+");
		if(!re.exec(val))
		{
			callback.apply(this);
		}
	}
}

$.fn.removeNumeric = function()
{
	return this.data("numeric.decimal", null).data("numeric.callback", null).unbind("keypress", $.fn.numeric.keypress).unbind("blur", $.fn.numeric.blur);
}

})(jQuery);*/
eval(function(p,a,c,k,e,d){e=function(c){return(c<a?"":e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('(2($){$.c.f=2(p){p=$.d({g:"!@#$%^&*()+=[]\\\\\\\';,/{}|\\":<>?~`.- ",4:"",9:""},p);7 3.b(2(){5(p.G)p.4+="Q";5(p.w)p.4+="n";s=p.9.z(\'\');x(i=0;i<s.y;i++)5(p.g.h(s[i])!=-1)s[i]="\\\\"+s[i];p.9=s.O(\'|\');6 l=N M(p.9,\'E\');6 a=p.g+p.4;a=a.H(l,\'\');$(3).J(2(e){5(!e.r)k=o.q(e.K);L k=o.q(e.r);5(a.h(k)!=-1)e.j();5(e.u&&k==\'v\')e.j()});$(3).B(\'D\',2(){7 F})})};$.c.I=2(p){6 8="n";8+=8.P();p=$.d({4:8},p);7 3.b(2(){$(3).f(p)})};$.c.t=2(p){6 m="A";p=$.d({4:m},p);7 3.b(2(){$(3).f(p)})}})(C);',53,53,'||function|this|nchars|if|var|return|az|allow|ch|each|fn|extend||alphanumeric|ichars|indexOf||preventDefault||reg|nm|abcdefghijklmnopqrstuvwxyz|String||fromCharCode|charCode||alpha|ctrlKey||allcaps|for|length|split|1234567890|bind|jQuery|contextmenu|gi|false|nocaps|replace|numeric|keypress|which|else|RegExp|new|join|toUpperCase|ABCDEFGHIJKLMNOPQRSTUVWXYZ'.split('|'),0,{}));
function IsNumeric(valor){ var log=valor.length; var sw="S"; for (x=0; x<log; x++) { v1=valor.substr(x,1); v2 = parseInt(v1); if (isNaN(v2)) { sw= "N"; } } if (sw=="S") {return true;} else {return false; } }
function isMail(v_mail){ var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/; return emailReg.test(v_mail); }
function trim (vValor) { return vValor.replace(/^\s+/g,'').replace(/\s+$/g,''); }
function esFechaValida(fecha){ if (fecha != undefined && fecha != "" ){ if (!/^\d{2}\/\d{2}\/\d{4}$/.test(fecha)){ return false; } var dia  =  parseInt(fecha.substring(0,2),10); var mes  =  parseInt(fecha.substring(3,5),10); var anio =  parseInt(fecha.substring(6),10); switch(mes){ case 1: case 3: case 5: case 7: case 8: case 10: case 12: numDias=31; break; case 4: case 6: case 9: case 11: numDias=30; break; case 2: if (comprobarSiBisisesto(anio)){ numDias=29 }else{ numDias=28}; break; default: return false; } if (dia>numDias || dia==0){ return false; } return true; } }
function comprobarSiBisisesto(anio){ if ( ( anio % 100 != 0) && ((anio % 4 == 0) || (anio % 400 == 0))) { return true; } else { return false; } }

function valNumeric(vval, vdecimal) {
    var decimal = vdecimal;
    var val = vval;
    if(val == "0"){ return true; }
    if(val != "")
    {
        var re = new RegExp("^\\d+(\\" + decimal + "(\\d{1,2}))?$");
        //^\$?\d+(\" + decimal + "(\d{2}))?$
        if(!re.exec(val))
        {
            return false;
        } else {
            return true;
        }
    } else {
        return true;
    }
}

