/********************************************
* joblikeme.js
* v1.0
********************************************/

NomDuSite="JobLikeMe";
siteName="companyinfo";

function CheckTxtField(field,Label){

	if (field.value == "")
	{
		alert("Please enter a value for the '" + Label + "' field.");
		field.focus();
		return (false);
	}
	return(true);

}

// Form Validation
function frmjoblikeme_Validation(frmName)
{
	if (! CheckTxtField(frmName.fLastname,"Last Name")) return(false);
	if (! CheckTxtField(frmName.fFirstname,"First Name")) return(false);
	if (! CheckTxtField(frmName.fBday_month,"Month of the Date of Birth")) return(false);
	if (! CheckTxtField(frmName.fBday_day,"Day of the Date of Birth")) return(false);
	if (! CheckTxtField(frmName.fBday_year,"Year of the Date of Birth")) return(false);
	if (! CheckTxtField(frmName.fEmail,"email")) return(false);
	if (! CheckTxtField(frmName.fTel,"Telephone")) return(false);
	if (! CheckTxtField(frmName.fAddr1,"Address")) return(false);
	if (! CheckTxtField(frmName.fCity,"City")) return(false);
	if (! CheckTxtField(frmName.fZip,"Zip")) return(false);
	if (! CheckTxtField(frmName.fUniversity,"University/College")) return(false);
	if (! CheckTxtField(frmName.fDegreeplan,"Degree Plan")) return(false);

	// State	
	if (frmName.fState.selectedIndex == 0)
	{
		alert("Please enter a value for the 'State' field.");
		frmName.fState.focus();
		return (false);
	}

	// Email
	if (!validateEmail(frmName.fEmail.value)) {
		alert("Please enter a valid email address.");
		frmName.fEmail.focus();
		return (false);
	}

	if (frmName.fBday_month.value.toString().length==1) frmName.fBday_month.value='0'+frmName.fBday_month.value;
	if (frmName.fBday_day.value.toString().length==1) frmName.fBday_day.value='0'+frmName.fBday_day.value;
	if (! check_date(frmName.fBday_month.value + "/" + frmName.fBday_day.value + "/" + frmName.fBday_year.value)) {
		alert("Please enter a valid Date of Birth");
		frmName.fBday_month.focus();
		return (false);
	}
	
	if  (!frmName.fTerms.checked) {
		alert("You must agree to the general conditions");
		frmName.fTerms.focus();
		return (false);
	}


	if  (!frmName.fEligibility.checked) {
		alert("You must agree to the general conditions and accept the release");
		frmName.fEligibility.focus();
		return (false);
	}

		

	return (true);
}



