//Rotating Picture Code
		myImages = new Array("images/splashIMG-2.jpg","images/dog.jpg")
		altTags = new Array("Elderly People.","dog")
			function rotate() {
				if(document.images) {
					var length = myImages.length - 1
					var temp = Math.round(Math.random() * length)
					document.homePagePic.src = myImages[temp]
					document.homePagePic.alt = altTags[temp]
				}
			}
			<!--			
				var CannotEmployeed = "";
				var strMessage;

				function onEnterSSN(Section)
				{
					// Get the object ID of the input box
					var ObjectID = 'SSN' + Section;
					
					// Make sure the character that is just entered is a digit
					var SSNValue = document.getElementById(ObjectID).value;	
					var CharCode = SSNValue.charCodeAt(SSNValue.length - 1);
					
					if ((CharCode < 48) ||(CharCode > 57))
					{
						alert("Your input is invalid. Only numbers are allowed.");
						document.getElementById(ObjectID).value = SSNValue.substr(0, SSNValue.length - 1);
						return;
					}
					// If required digits have been entered
					if ((Section == 1) && (SSNValue.length == 3))
					{
						// Jump to the second part
						document.getElementById('SSN' + 2).focus();
					}
					if ((Section == 2) && (SSNValue.length == 2))
					{
						// Jump to the third part
						document.getElementById('SSN' + 3).focus();
					}
				}				
				function onEnterZip(Section)
				{
					// Get the object ID of the input box
					var ObjectID = 'Zip' + Section;
					
					// Make sure the character that is just entered is a digit
					var ZIPValue = document.getElementById(ObjectID).value;	
					var CharCode = ZIPValue.charCodeAt(ZIPValue.length - 1);
					
					if ((CharCode < 48) ||(CharCode > 57))
					{
						alert("Your input is invalid. Only numbers are allowed.");
						document.getElementById(ObjectID).value = ZIPValue.substr(0, ZIPValue.length -1); //-1
						return;
					}
					
					// If required digits have been entered
					if ((Section == 1) && (ZIPValue.length == 5))
					{
						// Jump to the second part
						document.getElementById('Zip' + 2).focus();
					}
				}
				//validates home phone #
				function onEnterHomePhone(Section)
				{
					// Get the object ID of the input box
					var ObjectID = 'HomePhone' + Section;
					// Make sure the character that is just entered is a digit
					var HomePhoneValue = document.getElementById(ObjectID).value;	
					var CharCode = HomePhoneValue.charCodeAt(HomePhoneValue.length - 1);
					
					if ((CharCode < 48) ||(CharCode > 57))
					{
						alert("Your input is invalid. Only numbers are allowed.");
						document.getElementById(ObjectID).value = HomePhoneValue.substr(0, HomePhoneValue.length - 1);
						return;
					}
					// If required digits have been entered
					if ((Section == 1) && (HomePhoneValue.length == 3))
					{
						// Jump to the second part
						document.getElementById('HomePhone' + 2).focus();
					}
					// If required digits have been entered
					if ((Section == 2) && (HomePhoneValue.length == 3))
					{
						// Jump to the third part
						document.getElementById('HomePhone' + 3).focus();
					}
			  }
			  //validates work phone
			  function onEnterWorkPhone(Section)
				{
					// Get the object ID of the input box
					var ObjectID = 'WorkPhone' + Section;
					// Make sure the character that is just entered is a digit
					var WorkPhoneValue = document.getElementById(ObjectID).value;	
					var CharCode = WorkPhoneValue.charCodeAt(WorkPhoneValue.length - 1);
					
					if ((CharCode < 48) ||(CharCode > 57))
					{
						alert("Your input is invalid. Only numbers are allowed.");
						document.getElementById(ObjectID).value = WorkPhoneValue.substr(0, WorkPhoneValue.length - 1);
						return;
					}
					// If required digits have been entered
					if ((Section == 1) && (WorkPhoneValue.length == 3))
					{
						// Jump to the second part
						document.getElementById('WorkPhone' + 2).focus();
					}
					// If required digits have been entered
					if ((Section == 2) && (WorkPhoneValue.length == 3))
					{
						// Jump to the third part
						document.getElementById('WorkPhone' + 3).focus();
					}
			  }
				// job phone number validations jobs 1-4 		  
			  // validates supervisor phone number for job 1
			  function onEnterjob1Phone(Section)
			  {
					// Get the object ID of the input box
					var ObjectID = 'job1-superphone' + Section;
					
					// Make sure the character that is just entered is a digit
					var job1PhoneValue = document.getElementById(ObjectID).value;	
					var CharCode = job1PhoneValue.charCodeAt(job1PhoneValue.length - 1);
					
					if ((CharCode < 48) ||(CharCode > 57))
					{
						alert("Your input is invalid. Only numbers are allowed.");
						document.getElementById(ObjectID).value = job1PhoneValue.substr(0, job1PhoneValue.length - 1);
						return;
					}
					
					// If required digits have been entered
					if ((Section == 1) && (job1PhoneValue.length == 3))
					{
						// Jump to the second part
						document.getElementById('job1-superphone' + 2).focus();
					}
					// If required digits have been entered
					if ((Section == 2) && (job1PhoneValue.length == 3))
					{
						// Jump to the third part
						document.getElementById('job1-superphone' + 3).focus();
					}
			  }
			   // validates supervisor phone number for job 2
			  function onEnterjob2Phone(Section)
			  {
					// Get the object ID of the input box
					var ObjectID = 'job2-superphone' + Section;
					
					// Make sure the character that is just entered is a digit
					var job2PhoneValue = document.getElementById(ObjectID).value;	
					var CharCode = job2PhoneValue.charCodeAt(job2PhoneValue.length - 1);
					
					if ((CharCode < 48) ||(CharCode > 57))
					{
						alert("Your input is invalid. Only numbers are allowed.");
						document.getElementById(ObjectID).value = job2PhoneValue.substr(0, job2PhoneValue.length - 1);
						return;
					}
					
					// If required digits have been entered
					if ((Section == 1) && (job2PhoneValue.length == 3))
					{
						// Jump to the second part
						document.getElementById('job2-superphone' + 2).focus();
					}
					// If required digits have been entered
					if ((Section == 2) && (job2PhoneValue.length == 3))
					{
						// Jump to the third part
						document.getElementById('job2-superphone' + 3).focus();
					}
			  }
			   // validates supervisor phone number for job 3
			  function onEnterjob3Phone(Section)
			  {
					// Get the object ID of the input box
					var ObjectID = 'job3-superphone' + Section;
					
					// Make sure the character that is just entered is a digit
					var job3PhoneValue = document.getElementById(ObjectID).value;	
					var CharCode = job3PhoneValue.charCodeAt(job3PhoneValue.length - 1);
					
					if ((CharCode < 48) ||(CharCode > 57))
					{
						alert("Your input is invalid. Only numbers are allowed.");
						document.getElementById(ObjectID).value = job3PhoneValue.substr(0, job3PhoneValue.length - 1);
						return;
					}
					
					// If required digits have been entered
					if ((Section == 1) && (job3PhoneValue.length == 3))
					{
						// Jump to the second part
						document.getElementById('job3-superphone' + 2).focus();
					}
					// If required digits have been entered
					if ((Section == 2) && (job3PhoneValue.length == 3))
					{
						// Jump to the third part
						document.getElementById('job3-superphone' + 3).focus();
					}
			  }
			   // validates supervisor phone number for job 4
			  function onEnterjob4Phone(Section)
			  {
					// Get the object ID of the input box
					var ObjectID = 'job4-superphone' + Section;
					
					// Make sure the character that is just entered is a digit
					var job4PhoneValue = document.getElementById(ObjectID).value;	
					var CharCode = job4PhoneValue.charCodeAt(job4PhoneValue.length - 1);
					
					if ((CharCode < 48) ||(CharCode > 57))
					{
						alert("Your input is invalid. Only numbers are allowed.");
						document.getElementById(ObjectID).value = job4PhoneValue.substr(0, job4PhoneValue.length - 1);
						return;
					}
					
					// If required digits have been entered
					if ((Section == 1) && (job4PhoneValue.length == 3))
					{
						// Jump to the second part
						document.getElementById('job4-superphone' + 2).focus();
					}
					// If required digits have been entered
					if ((Section == 2) && (job4PhoneValue.length == 3))
					{
						// Jump to the third part
						document.getElementById('job4-superphone' + 3).focus();
					}
			  }
	
	
       // references phone validation stuff  
	    // validates ref1 phone number
			  function onEnterref1Phone()
			  {
					// Get the object ID of the input box
					var ObjectID = 'ref1-phone';
					
					// Make sure the character that is just entered is a digit
					var ref1PhoneValue = document.getElementById(ObjectID).value;	
					var CharCode = ref1PhoneValue.charCodeAt(ref1PhoneValue.length - 1);
					
					if ((CharCode < 48) ||(CharCode > 57))
					{
						alert("Your input is invalid. Only numbers are allowed.");
						document.getElementById(ObjectID).value = ref1PhoneValue.substr(0, ref1PhoneValue.length - 1);
						return;
					}
			  } 
	  // validates ref2 phone number
			  function onEnterref2Phone()
			  {
					// Get the object ID of the input box
					var ObjectID = 'ref2-phone';
					
					// Make sure the character that is just entered is a digit
					var ref2PhoneValue = document.getElementById(ObjectID).value;	
					var CharCode = ref2PhoneValue.charCodeAt(ref2PhoneValue.length - 1);
					
					if ((CharCode < 48) ||(CharCode > 57))
					{
						alert("Your input is invalid. Only numbers are allowed.");
						document.getElementById(ObjectID).value = ref2PhoneValue.substr(0, ref2PhoneValue.length - 1);
						return;
					}	
			  } 
	 // validates ref3 phone number
			  function onEnterref3Phone()
			  {
					// Get the object ID of the input box
					var ObjectID = 'ref3-phone';
					
					// Make sure the character that is just entered is a digit
					var ref3PhoneValue = document.getElementById(ObjectID).value;	
					var CharCode = ref3PhoneValue.charCodeAt(ref3PhoneValue.length - 1);
					
					if ((CharCode < 48) ||(CharCode > 57))
					{
						alert("Your input is invalid. Only numbers are allowed.");
						document.getElementById(ObjectID).value = ref3PhoneValue.substr(0, ref3PhoneValue.length - 1);
						return;
					}
			  } 
     // end references phone validation
	     	
		//generic email validation - pass in EID as 'string' and it will work magics!
			 function onEnterEmailGEN(EID) 
			  {
			    var ich = new Object();
			    ich.ident=EID;
				//alert(ich.ident);
			    var eValue = document.getElementById(ich.ident).value;
				var AtPos = eValue.indexOf("@")
				var StopPos = eValue.lastIndexOf(".")
				Message = ""

				if (eValue == "")  //check if it is blank
				{
					alert("Your email address is invalid.\n");
				}

				else if (AtPos == -1 || StopPos == -1) //checks for "@" or "." and returns number greater than -1
				{
					alert("Your email address is invalid.\n");
				}

				else if (StopPos < AtPos) //check for "." before "@"
				{
					alert("Your email address is invalid.\n");
				}

				else if (StopPos - AtPos == 1) //checks for "@" and "." in correct order BUT next to eachother (so still invalid)
				{
					alert("Your email address is invalid.\n");
				} 
					return 
			 }
			  // this checks that the SalaryReq is a number
			  // outputs error message if it's not
			  function onEnterSalaryReq()
			  {
					// Get the object ID of the input box
					var ObjectID = 'SalaryReq';
					
					// Make sure the character that is just entered is a digit
					var SalValue = document.getElementById(ObjectID).value;	
					var CharCode = SalValue.charCodeAt(SalValue.length - 1);
					
					if ((CharCode < 48) ||(CharCode > 57))
					{
						alert("Your input is invalid. Only numbers are allowed.");
						document.getElementById(ObjectID).value = SalValue.substr(0, SalValue.length - 1);
						return;
					}
			 }	
			  // this checks that the Salary Range is a number
			  // outputs error message if it's not
			  function onEnterSalRangeVal()
			  {
					// Get the object ID of the input box
					var ObjectID = 'SalaryRange';
					
					// Make sure the character that is just entered is a digit
					var SalValue2 = document.getElementById(ObjectID).value;	
					var CharCode = SalValue2.charCodeAt(SalValue2.length - 1);
					
					if ((CharCode < 48) ||(CharCode > 57))
					{
						alert("Your input is invalid. Only numbers are allowed.");
						document.getElementById(ObjectID).value = SalValue2.substr(0, SalValue2.length - 1);
						return;
					}
			 }	
			  // this checks that starting salary is a number for jobs 1-4
			  // outputs error message if it's not
			  function onEnterjStartSalary()
			  {
					// generate job 1-4 ref ids
					// job1-startSalary
					var myjobSal = new Object(); // makes a blank object
					var count=5;
					for (var i=1; i<count; i++)
					{
					  //var myjobSal = new Object(); // makes a blank object
					  var str1="job"; //this makes the first part of the ref id
					  var str1num=str1+i; //this concatenates the # part of the ref id
			
					  var ending1 ="-startSalary"; //initializes endings
					 
					  myjobSal.details = str1num+ending1; //gives this object the property
				    
					  //var ObjectID = 'myjob.details';
					  
					  // Make sure the character that is just entered is a digit
					  var SalValue = document.getElementById(myjobSal.details).value;	
					  var CharCode = SalValue.charCodeAt(SalValue.length - 1);
					
					  if ((CharCode < 48) ||(CharCode > 57))
					  {
						alert("Your input is invalid. Only numbers are allowed.");
						document.getElementById(myjobSal.details).value = SalValue.substr(0, SalValue.length - 1);
						return;
					  }
			       }	
			  }
			  // this checks that ending salary is a number for jobs 1-4
			  // outputs error message if it's not
			  function onEnterjEndSalary()
			  {
					// generate job 1-4 ref ids
					// job1-endSalary
					var myjobSal = new Object(); // makes a blank object
					var count=5;
					for (var i=1; i<count; i++)
					{
					  //var myjobSal = new Object(); // makes a blank object
					  var str1="job"; //this makes the first part of the ref id
					  var str1num=str1+i; //this concatenates the # part of the ref id
			
					  var ending1 ="-endSalary"; //initializes endings
					 
					  myjobSal.details = str1num+ending1; //gives this object the property
				    
					  //var ObjectID = 'myjob.details';
					  
					  // Make sure the character that is just entered is a digit
					  var SalValue = document.getElementById(myjobSal.details).value;	
					  var CharCode = SalValue.charCodeAt(SalValue.length - 1);
					
					  if ((CharCode < 48) ||(CharCode > 57))
					  {
						alert("Your input is invalid. Only numbers are allowed.");
						document.getElementById(myjobSal.details).value = SalValue.substr(0, SalValue.length - 1);
						return;
					  }
			       }	
			  }
				function onClickCannotEmployeed(option)
				{
					CannotEmployeed = option;
				}
				
			// validate function checks for required fields
				function Validate()
				{
					var IsValid = true;
					strMessage = "Please correct the follow errors: \r\n\r\n";
					//
					//var strMessage = "Please correct the follow errors: \r\n\r\n";
					//
					var strHeading;
					var FirstFieldName = "";
					// checks if full name  is blank
					document.getElementById("Fullname").value = Trim(document.getElementById("Fullname").value);
					if (document.getElementById("Fullname").value == "")
					{
						strMessage += "Full name is required.\r\n";
						FirstFieldName = "Fullname";
						IsValid = false;
					}
					// checks if address is blank
					document.getElementById("Address").value = Trim(document.getElementById("Address").value);
					if (document.getElementById("Address").value == "")
					{
						strMessage += "Address is required.\r\n";
						if (FirstFieldName == "")
							FirstFieldName = "Address";
						IsValid = false;
					}
					// checks if city is blank
					document.getElementById("City").value = Trim(document.getElementById("City").value);
					if (document.getElementById("City").value == "")
					{
						strMessage += "City is required.\r\n";
						if (FirstFieldName == "")
							FirstFieldName = "City";
						IsValid = false;						
					}
					// checks if state is blank
					if (document.getElementById("State").selectedIndex == 0)
					{
						strMessage += "State is required.\r\n";
						if (FirstFieldName == "")
							FirstFieldName = "State";
						IsValid = false;						
					}
					//checks if zip code is blank
					if (document.getElementById("Zip1").value.length < 5)
					{
						strMessage += "Zip code is required.\r\n";
						if (FirstFieldName == "")
							FirstFieldName = "Zip1";
						IsValid = false;							
					}
					// checks is email is blank
					document.getElementById("email").value = Trim(document.getElementById("email").value);
					if (document.getElementById("email").value == "")
					{
						strMessage += "Email is required.\r\n";
						if (FirstFieldName == "")
							FirstFieldName = "email";
						IsValid = false;							
					}
					// checks is ssn is blank
					if (document.getElementById("SSN1").value.length < 3)
					{
						strMessage += "Social Security Number is required.\r\n";
						if (FirstFieldName == "")
							FirstFieldName = "SSN1";
						IsValid = false;							
					}
					else 
					{
						if (document.getElementById("SSN2").value.length < 2)
						{
							strMessage += "Social Security Number is required.\r\n";
							if (FirstFieldName == "")
								FirstFieldName = "SSN2";
							IsValid = false;							
						}
						else
						{
							if (document.getElementById("SSN3").value.length < 4)
							{
								strMessage += "Social Security Number is required.\r\n";
								if (FirstFieldName == "")
									FirstFieldName = "SSN3";
								IsValid = false;							
							}
						}
					}
					// makes Salary Requirement required field
					document.getElementById("SalaryReq").value = Trim(document.getElementById("SalaryReq").value);
					if (document.getElementById("SalaryReq").value == "")
					{
						strMessage += "Salary Requirement is required.\r\n";
						if (FirstFieldName == "")
							FirstFieldName = "SalaryReq";
						IsValid = false;
					}	
				    // makes felony details required if applicant checked Yes
				    
					document.getElementById("FelonyDetail").value = Trim(document.getElementById("FelonyDetail").value);
					//alert(document.getElementById("FelonyDetail").value);
					
					if ((document.getElementById("FelonyY").checked == true)&&(document.getElementById("FelonyDetail").value == ""))
					{
					  				
					    strMessage += "Felony explanation is required.\r\n";
					    if (FirstFieldName == "")
							FirstFieldName = "Felony";
						IsValid = false;
				    }
					// checks if salary range is blank
					document.getElementById("SalaryRange").value = Trim(document.getElementById("SalaryRange").value);
					if (document.getElementById("SalaryRange").value == "")
					{
						strMessage += "Your required salary range is required.\r\n";
						if (FirstFieldName == "")
							FirstFieldName = "SalaryRange";
						IsValid = false;						
					}
						
				    // makes How did you hear about this position a required field
					document.getElementById("FoundPosition").value = Trim(document.getElementById("FoundPosition").value);
					if (document.getElementById("FoundPosition").value == "None")
					{
						strMessage += "Referral Source is required.\r\n";
						if (FirstFieldName == "None")
							FirstFieldName = "FoundPosition";
						IsValid = false;
					}		
			    // If Company is filled out, then the rest of the employer info is required
				// this section is repeated for each job (1-4)
					
					//job1 validation
					document.getElementById("job1").value = Trim(document.getElementById("job1").value); 
					
					/*if((document.getElementById("job1").value != "")&&((document.getElementById("job1-title").value != "")
							||(document.getElementById("job1-address").value != "")||(document.getElementById("job1-supervisor").value != "")
							||(document.getElementById("job1-superphone").value != "")||(document.getElementById("job1-ContactEmployer").value != "")
							||(document.getElementById("job1-work").value != "")&&(document.getElementById("job1-leaving").value != "")
							||(document.getElementById("job1-fromMonth").value != "")||(document.getElementById("job1-fromYear").value != "")
							||(document.getElementById("job1-toMonth").value != "")||(document.getElementById("job1-toYear").value != "")
							||(document.getElementById("job1-startSalary").value != "")||(document.getElementById("job1-endSalary").value != "")))
						{ */
					if (document.getElementById("job1").value != "") //checks if company is filled out
					{
							
						// makes job title required field
							//document.getElementById("job1-title").value = Trim(document.getElementById("job1-title").value);
							//strMessage += "\r\n";
							//strMessage += "Previous or Current Employer:\r\n";
							strMessage += "\r\n";
							strHeading= "Previous or Current Employer:\r\n";
							strMessage += strHeading;
						document.getElementById("job1-title").value = Trim(document.getElementById("job1-title").value);	
						if (document.getElementById("job1-title").value == "")
						{
							//strMessage += "\r\n";
							//strMessage += "Previous or Current Employer:\r\n";
							strMessage += "Job Title is required.\r\n";
							if (FirstFieldName == "")
								FirstFieldName = "job1-title";
							IsValid = false;
						}			
						// makes job address required
						document.getElementById("job1-address").value = Trim(document.getElementById("job1-address").value);
						if (document.getElementById("job1-address").value == "")
						{
							strMessage += "Address is required.\r\n";
							if (FirstFieldName == "")
								FirstFieldName = "job1-address";
							IsValid = false;
						}	
						// makes job supervisor required
						document.getElementById("job1-supervisor").value = Trim(document.getElementById("job1-supervisor").value);
						if (document.getElementById("job1-supervisor").value == "")
						{
							strMessage += "Supervisor is required.\r\n";
							if (FirstFieldName == "")
								FirstFieldName = "job1-supervisor";
							IsValid = false;
						}	
						// makes job telephone required split up text fields
					    if (document.getElementById("job1-superphone1").value.length < 3)
					    {
						    strMessage += "Phone is required.\r\n";
						    if (FirstFieldName == "")
							    FirstFieldName = "job1-superphone1";
					  	    IsValid = false;							
					    }
					    else 
					    {
						    if (document.getElementById("job1-superphone2").value.length < 3)
						    {
							    strMessage += "Phone is required.\r\n";
								if (FirstFieldName == "")
									FirstFieldName = "job1-superphone2";
								IsValid = false;							
							}
							else
							{
								if (document.getElementById("job1-superphone3").value.length < 4)
								{
									strMessage += "Phone is required.\r\n";
									if (FirstFieldName == "")
										FirstFieldName = "job1-superphone3";
									IsValid = false;							
								}
							}
						}
					    
					    document.getElementById("ContactEmployerY").value = Trim(document.getElementById("ContactEmployerY").value);
						if ((document.getElementById("ContactEmployerY").checked == false)&&(document.getElementById("ContactEmployerN").checked==false))
						{
							strMessage += "May we contact Current Employer Y/N is required.\r\n";
							  if (FirstFieldName == "")
								FirstFieldName = "ContactEmployer";
							IsValid = false;
						}	
						// makes work performed required
						document.getElementById("job1-work").value = Trim(document.getElementById("job1-work").value);
						if (document.getElementById("job1-work").value == "")
						{
							strMessage += "Work performed is required.\r\n";
							if (FirstFieldName == "")
								FirstFieldName = "job1-work";
							IsValid = false;
						}	
						// makes reason for leaving required
						document.getElementById("job1-leaving").value = Trim(document.getElementById("job1-leaving").value);
						if (document.getElementById("job1-leaving").value == "")
						{
							strMessage += "Reason for leaving is required.\r\n";
							if (FirstFieldName == "")
								FirstFieldName = "job1-leaving";
							IsValid = false;
						}	
						//makes employed from month required
						document.getElementById("job1-fromMonth").value = Trim(document.getElementById("job1-fromMonth").value);
						if (document.getElementById("job1-fromMonth").value == "")
						{
							strMessage += "Employed from month is required.\r\n";
							if (FirstFieldName == "")
								FirstFieldName = "job1-fromMonth";
							IsValid = false;
						}	
						// makes employed from year required
						document.getElementById("job1-fromYear").value = Trim(document.getElementById("job1-fromYear").value);
						if (document.getElementById("job1-fromYear").value == "")
						{
							strMessage += "Employed from year is required.\r\n";
							if (FirstFieldName == "")
								FirstFieldName = "job1-fromYear";
							IsValid = false;
						}	
						// makes employed to month required
						document.getElementById("job1-toMonth").value = Trim(document.getElementById("job1-toMonth").value);
						if (document.getElementById("job1-toMonth").value == "")
						{
							strMessage += "Employed to month is required.\r\n";
							if (FirstFieldName == "")
								FirstFieldName = "job1-toMonth";
							IsValid = false;
						}	
						//makes employed to year required
						document.getElementById("job1-toYear").value = Trim(document.getElementById("job1-toYear").value);
						if (document.getElementById("job1-toYear").value == "")
						{
							strMessage += "Employed to year is required.\r\n";
							if (FirstFieldName == "")
								FirstFieldName = "job1-toYear";
							IsValid = false;
						}	
						// makes starting salary required
						document.getElementById("job1-startSalary").value = Trim(document.getElementById("job1-startSalary").value);
						if (document.getElementById("job1-startSalary").value == "")
						{
							strMessage += "Starting Salary is required.\r\n";
							if (FirstFieldName == "")
								FirstFieldName = "job1-startSalary";
							IsValid = false;
						}	
						// makes final salary required
						document.getElementById("job1-endSalary").value = Trim(document.getElementById("job1-endSalary").value);
						if (document.getElementById("job1-endSalary").value == "")
						{
							strMessage += "Final Salary is required.\r\n";
							if (FirstFieldName == "")
								FirstFieldName = "job1-endSalary";
							IsValid = false;
						}
				     }
					//job2 validation
					document.getElementById("job2").value = Trim(document.getElementById("job2").value); 
					if (document.getElementById("job2").value != "") //checks if company is filled out
					{
						// makes job title required field
						document.getElementById("job2-title").value = Trim(document.getElementById("job2-title").value);
					    strMessage += "\r\n";
						strMessage += "Previous Employer 1:\r\n";
						if (document.getElementById("job2-title").value == "")
						{
							strMessage += "Job Title is required.\r\n";
							if (FirstFieldName == "")
								FirstFieldName = "job2-title";
							IsValid = false;
						}			
						// makes job address required
						document.getElementById("job2-address").value = Trim(document.getElementById("job2-address").value);
						if (document.getElementById("job2-address").value == "")
						{
							strMessage += "Address is required.\r\n";
							if (FirstFieldName == "")
								FirstFieldName = "job2-address";
							IsValid = false;
						}	
						// makes job supervisor required
						document.getElementById("job2-supervisor").value = Trim(document.getElementById("job2-supervisor").value);
						if (document.getElementById("job2-supervisor").value == "")
						{
							strMessage += "Supervisor is required.\r\n";
							if (FirstFieldName == "")
								FirstFieldName = "job2-supervisor";
							IsValid = false;
						}	
						// makes supervisor phone required
					    if (document.getElementById("job2-superphone1").value.length < 3)
					    {
						    strMessage += "Phone is required.\r\n";
						    if (FirstFieldName == "")
							    FirstFieldName = "job2-superphone1";
					  	    IsValid = false;							
					    }
					    else 
					    {
						    if (document.getElementById("job2-superphone2").value.length < 3)
						    {
							    strMessage += "Phone is required.\r\n";
								if (FirstFieldName == "")
									FirstFieldName = "job2-superphone2";
								IsValid = false;							
							}
							else
							{
								if (document.getElementById("job2-superphone3").value.length < 4)
								{
									strMessage += "Phone is required.\r\n";
									if (FirstFieldName == "")
										FirstFieldName = "job2-superphone3";
									IsValid = false;							
								}
							}
						}
						// makes work performed required
						document.getElementById("job2-work").value = Trim(document.getElementById("job2-work").value);
						if (document.getElementById("job2-work").value == "")
						{
							strMessage += "Work performed is required.\r\n";
							if (FirstFieldName == "")
								FirstFieldName = "job2-work";
							IsValid = false;
						}	
						// makes reason for leaving required
						document.getElementById("job2-leaving").value = Trim(document.getElementById("job2-leaving").value);
						if (document.getElementById("job2-leaving").value == "")
						{
							strMessage += "Reason for leaving is required.\r\n";
							if (FirstFieldName == "")
								FirstFieldName = "job2-leaving";
							IsValid = false;
						}	
						//makes employed from month required
						document.getElementById("job2-fromMonth").value = Trim(document.getElementById("job2-fromMonth").value);
						if (document.getElementById("job2-fromMonth").value == "")
						{
							strMessage += "Employed from month is required.\r\n";
							if (FirstFieldName == "")
								FirstFieldName = "job2-fromMonth";
							IsValid = false;
						}	
						// makes employed from year required
						document.getElementById("job2-fromYear").value = Trim(document.getElementById("job2-fromYear").value);
						if (document.getElementById("job2-fromYear").value == "")
						{
							strMessage += "Employed from year is required.\r\n";
							if (FirstFieldName == "")
								FirstFieldName = "job2-fromYear";
							IsValid = false;
						}	
						// makes employed to month required
						document.getElementById("job2-toMonth").value = Trim(document.getElementById("job2-toMonth").value);
						if (document.getElementById("job2-toMonth").value == "")
						{
							strMessage += "Employed to month is required.\r\n";
							if (FirstFieldName == "")
								FirstFieldName = "job2-toMonth";
							IsValid = false;
						}	
						//makes employed to year required
						document.getElementById("job2-toYear").value = Trim(document.getElementById("job2-toYear").value);
						if (document.getElementById("job2-toYear").value == "")
						{
							strMessage += "Employed to year is required.\r\n";
							if (FirstFieldName == "")
								FirstFieldName = "job2-toYear";
							IsValid = false;
						}	
						// makes starting salary required
						document.getElementById("job2-startSalary").value = Trim(document.getElementById("job2-startSalary").value);
						if (document.getElementById("job2-startSalary").value == "")
						{
							strMessage += "Starting Salary is required.\r\n";
							if (FirstFieldName == "")
								FirstFieldName = "job2-startSalary";
							IsValid = false;
						}	
						// makes final salary required
						document.getElementById("job2-endSalary").value = Trim(document.getElementById("job2-endSalary").value);
						if (document.getElementById("job2-endSalary").value == "")
						{
							strMessage += "Final Salary is required.\r\n";
							if (FirstFieldName == "")
								FirstFieldName = "job2-endSalary";
							IsValid = false;
						}	
					}
					//job3 validation
					document.getElementById("job3").value = Trim(document.getElementById("job3").value); 
					if (document.getElementById("job3").value != "") //checks if company is filled out
					{
						// makes job title required field
						document.getElementById("job3-title").value = Trim(document.getElementById("job3-title").value);
						strMessage += "\r\n";
						strMessage += "Previous Employer 2:\r\n";
						if (document.getElementById("job3-title").value == "")
						{
							strMessage += "Job Title is required.\r\n";
							if (FirstFieldName == "")
								FirstFieldName = "job3-title";
							IsValid = false;
						}			
						// makes job address required
						document.getElementById("job3-address").value = Trim(document.getElementById("job3-address").value);
						if (document.getElementById("job3-address").value == "")
						{
							strMessage += "Address is required.\r\n";
							if (FirstFieldName == "")
								FirstFieldName = "job3-address";
							IsValid = false;
						}	
						// makes job supervisor required
						document.getElementById("job3-supervisor").value = Trim(document.getElementById("job3-supervisor").value);
						if (document.getElementById("job3-supervisor").value == "")
						{
							strMessage += "Supervisor is required.\r\n";
							if (FirstFieldName == "")
								FirstFieldName = "job3-supervisor";
							IsValid = false;
						}	
						// makes job telephone required split up text fields
					    if (document.getElementById("job3-superphone1").value.length < 3)
					    {
						    strMessage += "Phone is required.\r\n";
						    if (FirstFieldName == "")
							    FirstFieldName = "job3-superphone1";
					  	    IsValid = false;							
					    }
					    else 
					    {
						    if (document.getElementById("job3-superphone2").value.length < 3)
						    {
							    strMessage += "Phone is required.\r\n";
								if (FirstFieldName == "")
									FirstFieldName = "job3-superphone2";
								IsValid = false;							
							}
							else
							{
								if (document.getElementById("job3-superphone3").value.length < 4)
								{
									strMessage += "Phone is required.\r\n";
									if (FirstFieldName == "")
										FirstFieldName = "job3-superphone3";
									IsValid = false;							
								}
							}
						}
						// makes work performed required
						document.getElementById("job3-work").value = Trim(document.getElementById("job3-work").value);
						if (document.getElementById("job3-work").value == "")
						{
							strMessage += "Work performed is required.\r\n";
							if (FirstFieldName == "")
								FirstFieldName = "job3-work";
							IsValid = false;
						}	
						// makes reason for leaving required
						document.getElementById("job3-leaving").value = Trim(document.getElementById("job3-leaving").value);
						if (document.getElementById("job3-leaving").value == "")
						{
							strMessage += "Reason for leaving is required.\r\n";
							if (FirstFieldName == "")
								FirstFieldName = "job3-leaving";
							IsValid = false;
						}	
						//makes employed from month required
						document.getElementById("job3-fromMonth").value = Trim(document.getElementById("job3-fromMonth").value);
						if (document.getElementById("job3-fromMonth").value == "")
						{
							strMessage += "Employed from month is required.\r\n";
							if (FirstFieldName == "")
								FirstFieldName = "job3-fromMonth";
							IsValid = false;
						}	
						// makes employed from year required
						document.getElementById("job3-fromYear").value = Trim(document.getElementById("job3-fromYear").value);
						if (document.getElementById("job3-fromYear").value == "")
						{
							strMessage += "Employed from year is required.\r\n";
							if (FirstFieldName == "")
								FirstFieldName = "job3-fromYear";
							IsValid = false;
						}	
						// makes employed to month required
						document.getElementById("job3-toMonth").value = Trim(document.getElementById("job3-toMonth").value);
						if (document.getElementById("job3-toMonth").value == "")
						{
							strMessage += "Employed to month is required.\r\n";
							if (FirstFieldName == "")
								FirstFieldName = "job3-toMonth";
							IsValid = false;
						}	
						//makes employed to year required
						document.getElementById("job3-toYear").value = Trim(document.getElementById("job3-toYear").value);
						if (document.getElementById("job3-toYear").value == "")
						{
							strMessage += "Employed to year is required.\r\n";
							if (FirstFieldName == "")
								FirstFieldName = "job3-toYear";
							IsValid = false;
						}	
						// makes starting salary required
						document.getElementById("job3-startSalary").value = Trim(document.getElementById("job3-startSalary").value);
						if (document.getElementById("job3-startSalary").value == "")
						{
							strMessage += "Starting Salary is required.\r\n";
							if (FirstFieldName == "")
								FirstFieldName = "job3-startSalary";
							IsValid = false;
						}	
						// makes final salary required
						document.getElementById("job3-endSalary").value = Trim(document.getElementById("job3-endSalary").value);
						if (document.getElementById("job3-endSalary").value == "")
						{
							strMessage += "Final Salary is required.\r\n";
							if (FirstFieldName == "")
								FirstFieldName = "job3-endSalary";
							IsValid = false;
						}	
				    }
					// job4 validation
					document.getElementById("job4").value = Trim(document.getElementById("job4").value); 
					if (document.getElementById("job4").value != "") //checks if company is filled out
					{
						// makes job title required field
						document.getElementById("job4-title").value = Trim(document.getElementById("job4-title").value);
						strMessage += "\r\n";
						strMessage += "Previous Employer 3:\r\n";
						if (document.getElementById("job4-title").value == "")
						{
							strMessage += "Job Title is required.\r\n";
							if (FirstFieldName == "")
								FirstFieldName = "job4-title";
							IsValid = false;
						}			
						// makes job address required
						document.getElementById("job4-address").value = Trim(document.getElementById("job4-address").value);
						if (document.getElementById("job4-address").value == "")
						{
							strMessage += "Address is required.\r\n";
							if (FirstFieldName == "")
								FirstFieldName = "job4-address";
							IsValid = false;
						}	
						// makes job supervisor required
						document.getElementById("job4-supervisor").value = Trim(document.getElementById("job4-supervisor").value);
						if (document.getElementById("job4-supervisor").value == "")
						{
							strMessage += "Supervisor is required.\r\n";
							if (FirstFieldName == "")
								FirstFieldName = "job4-supervisor";
							IsValid = false;
						}	
						// makes job telephone required split up text fields
					    if (document.getElementById("job4-superphone1").value.length < 3)
					    {
						    strMessage += "Phone is required.\r\n";
						    if (FirstFieldName == "")
							    FirstFieldName = "job4-superphone1";
					  	    IsValid = false;							
					    }
					    else 
					    {
						    if (document.getElementById("job4-superphone2").value.length < 3)
						    {
							    strMessage += "Phone is required.\r\n";
								if (FirstFieldName == "")
									FirstFieldName = "job4-superphone2";
								IsValid = false;							
							}
							else
							{
								if (document.getElementById("job4-superphone3").value.length < 4)
								{
									strMessage += "Phone is required.\r\n";
									if (FirstFieldName == "")
										FirstFieldName = "job4-superphone3";
									IsValid = false;							
								}
							}
						}
						// makes work performed required
						document.getElementById("job4-work").value = Trim(document.getElementById("job4-work").value);
						if (document.getElementById("job4-work").value == "")
						{
							strMessage += "Work performed is required.\r\n";
							if (FirstFieldName == "")
								FirstFieldName = "job4-work";
							IsValid = false;
						}	
						// makes reason for leaving required
						document.getElementById("job4-leaving").value = Trim(document.getElementById("job4-leaving").value);
						if (document.getElementById("job4-leaving").value == "")
						{
							strMessage += "Reason for leaving is required.\r\n";
							if (FirstFieldName == "")
								FirstFieldName = "job4-leaving";
							IsValid = false;
						}	
						//makes employed from month required
						document.getElementById("job4-fromMonth").value = Trim(document.getElementById("job4-fromMonth").value);
						if (document.getElementById("job4-fromMonth").value == "")
						{
							strMessage += "Employed from month is required.\r\n";
							if (FirstFieldName == "")
								FirstFieldName = "job4-fromMonth";
							IsValid = false;
						}	
						// makes employed from year required
						document.getElementById("job4-fromYear").value = Trim(document.getElementById("job4-fromYear").value);
						if (document.getElementById("job4-fromYear").value == "")
						{
							strMessage += "Employed from year is required.\r\n";
							if (FirstFieldName == "")
								FirstFieldName = "job4-fromYear";
							IsValid = false;
						}	
						// makes employed to month required
						document.getElementById("job4-toMonth").value = Trim(document.getElementById("job4-toMonth").value);
						if (document.getElementById("job4-toMonth").value == "")
						{
							strMessage += "Employed to month is required.\r\n";
							if (FirstFieldName == "")
								FirstFieldName = "job4-toMonth";
							IsValid = false;
						}	
						//makes employed to year required
						document.getElementById("job4-toYear").value = Trim(document.getElementById("job4-toYear").value);
						if (document.getElementById("job4-toYear").value == "")
						{
							strMessage += "Employed to year is required.\r\n";
							if (FirstFieldName == "")
								FirstFieldName = "job4-toYear";
							IsValid = false;
						}	
						// makes starting salary required
						document.getElementById("job4-startSalary").value = Trim(document.getElementById("job4-startSalary").value);
						if (document.getElementById("job4-startSalary").value == "")
						{
							strMessage += "Starting Salary is required.\r\n";
							if (FirstFieldName == "")
								FirstFieldName = "job4-startSalary";
							IsValid = false;
						}	
						// makes final salary required
						document.getElementById("job4-endSalary").value = Trim(document.getElementById("job4-endSalary").value);
						if (document.getElementById("job4-endSalary").value == "")
						{
							strMessage += "Final Salary is required.\r\n";
							if (FirstFieldName == "")
								FirstFieldName = "job4-endSalary";
							IsValid = false;
						}	
						
			
							
				    } // end of super long job (1-4) validation!!! 	
    
			 // this section checks if the previous or current employer info is filled out
			 // it takes off the section header that says "Previous or Current Employer: ", "Previous Employer 1:", ect
			 // in the concatenated string strMessage
						
						// current or previous employer
						// takes off the section head in the error message for Current or Previous Employer
						// if everything is filled out
						if ((document.getElementById("job1").value != "")
						    &&(document.getElementById("job1-title").value != "")
							&&(document.getElementById("job1-address").value != "")
							&&(document.getElementById("job1-supervisor").value != "")
							&&(document.getElementById("job1-superphone1").value != "")
							&&(document.getElementById("job1-superphone1").value.length == 3)
							&&(document.getElementById("job1-superphone2").value != "")
							&&(document.getElementById("job1-superphone2").value.length == 3)
							&&(document.getElementById("job1-superphone3").value != "")
							&&(document.getElementById("job1-superphone3").value.length == 4)
							&&((document.getElementById("ContactEmployerY").checked == true)||(document.getElementById("ContactEmployerN").checked==true))
							&&(document.getElementById("job1-work").value != "")
							&&(document.getElementById("job1-leaving").value != "")
							&&(document.getElementById("job1-fromMonth").value != "")
							&&(document.getElementById("job1-fromYear").value !=  "")
							&&(document.getElementById("job1-toMonth").value != "")
							&&(document.getElementById("job1-toYear").value != "")
							&&(document.getElementById("job1-startSalary").value != "")
							&&(document.getElementById("job1-endSalary").value != ""))
						{
							strMessage=strMessage.replace(/Previous or Current Employer:/,"");
						}
						// previous employer 1
						// takes off the section header in the error message for Previous Employer 1
					    // if everything is filled out
						if ((document.getElementById("job2").value != "")
						    &&(document.getElementById("job2-title").value != "")
							&&(document.getElementById("job2-address").value != "")
							&&(document.getElementById("job2-supervisor").value != "")
							&&(document.getElementById("job2-superphone1").value != "")
							&&(document.getElementById("job2-superphone1").value.length == 3)
							&&(document.getElementById("job2-superphone2").value != "")
							&&(document.getElementById("job2-superphone2").value.length == 3)
							&&(document.getElementById("job2-superphone3").value != "")
							&&(document.getElementById("job2-superphone3").value.length == 4)
							&&(document.getElementById("job2-work").value != "")
							&&(document.getElementById("job2-leaving").value != "")
							&&(document.getElementById("job2-fromMonth").value != "")
							&&(document.getElementById("job2-fromYear").value !=  "")
							&&(document.getElementById("job2-toMonth").value != "")
							&&(document.getElementById("job2-toYear").value != "")
							&&(document.getElementById("job2-startSalary").value != "")
							&&(document.getElementById("job2-endSalary").value != ""))
						{
							strMessage=strMessage.replace(/Previous Employer 1:/,"");
						}
						// previous employer 2
						// takes off the section header in the error message for Previous Employer 2
					    // if everything is filled out
						if ((document.getElementById("job3").value != "")
						    &&(document.getElementById("job3-title").value != "")
							&&(document.getElementById("job3-address").value != "")
							&&(document.getElementById("job3-supervisor").value != "")
							&&(document.getElementById("job3-superphone1").value != "")
							&&(document.getElementById("job3-superphone1").value.length == 3)
							&&(document.getElementById("job3-superphone2").value != "")
							&&(document.getElementById("job3-superphone2").value.length == 3)
							&&(document.getElementById("job3-superphone3").value != "")
							&&(document.getElementById("job3-superphone3").value.length == 4)
							&&(document.getElementById("job3-work").value != "")
							&&(document.getElementById("job3-leaving").value != "")
							&&(document.getElementById("job3-fromMonth").value != "")
							&&(document.getElementById("job3-fromYear").value !=  "")
							&&(document.getElementById("job3-toMonth").value != "")
							&&(document.getElementById("job3-toYear").value != "")
							&&(document.getElementById("job3-startSalary").value != "")
							&&(document.getElementById("job3-endSalary").value != ""))
						{
							strMessage=strMessage.replace(/Previous Employer 2:/,"");
						}
						// previous employer 3
					    // takes off the section header in the error message for Previous Employer 3
					    // if everything is filled out
						if ((document.getElementById("job4").value != "")
						    &&(document.getElementById("job4-title").value != "")
							&&(document.getElementById("job4-address").value != "")
							&&(document.getElementById("job4-supervisor").value != "")
							&&(document.getElementById("job4-superphone1").value != "")
							&&(document.getElementById("job4-superphone1").value.length == 3)
							&&(document.getElementById("job4-superphone2").value != "")
							&&(document.getElementById("job4-superphone2").value.length == 3)
							&&(document.getElementById("job4-superphone3").value != "")
							&&(document.getElementById("job4-superphone3").value.length == 4)
							&&(document.getElementById("job4-work").value != "")
							&&(document.getElementById("job4-leaving").value != "")
							&&(document.getElementById("job4-fromMonth").value != "")
							&&(document.getElementById("job4-fromYear").value !=  "")
							&&(document.getElementById("job4-toMonth").value != "")
							&&(document.getElementById("job4-toYear").value != "")
							&&(document.getElementById("job4-startSalary").value != "")
							&&(document.getElementById("job4-endSalary").value != ""))
						{
							strMessage=strMessage.replace(/Previous Employer 3:/,"");
						}
		     // this section checks that if reference source is Employee or Other than field is completed
		     // other similiar function above only checks if the ref. source drop down is picked.
			 // this one checks if the selection is Employee or Other and then makes  details required accordingly
					
			        // reference - checks if Referal drop down is employee or other
					document.getElementById("FoundPosition").value = Trim(document.getElementById("FoundPosition").value); 
					if ((document.getElementById("FoundPosition").value=="Employee")||(document.getElementById("FoundPosition").value=="Other"))                                        
					{
						// makes detail required field
						document.getElementById("FoundPositionDetail").value = Trim(document.getElementById("FoundPositionDetail").value);
						if (document.getElementById("FoundPositionDetail").value == "") //checks if detail txt field is blank
						{
							
							strMessage += "\r\n";
							strMessage += "Referral Source:\r\n";
							strMessage += "Referal Source Information is required.\r\n";
							
							if (FirstFieldName == "")
								FirstFieldName = "FoundPositionDetail";
							IsValid = false;
						}			
						
					}
		    // certification dates validation section
		    // NOTE: Every year divisible by 4 is a leap year. 
		    //every year divisible by 100 is NOT a leap year unless the year is also divisible by 400, then it is still a leap year. 
					var dateObj = new Object(); // sets up blank object
			        // store date month, date year, date day for certy1 in object		
					var tempcerty1_dm = document.getElementById("certy1-dateMonth").value = Trim(document.getElementById("certy1-dateMonth").value);
					dateObj.dateMonth1=tempcerty1_dm; //
					var tempcerty1_dy =document.getElementById("certy1-dateYear").value = Trim(document.getElementById("certy1-dateYear").value);
					dateObj.dateYear1=tempcerty1_dy;
					var tempcerty1_dd =document.getElementById("certy1-dateDay").value = Trim(document.getElementById("certy1-dateDay").value);
					dateObj.dateDay1=tempcerty1_dd;
					// certy1 checks if date is leap year and checks # days in feb
					//leap year has 29 days, non leap have 28 yo
					if (dateObj.dateMonth1 == "February")                                     
					{
						if ((dateObj.dateYear1%4==0)||((!(dateObj.dateYear1%100==0))&&(dateObj.dateYear1%400==0)))
						{
							if((dateObj.dateDay1)>29)
							{
							strMessage += "\r\n";
							strMessage += "Certification1 - invalid date.\r\n";
							}
						}
						else
						{
							if((dateObj.dateDay1)>28)
							{
							strMessage += "\r\n";
							strMessage += "Certification1 - invalid date.\r\n";
							}
						}
					}
					// check that the date has only 30 days if it is sept, april, june, nov
					if ((dateObj.dateMonth1=="September")||(dateObj.dateMonth1=="April")||(dateObj.dateMonth1=="June")||
					   (dateObj.dateMonth1=="November"))
					{
						if((dateObj.dateDay1)>30) //not evaluationg right
						{
							strMessage += "\r\n";
							strMessage += "Certification1 - invalid date.\r\n";
						}
					}
				// store date month, date year, date day for certy2 in object
					var tempcerty2_dm = document.getElementById("certy2-dateMonth").value = Trim(document.getElementById("certy2-dateMonth").value); 
					dateObj.dateMonth2=tempcerty2_dm; //
					var tempcerty2_dy =document.getElementById("certy2-dateYear").value = Trim(document.getElementById("certy2-dateYear").value);
					dateObj.dateYear2=tempcerty2_dy;
					var tempcerty2_dd =document.getElementById("certy2-dateDay").value = Trim(document.getElementById("certy2-dateDay").value);
					dateObj.dateDay2=tempcerty2_dd;
					// certy2 checks if date is leap year and checks # days in feb
					//leap year has 29 days, non leap have 28 yo
					if (dateObj.dateMonth2 == "February")                                     
					{
						if ((dateObj.dateYear2%4==0)||((!(dateObj.dateYear2%100==0))&&(dateObj.dateYear2%400==0)))
						{
							if((dateObj.dateDay2)>29)
							{
								strMessage += "\r\n";
								strMessage += "Certification2 - invalid date.\r\n";
							}
						}
						else
						{
							if((dateObj.dateDay2)>28)
							{
								strMessage += "\r\n";
								strMessage += "Certification2 - invalid date.\r\n";
							}
						}
					}
					// check that the date has only 30 days if it is sept, april, june, nov
					if ((dateObj.dateMonth2=="September")||(dateObj.dateMonth2=="April")||(dateObj.dateMonth2=="June")||
					   (dateObj.dateMonth2=="November"))
					{
						if((dateObj.dateDay2)>30) //not evaluationg right
						{
							strMessage += "\r\n";
							strMessage += "Certification2 - invalid date.\r\n";
						}
					}
				// store date month, date year, date day for certy3 in object
				    var tempcerty3_dm = document.getElementById("certy3-dateMonth").value = Trim(document.getElementById("certy3-dateMonth").value); 
					dateObj.dateMonth3=tempcerty3_dm; //
					var tempcerty3_dy =document.getElementById("certy3-dateYear").value = Trim(document.getElementById("certy3-dateYear").value);
					dateObj.dateYear3=tempcerty3_dy;
					var tempcerty3_dd =document.getElementById("certy3-dateDay").value = Trim(document.getElementById("certy3-dateDay").value);
					dateObj.dateDay3=tempcerty3_dd;
					// certy3 checks if date is leap year and checks # days in feb
					//leap year has 29 days, non leap have 28 yo
					if (dateObj.dateMonth3 == "February")                                     
					{
						if ((dateObj.dateYear3%4==0)||((!(dateObj.dateYear3%100==0))&&(dateObj.dateYear3%400==0)))
						{
							if((dateObj.dateDay3)>29)
							{
								strMessage += "\r\n";
								strMessage += "Certification3 - invalid date.\r\n";
							}
						}
						else
						{
							if((dateObj.dateDay3)>28)
							{
							    strMessage += "\r\n";
								strMessage += "Certification3 - invalid date.\r\n";
							}
						}
					}
					// check that the date has only 30 days if it is sept, april, june, nov
					if ((dateObj.dateMonth3=="September")||(dateObj.dateMonth3=="April")||(dateObj.dateMonth3=="June")||
					   (dateObj.dateMonth3=="November"))
					{
						if((dateObj.dateDay3)>30) //not evaluationg right
						{
							strMessage += "\r\n";
						    strMessage += "Certification3 - invalid date.\r\n";
						}
					}	
				// store date month, date year, date day for certy4 in object
				    var tempcerty4_dm = document.getElementById("certy4-dateMonth").value = Trim(document.getElementById("certy4-dateMonth").value); 
					dateObj.dateMonth4=tempcerty4_dm; //
					var tempcerty4_dy =document.getElementById("certy4-dateYear").value = Trim(document.getElementById("certy4-dateYear").value);
					dateObj.dateYear4=tempcerty4_dy;
					var tempcerty4_dd =document.getElementById("certy4-dateDay").value = Trim(document.getElementById("certy4-dateDay").value);
					dateObj.dateDay4=tempcerty4_dd;
					// certy4 checks if date is leap year and checks # days in feb
					//leap year has 29 days, non leap have 28 yo
					if (dateObj.dateMonth4 == "February")                                     
					{
						if ((dateObj.dateYear4%4==0)||((!(dateObj.dateYear4%100==0))&&(dateObj.dateYear4%400==0)))
						{
							if((dateObj.dateDay4)>29)
							{
								strMessage += "\r\n";
								strMessage += "Certification4 - invalid date.\r\n";
							}
						}
						else
						{
							if((dateObj.dateDay4)>28)
							{
							    strMessage += "\r\n";
								strMessage += "Certification4 - invalid date.\r\n";
							}
						}
					}
					// check that the date has only 30 days if it is sept, april, june, nov
					if ((dateObj.dateMonth4=="September")||(dateObj.dateMonth4=="April")||(dateObj.dateMonth4=="June")||
					   (dateObj.dateMonth4=="November"))
					{
						if((dateObj.dateDay4)>30) 
						{
							strMessage += "\r\n";
						    strMessage += "Certification4 - invalid date.\r\n";
						}
					}	
	          // end certification date validation section
			        
			        // if clearance is yes then makes what type required
					var tempObj = document.getElementById("ClearanceLevel").value = Trim(document.getElementById("ClearanceLevel").value); 
					var clearObj = new Object(); // makes blank object
					clearObj.level = tempObj;    //stores the ref ID as an attribute of the object
					
					if(((document.getElementById("ClearanceY").checked)==true)&&(clearObj.level=="none"))                                  
					{
						// makes detail required field
						//if (clearObj.level=="none")  
						//{
							strMessage += "\r\n";
						    strMessage += "Clearance Level detail required.\r\n";
						    if (FirstFieldName == "")
							  FirstFieldName = "Clearance";
						    IsValid = false;		
						//}
					} // end clearance section validation

					//email validation for references section - ref1
					document.getElementById("ref1-email").value = Trim(document.getElementById("ref1-email").value); 
					if (document.getElementById("ref1-email").value!= "")
					{ 
						var ObjectID = 'ref1-email';
						var eValue = document.getElementById(ObjectID).value;
						var AtPos = eValue.indexOf("@")
						var StopPos = eValue.lastIndexOf(".")
						Message = ""
			
						if (AtPos == -1 || StopPos == -1) //checks for "@" or "." and returns number greater than -1
						{
							alert("References 1:\n Email address is invalid.\n");
						}

						else if (StopPos < AtPos) //check for "." before "@"
						{
							alert("References 1:\n Email address is invalid.\n");
						}

						else if (StopPos - AtPos == 1) //checks for "@" and "." in correct order BUT next to eachother (so still invalid)
						{
							alert("References 1:\n Email address is invalid.\n");
						} 
					}
					//email validation for references section -ref2
					document.getElementById("ref2-email").value = Trim(document.getElementById("ref2-email").value); 
					if (document.getElementById("ref2-email").value!= "")
					{ 
						var ObjectID = 'ref2-email';
						var eValue = document.getElementById(ObjectID).value;
						var AtPos = eValue.indexOf("@")
						var StopPos = eValue.lastIndexOf(".")
						Message = ""
						
						if (AtPos == -1 || StopPos == -1) //checks for "@" or "." and returns number greater than -1
						{
							alert("References 2:\n Email address is invalid.\n");
						}

						else if (StopPos < AtPos) //check for "." before "@"
						{
							alert("References 2:\n Email address is invalid.\n");
						}

						else if (StopPos - AtPos == 1) //checks for "@" and "." in correct order BUT next to eachother (so still invalid)
						{
							alert("References 2:\n Email address is invalid.\n");
						} 
				    }
				    //email validation for references section -ref 3
					document.getElementById("ref3-email").value = Trim(document.getElementById("ref3-email").value); 
					if (document.getElementById("ref3-email").value!= "")
					{ 
						var ObjectID = 'ref3-email';
						var eValue = document.getElementById(ObjectID).value;
						var AtPos = eValue.indexOf("@")
						var StopPos = eValue.lastIndexOf(".")
						Message = ""
			
						if (AtPos == -1 || StopPos == -1) //checks for "@" or "." and returns number greater than -1
						{
							alert("References 3:\n Email address is invalid.\n");
						}

						else if (StopPos < AtPos) //check for "." before "@"
						{
							alert("References 3:\n Email address is invalid.\n");
						}

						else if (StopPos - AtPos == 1) //checks for "@" and "." in correct order BUT next to eachother (so still invalid)
						{
							alert("References 3:\n Email address is invalid.\n");
						}
					}
						
				// rest of original code
					if (!IsValid)
					{
						alert(strMessage);
						
						if (FirstFieldName != "")
							document.getElementById(FirstFieldName).focus();
						return false;
					}
					
					return true;	
				} //ends validate() function
				
				function LeftTrim(theString)
				{
					var index1 = 0;
					var index2 = 1;
					while(theString.substring(index1, index2)==' ' && index1 < theString.length)
					{
						index1++;
						index2++;
					}
					var newString = theString.substring(index1, theString.length)
					return newString;
				}
				// Trim the trailing space
				function RightTrim(theString)
				{
					var index2 = theString.length;
					var index1 = index2 - 1;
					while(theString.substring(index1, index2) == ' ' && index1 >= 0)
					{
						index1--;
						index2--;
					}
					var newString = theString.substring(0, index2);
					return newString;
				}
				// Trim the leading and trailing space
				function Trim(theString)
				{
					var newString;
					newString = LeftTrim(theString);	
					newString = RightTrim(newString);
					return newString;
				}	

