function prepareForm() {		if (!document.getElementById || !document.getElementById('register_form')) return false;		var e = document.getElementById('register_form');		e.onsubmit = function() {				return validation(this);			}	}addLoadEvent(prepareForm);/* BEGIN: CODE FOR THE ENTIRE FORM VALIDATION *//* ============================= */// begin validation of the formvar warning_color = "#FFCCCC";var normal_color = "#EEEEEE";	// Create new main array. Good for empty text fieldsvar txt_name = new Array() // Form field names is listed first followed by a descriptive name to be show in the js pop up if left blanktxt_name[0] = new Array("first_name","First Name") txt_name[1] = new Array("last_name","Last Name") txt_name[2] = new Array("name","Organization Name") txt_name[3] = new Array("city","City") txt_name[4] = new Array("state","State") txt_name[5] = new Array("zip","Zip Code") txt_name[6] = new Array("phone","Telephone") txt_name[7] = new Array("email","Email") txt_name[8] = new Array("comments","Brief Description of how you intend to use Measures of Health") // check for blank text fieldsfunction missing_content(field){	// check the regular text fields for empty content	var j;	var missing_empty = "";	// [01] CHECK THE TEXT FIELDS FROM THE ARRAY ABOVE	for (j=0; j<txt_name.length; j++){		if (field[txt_name[j][0]].value == "") {			missing_empty+= txt_name[j][1] + "\n";			field[txt_name[j][0]].style.backgroundColor = warning_color;		} else {			field[txt_name[j][0]].style.backgroundColor = normal_color;		}	}	return missing_empty;}// email validationfunction checkEmail(myForm) {	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,5})+$/.test(myForm)){		return (true)	}	return (false)}function checkSelect(e,desc,form) {	var missing_select = '';	if (form[e].value == 'no selection') {		form[e].style.backgroundColor = warning_color;		missing_select+= desc + "\n";	} else {		form[e].style.backgroundColor = normal_color;	}	return missing_select;}function validation(which){ // validation of the entire form.	var missing = ""; 		// ck for blank fields	missing += missing_content(which);		// if the email field is filled in, we need to verify that the email is correct	if (which["email"].value != ""){		email = checkEmail(which["email"].value);			if (email == false){			missing+= "Invalid Email Address\n";			which["email"].style.backgroundColor = warning_color;		} else {			which["email"].style.backgroundColor = normal_color;		}	}	// Insert Additional Validation Here	// Validate that at least one organization type has been selected	var orgType = document.getElementById('org_type').getElementsByTagName('input');	var orgOther = document.getElementById('other_org_type');	var orgTypeChecked = false;		if (orgOther.value == '') {		for (var i = 0; i < orgType.length; i++) {			if (orgType[i].checked) {				orgTypeChecked = true;			}		}	}			if ((orgOther.value == '') && (!orgTypeChecked)) {		missing+= "Please indicate your organization type\n";	}	// Validate the organization size and scope	missing+= checkSelect("org_size","Organization Size",which);	missing+= checkSelect("org_scope","Organization Scope",which);		// FINALE: is anything missing?	if (missing != ""){		missing_hdr = "Please fill in the required information:\n";		alert (missing_hdr + missing);		return false;	} else {			return true;	}}/* END: CODE FOR THE ENTIRE FORM VALIDATION */