// 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);
}