/**
 * Image captcha Javascript functions used for the
 * EuroAlumni web application
 * (c) 2007 Euro-Alumni e.V.
 **/
 

/**
 * Reloads the captcha image by changing 
 * the source
 **/
function reloadCaptcha() {

	//Get the captcha image
	var captchaImage = document.getElementById( "captchaImage" );
	
	//Return if the image is not in the page
	if ( captchaImage === null ) {
		return;
	}
	
	//Get the image source 
	var imageSrc = captchaImage.src;
	
	//Exit if there is no source
	if ( imageSrc === null ) {
		return;
	}
	
	//Replace the old random part with a new one
	imageSrc = imageSrc.replace(/;rnd=.*/,"")+";rnd="+Math.floor( Math.random()*1000000 );
	
	//Put back the new source
	captchaImage.src = imageSrc;
}