// JavaScript Document
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; 
for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function submit_form()
{
	if (FormValidation())
	{
		document.mailform.submit();
		//alert('Thank you for your interest at Prairie View, Inc.\n.');
		//window.close();
	}
}
function FormValidation() 
{

	if (document.mailform.lastname.value == '')
	{
		alert('Please enter your last name!');
		document.mailform.lastname.focus();
		return false;
	}
	
	if (document.mailform.firstname.value == '')
	{
		alert('Please enter your first name.');
		document.mailform.firstname.focus();
		return false;
	}

	if (document.mailform.address.value=="")
	{
		alert('Please enter your address.');
		document.mailform.address.focus();
		return false;
	}
	if (document.mailform.city.value=="")
	{
		alert('Please enter your city.');
		document.mailform.city.focus();
		return false;
	}
	if (document.mailform.EmpState.value=="")
	{
		alert('Please enter your state.');
		document.mailform.EmpState.focus();
		return false;
	}
	if (document.mailform.zip.value=="")
	{
		alert('Please enter your zip code.');
		document.mailform.zip.focus();
		return false;
	}
	if (document.mailform.phone.value=="")
	{
		alert('Please enter your phone number.');
		document.mailform.phone.focus();
		return false;
	}
	if (document.mailform.country.value=="")
	{
		alert('Please enter your country.');
		document.mailform.country.focus();
		return false;
	}
/*
	if (document.mailform.ssn.value=="")
	{
		alert('Please enter your social security number.');
		document.mailform.ssn.focus();
		return false;
	}
*/
	if ((document.mailform.legalright[0].checked==false) && (document.mailform.legalright[1].checked==false))
	{
		alert('Do you have legal right to accept employment in the United States? Select Yes or No option.');
		return false;
	}
	if ((document.mailform.phys[0].checked==false) && (document.mailform.phys[1].checked==false))
	{
		alert('Do you agree to take a physicial examination if re-quested after employment? Select Yes or No option.');
		return false;
	}
	if ((document.mailform.prevemp[0].checked==false) && (document.mailform.prevemp[1].checked==false))
	{
		alert('Have you been previous been employed at Prairie View? Select Yes or No option.');
		return false;
	}
	if((document.mailform.prevemp[0].checked==true) && (document.mailform.pname.value==""))
	{
		alert('If previously employed, what was your name?');
		document.mailform.pname.focus();
		return false;
	}
	if((document.mailform.prevemp[0].checked==true) && (document.mailform.lempdate.value==""))
	{
		alert('If previously employed, when were you employed at Prairie View?');
		document.mailform.lempdate.focus();
		return false;
	}
	if(document.mailform.posdes.value=="")
	{
		alert('Position Desired?');
		document.mailform.posdes.focus();
		return false;
	}
	if ((document.mailform.age18[0].checked==false) && (document.mailform.age18[1].checked==false))
	{
		alert('Are you atleast 18 years of age? Select Yes or No option.');
		return false;
	}
	if ((document.mailform.related[0].checked==false) && (document.mailform.related[1].checked==false))
	{
		alert('Are you related to anyone at Prairie View? Select Yes or No option.');
		return false;
	}
	if ((document.mailform.related[0].checked==true) && (document.mailform.relname.value==""))
	{
		alert('Are you related to anyone at Prairie View? If so, who and how?');
		document.mailform.relname.focus();
		return false;
	} 
	if(document.mailform.college1.value=="")
	{
		alert('Please enter name and location of your school/college.');
		document.mailform.college1.focus();
		return false;
	}
	if((document.mailform.checkbox1.checked==false) && (document.mailform.checkbox2.checked==false) && (document.mailform.checkbox3.checked==false) && (document.mailform.checkbox4.checked==false))
	{
		alert('Are you interested in full-time, part-time, contract, and/or PRN/Seasonal position?');
		document.mailform.checkbox1.focus();
		
		return false;
	}
	if ((document.mailform.convicted[0].checked==false) && (document.mailform.convicted[1].checked==false))
	{
		alert('Have you ever been convicted of a felony? Please, select Yes or No option.');
		return false;
	}
	if ((document.mailform.convicted[0].checked==true) && (document.mailform.condesc.value==""))
	{
		alert('If you have ever been convicted, please describe in detail.');
		document.mailform.condesc.focus();
		return false;
	}
	if ((document.mailform.agree[0].checked==false) && (document.mailform.agree[1].checked==false))
	{
		alert('In submitting this application for employment to you (Prairie View), I clearly understand and agree to the above terms. Select Yes or No option.');
		return false;
	}
	return true;
}

