function submitenter(myfield,e)
{
var keycode;
if (window.event) keycode = window.event.keyCode;
else if (e) keycode = e.which;
else return true;

if (keycode == 13)
   {
   chkForm();
   return false;
   }
else
   return true;
}

function CheckForm1() {
	var errorreason = "";
	errorreason += checkDropdown(document.forms.frmLogin.GenderID1.selectedIndex,'Enter your gender\n');
	errorreason += checkDropdown(document.forms.frmLogin.GenderID2.selectedIndex,'Enter the gender of the person you are looking for\n');
	errorreason += checkDropdown(document.forms.frmLogin.CountryID.selectedIndex,'Enter your country\n');
	errorreason += CheckDateAge(document.forms.frmLogin.dob[0].value,document.forms.frmLogin.dob[1].value,document.forms.frmLogin.dob[2].value);
	errorreason += checkMail(document.forms.frmLogin.txtNewUserName1.value,'Your email address is not valid\n');
	errorreason += checkMail(document.forms.frmLogin.txtNewUserName2.value,'Your confirmation email address is not valid\n');
	errorreason += CheckValidPassword(document.forms.frmLogin.txtPass.value);
	if (document.forms.frmLogin.txtNewUserName1.value != document.forms.frmLogin.txtNewUserName2.value) {
		errorreason += 'Your email addresses do not match\n';
	}
	if (document.forms.frmLogin.chkTerms.checked == false) {
		errorreason += 'You have NOT read and agreed to the terms of use\n';
	}
	
	 if (errorreason != "") {
       alert(errorreason);
       return false;
    }
	document.forms.frmLogin.txtSubmit.value = '2';
	document.forms.frmLogin.submit();
}

function chkForm()
	{
		if(checkMail(document.forms.frmLogin.txtUserName.value,'invalid') != "") 
			{
			alert('You must enter a valid email address');
			document.forms.frmLogin.txtUserName.focus();
			}
		else
			if (document.forms.frmLogin.txtPassword.value.length<1)
				{
				alert('You must enter a Password');
				document.forms.frmLogin.txtPassword.focus();
				}
			else 
				{
				document.forms.frmLogin.txtSubmit.value = '1';
				document.forms.frmLogin.submit();
				}				
	}