/* ---------------------------------------------------------------------------
 * Pushing Karam javascript Library
 * @author M.Shepanski (2009)
 * @requires jQuery 1.3.2 or higher
 *
 * Table of Contents
 *   Dump Object (Pretty-Printer)
 *---------------------------------------------------------------------------- */


/*------------------------------------------------------------
 * Dump Object (Pretty-Printer)
 * ----------------------------------------------------------- */
function printr(obj, indent) {
    var result = "";
    if (indent == null) indent = "";
    for (var property in obj) {
        var value = obj[property];
        if (typeof value == 'string')
            value = "'" + value + "'";
        else if (typeof value == 'object') {
            if (value instanceof Array) {
                value = "[ " + value + " ]";
            } else {
                var od = printr(value, indent + "  ");
                value = "{\n" + od + "\n" + indent + "}";
            }
        }
        result += indent + "'" + property + "': " + value + ",\n";
    }
    return result.replace(/,\n$/, "");
}