function reset_form()
{
	document.mailform.lastname.value = "";
	document.mailform.firstname.value = "";
	document.mailform.midinit.value = "";
	document.mailform.ssn.value="";
	document.mailform.address.value="";
	document.mailform.city.value="";
	document.mailform.EmpState.value="";
	document.mailform.zip.value="";
	document.mailform.phone.value="";
	document.mailform.country.value="";
	document.mailform.legalright[0].checked=false;
	document.mailform.legalright[1].checked=false;
	document.mailform.phys[0].checked=false;
	document.mailform.phys[1].checked=false;
	document.mailform.prevemp[0].checked=false;
	document.mailform.prevemp[1].checked=false;
	document.mailform.lempdate.value="";
	document.mailform.pname.value="";
	document.mailform.email.value = "";
	document.mailform.posdes.value="";
	document.mailform.age18[0].checked=false;
	document.mailform.age18[1].checked=false;
	document.mailform.related[0].checked=false;
	document.mailform.related[1].checked=false;
	document.mailform.relname.value="";
	
	document.mailform.license.value="";
	document.mailform.licstate.value="";
	
	document.mailform.college1.value="";
	document.mailform.majorsub1.value="";
	document.mailform.grad1[0].checked=false;
	document.mailform.grad1[1].checked=false;
	document.mailform.degree1.value="";
	document.mailform.to1.value="";
	document.mailform.from1.value="";
	
	document.mailform.college2.value="";
	document.mailform.majorsub2.value="";
	document.mailform.grad2[0].checked=false;
	document.mailform.grad2[1].checked=false;
	document.mailform.degree2.value="";
	document.mailform.to2.value="";
	document.mailform.from2.value="";
	
	document.mailform.college3.value="";
	document.mailform.majorsub3.value="";
	document.mailform.grad3[0].checked=false;
	document.mailform.grad3[1].checked=false;
	document.mailform.degree3.value="";
	document.mailform.to3.value="";
	document.mailform.from3.value="";
	
	document.mailform.college4.value="";
	document.mailform.majorsub4.value="";
	document.mailform.grad4[0].checked=false;
	document.mailform.grad4[1].checked=false;
	document.mailform.degree4.value="";
	document.mailform.to4.value="";
	document.mailform.from4.value="";
	
	//document.mailform.college5.value="";
	//document.mailform.majorsub5.value="";
	//document.mailform.grad5[0].checked=false;
	//document.mailform.grad5[1].checked=false;
	//document.mailform.degree5.value="";
	//document.mailform.to5.value="";
	//document.mailform.from5.value="";
	
	document.mailform.emp1.value="";
	document.mailform.exprnce1.value="";
	document.mailform.empfrom1.value="";
	document.mailform.empto1.value="";
	document.mailform.salary1.value="";
	document.mailform.comp1.value="";
	document.mailform.reason1.value="";
	
	document.mailform.emp2.value="";
	document.mailform.exprnce2.value="";
	document.mailform.empfrom2.value="";
	document.mailform.empto2.value="";
	document.mailform.salary2.value="";
	document.mailform.comp2.value="";
	document.mailform.reason2.value="";
	
	document.mailform.emp3.value="";
	document.mailform.exprnce3.value="";
	document.mailform.empfrom3.value="";
	document.mailform.empto3.value="";
	document.mailform.salary3.value="";
	document.mailform.comp3.value="";
	document.mailform.reason3.value="";
	
	document.mailform.emp4.value="";
	document.mailform.exprnce4.value="";
	document.mailform.empfrom4.value="";
	document.mailform.empto4.value="";
	document.mailform.salary4.value="";
	document.mailform.comp4.value="";
	document.mailform.reason4.value="";
	
	document.mailform.emp5.value="";
	document.mailform.exprnce5.value="";
	document.mailform.empfrom5.value="";
	document.mailform.empto5.value="";
	document.mailform.salary5.value="";
	document.mailform.comp5.value="";
	document.mailform.reason5.value="";
	
	document.mailform.wref1.value="";
	document.mailform.wrefaddr1.value="";
	document.mailform.wphone1.value="";
	document.mailform.whmphone1.value="";
	document.mailform.emailaddr1.value="";
	
	document.mailform.wref2.value="";
	document.mailform.wrefaddr2.value="";
	document.mailform.wphone2.value="";
	document.mailform.whmphone2.value="";
	document.mailform.emailaddr2.value="";

	document.mailform.wref3.value="";
	document.mailform.wrefaddr3.value="";
	document.mailform.wphone3.value="";
	document.mailform.whmphone3.value="";
	document.mailform.emailaddr3.value="";


/*	
	document.mailform.pref1.value="";
	document.mailform.prefaddr1.value="";
	document.mailform.pphone1.value="";
	document.mailform.phmphone1.value="";
	
	document.mailform.pref2.value="";
	document.mailform.prefaddr2.value="";
	document.mailform.pphone2.value="";
	document.mailform.phmphone2.value="";
	
	document.mailform.pref3.value="";
	document.mailform.prefaddr3.value="";
	document.mailform.pphone3.value="";
	document.mailform.phmphone3.value="";
*/	
	document.mailform.skills.value="";
	document.mailform.empreason.value="";
	document.mailform.prompted.value="";
	document.mailform.checkbox1.checked=false
	document.mailform.checkbox2.checked=false;
	document.mailform.checkbox3.checked=false;
	document.mailform.checkbox4.checked=false;
	
	document.mailform.convicted[0].checked=false;
	document.mailform.convicted[1].checked=false;
	document.mailform.condesc.value="";
	
	
	
}

