//register.php
function validateFormOnSubmitInquiry1(inquiry1) {
	var reason = "";
	reason += validateJobType (inquiry1.jobtype);
	reason += validateJobDescription (inquiry1.jobdescription);
	
	if(reason != "") {
		alert("Some fields are required:\n" + reason);
		return false;
	}
	return true;
}

function validateEmpty(fld) {
	var error = "";
	if (fld.value.length == 0) {
		fld.style.background = '#74c6fd';
		error = "The requested field have not been completed.\n"
	} else {
		fld.style.background = 'White';
	}
	return error;
}

function validateJobType(fld) {
	var error = "";
	if (fld.value == "") {
		fld.style.background = '#74c6fd';
		error = "You did not select the Job Type.\n";
	} else {
		fld.style.background = 'White';
	}
	return error;
}

function validateJobDescription(fld) {
	var error = "";
	if (fld.value == "") {
		fld.style.background = '#74c6fd';
		error = "You did not write the Job Description.\n";
	} else {
		fld.style.background = 'White';
	}
	return error;
}


function validateFormOnSubmitInquiry2(inquiry2) {
	var reason = "";
	reason += validateFullName (inquiry2.fullname);
	reason += validateTelephone (inquiry2.telephone);
	reason += validateEmail (inquiry2.email);
	reason += validateAddress1 (inquiry2.address1);
	reason += validateTown (inquiry2.town);
	reason += validatePostCode (inquiry2.postcode);
	
	if(reason != "") {
		alert("Some fields are required:\n" + reason);
		return false;
	}
	return true;
}

function validateEmpty(fld) {
	var error = "";
	if (fld.value.length == 0) {
		fld.style.background = '#74c6fd';
		error = "The requested field have not been completed.\n"
	} else {
		fld.style.background = 'White';
	}
	return error;
}

function validateFullName(fld) {
	var error = "";
	if (fld.value == "") {
		fld.style.background = '#74c6fd';
		error = "You did not input your Full Name.\n";
	} else {
		fld.style.background = 'White';
	}
	return error;
}

function validateTelephone(fld) {
	var error = "";
	if (fld.value == "") {
		fld.style.background = '#74c6fd';
		error = "You did not input your Telephone number.\n";
	} else {
		fld.style.background = 'White';
	}
	return error;
}

function validateEmail(fld) {
	var error = "";
	if (fld.value == "") {
		fld.style.background = '#74c6fd';
		error = "You did not input your e-mail address.\n";
	} else {
		fld.style.background = 'White';
	}
	return error;
}

function validateAddress1(fld) {
	var error = "";
	if (fld.value == "") {
		fld.style.background = '#74c6fd';
		error = "You did not input your address.\n";
	} else {
		fld.style.background = 'White';
	}
	return error;
}
function validateTown(fld) {
	var error = "";
	if (fld.value == "") {
		fld.style.background = '#74c6fd';
		error = "You did not input your Town.\n";
	} else {
		fld.style.background = 'White';
	}
	return error;
}
function validatePostCode(fld) {
	var error = "";
	if (fld.value == "") {
		fld.style.background = '#74c6fd';
		error = "You did not input your Post Code.\n";
	} else {
		fld.style.background = 'White';
	}
	return error;
}


function validateFormOnSubmitInquiry3(inquiry3) {
	var reason = "";
	reason += validateStartDate (inquiry3.startdate);
	
	if(reason != "") {
		alert("Some fields are required:\n" + reason);
		return false;
	}
	return true;
}

function validateEmpty(fld) {
	var error = "";
	if (fld.value.length == 0) {
		fld.style.background = '#74c6fd';
		error = "The requested field have not been completed.\n"
	} else {
		fld.style.background = 'White';
	}
	return error;
}

function validateStartDate(fld) {
	var error = "";
	if (fld.value == "") {
		fld.style.background = '#74c6fd';
		error = "You did not select the Start Date.\n";
	} else {
		fld.style.background = 'White';
	}
	return error;
}


function validateFormOnSubmitContact(contactform) {
	var reason = "";
	reason += validateName (contactform.name);
	reason += validateEmail (contactform.email);
	
	if(reason != "") {
		alert("Some fields are required:\n" + reason);
		return false;
	}
	return true;
}

function validateEmpty(fld) {
	var error = "";
	if (fld.value.length == 0) {
		fld.style.background = '#74c6fd';
		error = "The requested field have not been completed.\n"
	} else {
		fld.style.background = 'White';
	}
	return error;
}

function validateName(fld) {
	var error = "";
	if (fld.value == "") {
		fld.style.background = '#74c6fd';
		error = "You did not input your name.\n";
	} else {
		fld.style.background = 'White';
	}
	return error;
}
function validateEmail(fld) {
	var error = "";
	if (fld.value == "") {
		fld.style.background = '#74c6fd';
		error = "You did not input your email/email address is not valid.\n";
	} else {
		fld.style.background = 'White';
	}
	return error;
}
