function searchClient() {
    var search = document.getElementById('searchClient').value;
    window.location.href = urlRedirect() + '?searchClient='+search;
}

function reinstallAgent(client, classname) {
    if (confirm('Réinstaller l\'agent du client '+client+' ('+classname+') ?')) {
        window.location.href = urlRedirect() + '?action=reinstallAgent&client='+client+'&class='+classname;
    }
}

function urlRedirect() {
    var urlRedirect = window.location.href;
    var decoupeQuery = urlRedirect.indexOf('?');
    if (decoupeQuery != -1) {
        urlRedirect = urlRedirect.substring(0, decoupeQuery);
    }
    return urlRedirect;
}