I wrote a function that does exactly this, it reloads the current page, and has full support for changing existing url variables (as well as adding new ones). All you have to do is pass an object literal to the function. See here: https://stackoverflow.com/a/10235376/733347
In your case all you'd need to do is call the function as so
reloadWithQueryStringVars({"type": "all"});
or
reloadWithQueryStringVars({"type": "confirmed"});
or
reloadWithQueryStringVars({"type": "unconfirmed"});
on the click events of your buttons
Here's the entire function for reference:
function reloadWithQueryStringVars (queryStringVars) {
var existingQueryVars = location.search ? location.search.substring(1).split("&") : [],
currentUrl = location.search ? location.href.replace(location.search,"") : location.href,
newQueryVars = {},
newUrl = currentUrl + "?";
if(existingQueryVars.length > 0) {
for (var i = 0; i < existingQueryVars.length; i++) {
var pair = existingQueryVars[i].split("=");
newQueryVars[pair[0]] = pair[1];
}
}
if(queryStringVars) {
for (var queryStringVar in queryStringVars) {
newQueryVars[queryStringVar] = queryStringVars[queryStringVar];
}
}
if(newQueryVars) {
for (var newQueryVar in newQueryVars) {
newUrl += newQueryVar + "=" + newQueryVars[newQueryVar] + "&";
}
newUrl = newUrl.substring(0, newUrl.length-1);
window.location.href = newUrl;
} else {
window.location.href = location.href;
}
}