function removeCat(name, id)
{
    if(confirm("Weet je zeker dat je " + name + " wilt verwijderen?"))
    {
        var xmlhttp = new XMLHttpRequest();
        xmlhttp.onreadystatechange = function()
        {
            if (this.readyState == 4 && this.status == 200)
            {
                index_refresh();
            }
        };
        xmlhttp.open("GET", "removecat.php?id=" + id, true);
        xmlhttp.send();
    }
}

/* refresh the category view */
function index_refresh()
{
    var xmlhttp = new XMLHttpRequest();
    xmlhttp.onreadystatechange = function()
    {
        if (this.readyState == 4 && this.status == 200)
        {
            document.getElementById('catContainer').innerHTML = this.responseText;
        }
    };
    xmlhttp.open("GET", "cats.php", true);
    xmlhttp.send();
}
