// Get base url
the_url = document.location.href;
xend = the_url.lastIndexOf("/") + 1;
var base_url = the_url.substring(0, xend); 

function ajax_do (the_url){
	// to make each call as unique as possible.
	// two random querystring names and values should do the trick
	// if there were no querystrings, we need to start with a '?'
	if (the_url.indexOf("?") != -1) {
		the_url += "&";
	} else {
		the_url += "?";
	}
	the_url += Math.random(0,1000) + "=" + Math.random(0,1000) + "&" + Math.random(0,1000) + "=" + Math.random(0,1000);

	// Does URL begin with http?
	if (the_url.substring(0, 4) != 'http') {
	        the_url = base_url + the_url;
	}
	
	// Create new JS element
	var jsel = document.createElement('SCRIPT');
	jsel.type = 'text/javascript';
	jsel.src = the_url;
	
	// Append JS element (therefore executing the 'AJAX' call)
	document.body.appendChild (jsel);
}
