/*
 * Author: Charles Lauzon
 * Name:   Functions_MotdePasse.js
 * Date:   12 Janvier, 2008
 */
 
/********************************************************************
 * 																	*
 *						   MOT DE PASSE                             *
 *																	*
 ********************************************************************/
//btnValiderLostPassword onClick envoye les instructions par email au membre
function btnValiderLostPassword_onClick(){
	var isEmailEmpty = true;
	
	//Email
	if(document.fAccountInfo.txtEmail.value.length > 0){
		if(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document.fAccountInfo.txtEmail.value)){		
			isEmailEmpty = false;
			document.getElementById("lblEmail").style.color = "#000000";
		}
		else{
			document.getElementById("lblEmail").style.color = "#FF0000";
		}
	}
	else{
		document.getElementById("lblEmail").style.color = "#FF0000";
	}
	
	//Check if everything is correct
	if(isEmailEmpty == false){
		document.fAccountInfo.submit();
	}
	else{
		alert("SVP Entrez votre Adresse Courriel!");
	}
}

//Email onBlur regarde si le email es un email valide
function txtEmail_onBlur(){
	var Email = document.fAccountInfo.txtEmail.value;
	if(Email != ""){
		if(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(Email)){		
			document.getElementById("lblInvalidEmail").style.visibility = "hidden";
		}
		else{
			document.getElementById("lblInvalidEmail").style.visibility = "visible";
		}
	}
}