/*This function loops through the required fields on the form and tests that the values entered
in them appear to be valid.  If no invalid fields are identified it returns true, if not it returns false
and returns the keyboard focus to the first offending field*/
function checkField(total){
	for (i=0;i<mandatoryFieldsArray.length;i++) {
		currField=document.orderForm.elements[mandatoryFieldsArray[i]];
		if(currField && (currField.type=="text" || currField.type=="password")){
			if(isblank(currField.value)) {
				//alert(currField.name + " is a required field\n Please enter a value.");
				alert("Some details that are compulsory are missing.\n Please enter the required information.\nThe first missing field will now be highlighted.");
				currField.focus();
				if(currField.className=="emptyField"){currField.className="missingField";}
			return false;
			}
			else{currField.className="emptyField";}
		}
		
		
		
		else{
		//currField=document.orderForm.vehicle[0];
		}
		//alert("currField\n\n" + currField);
		
		
		
	}
	if(total == 'none'){
	document.orderForm.submit();
	}
	else{
	//if(confirm("Your card is about to be debited\nfor £" + getDot(total) + "\nDo you wish to continue?"))
		{
		document.orderForm.submit();
		}
	}
}

