// 	############# 	Association and publication validation 		############.

function validate_assoc() {
   with(document.assocForm) {

      var assoc_name = kp_assopbl_name.value;
      var assoc_addr = kp_assopbl_address.value;
      var assoc_tel = kp_assopbl_telephone.value;
      var assoc_email = kp_assopbl_email.value;
      var assoc_publ = kp_assopbl_head.value;
      var assoc_contents = kp_assopbl_contents.value;


      if ((assoc_name == "") || (assoc_name == " ") || (assoc_name == "  ")) {
         alert("Name of Publication can not be empty");
         kp_assopbl_name.focus();
         return false;
      }

      if (isNaN(assoc_name) == false) {
         alert("Invalid entry");
         kp_assopbl_name.focus();
         return false;
      }

      if ((assoc_addr == "") || (assoc_addr == " ") || (assoc_addr  == "  ")) {
         alert("Address field cannot be empty");
         kp_assopbl_address.focus();
         return false;
      }

     if (isNaN(assoc_tel) == true) {
        alert("Has to be a number without any separators");
        kp_assopbl_telephone.focus();
        return false;
     }

      if ((assoc_tel == "") || (assoc_tel == " ") || (assoc_tel  == "  ")) {
         alert("Telephone number cannot be empty");
         kp_assopbl_telephone.focus();
         return false;
      }

      if ((assoc_email == "") || (assoc_email == " ") || (assoc_email  == "  ")) {
         kp_assopbl_email.value = "Not available";
         kp_assopbl_head.focus();
      }

      if ((assoc_publ == "") || (assoc_publ == " ") || (assoc_publ  == "  ")) {
         alert("Editor field cannot be empty");
         kp_assopbl_head.focus();
         return false;
      }

      if ((assoc_contents == "") || (assoc_contents == " ") || (assoc_contents  == "  ")) {
         alert("Contents field cannot be empty");
         kp_assopbl_contents.focus();
         return false;
      }
   }
}


// 	#################    	Nominee Form Validations  	################

function validate_nominee() {
   with(document.nomineeForm) {

      var talent_name = kp_talent_name.value;
      var talent_addr = kp_talent_address.value;
      var talent_tel = kp_talent_telephone.value;
      var talent_email = kp_talent_email.value;
      var talent_field = kp_talent_field.value;
      var talent_contents = kp_talent_contents.value;


      if ((talent_name == "") || (talent_name == " ") || (talent_name == "  ")) {
         alert("Name field can not be empty");
         kp_talent_name.focus();
         return false;
      }
      if (isNaN(talent_name) == false) {
         alert("Not a valid entry");
         kp_talent_name.focus();
         return false;
      }

      if ((talent_addr == "") || (talent_addr == " ") || (talent_addr  == "  ")) {
         alert("Address field cannot be empty");
         kp_talent_address.focus();
         return false;
      }

     if (isNaN(talent_tel) == true) {
        alert("Has to be a number without any separators");
        kp_talent_telephone.focus();
        return false;
     }

      if ((talent_tel == "") || (talent_tel == " ") || (talent_tel  == "  ")) {
         alert("Telephone number cannot be empty");
         kp_talent_telephone.focus();
         return false;
      }

      if ((talent_email == "") || (talent_email == " ") || (talent_email  == "  ")) {
         kp_talent_email.value = "Not available";
         kp_talent_field.focus();
      }

      if ((talent_field == "") || (talent_field == " ") || (talent_field == "  ")) {
         alert("Please specify field of work");
         kp_talent_field.focus();
         return false;
      }

      if ((talent_contents == "") || (talent_contents == " ") || (talent_contents  == "  ")) {
         alert("Contents field cannot be empty");
          kp_talent_contents.focus();
         return false;
      }
   }
}


// 	#################    	Matrimonials Validations  	################

function validate_matri() {
   with(document.matriForm) {

      var matri_name = mars_name.value;
      var matri_age = mars_age.value;
      var matri_height = mars_height.value;
      var matri_renum = mars_renum.value;
      var matri_complexion = mars_complexion.value;
      var matri_features = mars_features.value;
      var matri_education = mars_education.value;
      var matri_proccup = mars_proccup.value;
      var matri_coninfo = mars_coninfo.value;
      var matri_mars_addinfo = mars_addinfo.value;
      var matri_tel = mars_telephone.value;
      var matri_email = mars_email.value;
      


      if ((matri_name == "") || (matri_name == " ") || (matri_name == "  ")) {
         alert("Name field can not be empty");
         mars_name.focus();
         return false;
      }

      if (isNaN(matri_name) == false) {
         alert("Not a valid entry");
         mars_name.focus();
         return false;
      }

	if ((matri_age == "") || (matri_age == " ") || (matri_age == "  ")) {
         alert("Age field can not be empty");
         mars_age.focus();
         return false;
      }

      if (isNaN(matri_age) == true) {
         alert("Invalid entry in age field");
         mars_age.focus();
         return false;
      } 

	if ((matri_height == "") || (matri_height == " ") || (matri_height == "  ")) {
         alert("Height field can not be empty");
         mars_height.focus();
         return false;
      }

      if (isNaN(matri_height) == true) {
         alert("Invalid entry in height field");
         mars_height.focus();
         return false;
      }

	if ((matri_renum == "") || (matri_renum == " ") || (matri_renum == "  ")) {
	   mars_renum.value = "Not employed";
//         alert("Please enter your present renumeration");
         mars_complexion.focus();
//         return false;
      }

//      if (isNaN(matri_renum) == true) {
//         alert("Invalid entry in renumeration field");
//         mars_renum.focus();
//         return false;
//      }

	if ((matri_complexion == "") || (matri_complexion == " ") || (matri_complexion == "  ")) {
         alert("Please specify the complexion");
         mars_complexion.focus();
         return false;
      }

      if (isNaN(matri_complexion) == false) {
         alert("Invalid entry in complexion field");
         mars_complexion.focus();
         return false;
      }

if ((matri_features == "") || (matri_features == " ") || (matri_features == "  ")) {
         alert("Please specify the features");
         mars_features.focus();
         return false;
      }

if ((matri_education == "") || (matri_education == " ") || (matri_education == "  ")) {
         alert("Please specify details of your education");
         mars_education.focus();
         return false;
      }

	if ((matri_proccup == "") || (matri_proccup == " ") || (matri_proccup == "  ")) {
         alert("Please specify your present occupation");
         mars_proccup.focus();
         return false;
      }

      if (isNaN(matri_proccup) == false) {
         alert("Invalid entry in occupation field");
         mars_proccup.focus();
         return false;
      }

if ((matri_coninfo == "") || (matri_coninfo == " ") || (matri_coninfo == "  ")) {
         alert("Please give your contact information");
         mars_coninfo.focus();
         return false;
      }

//if ((matri_addinfo == "") || (matri_addinfo == " ") || (matri_addinfo == "  ")) {
//         alert("Please specify any additional information");
//         mars_addinfo.focus();
//         return false;
//      }


     if (isNaN(matri_tel) == true) {
        alert("Has to be a number without any separators");
       mars_telephone.focus();
        return false;
     }

      if ((matri_tel == "") || (matri_tel == " ") || (matri_tel  == "  ")) {
         alert("Telephone number cannot be empty");
         mars_telephone.focus();
         return false;
      }

      if ((matri_email == "") || (matri_email == " ") || (matri_email  == "  ")) {
         mars_email.value = "Not available";
//         mars_contents.focus();
      }

   }
}
