var form = document.getElementById("signup");
var fname = document.getElementById("fname");
var sname = document.getElementById("sname");
var address = document.getElementById("address");
var phone = document.getElementById("phone");
var email = document.getElementById("email");
var comments = document.getElementById("comments");

fname.focus();

function checkdetails()
{
	if(fname.value=="")
	{
		alert("You have not entered a first name");
		fname.focus();
		return false;
	}
	
	if(sname.value=="")
	{
		alert("You have not entered a surname");
		sname.focus();
		return false;
	}

	if(address.value=="")
	{
		alert("You have not entered an address");
		address.focus();
		return false;
	}

	if(phone.value=="")
	{
		alert("You have not entered a phone number");
		phone.focus();
		return false;
	}

	if(email.value=="")
	{
		alert("You have not entered an email address");		
		email.focus();
		return false;
	}
	
	if(comments.value=="")
	{
		alert("Did you have a question to ask?");		
		comments.focus();
		return false;
	}
	alert("Thank You! You have entered all the correct information");
	return true;
}

function imposeMaxLength(Object, MaxLen)
{
  return (Object.value.length <= MaxLen);
}

form.onsubmit = checkdetails;