// JavaScript Document

function validate() {	
	var err = false;
	species = document.uploadimg.selectSP.value;
	country = document.uploadimg.selectC.value;
	file = document.uploadimg.thefile.value;
	radiofield = document.uploadimg.typeofphoto;
	notchecked = radiofield.length;
	msg="Please review the information submitted, the following are missing:\n";
	if(file == ''){msg+="- You failed to select a photo from your computer\n";err = true}
	if(country==0){msg+="- You failed to select a the country from which the photo was taken\n";err = true}
	if(species==0){msg+="- You failed to select a the species your photo shows\n";err = true}
	for (i=0; i < radiofield.length; i++){
		if (!radiofield[i].checked){
			notchecked--
			if(notchecked==0){msg+="- You failed to select what the photo represents\n";err = true}
		}
	}

	if(err){
		alert(msg);
		return false;
	}else{
		return true;
	}
}