/* Add isArray functionality (from 1.3) and new replace function */
$.extend({
  isArray: function( obj ) { return toString.call(obj) === "[object Array]"; },
  isObject: function( obj ) { return this.constructor.call(obj) === Object;},
  isEmptyObject: function( obj ) { var name = ""; for(name in obj) break; return !name;}
});

/* Function to replace text once, rather than looping through */
$.fn.rep = function(c) { 
    var html = $(this).html();
    $.each(c,function(k,v){
        html = html.replace(k,v);
    });
    return $(this).html(html);
}

/* Same as above, but uses regular expression if needed */
$.fn.repRegEx = function(c) { 
    var html = $(this).html();
    $.each(c,function(k,v){
        var re = new RegExp(k,'g');
        html = html.replace(re,v);
    });
    return $(this).html(html);
}