if (typeof fw == "undefined"){
	fw = {};
}

if (typeof fw.domain == "undefined"){
	fw.domain = {};
}

fw.domain.EmailRule=function (email){

	this.email = (typeof email!="undefined"?email:"");
	
	this.validate=function (email) {

		this.setValueEmail(email);

		var pattern = "^[a-z][a-z|0-9|]*([_][a-z|0-9]+)*([.][a-z|" +
					   "0-9]+([_][a-z|0-9]+)*)?@[a-z][a-z|0-9|]*\.([a-z]" +
					   "[a-z|0-9]*(\.[a-z][a-z|0-9]*)?"+
					   "[a-z|0-9]*(\.[a-z][a-z|0-9]*)?)$";

		var re = new RegExp(pattern);
		if (re.test(this.email)){
			return true;
		}
		return false;
	};	
	

	this.setValueEmail=function(email){

		if (typeof email != "undefined" || email != ""){
			this.email = email;
		}else{
			if (this.email != ""){
				return;
			}
			this.email="";			
		}	
	};


}