// JavaScript Document
function validateRegForm() {

		if (document.regForm.email.value == '') {
			alert('Please enter your E-Mail address.');
			document.regForm.email.focus();
			return;
		}
		
		/*
		if (document.regForm.remail.value == '') {
			alert('Please retype your E-Mail address.');
			document.regForm.remail.focus();
			return;
		}
		*/
		
	
		if (document.regForm.password.value == '') {
			alert('Please enter a password.');
			document.regForm.password.focus();
			return;
		}

		if (document.regForm.rpassword.value == '') {
			alert('Please retype your password.');
			document.regForm.rpassword.focus();
			return;
		}
		
		if (document.regForm.password.value != document.regForm.rpassword.value) {
			alert('The paswords you entered are not identical.');
			document.regForm.email.focus();
			return;
		}
		
		if(!checkEmail(document.regForm.email.value))
		{
			document.regForm.email.focus();
			return;
		}
		
		document.regForm.submit();
	}

	
	function validateLoginForm() {

		if (document.loginForm.email.value == '') {
			alert('Please enter your E-Mail address.');
			document.loginForm.email.focus();
			return;
		}
		
		if (document.loginForm.password.value == '') {
			alert('Please enter a password.');
			document.loginForm.password.focus();
			return;
		}
		
		document.loginForm.submit();
	}
	
function checkEmail(str) {
	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(str)){
	return (true)
	}
	alert("Invalid E-mail Address! Please re-enter.")
	return (false)
}

