// JavaScript Document




function toggleB(bool) {
document.getElementById("degree_first_year").disabled=bool;
document.getElementById("degree_second_year").disabled=bool;
document.getElementById("degree_third_year").disabled=bool;
document.getElementById("degree_fourth_year").disabled=bool;
}



//function toggleD(bool) {
//document.getElementByName("degree_one").disabled = bool;
//document.getElementById("non_us_country").disabled=bool;
//}

function toggleE(bool) {
//document.getElementByName("degree_one").disabled = bool;
document.getElementById("non_us_country").value = "";
//document.getElementById("non_us_country").disabled=true;
}

function toggleMTO(bool) {
document.getElementById("dspeciality_modeling").value = "";
document.getElementById("dspeciality_technology").value = "";
document.getElementById("dspeciality_other").value = "";
}

function toggleMT(bool) {
document.getElementById("dspeciality_modeling").value = "";
document.getElementById("dspeciality_technology").value = "";
}

function toggleTO(bool) {
document.getElementById("dspeciality_technology").value = "";
document.getElementById("dspeciality_other").value = "";
}

function toggleMO(bool) {
document.getElementById("dspeciality_modeling").value = "";
document.getElementById("dspeciality_other").value = "";
}

<!----------------------------------------------------------------------------------------------------------------->  
<!-----------FUNCTION TO CHECK ----- MAXIMUM ---- NUMBER OF ITEMS SELECTED IN A CHECKBOX--------------------------->  
<!----------------------------------------------------------------------------------------------------------------->  

function y(_obj) {
var current
var currentgroup
var count=0;
var CHECK_LIMIT=new Array(); 

CHECK_LIMIT[1]=2; 
CHECK_LIMIT[2]=1; 

	for (var i=0;i<_obj.form[_obj.name].length;i++) {
	/* if it is checked -- count it */
	if(_obj.form[_obj.name][i].checked)
		count++;
	// get index of current checkbox
	if (_obj.form[_obj.name][i] == _obj) {
		current = i
		currentgroup = _obj.name.substr(5)
		}
	}
	
	if(count>CHECK_LIMIT[_obj.getAttribute("f")]) {
		_obj.checked=false;
		alert("You have exceeded the number of items allowed. Please de-select an item.");
		}
		
		var total=0;
	} 



<!----------------------------------------------------------------------------------------------------------------->  
<!-----------FUNCTION TO CHECK ----- JUST ONE ---- ITEM IS SELECTED IN A CHECKBOX---------------------------------->  
<!----------------------------------------------------------------------------------------------------------------->  

window.onload = function() {
addClickActionSecondBoxGroup('school_mentor')
addClickActionSecondBoxGroup('no_mentor')

}
function addClickActionSecondBoxGroup(name) {
var allBoxes = document.getElementsByName(name)
for (var i = 0; i < allBoxes.length; i++) {
allBoxes[i].onclick = function() { toggleBox(this) }
}
}
function toggleBox(box) {
var allBoxes = document.getElementsByName(box.name)
for (var i = 0; i < allBoxes.length; i++) {
if (box != allBoxes[i]) {
allBoxes[i].checked = false
}
}
}

<!----------------------------------------------------------------------------------------------------------------->  
<!-----------FUNCTION TO CHECK ----- MINIMUM ---- NUMBER OF ITEMS SELECTED IN A CHECKBOX--------------------------->  
<!----------------------------------------------------------------------------------------------------------------->  

function checkCheckboxGroup(theForm,theGroupname) {
var theElements = theForm.getElementsByTagName("input")
for (var i = 0; i < theElements.length; i++) {
if (theElements[i].type == 'checkbox' && theElements[i].name == theGroupname && theElements[i].checked)
return true
}
return false
}

<!----------------------------------------------------------------------------------------------------------------->  
<!-----------FUNCTION TO CHECK ----- MINIMUM ---- NUMBER OF ITEMS SELECTED IN A CHECKBOX--------------------------->  
<!----------------------------------------------------------------------------------------------------------------->  



