function submitError(error) {
	changeStatus("There was an error sending your nomination: " + error, "red");
}

function submitSuccess() {
	document.forms.nom.reset();

	var text = "Thank you for your nomination submission for the Blue Mountain Cares Everyday Inspiration. ";
	text += "We will be reviewing your submission and will contact you if your story is chosen or if we have questions.";

	changeStatus(text, "black");

}

function changeStatus(text, color) {
	var status = document.getElementById('nomStatus');
	status.innerHTML = '<font color="' + color + '">' + text + '</font>';
}

function submitNom() {
	var name = document.forms.nom.nomName.value;
	var email = document.forms.nom.nomEmail.value;
	var address = document.forms.nom.nomAddress.value;
	var city = document.forms.nom.nomCity.value;
	var state = document.forms.nom.nomState.value;
	var zip = document.forms.nom.nomZip.value;
	var country = document.forms.nom.nomCountry.value;
	var phone = document.forms.nom.nomPhone.value;
	var nom = document.forms.nom.nomText.value;
	var legal = document.forms.nom.legal.checked;
	var userfile = document.forms.nom.userFile.value;	

	if (name == '' || email == '' || address == '' || city == '' ||
		state == '' || zip == '' || country == '' || phone == '' || nom == '') {
		alert('You must fill in the required fields before submitting.\nPlease try again.');
	} else {
		if (userfile != '' && legal == false) {
			alert('You must have the rights to the photo that you are uploading.');
		} else {
			changeStatus("Sending your nomination...", "black");
			document.forms.nom.target = "upload_target";
			document.forms.nom.submit();
		}
	}
}

function photoTOS() {
	var popURL = "phototerms.pd";
	var strWinFeatures = "resizeable=yes,scrollbars=auto,width=500,height=500";
	window.open(popURL, "popaway", strWinFeatures);
}