
// Function to validate Event Submission form
	function checkForm(thisForm){
		var error = 0
		if(thisForm.strFirstName.value == ""){
			thisForm.strFirstName.focus();
			document.getElementById("tdFirstName").setAttribute("class", "error");
			error = 1
		} else {
			document.getElementById("tdFirstName").setAttribute("class", "");
		}
		if(thisForm.strLastName.value == ""){
			if (error == 0){
				thisForm.strLastName.focus();
			}
			document.getElementById("tdLastName").setAttribute("class", "error");
			error = 1
		} else {
			document.getElementById("tdLastName").setAttribute("class", "");
		}
		if(thisForm.strPhoneNumber.value == ""){
			if (error == 0){
				thisForm.strPhoneNumber.focus();
			}
			document.getElementById("tdPhoneNumber").setAttribute("class", "error");
			error = 1
		}	else {
			document.getElementById("tdPhoneNumber").setAttribute("class", "");
		}	
		// this statement makes sure the email address is valid
		if((thisForm.strEmail.value.indexOf("@") < 1)   ||  							
			(thisForm.strEmail.value.lastIndexOf(".") <= thisForm.strEmail.value.indexOf("@") +1) ||      
    		(thisForm.strEmail.value.lastIndexOf(".") == thisForm.strEmail.value.length - 1) ||          	
			(thisForm.strEmail.value.indexOf(" ")  != -1)){ 
			
			if (error == 0){
				thisForm.strEmail.focus();
			}
			document.getElementById("tdEmail").setAttribute("class", "error");
     		error = 1	
		} else {
			document.getElementById("tdEmail").setAttribute("class", "");
			}	
		// Start of resume validation
		if(thisForm.strFileUpload.value == ""){
			if (error == 0){
				thisForm.strFileUpload.focus();
			}
			document.getElementById("tdFileUpload").setAttribute("class", "error");
			error = 1
		}	else {
			document.getElementById("tdFileUpload").setAttribute("class", "");
		}	
		// check for correct file type
		
		if(thisForm.strFileUpload.value.lastIndexOf(".doc") != -1 || thisForm.strFileUpload.value.lastIndexOf(".docx")!= -1 || thisForm.strFileUpload.value.lastIndexOf(".pdf")!= -1){
			//alert("Good") ;
			document.getElementById("tdFileUploadMessage").setAttribute("class", "");
			document.getElementById("tdFileUploadMessage").innerHTML = "";
			document.getElementById("tdFileUpload").setAttribute("class", "");
		}else{
			if (error == 0){
				thisForm.strFileUpload.focus();
			}
			document.getElementById("tdFileUpload").setAttribute("class", "error");
			document.getElementById("tdFileUploadMessage").setAttribute("class", "error");
			document.getElementById("tdFileUploadMessage").innerHTML = "Please only upload Micrsoft Word or Adobe PDF files";
			error = 1
		}
		// End of resume validation  
		if(thisForm.strCAPTCHA.value == ""){
			if (error == 0){
				thisForm.strCAPTCHA.focus();
			}
			document.getElementById("tdCaptchaImage").setAttribute("class", "error");
			error = 1
		}	else {
			document.getElementById("tdCaptchaImage").setAttribute("class", "");
		}	
		if (error == 1){
			document.getElementById("tdHead").setAttribute("class", "error");
			document.getElementById("tdHead").innerHTML = "Please Enter Required Fields"
			return false;
		}else{
			//alert("form ok");
			return true;
		}
	}


