function checkLogin() {
	var txtEmail = document.getElementById("inpEmail");
	var txtPass = document.getElementById("inpPass");
	// If Email or Password is blank, then alert and exit
	if(txtEmail.value=='') {
		alert('You must provide an Email Address');
		txtEmail.focus();
		return;
	}
	if(txtPass.value=='') {
		alert('You must provide a Password');
		txtPass.focus();
		return;
	}
	// Check if valid email
	if(isValidEmail(txtEmail.value)==false) {
		alert('You must provide a valid Email Address');
		txtEmail.focus();
		return;
	}
	document.frmLogin.submit();
}
function checkReg() {
	var txtFirst = document.getElementById("userfirstname");
	var txtLast = document.getElementById("userlastname");
	var txtEmail = document.getElementById("useremail");
	var txtPass = document.getElementById("userpass");
	var txtTerms = document.getElementById("usertermscons");
	// If Firstname is blank, then alert and exit
	if(txtFirst.value=='') {
		alert('You must provide your First name');
		txtFirst.focus();
		return;
	}
	// If Lastname is blank, then alert and exit
	if(txtLast.value=='') {
		alert('You must provide your Surname');
		txtLast.focus();
		return;
	}
	// If email is blank, then alert and exit
	if(txtEmail.value=='') {
		alert('You must provide your Email Address');
		txtEmail.focus();
		return;
	}
	// If password is blank, then alert and exit
	if(txtPass.value=='') {
		alert('You must provide a Password');
		txtEmail.focus();
		return;
	}
	// If terms and cons is not checked
	if(txtTerms.checked==false) {
		alert('You must agree to our terms and conditions');
		txtTerms.focus();
		return;
	}
	// Check if valid email
	if(isValidEmail(txtEmail.value)==false) {
		alert('You must provide a valid Email Address');
		txtEmail.focus();
		return;
	}
	document.frmReg.submit();
}
function checkRequestPassword() {
	var txtEmail = document.getElementById("inpEmailRequestPass");
	// If Email is blank then exit
	if(txtEmail.value=='') {
		alert('You must provide an Email Address');
		txtEmail.focus();
		return;
	}
	// Check if valid email
	if(isValidEmail(txtEmail.value)==false) {
		alert('You must provide a valid Email Address');
		txtEmail.focus();
		return;
	}
	document.frmRequestPass.submit();
}
function checkMySettings() {
	/*
	var txtFirst = document.getElementById("userfirstname");
	var txtLast = document.getElementById("userlastname");
	var txtEmail = document.getElementById("useremail");
	var txtPass = document.getElementById("userpassword");
	// If Firstname is blank, then alert and exit
	if(txtFirst.value=='') {
		alert('You must provide your First name');
		txtFirst.focus();
		return;
	}
	// If Lastname is blank, then alert and exit
	if(txtLast.value=='') {
		alert('You must provide your Surname');
		txtLast.focus();
		return;
	}
	// If email is blank, then alert and exit
	if(txtEmail.value=='') {
		alert('You must provide your Email Address');
		txtEmail.focus();
		return;
	}
	// If password is blank, then alert and exit
	if(txtPass.value=='') {
		alert('You must provide a Password');
		txtEmail.focus();
		return;
	}
	// Check if valid email
	if(isValidEmail(txtEmail.value)==false) {
		alert('You must provide a valid Email Address');
		txtEmail.focus();
		return;
	}*/
	document.frmSettings.submit();
}
function checkListing() {
	document.frmListings.submit();
}
function isValidEmail(str) {
   return (str.indexOf(".") > 2) && (str.indexOf("@") > 0);
}