// JavaScript Document

function charger(url_to_load)
{
	$('cont_bdy_text').style.display='none';
	$('cont_bdy_wait').style.display='block';
	
	var req = new Request.HTML({url:""+url_to_load, 
		onSuccess: function(html) {
			//Clear the text currently inside the results div.
			$('cont_bdy_text').set('text', '');
			//Inject the new DOM elements into the results div.
			$('cont_bdy_text').adopt(html);
			$('cont_bdy_wait').style.display='none';
			$('cont_bdy_text').style.display='block';
		},
		//Our request will most likely succeed, but just in case, we'll add an
		//onFailure method which will let the user know what happened.
		onFailure: function() {
			$('cont_bdy_text').set('text', 'The request failed.');
			$('cont_bdy_wait').style.display='none';
			$('cont_bdy_text').style.display='block';
		}
	});
	
	req.send();
	
}

nbre = 0;

function controlerEmail(valeur) {
    ctl = /^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+([\.][a-z0-9-]+)+$/;
    if (valeur.search(ctl) != -1) return true;
    else return false;
}

function controlerTel(valeur) {
    ctl = /^(\(\d+\))?([\s\.\-]?\d{2,})+$/;
    if (valeur.search(ctl) != -1) return true;
    else return false;
}
