
function ValidatePersonal(theForm)
{

  foundError = false;
        pathError = true;
        commaError = false;
  //if (theForm.Form_Type.value == "")
  //{
  //  alert("Please enter a value for the \"Form_Type\" field.");
  //  theForm.Form_Type.focus();
  //  return (false);
 // }
 
//  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ \t\r\n\f";
 // var checkStr = theForm.Form_Type.value;
//  var allValid = true;
//  for (i = 0;  i < checkStr.length;  i++)
//  {
  //  ch = checkStr.charAt(i);
  //  for (j = 0;  j < checkOK.length;  j++)
  //    if (ch == checkOK.charAt(j))
  //      break;
  //  if (j == checkOK.length)
  //  {
  //    allValid = false;
  //    break;
  //  }
 // }
 // if (!allValid)
  {
   // alert("Please enter only letter and whitespace characters in the \"Form_Type\" field.");
    //theForm.Form_Type.focus();
    //return (false);
  }
  
 // var chkVal = theForm.Form_Type.value;
  //var prsVal = chkVal;
  //if (chkVal != "" && !(prsVal == ""))
 // {
    //alert("Please select a Registration Payment Option in the \"Form_Type\" field.");
    //theForm.Form_Type.focus();
    //return (false);
  //}


  var checkOK = "0123456789-";
  var checkStr = theForm.hdn_PIN.value;
  var allValid = true;
  var decPoints = 0;
  var allNum = "";
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
    allNum += ch;
  }
  if (!allValid)
  {
    alert("Please enter only digit characters in the \"PIN Number\" field.");
    theForm.hdn_PIN.focus();
    return (false);
  }


  if (theForm.dnr_fTitle.value == 2){
	  if (theForm.Title.value == "")
	  	{
	  		theForm.Title.focus();
	    	alert("Please enter a value for the \"Title\" field.");
	    	theForm.Title.focus();
	    	return (false);
	  	}
  }
  
  if (theForm.FirstName.value == "")
  {
    alert("Please enter a value for the \"FirstName\" field.");
    theForm.FirstName.focus();
    return (false);
  }

  if (theForm.FamilyName.value == "")
  {
    alert("Please enter a value for the \"FamilyName\" field.");
    theForm.FamilyName.focus();
    return (false);
  }
 if (theForm.dnr_fBadgename.value == 2){
  		if (theForm.Badgename.value == ""){
    	//alert("Please enter a value for the \"Badgename\" field.");
    	//theForm.Badgename.focus();
    	//return (false);
  		}
	}
 if (theForm.dnr_fGender.value == 2){
	  if (theForm.Gender[0].checked == false && theForm.Gender[1].checked == false)
	  	{
	  		
	    	alert("Please enter a value for the \"Gender\" field.");
	    	
	    	return (false);
	  	}
  }
  if (theForm.dnr_fDOB.value == 2){
	  if (theForm.DOB.value == "")
	  	{
	  		
	    	alert("Please enter your Date of Birth.");
	    	theForm.DOB.focus();
	    	return (false);
	  	}
  }
 if (theForm.dnr_fPosition.value == 2){
  		if (theForm.Position.value == ""){
    	alert("Please enter a value for the \"Job Title\" field.");
    	theForm.Position.focus();
    	return (false);
  		}
	} 
 if (theForm.dnr_fDivision.value == 2){
  		if (theForm.Division.value == ""){
    	alert("Please enter a value for the \"Team\" field.");
    	theForm.Division.focus();
    	return (false);
  		}
	} 
 if (theForm.dnr_fOrganisation.value == 2){
  		if (theForm.Organisation.value == ""){
    	alert("Please enter a value for the \"Business Unit\" field.");
    	theForm.Organisation.focus();
    	return (false);
  		}
	}   
  
 if (theForm.dnr_fAddress1.value == 2){
  		if (theForm.Address1.value == ""){
    	alert("Please enter a value for the \"Address1\" field.");
    	theForm.Address1.focus();
    	return (false);
  		}
	}
	
if (theForm.dnr_fSuburbCity.value == 2){
	  if (theForm.SuburbCity.value == "") {
	    alert("Please enter a value for the \"SuburbCity\" field.");
	    theForm.SuburbCity.focus();
	    return (false);
	  }
 }
 if (theForm.dnr_fState.value == 2){
	   if (theForm.State.value == ""){
	    alert("Please enter a value for the \"State\" field.");
	    theForm.State.focus();
	    return (false);
	  }
 } 
  if (theForm.dnr_fPostcode.value == 2){
	   if (theForm.Postcode.value == ""){
	    alert("Please enter a value for the \"Postcode\" field.");
	    theForm.Postcode.focus();
	    return (false);
	  }
}
 if (theForm.dnr_fCountry.value == 2){
  if (theForm.Country.selectedIndex == "0" || theForm.Country.selectedIndex == "1")
  {
    alert("Please Select a value for the \"Country\" field.");
    theForm.Country.focus();
    return (false);
  }
}
if (theForm.dnr_fPhoneB.value == 2){
	if(theForm.PhoneB.value == ""){
		alert("Please enter your business phone number.");
		 theForm.PhoneB.focus();
		return(false);
	}
}
if (theForm.dnr_fFaxB.value == 2){
	if(theForm.FaxB.value == ""){
		alert("Please enter your business fax number.");
		 theForm.FaxB.focus();
		return(false);
	}
}

