new function ()
{
    var path = $.trim(document.location.pathname);
    if (path.substring(0,1)=='/')
    {
        path = path.substring(1);
    }

    var args = path.split('/');

    var module = args[0];
    var action = args[1];
    args = args.slice(2);

    jQuery.cbPath =
    {
        args:   args,
        getArgument: function(i)
        {
            return args[i];
        },
        getModule: function()
        {
            return module;
        },
        module: module,
        getAction: function()
        {
            return action;
        },
        action: action,
        encode: function(s)
        {
            var e = $.URLEncode(s);
            return e.replace(/\%2F/g,'%252F');
        },
        decode: function(s)
        {
            var e = s.replace(/\%252F/g,'%2F');
            return $.URLDecode(e);
        }

    }
    for (var i = 0; i < args.length; i++)
    {
        args[i]=jQuery.cbPath.decode(args[i]);        
    }

}(jQuery.cbPath);


$.extend({
    pathEncode: $.cbPath.encode,
    pathDecode: $.cbPath.decode
});
