/*VALIDATE THE SUBMIT A JOB FORM (submit_a_job.php)*/
function validateJob(theForm){
//used for dev only- bypasses validation
//return true
	if (theForm.yourname.value == "" || theForm.yourname.value.length < 2){
		alert("Please complete your your name.");
		theForm.yourname.focus();
		return false;
	}
	if (theForm.yourname.value == "" || theForm.yourname.value.length < 2){
		alert("Please complete your your name.");
		theForm.yourname.focus();
		return false;
	}
	if (theForm.email.value == "" || theForm.email.value.indexOf('@',1) == -1 || theForm.email.value.indexOf('.',2)==-1){
		alert("Please fill in your email address with a valid address. Please note that we may try and contact you via this address.");
		theForm.email.focus();
		return false;
	}
	if (theForm.phone.value == "" || theForm.phone.value.length < 2){
		alert("Please complete your your name.");
		theForm.phone.focus();
		return false;
	}
	if (theForm.pickup.value == "select" ){
		alert("Please select pick up location.");
		return false;
	}
	
	
	
	if (document.getElementById('fileOne').value == ""){
		alert("Please select at least one file to upload.");
		return false;
	}
	
	
	
	
	return true;
}





/*VALIDATE THE SUBMIT A JOB FORM (submit_a_job.php)*/
function validateContact(theForm){
//used for dev only- bypasses validation
//return true
	if (theForm.branch.value == 0){
		alert("Please choose branch location.");
		theForm.yourname.focus();
		return false;
	}
	if (theForm.yourname.value == "" || theForm.yourname.value.length < 2){
		alert("Please complete your name.");
		theForm.yourname.focus();
		return false;
	}
	if (theForm.yourname.value == "" || theForm.yourname.value.length < 2){
		alert("Please complete your name.");
		theForm.yourname.focus();
		return false;
	}
	if (theForm.email.value == "" || theForm.email.value.indexOf('@',1) == -1 || theForm.email.value.indexOf('.',2)==-1){
		alert("Please fill in your email address with a valid address. Please note that we may try and contact you via this address.");
		theForm.email.focus();
		return false;
	}
	if (theForm.phone.value == "" || theForm.phone.value.length < 2){
		alert("Please complete your your name.");
		theForm.phone.focus();
		return false;
	}
	
	
	if (document.getElementById('fileOne').value == ""){
		alert("Please select at least one file to upload.");
		return false;
	}
	
	
	return true;
}


/*VALIDATE THE SUBMIT A JOB FORM (submit_a_job.php)*/
function validateQuote(theForm){
//used for dev only- bypasses validation
//return true
	if (theForm.yourname.value == "" || theForm.yourname.value.length < 2){
		alert("Please complete your name.");
		theForm.yourname.focus();
		return false;
	}
	if (theForm.phone.value == "" || theForm.phone.value.length < 2){
		alert("Please complete your phone number.");
		theForm.phone.focus();
		return false;
	}
	if (theForm.email.value == "" || theForm.email.value.indexOf('@',1) == -1 || theForm.email.value.indexOf('.',2)==-1){
		alert("Please fill in your email address with a valid address. Please note that we may try and contact you via this address.");
		theForm.email.focus();
		return false;
	}
	if (theForm.servicerequired.value == ""){
		alert("Please complete the services required section.");
		theForm.servicerequired.focus();
		return false;
	}

	
	

	return true;
}


