
        }
        return (false);
    }

    // if value is null or undefined than execute delete operate, else execute update
    function updateQueryVariable(uri, key, value) {
        var re = new RegExp('([?&])' + key + '=.*?(&|$)', 'i');
        var separator = uri.indexOf('?') !== -1 ? '&' : '?';
        if (uri.match(re)) {
            return uri.replace(re, !value ? '' : ('$1' + key + '=' + value + '$2'));
        } else {
            return !value ? '' : (uri + separator + key + '=' + value);
    