
// mini jQuery plugin that formats to two decimal places    
(function($) {
    $.fn.currencyFormat = function() {
        this.each(function(i) {
            $(this).change(function(e) {
            if (isNaN(parseFloat(this.value))) 
                return;
                this.value = parseFloat(this.value).toFixed(2);
            });
        });
        return this;
        //for chaining
    }
})(jQuery);

// apply the currencyFormat behaviour to elements with 'currency' as their class
$(function() {
    $('.currency').currencyFormat();
});

$.fn.delay = function(time, callback) {
    // Empty function:
    jQuery.fx.step.delay = function() { };
    // Return meaningless animation, (will be added to queue)
    return this.animate({ delay: 1 }, time, callback);
}
$.fn.showStatus = function() {
    this.fadeIn(500).delay(2000).slideUp(400, function() {
        this.className = '';
        $(this).html('');
    });
}
