$(document).ready(function(){

	$('a.email').each(function(){ //Email address obfuscation
		e = this.rel.replace('/','@');
		this.href = 'mailto:' + e;
		$(this).text(e);
	});

});

function validate(form) {
	email=form.email.value;
	
	var error=false;

	if (!isEmail(email)) {
		error=true;
	}

	if (error) {
		alert("Please enter a valid email address");
		return false;
	} else {
		return true;
	}
}

function isEmail(str) { //Email address
	var emailRegExp="^[\\w-_\.]*[\\w-_\.]\@[\\w]\.+[\\w]+[\\w]$";
	var regex=new RegExp(emailRegExp);
	return regex.test(str);
}