// function to check and see if yes or no was clicked
function checkForm(value) {
	
	// define variables
	var choiceYes = document.getElementById('choiceYes');
	var choiceNo = document.getElementById('choiceNo');
	var choiceSend = document.getElementById('choiceSend');
	
	if (value == "existing_plate") {
		choiceSend.style.display = "none";
	}
	if (value == "call_me") {
		choiceSend.style.display = "none";
	}
	if (value == "provide_artwork") {
		choiceSend.style.display = "";
	}
	
	if (value == "Yes") {
		if (choiceNo.style.display == "") {
			choiceNo.style.display = "none";	
		}
		choiceYes.style.display = "";
	} else if (value == "No") {
		if (choiceYes.style.display == "") {
			choiceYes.style.display = "none";	
		}
		choiceNo.style.display = "";	
	}
	
}

// function to verify form was filled out
function validateForm() {

	// define variables
	var from_name = document.getElementById('from_name');
	var phone = document.getElementById('phone_id');
	var attachment = document.getElementById('attachment');
	
	if (from_name.value.length < 2) {
		alert("Please enter your name.");
		from_name.focus();
		return false;
	} else if (phone.value.length < 10) {
		alert("Please enter your phone number.");
		phone.focus();
		return false;
	} else if (attachment.value == "") {
		alert("Please include your logo as an attachment.");
		attachment.focus();
		return false;
	} else {
		return true;	
	}
	
}

// function to disable the form once you click submit
function showStatus() {
	
	// make sure it validates
	var correctForm = validateForm();
	
	if (correctForm) {
		// define variables
		var statusDiv = document.getElementById('statusDiv');
		var uploadSubmit = document.getElementById('uploadSubmit');
		var attachment = document.getElementById('attachment');
		
		uploadSubmit.disabled = true;
		attachment.disabled = true;
		
		statusDiv.style.display = "";
	
		return true;
	} else {
		return false;	
	}
}


