// NEHA Ext App form validator
// Built by Rebecca

function validform()

{
	var reqfields=new Array();
	reqfields[0]="Last_Name";
	reqfields[1]="First_Name";
	reqfields[2]="Home_Phone";
	reqfields[3]="email";


	var missedfields=new Array();
	var invalcount =0;
 	var fieldid ='';
	var fieldval ='';
	var i = 0;
	 
        while(i<reqfields.length)
	  {
		fieldid = reqfields[i];
                fieldval = document.getElementById(fieldid);
		if(fieldval.value=="")
		  {
		  invalcount++;
		  //alert('Test 1');
		  }
		i++;  
                //alert('Test 2');
	  }

fieldval = document.getElementById("auth")	  

	  if(invalcount>0 || fieldval.checked == false)
	  {
	    alert('You have attempted to submit your application without completing required fields. ' +
	  '\n' +  'Please make sure you have provided your name, home phone number and email address. ' +
	  '\n' +  'If you cannot provide these details, you may wish to apply through regular mail.');
	  return false;	  	  
	  }
	else{


// alert('This form is complete');

		return true;


	}

}

