<!--
// ********************************************************************************
// ********************************************************************************
function validate_employmentform() {
// ********************************************************************************
// ********************************************************************************

	if (trimString(document.employmentform.position.value) == "")
	{
		alert("Please tell us your position of interest.");
		return;
	}
	if (trimString(document.employmentform.firstname.value) == "")
	{
		alert("Please tell us your first name.");
		return;
	}

	if (trimString(document.employmentform.lastname.value) == "")
	{
		alert("Please tell us your last name.");
		return;
	}

	if (trimString(document.employmentform.address1.value) == "")
	{
		alert("Please tell us your address.");
		return;
	}
	if (trimString(document.employmentform.city.value) == "")
	{
		alert("Please tell us your city.");
		return;
	}
	if (trimString(document.employmentform.state.value) == "")
	{
		alert("Please tell us your state.");
		return;
	}
	if (trimString(document.employmentform.zipcode.value) == "")
	{
		alert("Please tell us your zip code.");
		return;
	}

	if (trimString(document.employmentform.email.value) == "")
	{
		alert("Please tell us your email address");
		return;
	}
		
	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(trimString(employmentform.email.value))){
	}
	else {
		alert("The Email address you entered is invalid. Please re-enter it.")
		return;
 	}


	if (trimString(document.employmentform.phone1.value) == "")
	{
		alert("Please tell us your home phone area code.");
		return;
	}
	
	var valid_numeric_characters = "0123456789";
	
	var phone1_ok = "yes";
	var temp;
	for (var i=0; i<document.employmentform.phone1.value.length; i++) {
	temp = "" + document.employmentform.phone1.value.substring(i, i+1);
	if (valid_numeric_characters.indexOf(temp) == "-1") phone1_ok = "no";
	}
	if (phone1_ok == "no") {
	alert("Please use only numeric characters in your home phone number.");
	return;
	}
	
	if (trimString(document.employmentform.phone2.value) == "")
	{
		alert("Please tell us your Home Phone Number.");
		return;
	}
	
	var phone2_ok = "yes";
	var temp;
	for (var i=0; i<document.employmentform.phone2.value.length; i++) {
	temp = "" + document.employmentform.phone2.value.substring(i, i+1);
	if (valid_numeric_characters.indexOf(temp) == "-1") phone2_ok = "no";
	}
	if (phone2_ok == "no") {
	alert("Please use only numeric characters in your home phone number.");
	return;
	}
	
	if (trimString(document.employmentform.phone3.value) == "")
	{
		alert("Please tell us your Home Phone Number.");
		return;
	}
	
	var phone3_ok = "yes";
	var temp;
	for (var i=0; i<document.employmentform.phone3.value.length; i++) {
	temp = "" + document.employmentform.phone3.value.substring(i, i+1);
	if (valid_numeric_characters.indexOf(temp) == "-1") phone3_ok = "no";
	}
	if (phone3_ok == "no") {
	alert("Please use only numeric characters in your home phone area ");
	return;
	}

	/* ************************************************************************ */

	if (trimString(document.employmentform.position.value) == "Pharmacist" || trimString(document.employmentform.position.value) == "Pharmacy Technician") {

		if (trimString(document.employmentform.college.value) == "")
		{
			alert("Please tell us your College or University (required for Pharmacist or Pharmacy Technician positions).");
			return;
		}


		var GraduatedRadioArray = document.employmentform.graduated;
		  var GraduatedChecked = "no";
		
		  for (var index = 0; index < GraduatedRadioArray.length; index++) {
		  
			if (GraduatedRadioArray[ index ].checked ) {
		
				if (GraduatedRadioArray[ index ].value == "T") {
	
					if (trimString(document.employmentform.graduationdate.value) == "mm/dd/yyyy" || trimString(document.employmentform.graduationdate.value) == "") {
	
						alert("Please tell us your graduation date");
						return;
					} else {
						var DateValid = ValidateGraduationDate();
						if(DateValid == false) {
						 return;
						}
					}
	
				}
	
			 var GraduatedChecked = "yes";
			}
		  }
	
		if (GraduatedChecked == "no") {
		
			alert("Please tell us whether or not you graduated from a College or University.");
			return;
		}
	}
	/* ************************************************************************ */

	if (trimString(document.employmentform.question.value) != "")
	{
		if (trimString(document.employmentform.question.value).length > 2000)
			{
			alert("Please limit your questions or comments to 2,000 characters or less");
			return;
			}
	}


	document.getElementById('employmentform_submit').innerHTML = "<span class=\"errormessage\">Request processing, please wait ...</span>";
	document.employmentform.submit();


