function encodeParams(params) {
        var tail = [];
        var item = [];
        var i;
        if (params instanceof Array) {
            for (i in params) {
                item = params[i];
                if (item instanceof Array && item.length > 1) {
                    tail.push(item[0] + "=" + encodeURIComponent(item[1]));
                }
            }
        } else {
            for (var key in params) {
                if (params.hasOwnProperty(key)) {
                    var value = params[key];
                    if (value instanceof Array) {
                        for (i in value) {
                            item = value[i];
                            tail.push(key + "=" + encodeURIComponent(item));
                        }
                    } else {
                        tail.push(key + "=" + encodeURIComponent(value));
                    }
                }
            }
        }
        return tail.join("&");
    }
/*
    *  method to encode the query string parameters
    *
    *  @method encodeParams
    *  @public
    *  @params {object} params - an object of name value pairs that will be urlencoded
    *  @return {string} Returns the encoded string
    */
method to encode the query string parameters
@method encodeParams
@public
@params {object} params - an object of name value pairs that will be urlencoded
@return {string} Returns the encoded string
method to encode the query string parameters @method encodeParams @public @params { object } params - an object of name value pairs that will be urlencoded @return { string } Returns the encoded string
function encodeParams(params) {
        var tail = [];
        var item = [];
        var i;
        if (params instanceof Array) {
            for (i in params) {
                item = params[i];
                if (item instanceof Array && item.length > 1) {
                    tail.push(item[0] + "=" + encodeURIComponent(item[1]));
                }
            }
        } else {
            for (var key in params) {
                if (params.hasOwnProperty(key)) {
                    var value = params[key];
                    if (value instanceof Array) {
                        for (i in value) {
                            item = value[i];
                            tail.push(key + "=" + encodeURIComponent(item));
                        }
                    } else {
                        tail.push(key + "=" + encodeURIComponent(value));
                    }
                }
            }
        }
        return tail.join("&");
    }
function encodeParams ( params ) { var tail = [ ] ; var item = [ ] ; var i ; if ( params instanceof Array ) { for ( i in params ) { item = params [ i ] ; if ( item instanceof Array && item . length > 1 ) { tail . push ( item [ 0 ] + "=" + encodeURIComponent ( item [ 1 ] ) ) ; } } } else { for ( var key in params ) { if ( params . hasOwnProperty ( key ) ) { var value = params [ key ] ; if ( value instanceof Array ) { for ( i in value ) { item = value [ i ] ; tail . push ( key + "=" + encodeURIComponent ( item ) ) ; } } else { tail . push ( key + "=" + encodeURIComponent ( value ) ) ; } } } } return tail . join ( "&" ) ; }
method to encode the query string parameters
  @method encodeParams
  @public
  @params {object} params - an object of name value pairs that will be urlencoded
  @return {string} Returns the encoded string
method to encode the query string parameters @method encodeParams @public @params { object } params - an object of name value pairs that will be urlencoded @return { string } Returns the encoded string