function form_check(){

	// variables that will be used to validate integers
	/*var feastx = document.form.feast.value;
	var ghostx = document.form.ghost.value;
	var firstx = document.form.first.value;
	var channingx = document.form.channing.value;
	var improvx = document.form.improv.value;
	var meetingx = document.form.meeting.value;
	var lunchx = document.form.lunch.value;
	var footballx = document.form.football.value;
	var zoox = document.form.zoo.value;
	var bustripx = document.form.bustrip.value;
	var happeningx = document.form.happening.value;
	var feudx = document.form.feud.value;
	var clickmovx = document.form.clickmov.value;
	var fwlx = document.form.fwl.value;
	var brunchx = document.form.brunch.value;
	var jazzx = document.form.jazz.value;
	var museumx = document.form.museum.value;
	
	
	
	var idx = document.form.id.value;
	var phone1x = document.form.phone1.value;
	var phone2x = document.form.phone2.value;
	var phone3x = document.form.phone3.value;
	var zipx = document.form.zip.value;
	var classx = document.form.classyear.value;
	
	// this variable contains elements to test if the input is an integer
	var anum = /(^\d+$)|(^\d+\.\d+$)/;

	if (document.form.mp.value != "" || !anum.test(mpx)){
		alert ("Please enter a valid number");
		document.form.mp.focus();
		return (false);
	}

	if (document.form.mp.value != "" || !anum.test(mpx)){
		alert ("Please enter a valid number");
		document.form.mp.focus();
		return (false);
	}
	*/
}
function checkinfo(){
	var idx = document.form.id.value;
	var phone1x = document.form.phone1.value;
	var phone2x = document.form.phone2.value;
	var phone3x = document.form.phone3.value;
	var zipx = document.form.zip.value;
	var classx = document.form.classyear.value;
	
	// this variable contains elements to test if the input is an integer
	var anum = /(^\d+$)|(^\d+\.\d+$)/;
	if(document.form.sname.value == ""){  
		alert("Please enter the student's name");
		document.form.sname.focus();
		return(false);
	}
	if(document.form.id.value != ""){
		if (document.form.id.value.length < 7 || !anum.test(idx)){
			alert("Please enter your id number");
			document.form.id.focus();
			document.form.id.select();
			return(false);
		}
	}
	if(document.form.first.value == ""){  
		alert("Please enter your first name");
		document.form.first.focus();
		return(false);
	}
	if(document.form.last.value == ""){  
		alert("Please enter your last name");
		document.form.last.focus();
		return(false);
	}
	if(document.form.classyear.value == "" || document.form.classyear.value.length < 4 || !anum.test(classx)){
		alert("Please enter your class year");
		document.form.classyear.focus();
		document.form.classyear.select();
		return(false);
	}
	if(document.form.address1.value == ""){
    	alert ("Please enter your address");
     	document.form.address1.focus();
	 	return(false);
	}
	if(document.form.city.value == ""){
    	alert ("Please enter your city");
     	document.form.city.focus();
	 	return(false);
	}
	if(document.form.state.value == ""){
    	alert ("Please select your state");
     	document.form.state.focus();
	 	return(false);
	}
	if(document.form.zip.value.length < 5 || !anum.test(zipx)){
    	alert ("Please fill in your zip code");
     	document.form.zip.focus();
		document.form.zip.select();
	 	return(false);
	}
	if(document.form.email.value == ""){
    	alert ("Please fill in your email address");
     	document.form.email.focus();
	 	return(false);
	}
	if(document.form.phone1.value != "" || document.form.phone2.value != "" || document.form.phone3.value != ""){
		if(document.form.phone1.value.length < 3 || !anum.test(phone1x)){
			alert ("Please fill in the area code of your contact number");
			document.form.phone1.focus();
			document.form.phone1.select();
			return(false);
		}
		else if (document.form.phone2.value.length < 3 || !anum.test(phone2x)){
			alert ("Please fill in your contact number");
			document.form.phone2.focus();
			document.form.phone2.select();
			return(false);
		}
		else if (document.form.phone3.value.length < 4 || !anum.test(phone3x)){
			alert ("Please fill in the last 4 numbers of your contact number");
			document.form.phone3.focus();
			document.form.phone3.select();
			return(false);
		}
	}
	return (emailCheck(document.form.email.value));
}

<!--
var secs;
var timerID = null;
var timerRunning = false;
var delay = 500;

function InitializeTimer(){
    // Set the length of the timer, in seconds
    secs = .5
    StartTheTimer()
}

function StartTheTimer(){
    if (secs!=0){
        secs = secs - 1;
        timerRunning = true;
        timerID = self.setTimeout("StartTheTimer()", delay);
		checktotal();
    }
}
//-->

function calculate_ghost(){
	var calculated = 0;
	var value = document.form.ghost.value;
	calculated = 12*value;
	document.getElementById('ghost_output').innerHTML = calculated;			
}
function calculate_lunch(){
	var calculated = 0;
	var value = document.form.lunch.value;
	calculated = 15*value;
	document.getElementById('lunch_output').innerHTML = calculated;			
}
function calculate_zoo(){
	var calculated = 0;
	var value = document.form.zoo.value;
	calculated = 12*value;
	document.getElementById('zoo_output').innerHTML = calculated;			
}
function calculate_happening(){
	var calculated = 0;
	var value = document.form.happening.value;
	calculated = 15*value;
	document.getElementById('happening_output').innerHTML = calculated;			
}
function calculate_brunch(){
	var calculated = 0;
	var value = document.form.brunch.value;
	calculated = 15*value;
	document.getElementById('brunch_output').innerHTML = calculated;			
}
function checktotal(){
	var calculated = 0;
	var ghost = (document.form.ghost.value * 12);
	var lunch = (document.form.lunch.value * 15);
	var zoo = (document.form.zoo.value * 12);
	var happening = (document.form.happening.value * 15);
	var brunch = (document.form.brunch.value * 15);
	calculated = ghost + lunch + zoo + happening + brunch + 20;
	document.getElementById('total').innerHTML = calculated;
}