function formValidator(){
	// Make quick references to our fields
	var plunge = document.getElementById('lineplungeangle');
	var direction = document.getElementById('lineplungedirection');
	var sense = document.getElementById('lineplungesense');
	var latitude = document.getElementById('latitude');
	var longitude = document.getElementById('longitude');
	var scale = document.getElementById('scale');
	
	// Check each input in the order that it appears in the form!
	if(isAtitude(plunge, "Plunge must be a value from 0 to 90; 0 for horizontal and 90 for vertical")){
		if(isAtitude(direction, "Plunge direction must be a value from 0 to 90; 0 for north/south and 90 for east/west")){
			if(isLongitude(longitude, "Longitude must be from -180 (western hemisphere) to 180 (eastern hemisphere)")){
				if(isScale(scale, "Scale cannot be greater than 100 or less than 0.1")){
					if(isSense(strikesense, dipsense, "The Strike Sense does not match with the Dip Sense")){
						return true;
					}
				}
			}
		}
	}
	
	
	return false;
	
}

function isAtitude(elem, helperMsg){
	var num=elem.value;
	if(elem.value.length == 0){
		alert(helperMsg);
		elem.focus();
		return false;
	} else if(num<=90 && num>=0){
		return true;
	}else{
		alert(helperMsg);
		elem.focus();
		return false;
	}
}

function isLatitude(elem, helperMsg){
	var num=elem.value;
	if(elem.value.length == 0){
		alert(helperMsg);
		elem.focus();
		return false;
	} else if(num<=90 && num>=-90){
		return true;
	}else{
		alert(helperMsg);
		elem.focus();
		return false;
	}
}

function isLongitude(elem, helperMsg){
	var num=elem.value;
	if(elem.value.length == 0){
		alert(helperMsg);
		elem.focus();
		return false;
	} else if(num<=180 && num>=-180){
		return true;
	}else{
		alert(helperMsg);
		elem.focus();
		return false;
	}
}

function isScale(elem, helperMsg){
	var num=elem.value;
	if(elem.value.length == 0){
		alert(helperMsg);
		elem.focus();
		return false;
	} else if(num<=100 && num>=0.1){
		return true;
	}else{
		alert(helperMsg);
		elem.focus();
		return false;
	}
}


