function validateEmail(email) {
    if (email.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1){

		var sPath = window.location.pathname;
		var sPage = sPath.substring(sPath.lastIndexOf('/') + 1);
		
		switch (sPage) {
			case "error404.html":
				document.getElementById('email').href="en/subscribe-enews.html?email="+email;
				break;
			default:
				document.getElementById('email').href="subscribe-enews.html?email="+email;
		}
   } else {
		alert("Invalid email address!");
		document.getElementById('txtEmail').value="";
   }
}