function defaultValueInput(focus, inputValue) {
	if (focus) {
	  if (document.search.query.value == inputValue) {
		  document.search.query.value = "";
		}
	}
	else {
	  if (document.search.query.value == "") {
		  document.search.query.value = inputValue;
		}
	}
}

function flipVisibility(strIdVisible, strIdHidden) {
	document.getElementById(strIdHidden).style.display = "none";
	document.getElementById(strIdVisible).style.display = "block";	
}

/* Function that validate the email address against a specific email regular expression */
function validateEmail(strCourriel) {
	
	var reg = /^[A-Za-z0-9](([_\.\-]?[a-zA-Z0-9]+)*)@([A-Za-z0-9]+)(([\.\-]?[a-zA-Z0-9]+)*)\.([A-Za-z]{2,})$/;
	
	return reg.test(strCourriel);
}

function valideFormAdrenaline(strLanguage) {
	var strMesgEmptyEmail;
	var strMesgEmailError;
	if (strLanguage == "fr") {
		strMesgEmptyEmail = "Vous devez saisir votre adresse de courriel.";
		strMesgEmailError = "Vous devez saisir une adresse de courriel valide.";
	}
	else {
		strMesgEmptyEmail = "You must fill in your email address";
		strMesgEmailError = "You must fill in a valid email address";
	}
	
	if (document.getElementById("A001_posteur").value == "") {
		alert(strMesgEmptyEmail);
		return false;
	}
	else {
		if (!validateEmail(document.getElementById("A001_posteur").value)) {
			alert(strMesgEmailError);
			return false;
		}
		else {
			return true;
		}
	}
}