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