// pega a url base
url = document.location.href;
xend = url.lastIndexOf("/") + 1;
var base_url = url.substring(0, xend);

function ajax_do(url) {
        // verifica se a url inicia com http
        if (url.substring(0, 4) != 'http') {
                url = base_url + url;
        }

        // cria um novo elemento JS
        var jsel = document.createElement('SCRIPT');
        jsel.type = 'text/javascript';
        jsel.src = url;

        // Adiciona o elemento JS (portanto executando a chamada "AJAX)
        document.body.appendChild (jsel);
}

// pega a url base
url2 = document.location.href;
xend2 = url2.lastIndexOf("/") + 1;
var base_url2 = url2.substring(0, xend2);

function ajax_do2(url2) {
        // verifica se a url inicia com http
        if (url2.substring(0, 4) != 'http') {
                url2 = base_url2 + url2;
        }

        // cria um novo elemento JS
        var jsel = document.createElement('SCRIPT');
        jsel.type = 'text/javascript';
        jsel.src = url2;

        // Adiciona o elemento JS (portanto executando a chamada "AJAX)
        document.body.appendChild (jsel);
}
