function checkFormFields(test_type) {	missinginfo = "";	if (test_type==1){		var questions = new Array(2, 9, 11, 12, 13, 14, 16, 24, 32, 34, 38);	}	else if (test_type==4){		var questions = new Array(52, 53);	}	for (var counter=0; counter<questions.length; counter++){				var i = questions[counter];		var fld_id = "q"+i;		var fld_label = counter+1;		//alert(fld_id);		//question id's 10, 12, 13, 14, 17, 39, 53, 58, 68, 69, 70 are memo fields, so check input value		//questions 53, 68 are only required based on the answer to previous question		if ( (i==10) || (i==12) || (i==13) || (i==14) || (i==17) || (i==39) || (i==53) || (i==58) || (i==68) ){			if (i==53){				// if "do not wish to partcipate is checked", q53 is mandatory				if (document.form.q52[2].checked && document.form[fld_id].value == ""){					missinginfo += "\n   - " + fld_label;}			}			else if (i==68){				// if "no" is checked for q67, q68 is mandatory				if (document.form.q67[1].checked && document.form[fld_id].value == ""){					missinginfo += "\n   - " + fld_label;}			}						else if (document.form[fld_id].value == "") 				{missinginfo += "\n   - " + fld_label;}		}				// else question is a radiobutton, so check if a button in the group is checked		else{			// q_id=36 is not required if q35=no			if (i==36 && document.form.radio113.checked) { 				// do nothing 			}			else {				var btn = valButton(document.form[fld_id]);				if (btn == null) {missinginfo += "\n   - " + fld_label;	}				}		}			} // end for i		if (missinginfo != "") {		if (test_type==4&&document.form.q52[3].checked)			missinginfo = "Please tell us why you do not wish to participate in the PI Phase."		else if (test_type==4)			missinginfo = "Please select an option."		else			missinginfo = "Please provide answers to questions" + missinginfo + "\n and submit again.";		alert(missinginfo);		return false;	}	else 		return true;		}  // end function CheckFormFields(testtype)// Radio Button Validation// copyright Stephen Chapman, 15th Nov 2004,14th Sep 2005// you may copy this function but please keep the copyright notice with itfunction valButton(btn) {    var cnt = -1;    for (var i=btn.length-1; i > -1; i--) {        if (btn[i].checked) {cnt = i; i = -1;}    }    if (cnt > -1) return btn[cnt].value;    else return null;}