TreeViewIndicatorHandler = function()
{
    var nextId = 0;
	var url = "http://www.climatesmartbusiness.com/fp/shared/treeview2/treeviewindicatorhandler.ashx";
	
    var proxy = {
        
        "createNode" : function(parentSid, name, callback, scope) {
            Call("createNode", [ parentSid, name ], callback, scope, Array.prototype.slice.call(arguments, 4));
        },
        
        "deleteNode" : function(sid, callback, scope) {
            Call("deleteNode", [ sid ], callback, scope, Array.prototype.slice.call(arguments, 3));
        },
        
        "getChildNodes" : function(parentSid, fetchDepth, options, callback, scope) {
            Call("getChildNodes", [ parentSid, fetchDepth, options ], callback, scope, Array.prototype.slice.call(arguments, 5));
        },
        
        "getChildNodesMultipleParent" : function(parentSids, fetchDepth, options, callback, scope) {
            Call("getChildNodesMultipleParent", [ parentSids, fetchDepth, options ], callback, scope, Array.prototype.slice.call(arguments, 5));
        },
        
        "getList" : function(rootSid, options, callback, scope) {
            Call("getList", [ rootSid, options ], callback, scope, Array.prototype.slice.call(arguments, 4));
        },
        
        "getListMultipleParent" : function(rootSids, options, callback, scope) {
            Call("getListMultipleParent", [ rootSids, options ], callback, scope, Array.prototype.slice.call(arguments, 4));
        },
        
        "getTagGroups" : function(callback, scope) {
            Call("getTagGroups", [ ], callback, scope, Array.prototype.slice.call(arguments, 2));
        },
        
        "getTags" : function(tagGroupId, callback, scope) {
            Call("getTags", [ tagGroupId ], callback, scope, Array.prototype.slice.call(arguments, 3));
        },
        
        "renameNode" : function(sid, name, callback, scope) {
            Call("renameNode", [ sid, name ], callback, scope, Array.prototype.slice.call(arguments, 4));
        },
        
        "system.about" : function(callback, scope) {
            Call("system.about", [ ], callback, scope, Array.prototype.slice.call(arguments, 2));
        },
        
        "system.listMethods" : function(callback, scope) {
            Call("system.listMethods", [ ], callback, scope, Array.prototype.slice.call(arguments, 2));
        },
        
        "system.version" : function(callback, scope) {
            Call("system.version", [ ], callback, scope, Array.prototype.slice.call(arguments, 2));
        }
    };
    
    function Call(method, params, callback, scope, callbackParams)
    {
        var request = { 
            id     : ++nextId, 
            method : method, 
            params : params 
        };
        Jayrock.Rpc.asyncRequest(url, request, callback, scope, callbackParams);
    }
        
    return proxy;
}();
