// JavaScript Document

/* This script and many more are available free online at
The JavaScript Source!! http://javascript.internet.com
Created by: wsabstract.com | http://www.wsabstract.com */

function checkRequired(which) {
	var pass = true;
	for (i=0; i<which.length; i++) {
		var tempobj = which.elements[i];
		if (tempobj.name == "firstName" ||
			tempobj.name == "lastName" ||
			tempobj.name == "phone") {
			if (((tempobj.type == "text" || tempobj.type == "textarea") &&
				  tempobj.value == '') || (tempobj.type.toString().charAt(0) == "s" &&
				  tempobj.selectedIndex == 0)) {
				pass = false;
				break;
			}
	 	}
	}
  	if (!pass) {
    	alert("The "+tempobj.name+" field is a required field.");
    	return false;
  	} else {
  		return true;
  	}
}

