/**
 * Description
 * @author tjunghans, Namics AG, www.namics.com
 * @module
 * @requires jQuery
 */

/* JSLint Stuff */
/*globals jQuery */

var NX = NX || {};

/**
 *
 * @method throttle
 * @parameter {function} method
 * @paremeter {int} delay in seconds
 * @paramter {object} context, eg this

*/
(function () {
    NX.throttle = function (method, delay, context) {
        if (!method) {
            return false;
        }

        if (!delay) {
            delay = 100;
        }

        clearTimeout(method.tId);
        method.tId = setTimeout(function () {
                method.call(context);
            }, delay);

        return true;
    };
}());