!function(a){a.fn.numeric=function(b,c){return b=b===!1?"":b||".",c="function"==typeof c?c:function(){},this.data("numeric.decimal",b).data("numeric.callback",c).keypress(a.fn.numeric.keypress).blur(a.fn.numeric.blur)},a.fn.numeric.keypress=function(b){var c=a.data(this,"numeric.decimal"),d=b.charCode?b.charCode:b.keyCode?b.keyCode:0;if(13==d&&"input"==this.nodeName.toLowerCase())return!0;if(13==d)return!1;var e=!1;if(b.ctrlKey&&97==d||b.ctrlKey&&65==d)return!0;if(b.ctrlKey&&120==d||b.ctrlKey&&88==d)return!0;if(b.ctrlKey&&99==d||b.ctrlKey&&67==d)return!0;if(b.ctrlKey&&122==d||b.ctrlKey&&90==d)return!0;if(b.ctrlKey&&118==d||b.ctrlKey&&86==d||b.shiftKey&&45==d)return!0;if(48>d||d>57){if(45==d&&0==this.value.length)return!0;c&&d==c.charCodeAt(0)&&-1!=this.value.indexOf(c)&&(e=!1),8!=d&&9!=d&&13!=d&&35!=d&&36!=d&&37!=d&&39!=d&&46!=d?e=!1:"undefined"!=typeof b.charCode&&(b.keyCode==b.which&&0!=b.which?(e=!0,46==b.which&&(e=!1)):0!=b.keyCode&&0==b.charCode&&0==b.which&&(e=!0)),c&&d==c.charCodeAt(0)&&(e=-1==this.value.indexOf(c)?!0:!1)}else e=!0;return e},a.fn.numeric.blur=function(){var b=a.data(this,"numeric.decimal"),c=a.data(this,"numeric.callback"),d=a(this).val();if(""!=d){var e=new RegExp("^\\d+$|\\d*"+b+"\\d+");e.exec(d)||c.apply(this)}},a.fn.removeNumeric=function(){return this.data("numeric.decimal",null).data("numeric.callback",null).unbind("keypress",a.fn.numeric.keypress).unbind("blur",a.fn.numeric.blur)}}(jQuery);