var aok;
	
//Functions to submit a form.
function getformvalues (fobj){
	aok = true;
	var val;
	var str = "";
		
	//Run through a list of all objects contained within the form.
	for(var i = 0; i < fobj.elements.length; i++){
		var valfunc = self[fobj.elements[i].name + "FN"];
		if(valfunc) {
			if (aok == true){
				val = valfunc(fobj.elements[i].value,fobj.elements[i].name); 
				if (val == true){
					aok = false;
				}
			}
		}
		str += fobj.elements[i].name + "=" + escape(fobj.elements[i].value) + "&";
	}
	//Then return the string values.
	return str;
}
	
function submitform (theform, serverPage, returnFunc){
	var str = getformvalues(theform);
	//If the validation is ok.
	if(aok == true){
		processajax (serverPage, returnFunc, "post", str);
	}
}