// JavaScript Document
function newCap(id, noImageMessage) {
	if (document.getElementById) {
			// extract image name from image source (i.e. cut off ?randomness)
		var theImage = document.getElementById("captcha_image_"+id);
		var parts = theImage.src.split("&");
			// add ?(random) to prevent browser/isp caching
			// parts[0] should be base url up to eID parameter
		theImage.src = parts[0] + "&set=" + Math.round(Math.random()*100000);
	} else {
		alert(noImageMessage ? noImageMessage : "Sorry, we cannot autoreload a new image. Submit the form and a new image will be loaded.");
	}
}

