function loginFunc()
{
	if( document.forms[0].email.value == "" )
	{
		alert( "Please type your email and try again." ); 
		document.forms[0].email.focus();
		return false;
	}
	else if( document.forms[0].email.value.indexOf("@") < 0 || document.forms[0].email.value.indexOf(".") < 0 )
	{
		alert( "Please make sure to enter a valid email address." ); 
		document.forms[0].email.focus();
		return false;
	}
	else if( document.forms[0].password.value == "" )
	{
		alert( "Please type your password and try again." ); 
		document.forms[0].password.focus();
		return false;
	}
	else
	{
		document.forms[0].submit();
		return true;
	}
}

function checkKey()
{
	document.onkeydown = checkKeycode
	function checkKeycode(e) 
	{
		var keycode;
		if (window.event) keycode = window.event.keyCode;
		else if (e) keycode = e.which;
		
		if( keycode == 13 ) loginFunc();
	}
}