function checkRadioGroup(theForm,theGroupname) {
var theElements = theForm.getElementsByTagName("input")
for (var i = 0; i < theElements.length; i++) {
if (theElements[i].type == 'radio' && theElements[i].name == theGroupname && theElements[i].checked)
return true
}
return false
}



<!----------------------------------------------------------------------------------------------------------------->  
<!-----------FUNCTION TO CHECK ----- MINIMUM THREE---- NUMBER OF ITEMS FOR EXPECTATIONS---------------------------->  
<!----------------------------------------------------------------------------------------------------------------->  

function checkExpectGroup(theForm,theGroupname) {
var theElements = theForm.getElementsByTagName("input")
var count=0
for (var i = 0; i < theElements.length; i++) {
if (theElements[i].type == 'checkbox' && theElements[i].name == theGroupname && theElements[i].checked)
{count = count + 1}

}
if (count<3)
{return false}
else{return true}
}

<!----------------------------------------------------------------------------------------------------------------->  
<!--------EMAIL AND CHECK IF PHONE AND ZIP IS NUMBER                   -------------------------------------------->  
<!----------------------------------------------------------------------------------------------------------------->  

var whitespace = " \t\n\r";
/* Define validations to run */


function isEmailAddr(email)
{
  var result = false
  var theStr = new String(email)
  var index = theStr.indexOf("@");
  if (index > 0)
  {
    var pindex = theStr.indexOf(".",index);
    if ((pindex > index+1) && (theStr.length > pindex+1))
	result = true;
  }
  return result;
}


function isDigit(c)
{   
 return ((c >= "0") && (c <= "9"))
}

function isInteger(field)
{ 
  var i, c;
  var s = field.value;
 for (i = 0; i < s.length; i++)
  { // Check if current character is number.
   c = s.charAt(i);
   if (!isDigit(c)) 
    {
	  field.focus();
      return false;
    }
  }
 
 return true;
}


function isNoInt(field)
{ 
  var i, c;
  var s = field.value;
 for (i = 0; i < s.length; i++)
  { // Check if current character is number.
   c = s.charAt(i);
   if (isDigit(c)) 
    {
    //field.focus();
      return false;
    }
  }
 
 return true;
}



<!----------------------------------------------------------------------------------------------------------------->  

