﻿(function($) {

    $.fn.inputnumber = function() {

        // 
        $(this).keypress(function(evt) {
            var charCode = (evt.which) ? evt.which : event.keyCode
            if (charCode > 31 && (charCode < 48 || charCode > 57) && charCode != 45)
                return false;
            return true;

        });

    }


    $.fn.inputnumberdecimal = function() {
        $(this).keypress(function(evt) {
            var charCode = (evt.which) ? evt.which : event.keyCode
            if ($(this).val().length > 10) {
                return false;
            }
            if (charCode == 46) {
                event.keyCode = 44;
            }
            if ((charCode == 46) || charCode == 45 || (charCode >= 48 && charCode <= 57))
                return true;
            return false;
        });
    }

    $.fn.inputtext = function() {

        //
        $(this).keypress(function(evt) {

            var charCode = (evt.which) ? evt.which : event.keyCode

            if ((charCode >= 97 && charCode <= 122) || (charCode >= 65 && charCode <= 90))
                return true;
            return false;
        });

    }

    $.fn.tooltip = function() {


        $(this).mouseover(function(control) {
            var _coord = {};
            _coord.x = control.pageX;
            _coord.y = control.pageY;

            //window.status = $(this).html();
        });

        //window.status = $(this).attr('id');
        /*
        $(this).each(function() {
        
        });
        
        //_coord.x = (obj.pageX - this.offsetLeft);
        //_coord.y = (obj.pageY - this.offsetTop);
        
        /*
    
       _coord.x = (obj.pageX- this.offsetLeft);
        _coord.y = (obj.pageY - this.offsetTop);
            
        window.status=(_coord.x + ' ' + _coord.y);
        */

    }

})(jQuery); 

