function validEmail() {

	var VEmail = "1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ@.-_+";

	var Name = document.forms[0].elements[0].value;

	var Email = document.forms[0].elements[1].value;

	

	if (!Name) {

		alert("Please enter your name");

		document.forms[0].elements[0].focus();

		//document.forms[0].elements[0].select();

		return false;

	}

	

	if (!Email) {

		alert("Please enter your email address");

		document.forms[0].elements[1].focus();

		//document.forms[0].elements[1].select();

		return false;

	}

	

	for (var i=0; i<Email.length; i++) {

		var chk = Email.charAt(i)

		if (VEmail.indexOf(chk) == -1) {

			alert("Please enter letters, numbers. Other characters(!#$%^&*()?:;etc,) are not allowed");

			document.forms[0].elements[1].focus();

			//document.forms[0].elements[1].select();

			return false;

		}

	}

	

	if (Email.indexOf("@") == -1) {

		alert("Please enter the '@' sign");

		document.forms[0].elements[1].focus();

		//document.forms[0].elements[1].select();

		return false;

	}

	

    if (Email.charAt(0) == "@") {

		alert("@ shound not be put in the first character in the email address");

		document.forms[0].elements[1].focus();

		//document.forms[0].elements[1].select();

		return false;

	}

	

	if (Email.indexOf(".") == -1) {

		alert("You must have a dot in your email address");

		document.forms[0].elements[1].focus();

		//document.forms[0].elements[1].select();

		return false;

	}

	

    var e = Email.split("@");

	if (e[1].indexOf(".") == -1) {

		alert("You need a dot after the @ sign in your email address");

		document.forms[0].elements[1].focus();

		//document.forms[0].elements[1].select();

		return false;

	}

	

	if (e[1].charAt(0) == ".") {

		alert("The @ and dot '.' can not be together in your email address");

		document.forms[0].elements[1].focus();

		//document.forms[0].elements[1].select();

		return false;

	}

	

	if (Email.indexOf(" ") != -1) {

		alert("Spaces are not allowed in an email address!");

		document.forms[0].elements[1].focus();

		//document.forms[0].elements[1].select();

		return false;

	}

	

	var period=Email.indexOf(".");

    if (period == Email.length -1) {

		alert("Period should not be at the very end!");

		document.forms[0].elements[1].focus();

		//document.forms[0].elements[1].select();

		return false;

	}

}