function checkForm(theForm) {     

<!----------------------------------------------------------------------------------------------------------------->  
<!--------if the user selects other check if the text fields are empty -------------------------------------------->  
<!----------------------------------------------------------------------------------------------------------------->  
 
  	checkFields = "";
  	checkFieldsA = "";
 	checkFieldsB = "";
	checkFieldsD = "";
	checkFieldsDig = "";
	checkFieldsEmail = "";
	checkFieldsNotInt = "";
	
	<!----------------------------------------------------------------------------------------------------------------->  

	if(document.mentorForm.last.value=="")
	{
	checkFieldsA = "\n- Last Name ";
	}
	
	 if (!isNoInt(document.mentorForm.last))
     {
		 checkFieldsNotInt = "\n- Last Name ";
	   //alert( "Last Name cannot contain any numeric value." );
	 //return (false);
	 }
	<!----------------------------------------------------------------------------------------------------------------->  

	if(document.mentorForm.first.value=="")
	{
	checkFieldsA += "\n- First Name ";
	}
	
	if (!isNoInt(document.mentorForm.first))
     {
	   checkFieldsNotInt += "\n- First Name ";
	 //return (false);
	 }
	 
	<!----------------------------------------------------------------------------------------------------------------->  

	if(document.mentorForm.inst.value=="")
	{
	checkFieldsA += "\n- Institution ";
	}
	
	if (!isNoInt(document.mentorForm.inst))
     {
	   checkFieldsNotInt += "\n- Institution ";
	 //return (false);
	 }

	<!----------------------------------------------------------------------------------------------------------------->  

	if(document.mentorForm.position.value=="")
	{
	checkFieldsA += "\n- Position ";
	}
	
	if (!isNoInt(document.mentorForm.position))
     {
	   checkFieldsNotInt += "\n- Position ";
	 //return (false);
	 }
	
	<!----------------------------------------------------------------------------------------------------------------->  

	if(document.mentorForm.lineOne.value=="")
	{
	checkFieldsA += "\n- Address in Line 1 ";
	}
	
	<!----------------------------------------------------------------------------------------------------------------->  

	if(document.mentorForm.city.value=="")
	{
	checkFieldsA += "\n- City ";
	}
	if (!isNoInt(document.mentorForm.city))
     {
	   checkFieldsNotInt += "\n- City ";
	 //return (false);
	 }
	
	<!----------------------------------------------------------------------------------------------------------------->  

	if(document.mentorForm.state.value=="")
	{
	checkFieldsA += "\n- State ";
	}
	if (!isNoInt(document.mentorForm.state))
     {
	   checkFieldsNotInt += "\n- State ";
	 //return (false);
	 }
	<!----------------------------------------------------------------------------------------------------------------->  

	if(document.mentorForm.zip.value=="")
	{
	checkFieldsA += "\n- Zip ";
	}
	 if (!isInteger(document.mentorForm.zip))
     {
		 checkFieldsDig = "\n- Zip ";
		 //return (false);
		 }
	  

	<!----------------------------------------------------------------------------------------------------------------->  

	if(document.mentorForm.zip.length < 5)
	{
	checkFieldsA += "\n- Please Enter 5 digit Zip Code ";
	}
  
	<!----------------------------------------------------------------------------------------------------------------->  

	if(document.mentorForm.country.value=="")
	{
	checkFieldsA += "\n- Country ";
	} 
	
	<!----------------------------------------------------------------------------------------------------------------->  

	if(document.mentorForm.phone_ac.value=="")
	{
	checkFieldsA += "\n- Area Code ";
	} 
		
	
	if(document.mentorForm.phone.value=="")
	{
	checkFieldsA += "\n- Phone Number ";
	} 
	
	 <!-----------------------------------------------------------------------------------------------------------------> 
	
	if (!isInteger(document.mentorForm.phone_ac))
		  {
		  checkFieldsDig += "\n- Area Code ";
		  //document.mentorForm.phone_ac.focus(); 		
		  //return (false);  
		  }
		  
	 <!-----------------------------------------------------------------------------------------------------------------> 
	
	if (!isInteger(document.mentorForm.phone))
		  {
		  checkFieldsDig += "\n- Phone Number ";
		  //document.mentorForm.phone.focus(); 		
		  //return (false);  
		  }

	<!----------------------------------------------------------------------------------------------------------------->   
	  
	if(document.mentorForm.email.value=="")
	{
	checkFieldsA += "\n- Email ";
	} 
	
	<!-----------------------------------------------------------------------------------------------------------------> 
	
	if (!isEmailAddr(document.mentorForm.email.value))
	  {
		checkFieldsEmail = "\n- Email (Contact Information) ";
		//alert("Please enter a complete email address in the form: yourname@yourdomain.com");
		//document.mentorForm.email.focus();
		//return (false);
	  }

	<!-----------------------------------------------------------------------------------------------------------------> 
	
	if (! checkRadioGroup (theForm,'citizenship'))
		{
		checkFieldsA += "\n- Citizenship ";
		}
	 
	<!----------------------------------------------------------------------------------------------------------------->  
		  
	   if(theForm.citizenship[1].checked==true ){
		if(theForm.non_us_country.value=="")
		{
		   checkFields = "\n- If not a U.S. Citizen, of what country are you a resident?\n";
		} 
	  }
	  
		if(theForm.citizenship[2].checked==true ){
		if(theForm.non_us_country.value=="")
		{
		   checkFields += "\n- If not a U.S. Citizen, of what country are you a resident?\n ";
		} 
	  }
	  
		if(theForm.citizenship[3].checked==true ){
		if(theForm.non_us_country.value=="")
		{
		   checkFields += "\n- If not a U.S. Citizen, of what country are you a resident?\n";
		} 
	  }
	
	
	<!-----------------------------------------------------------------------------------------------------------------> 
	
	if (! checkRadioGroup (theForm,'gender'))
		{
		checkFieldsA += "\n- Gender ";
		}
	  
	
	<!-----------------------------------------------------------------------------------------------------------------> 
	
	if (! checkRadioGroup (theForm,'etnicity'))
		{
		checkFieldsA += "\n- Race/Ethnicity ";
		}
	
	
	<!----------------------------------------------------------------------------------------------------------------->  
	
	   if(theForm.etnicity[3].checked==true ){
		if(theForm.etnicity_other.value=="")
		{
		   checkFields += "\n- Other Ethnicity\n";
		} 
	  }
	  
	<!----------------------------------------------------------------------------------------------------------------->  
	
	  if(theForm.etnicity_other.value!="")
		{
		 if(theForm.etnicity[3].checked==false ){
		   checkFieldsB = "\n- Other Ethnicity\n";
		} 
	  }
	
	<!-----------------------------------------------------------------------------------------------------------------> 
	
	if (! checkRadioGroup (theForm,'degree'))
		{
		checkFieldsA += "\n- Highest degree received";
		}
	<!-----------------------------------------------------------------------------------------------------------------> 
		
	if(theForm.degree[0].checked==true ){
		if(! checkRadioGroup (theForm,'degree_two'))
		{
		   checkFields += "\n- Please specify your current year of Graduate study\n";
		}
		
	  }
	  
	    <!-----------------------------------------------------------------------------------------------------------------> 
	
	if(theForm.degree[1].checked==true ){
		if(! checkRadioGroup (theForm,'degree_two'))
		{
		   checkFields += "\n- Please specify your current year of Ph.D \n";
		}
		
	  }
	
	 <!-----------------------------------------------------------------------------------------------------------------> 
	
	  if(theForm.degree_year.value=="")
		{
		   checkFieldsD += "\n- Please Indicate the year you received your highest degree \n";
		} 
	
	 <!-----------------------------------------------------------------------------------------------------------------> 
	
	if (!isInteger(document.mentorForm.degree_year))
		  {
		  checkFieldsDig += "\n- Year you received your highest degree ";
		  document.mentorForm.degree_year.focus(); 		
		 // return (false);  
		  }
	
	<!-----------------------------------------------------------------------------------------------------------------> 

	if(document.mentorForm.admin_acad.value=="")
		{
		checkFieldsA += "\n- Academic Preparation  ";
		} 
		
	<!----------------------------------------------------------------------------------------------------------------->   
	   
	if (! checkCheckboxGroup(theForm,'discipline_array[]'))
		{
		checkFieldsA += "\n- Discipline ";
		}
	
	<!----------------------------------------------------------------------------------------------------------------->   
	
	
	if(theForm.document.mentorForm.elements['discipline_array[]'][1].checked==true){
		if(theForm.engineering_other.value=="")
		{
		   checkFields += "\n- Discipline: Engineering (please specify) \n";
		} 
	  }
	
	<!----------------------------------------------------------------------------------------------------------------->   
		
	
		if(theForm.engineering_other.value!="")
		{
		if(theForm.document.mentorForm.elements['discipline_array[]'][1].checked==false){
		   checkFieldsB += "\n- Discipline: Engineering\n";
		} 
	  }
	
	<!----------------------------------------------------------------------------------------------------------------->   
	
	
	if(theForm.document.mentorForm.elements['discipline_array[]'][13].checked==true
	){
		if(theForm.technology_other.value=="")
		{
		   checkFields += "\n- Discipline: Technology\n";
		} 
	  }
	  
	<!----------------------------------------------------------------------------------------------------------------->   
		
		if(theForm.technology_other.value!="")
		{
		if(theForm.document.mentorForm.elements['discipline_array[]'][13].checked==false){
		   checkFieldsB += "\n- Discipline: Technology\n";
		} 
	  } 
	 	 
	 <!----------------------------------------------------------------------------------------------------------------->   
	
	
	if(theForm.document.mentorForm.elements['discipline_array[]'][14].checked==true
	){
		if(theForm.discipline_array_other.value=="")
		{
		   checkFields += "\n- Other Academic Discipline\n";
		} 
	  }
	  
	<!----------------------------------------------------------------------------------------------------------------->   
		
		if(theForm.discipline_array_other.value!="")
		{
		if(theForm.document.mentorForm.elements['discipline_array[]'][14].checked==false){
		   checkFieldsB += "\n- Other Academic Discipline\n";
		} 
	  } 
	 
	<!----------------------------------------------------------------------------------------------------------------->   
	   
	
	if (! checkRadioGroup (theForm,'dspeciality'))
		{
		checkFieldsA += "\n- Disciplinary Specialty ";
		}
	
	<!----------------------------------------------------------------------------------------------------------------->  
	
	   if(theForm.dspeciality[4].checked==true ){
		if(theForm.dspeciality_modeling.value=="")
		{
		   checkFields += "\n- Disciplinary Speciality: Modeling (Please Specify)\n";
		} 
	  }
	  
	  
	  
	  <!----------------------------------------------------------------------------------------------------------------->   
		
		if(theForm.dspeciality_modeling.value!="")
		{
		if(theForm.dspeciality[4].checked==false){
		   checkFieldsB += "\n- Disciplinary Speciality: Modeling\n";
		} 
	  } 
	  
	  <!----------------------------------------------------------------------------------------------------------------->  
	
	   if(theForm.dspeciality[6].checked==true ){
		if(theForm.dspeciality_technology.value=="")
		{
		   checkFields += "\n- Disciplinary Speciality: Technology Application/Development (Please Specify)\n";
		} 
	  } 
	  
	 <!----------------------------------------------------------------------------------------------------------------->   
		
		if(theForm.dspeciality_technology.value!="")
		{
		if(theForm.dspeciality[6].checked==false){
		   checkFieldsB += "\n- Disciplinary Speciality: Technology Application/Development\n";
		} 
	  } 
	  
	  
	  <!----------------------------------------------------------------------------------------------------------------->  
	
	   if(theForm.dspeciality[7].checked==true ){
		if(theForm.dspeciality_other.value=="")
		{
		   checkFields += "\n- Disciplinary Speciality: Other (Please Specify)\n";
		} 
	  }
	  
	<!----------------------------------------------------------------------------------------------------------------->   
		
		if(theForm.dspeciality_other.value!="")
		{
		if(theForm.dspeciality[7].checked==false){
		   checkFieldsB += "\n- Disciplinary Speciality: Other\n";
		} 
	  }
	
	
	<!----------------------------------------------------------------------------------------------------------------->   
	   
	if (! checkCheckboxGroup(theForm,'esp_array[]'))
		{
		checkFieldsA += "\n- Environmental Specialty ";
		}
		
	<!----------------------------------------------------------------------------------------------------------------->   
	   
	if(theForm.document.mentorForm.elements['esp_array[]'][9].checked==true){
		if(theForm.esp_array_other.value=="")
		{
		   checkFields += "\n- Other Environmental Specialty\n";
		} 
	  }
	
	<!----------------------------------------------------------------------------------------------------------------->   
		
		if(theForm.esp_array_other.value!="")
		{
		if(theForm.document.mentorForm.elements['esp_array[]'][9].checked==false){
		   checkFieldsB += "\n- Other Environmental Specialty\n";
		} 
	  }
	  
	<!-----------------------------------------------------------------------------------------------------------------> 
		
	if(document.mentorForm.research_summary.value=="")
		{
		checkFieldsA += "\n- Biographical and Research Summary ";
		} 
	<!----------------------------------------------------------------------------------------------------------------->   
		
		if(theForm.STEM_contact_A.value!="" || theForm.STEM_website_A.value!="" || theForm.STEM_phone_A.value!="" || theForm.STEM_email_A.value!=""  )
		{
		if(theForm.STEM_name_A.value==""){
		   checkFieldsD = "\n- Program 1 Name\n";
		} 
	  }
	
	<!----------------------------------------------------------------------------------------------------------------->   
		
		if(theForm.STEM_contact_B.value!="" || theForm.STEM_website_B.value!="" || theForm.STEM_phone_B.value!="" || theForm.STEM_email_B.value!=""  )
		{
		if(theForm.STEM_name_B.value==""){
		   checkFieldsD += "\n- Program 2 Name\n";
		} 
	  }
	
	<!----------------------------------------------------------------------------------------------------------------->   
		
		if(theForm.STEM_contact_C.value!="" || theForm.STEM_website_C.value!="" || theForm.STEM_phone_C.value!="" || theForm.STEM_email_C.value!=""  )
		{
		if(theForm.STEM_name_C.value==""){
		   checkFieldsD += "\n- Program 3 Name\n";
		} 
	  }
	  
	  <!----------------------------------------------------------------------------------------------------------------->   
		
		if(theForm.STEM_contact_D.value!="" || theForm.STEM_website_D.value!="" || theForm.STEM_phone_D.value!="" || theForm.STEM_email_D.value!=""  )
		{
		if(theForm.STEM_name_D.value==""){
		   checkFieldsD += "\n- Program 4 Name\n";
		} 
	  }
	  
	<!----------------------------------------------------------------------------------------------------------------->   
	
  if(theForm.STEM_name_A.value!=""){
	    if (!isEmailAddr(document.mentorForm.STEM_email_A.value))
	  {
		checkFieldsEmail += "\n- Program 1 Email ";
		//document.mentorForm.STEM_email_A.focus();
		//return (false);
	  }
  }
  
	    if(theForm.STEM_name_B.value!=""){
	  if (!isEmailAddr(document.mentorForm.STEM_email_B.value))
	  {
		checkFieldsEmail += "\n- Program 2 Email ";
		//document.mentorForm.STEM_email_B.focus();
		//return (false);
	  }
		}
	  
	    if(theForm.STEM_name_C.value!=""){
	  if (!isEmailAddr(document.mentorForm.STEM_email_C.value))
	  {
		checkFieldsEmail += "\n- Program 3 Email ";
		//document.mentorForm.STEM_email_C.focus();
		//return (false);
	  }
		}
	  
	    if(theForm.STEM_name_D.value!=""){
	  if (!isEmailAddr(document.mentorForm.STEM_email_D.value))
	  {
		checkFieldsEmail += "\n- Program 4 Email ";
		//document.mentorForm.STEM_email_D.focus();
		//return (false);
	  }
		}
		
	 
	<!----------------------------------------------------------------------------------------------------------------->   
		
	 if (theForm.school_mentor.value=="")
		{
		  checkFields += "\n- Did you have a mentor during your undergraduate/graduate school experience?\n";
		}
	
	
	if(theForm.school_mentor[1].checked==true ){
		if (theForm.no_mentor[0].checked==false && theForm.no_mentor[1].checked==false)
		{
		checkFieldsA += "\n- If you did not have a mentor, was it by choice or due to the absence of an appropriate individual who was willing to serve in this capacity? ";
		} 
		} 
		
		
 	<!----------------------------------------------------------------------------------------------------------------->   
		
		if (! checkRadioGroup (theForm,'ques_one'))
		{
		checkFieldsA += "\n- Have you participated in the MSPHD'S previously? ";
		}
	   <!----------------------------------------------------------------------------------------------------------------->   
		
		if (! checkRadioGroup (theForm,'ques_two'))
		{
		checkFieldsA += "\n- Have you participated in any diversity training program? ";
		}
	 <!----------------------------------------------------------------------------------------------------------------->   
		
		if(theForm.professional_experience.value=="")
		{
		 checkFieldsA += "\n- Professional Experience & Affilations";
		}
	<!----------------------------------------------------------------------------------------------------------------->   
	   
	if(theForm.document.mentorForm.elements['comm_service_array[]'][6].checked==true
	){
		if(theForm.comm_service_array_otherA.value=="")
		{
		  checkFields += "\n- Other Mentor Commitment of Service Item 7\n";
		} 
	  }
	  
		 <!----------------------------------------------------------------------------------------------------------------->   
	   
	if(theForm.document.mentorForm.elements['comm_service_array[]'][7].checked==true
	){
		if(theForm.comm_service_array_otherB.value=="")
		{
		  checkFields += "\n- Other Mentor Commitment of Service Item 8\n";
		} 
	  }
	  
	  
	<!----------------------------------------------------------------------------------------------------------------->   
		
		if(theForm.comm_service_array_otherA.value!="")
		{
		if(theForm.document.mentorForm.elements['comm_service_array[]'][6].checked==false){
		   checkFieldsB += "\n- Other Mentor Commitment of Service Item 7\n";
		} 
	  }
	  
	  
	 <!----------------------------------------------------------------------------------------------------------------->   
		
		if(theForm.comm_service_array_otherB.value!="")
		{
		if(theForm.document.mentorForm.elements['comm_service_array[]'][7].checked==false){
		   checkFieldsB += "\n- Other Mentor Commitment of Service Item 8\n";
		} 
	  }
	   <!----------------------------------------------------------------------------------------------------------------->   
	   
	if(theForm.document.mentorForm.elements['comm_time_array[]'][3].checked==true
	){
		if(theForm.comm_time_array_other.value=="")
		{
		 checkFields += "\n- Other Mentor Commitment of Time\n";
		} 
	  }
	  
	<!----------------------------------------------------------------------------------------------------------------->   
		
		if(theForm.comm_time_array_other.value!="")
		{
		if(theForm.document.mentorForm.elements['comm_time_array[]'][3].checked==false){
		   checkFieldsB += "\n- Other Mentor Commitment of Time\n";
		} 
	  }
	  
		 <!----------------------------------------------------------------------------------------------------------------->   
	   
	if(theForm.document.mentorForm.elements['exp_array[]'][4].checked==true
	){
		if(theForm.exp_array_otherA.value=="")
		{
		 checkFields += "\n- Other Mentee Expectations of Mentor Item 5\n";
		} 
	  }
	
	<!----------------------------------------------------------------------------------------------------------------->   
		
		if(theForm.exp_array_otherA.value!="")
		{
		if(theForm.document.mentorForm.elements['exp_array[]'][4].checked==false){
		   checkFieldsB += "\n- Other Mentee Expectations of Mentor Item 5\n";
		} 
	  }
	  
		 <!----------------------------------------------------------------------------------------------------------------->   
	   
	if(theForm.document.mentorForm.elements['exp_array[]'][5].checked==true
	){
		if(theForm.exp_array_otherB.value=="")
		{
		  checkFields += "\n- Other Mentee Expectations of Mentor Item 6\n";
		} 
	  }
	  
	<!-----------------------------------------------------------------------------------------------------------------> 
	
	if(theForm.exp_array_otherB.value!="")
		{
		if(theForm.document.mentorForm.elements['exp_array[]'][5].checked==false){
		   checkFieldsB += "\n- Other Mentee Expectations of Mentor Item 6\n";
		} 
	  }

	  <!----------------------------------------------------------------------------------------------------------------->  
	  
		 
	if(checkFieldsA>""){
		alert("Please Enter your :\t\t\t\n-------------------" +checkFieldsA+"\n ")
		return false
	  }
	
	if(checkFields>""){
		alert("Please insert a value in the text field or de-select the checkbox.\t\t\t\n " +checkFields+"\n\n\Fields belonging to this Group are empty:\t ")
		return false
	  }
	   
	   if(checkFieldsEmail>""){
		alert("Please enter a complete email address for the following items in the form: yourname@yourdomain.com :\t\t\t\n-------------------" +checkFieldsEmail+"\n ")
		return false
	  }
	  
	  if(checkFieldsB>""){
		alert("Please select the checkbox or delete the value in the text field.\t\t\t\n " +checkFieldsB+"\n\n\Checkbox belonging to the above item(s) is not selected:\t ")
		return false
	  }
	 
	  if(checkFieldsD>""){
		alert("Please Enter a value for :\t\t\t\n-------------------" +checkFieldsD+"\n ")
		return false
	  }
	  
	   if(checkFieldsDig>""){
		alert("The following items MUST contain only Digits :\t\t\t\n-------------------" +checkFieldsDig+"\n ")
		return false
	  }
	  
	  
	 
	 
	 if(checkFieldsNotInt>""){
		alert("The following items cannot contain any numeric value :\t\t\t\n-------------------" +checkFieldsNotInt+"\n ")
		return false
	  }
	 
	 
	 
	<!----------------------------------------------------------------------------------------------------------------->  
	<!----------------------------------------------------------------------------------------------------------------->  
	<!----------------------------------------------------------------------------------------------------------------->  
	
		 
	if (document.mentorForm.zip.value.length < 5 || document.mentorForm.zip.value.length > 5 )	
		 { 																		
		 alert(" Please Enter 5 digit Zip Code.");  
		  document.mentorForm.zip.focus(); 				 
		return (false); 								
		} 
		
				
		if (document.mentorForm.phone_ac.value.length < 3)	
		 { 																		
		 alert(" Please Enter 3 digit Area Code.");  
		  document.mentorForm.zip.focus(); 				 
		return (false); 								
		} 
		
		if (document.mentorForm.phone.value.length < 7)	
		 { 																		
		 alert(" Please Enter 7 digit Phone Number.");  
		  document.mentorForm.zip.focus(); 				 
		return (false); 								
		}
		
		if (document.mentorForm.research_past.value.length > 1400)	
		 { 																		
		 alert(" You have exceeded the maximum limit for Past Research Area.");  
		  document.mentorForm.research_past.focus(); 				 
		return (false); 								
		}
		
		if (document.mentorForm.research_current.value.length > 1400)	
		 { 																		
		 alert(" You have exceeded the maximum limit for Current Research Area.");  
		  document.mentorForm.research_current.focus(); 				 
		return (false); 								
		}
		
		if (document.mentorForm.research_future.value.length > 1400)	
		 { 																		
		 alert(" You have exceeded the maximum limit for Future Research Area.");  
		  document.mentorForm.research_future.focus(); 				 
		return (false); 								
		}
		
		
																	
	   
			  
	<!----------------------------------------------------------------------------------------------------------------->  
	<!--------------------------------         Delete Erroneous Data     ---------------------------------------------->  
	<!----------------------------------------------------------------------------------------------------------------->  
	

	
	<!----------------------------------------------------------------------------------------------------------------->  
	<!--------------------------------         Minimum One Selected      ---------------------------------------------->  
	<!----------------------------------------------------------------------------------------------------------------->  

	
	
	
	if (! checkCheckboxGroup(theForm,'comm_service_array[]'))
	{alert ('Please Select a value for Service Commitment.')
	 return false}
	 
	if (! checkCheckboxGroup(theForm,'comm_time_array[]'))
	{alert ('Please Select a value for Time Commitment.')
	 return false}
	 
	if (! checkExpectGroup(theForm,'exp_array[]'))
	{alert ('Please select at least three commitments that you expect your mentor to make to support the success of the relationship..')
	 return false}
	 }
	

function toggleC(bool) {
//document.getElementByName("degree_one").disabled = bool;
document.getElementById("no_mentor_A").disabled=bool;
document.getElementById("no_mentor_B").disabled=bool;
}

function toggleCC(bool) {
//document.getElementByName("degree_one").disabled = bool;
document.getElementById("no_mentor_A").disabled=bool;
document.getElementById("no_mentor_A").checked=false;
document.getElementById("no_mentor_B").disabled=bool;
document.getElementById("no_mentor_B").checked=false;
}