
/**
 * Исправляем ошибку совместного использования Rounded Corners и jQuery UI 1.7.2
 * на одной и той же странице.
 * DatePicker из UI всегда возвращает последний день предыдущего месяца. Это
 * вызвано неправильной работой функции $.fn.html из RoundedCorners.
 * Проблема заключается в том, что вызов this.canvas всегда возвращает true, т.к.
 * является фукнцией, всегда возвращающей this.
 * Решение: возможно автор имел в виду не this.canvas, а this.get(0).canvas.
 */
$.fn.html = function(val){

    var obj = this.get(0);
    if (!obj) return;
    //if there is a value run through all the elements and run the apropriate function
    //else just return the apropriate function
    if(val || typeof val == 'string'){
            $(this).each(function(){
                    if(obj.canvas) $('span.inner', this)._html(val);
                    else $(this)._html(val);
            });
            return this;
    } else{
            return obj.canvas ? $('span.inner', this)._html() : $(this)._html();
    };
};
