url = document.location.href;
xend = url.lastIndexOf("/") + 1;
var base_url = url.substring(0, xend);

function ajax_do (url,id,fun) {
		
        // Does URL begin with http?
        if (url.substring(0, 4) != 'http') {
                url = base_url + url;
        }
		var jsel = document.createElement('SCRIPT');
        jsel.type = 'text/javascript';
		
		jsel.src = url + '?id=' + id +'&func='+fun;
		document.body.appendChild (jsel);
}