// ********************************************************************************
// ********************************************************************************
}
// ********************************************************************************
// ********************************************************************************

// ********************************************************************************
// ********************************************************************************
function inEducationDate() {
		  
	if (trimString(document.employmentform.graduationdate.value) == "mm/dd/yyyy") {
		document.employmentform.graduationdate.value = "";
	}
}
function outEducationDate() {
		  
	if (trimString(document.employmentform.graduationdate.value) == "mm/dd/yyyy" || trimString(document.employmentform.graduationdate.value) == "") {
		document.employmentform.graduationdate.value = "mm/dd/yyyy";
	}
}

function AdjustEducationDate() {
		  
	var GraduatedRadioArray = document.employmentform.graduated;
	
	if (trimString(document.employmentform.position.value) == "Pharmacist" || trimString(document.employmentform.position.value) == "Pharmacy Technician") {

		for (var index = 0; index < GraduatedRadioArray.length; index++) {
			
			if (GraduatedRadioArray[ index ].checked ) {
			
				if (GraduatedRadioArray[ index ].value == "T") {
					document.getElementById("graduationdaterequired").innerHTML = "<b>*</b>";
				} else {
					document.getElementById("graduationdaterequired").innerHTML = "<b>&nbsp;</b>";
				}
			}
		}
	}
}

function AdjustEducationLevel() {
	  
	if (trimString(document.employmentform.position.value) == "Other" || trimString(document.employmentform.position.value) == "") {

		document.getElementById("collegerequired").innerHTML = "<b>&nbsp;</b>";
		document.getElementById("graduatedrequired").innerHTML = "<b>&nbsp;</b>";
		document.getElementById("graduationdaterequired").innerHTML = "<b>&nbsp;</b>";
		
	} else {
	
		document.getElementById("collegerequired").innerHTML = "<b>*</b>";
		document.getElementById("graduatedrequired").innerHTML = "<b>*</b>";
		
		var GraduatedRadioArray = document.employmentform.graduated;
		for (var index = 0; index < GraduatedRadioArray.length; index++) {
		
			if (GraduatedRadioArray[ index ].checked ) {
				if (GraduatedRadioArray[ index ].value == "T") {
					document.getElementById("graduationdaterequired").innerHTML = "<b>*</b>";
				} else {
					document.getElementById("graduationdaterequired").innerHTML = "<b>&nbsp;</b>";
				}
			}
		}
	}
}


// ********************************************************************************
// ********************************************************************************

var isNN = (navigator.appName.indexOf("Netscape")!=-1);
function autoTab(input,len, e) {
var keyCode = (isNN) ? e.which : e.keyCode; 
var filter = (isNN) ? [0,8,9] : [0,8,9,16,17,18,37,38,39,40,46];
if(input.value.length >= len && !containsElement(filter,keyCode)) {
input.value = input.value.slice(0, len);
input.form[(getIndex(input)+1) % input.form.length].focus();
}
function containsElement(arr, ele) {
var found = false, index = 0;
while(!found && index < arr.length)
if(arr[index] == ele)
found = true;
else
index++;
return found;
}
function getIndex(input) {
var index = -1, i = 0, found = false;
while (i < input.form.length && index == -1)
if (input.form[i] == input)index = i;
else i++;
return index;
}
return true;
}

//-->