if (theForm.dnr_fPhoneH.value == 2){
	if(theForm.PhoneH.value == ""){
		alert("Please enter your Home phone number.");
		 theForm.PhoneH.focus();
		return(false);
	}
}
if (theForm.dnr_fFaxH.value == 2){
	if(theForm.FaxH.value == ""){
		alert("Please enter your Home fax number.");
		 theForm.FaxH.focus();
		return(false);
	}
}

if (theForm.dnr_fPhoneM.value == 2){
	if(theForm.PhoneM.value == ""){
		alert("Please enter your Mobile phone number.");
		 theForm.PhoneM.focus();
		return(false);
	}
}
if (theForm.dnr_fEMail.value == 2){
	if(theForm.EMail.value == ""){
		alert("Please enter your email address.");
		 theForm.EMail.focus();
		return(false);
	}
}
if (theForm.dnr_fCorrespondencetype > 0){
  var c_type = 1
  for(i=0; i< theForm.CorrespondenceType.length;i++){
  	if(theForm.CorrespondenceType[i].checked == true){
	c_type = theForm.CorrespondenceType[i].value
	
	}
 }
 if (c_type == 2){
  if(theForm.FaxB.value == "" && theForm.FaxH.value == "") { 
  alert("Please enter a fax number.");
    //theForm.FaxB.focus();
    return (false);
	}
  }
 
 
 if (c_type == 3){
  if(theForm.EMail.value == "") { 
  alert("Please enter your email address.");
    theForm.EMail.focus();
    return (false);
	}
  }
 }
 
if (theForm.dnr_fEMail.value > 0){

  if(theForm.EMail.value != "") {
        pathLen = theForm.EMail.value.length;
for(var i=0; i<pathLen; i++) {
        ch = theForm.EMail.value.substring(i,i+1)
if (ch == " ") {
            commaError = true;
         }
if (ch == "@") {
            commaError = false;
         }
}
if(foundError == false && commaError == true) {
            alert("Spaces are not permitted in email addresses.");
            return (false);
	  }
// check for @ symbol
        pathLen = theForm.EMail.value.length;
for(var i=0; i<pathLen; i++) {
        ch = theForm.EMail.value.substring(i,i+1)
if (ch == "@") {
            commaError = true;
         }
}

if(foundError == false && commaError == false) {
            alert("email addresses must include an '@' symbol.");
			theForm.EMail.focus();
            return (false);
	  }

}

}


if (theForm.dnr_fDiet.value == 2){
	if(theForm.Diet.value == ""){
		alert("Please enter any Dietary Requirements - Enter NA if not applicable.");
		theForm.Diet.focus();
		return(false);
	}
}

if (theForm.dnr_fSpecialReq.value == 2){
	if(theForm.hdn_SpecialNeedsPD.value == ""){
		alert("Please enter any Special Needs - Enter NA if not applicable.");
		theForm.hdn_SpecialNeedsPD.focus();
		return(false);
	}
}
if (theForm.dnr_showaps.value == 1){

	if(theForm.xxx_APFirstName != ""){
		if (theForm.dnr_fAPBadgename.value == 2){
		  		if (theForm.xxx_APBadgeName.value == ""){
		    	//alert("Please enter a value for the \"Badgename\" field.");
		    	//theForm.xxx_APBadgeName.focus();
		    	//return (false);
		  		}
			}
	
	
		if (theForm.dnr_fAPDiet.value == 2){
			if(theForm.xxx_APDiet.value == ""){
				alert("Please enter any Accompanying Person Dietary Requirements - Enter NA if not applicable.");
				theForm.xxx_APDiet.focus();
				return(false);
			}
		}
	
		if (theForm.dnr_fAPSpecialReq.value == 2){
			if(theForm.xxx_zAPSpecialNeeds.value == ""){
				alert("Please enter any Accompanying Person Special Needs - Enter NA if not applicable.");
				theForm.xxx_zAPSpecialNeeds.focus();
				return(false);
			}
		}
	}




}
if (theForm.dnr_fPDComplete.value == 2){
if(theForm.dnr_regocomplete.checked == false){
	alert("Please tick the " + theForm.dnr_fPDCompleteDefault.value + " checkbox at the bottom of the page")
	return (false);
}


}

  return (true);
}
