﻿(function($) {
    $.fn.deleteCategoryId = function(id) {
        var tmpCategoryArray = catVars['categoriesObj'].val().split(' ');
        jQuery.sortArray(tmpCategoryArray);
        tmpCategoryArray = jQuery.grep(tmpCategoryArray, function(value) {
            return value != id;
        });
        catVars['catgoryArray'] = tmpCategoryArray;
        $(this).val(jQuery.trim(tmpCategoryArray.join(' ')));
//        if (jQuery.browser.mozilla) {
//            console.log("#cat: '" + $(this).val()+"'");
//        }
    };
})(jQuery);