ri.substring(s) : '';
        }
        var query = searchArgs.substring(1);
        var vars = query.split('&');
        var varObj = {};
        for (var i = 0; i < vars.length; i++) {
            var pair = vars[i].split('=');
            varObj[pair[0]] = pair[1];
        }
        return varObj;
    }

    // get uri query variable
    function getQueryVariable(variable, uri) {
        var vars = getQueryVariables(uri);
        for (var key in vars) {
            if (key === variable) return vars[key];