function formQuoteValidator(){
	var qfrom = document.getElementById('quote_from');
	var qto = document.getElementById('quote_to');
	var qitems = document.getElementById('quote_items');
	var qweight = document.getElementById('quote_weight');
	var qtype = document.quote_details.quote_type;
	var qlength = document.quote_details.quote_length;
	
	// Check each input in the order that it appears in the form!
	if(madeSelection(qfrom, "Please Choose FROM location")){
		if(madeSelection(qto, "Please Choose TO location")){
			if(isNumeric(qitems, "Please enter the number of items you wish to send")){
				if(isNumeric(qweight, "Please enter total weight of the items")){
					if(optionChecked(qtype, "Please select the type of consignment")){
						if(optionChecked(qlength, "Please choose if the length of any of your items exceeds 60cm")){
							return true;
						}
					}
				} 
			}
		}
	}
	
	return false;
	
}

function optionChecked(elem, helperMsg){
	if (( elem[0].checked == false ) && ( elem[1].checked == false )) {
		alert(helperMsg);
		return false;
	}
	return true;
}

function isEmpty(elem, helperMsg){
	if(elem.value.length == 0){
		alert(helperMsg);
		elem.focus(); // set the focus to this input
		return true;
	}
	return false;
}

function madeSelection(elem, helperMsg){
	if(elem.value == ""){
		alert(helperMsg);
		elem.focus();
		return false;
	}else{
		return true;
	}
}

function isNumeric(elem, helperMsg){
	var numericExpression = /^[0-9\.]/;
	if(elem.value.match(numericExpression)){
		return true;
	}else{
		alert(helperMsg);
		elem.focus();
		return false;
	}
}