function svalidation(show) {
	var errvar = 0;
	errors = '';
	if ($('fname').value.length < 2) {
		errvar++;
		errors += "Please enter student's first name\n"; 
	}
	if ($('lname').value.length < 2) {
		errvar++;
		errors += "Please enter student's last name\n"; 
	}
	if (show == 1) {
		if (errvar != 0) {
			alert(errors);
		}
		else {
			addPerson();
		}
	}
}
function addPerson() {
	$('submit').disabled = true;
	loadingText('update');
	$('list').innerHTML = '<img src="images/load.gif" />';
	getvars = getAllInputs('form[general]');
	window.setTimeout(function() { ajaxCall('list','app.php','page=addperson&'+getvars); },100);
}
function savePerson() {
	$('submit').disabled = true;
	$('list').innerHTML = '<img src="images/load.gif" />';
	loadingText('update');
	getvars = getAllInputs('form[general]');
	window.setTimeout(function() { ajaxCall('list','app.php','page=saveperson&'+getvars); },100);
}
function removePerson(personid) {
	if (confirm("Are you sure you want to remove this student?")) {
		$('list').innerHTML = '<img src="images/load.gif" />';
		loadingText('update');
		getvars = getAllInputs('form[general]');
		window.setTimeout(function() { ajaxCall('list','app.php','page=removeperson&'+getvars+'&id='+personid); },100);
	}
}
