<!--

function openPrivacy() {
	var width = 467;
	var height = 581;
	var Xcord = (window.screen.width-width)/2;
	var Ycord = (window.screen.height-height)/2;
	window.open("/privacy.htm", "Privacy", "width="+width+",height="+height+", top="+Ycord+", left="+Xcord+", toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no");
	return false;
}

function openVideo() {
	var width = 424;
	var height = 444;
	var Xcord = (window.screen.width-width)/2;
	var Ycord = (window.screen.height-height)/2;
	window.open("/video_services.htm", "Video", "width="+width+",height="+height+", top="+Ycord+", left="+Xcord+", toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no");
	return false;
}

function setOver(objCell) {
	image = eval("document.images." + objCell);
	image.src = "/images/" + objCell + "_over.gif";
	return false;
}

function setOut(objCell) {
	image = eval("document.images." + objCell);
	image.src = "/images/" + objCell + ".gif";
	return false;
}

function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		about_over = newImage("/images/about_over.gif");
		services_over = newImage("/images/services_over.gif");
		staff_over = newImage("/images/staff_over.gif");
		benefits_over = newImage("/images/benefits_over.gif");
		hotline_over = newImage("/images/hotline_over.gif");
		salesenq_over = newImage("/images/salesenq_over.gif");
		salesenq2_over = newImage("/images/salesenq2_over.gif");
		application_over = newImage("/images/application_over.gif");
		application2_over = newImage("/images/application2_over.gif");
		home_over = newImage("/images/home_over.gif");

		aboutint_over = newImage("/images/aboutint_over.gif");
		servicesint_over = newImage("/images/servicesint_over.gif");
		staffint_over = newImage("/images/staffint_over.gif");
		benefitsint_over = newImage("/images/benefitsint_over.gif");
		hotlineint_over = newImage("/images/hotlineint_over.gif");
		salesenqint_over = newImage("/images/salesenqint_over.gif");
		applicationint_over = newImage("/images/applicationint_over.gif");
		homeint_over = newImage("/images/homeint_over.gif");

		background = newImage("/images/background.gif");
		preloadFlag = true;
	}
}

var strValidPhoneChars = "()- ";
var strValidZipChars = "-";
var intMinPhoneDigits = 10;
var intMinZipDigits = 5;
var dtCh= "/";
var minYear=1900;
var maxYear=2100;

function isInt(s) {
	var i;
    for (i = 0; i < s.length; i++){   
        var c = s.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    return true;
}

function stripCharsInBag(s, bag){
	var i;
    var returnString = "";
    // Search through string's characters one by one.
    // If character is not in bag, append to returnString.
    for (i = 0; i < s.length; i++){   
        var c = s.charAt(i);
        if (bag.indexOf(c) == -1) returnString += c;
    }
    return returnString;
}

function daysInFebruary (year){
	// February has 29 days in any year evenly divisible by four,
    // EXCEPT for centurial years which are not also divisible by 400.
    return (((year % 4 == 0) && ( (!(year % 100 == 0)) || (year % 400 == 0))) ? 29 : 28 );
}

function DaysArray(n) {
	for (var i = 1; i <= n; i++) {
		this[i] = 31
		if (i==4 || i==6 || i==9 || i==11) {this[i] = 30}
		if (i==2) {this[i] = 29}
   } 
   return this
}

function isDate(dtStr){
	var daysInMonth = DaysArray(12)
	var pos1=dtStr.indexOf(dtCh)
	var pos2=dtStr.indexOf(dtCh,pos1+1)
	var strMonth=dtStr.substring(0,pos1)
	var strDay=dtStr.substring(pos1+1,pos2)
	var strYear=dtStr.substring(pos2+1)
	strYr=strYear
	if (strDay.charAt(0)=="0" && strDay.length>1) strDay=strDay.substring(1)
	if (strMonth.charAt(0)=="0" && strMonth.length>1) strMonth=strMonth.substring(1)
	for (var i = 1; i <= 3; i++) {
		if (strYr.charAt(0)=="0" && strYr.length>1) strYr=strYr.substring(1)
	}
	month=parseInt(strMonth)
	day=parseInt(strDay)
	year=parseInt(strYr)
	if (pos1==-1 || pos2==-1) 
		return false;
	if (strMonth.length<1 || month<1 || month>12)
		return false;
	if (strDay.length<1 || day<1 || day>31 || (month==2 && day>daysInFebruary(year)) || day > daysInMonth[month]) 	
		return false;
	if (strYear.length != 4 || year==0 || year<minYear || year>maxYear) 
		return false;
	if (dtStr.indexOf(dtCh,pos2+1)!=-1 || isInt(stripCharsInBag(dtStr, dtCh))==false) 
		return false;
	return true
}

function removeChars(s,strChar) {
	var i;
    var returnString = "";
    for (i = 0; i < s.length; i++){   
        var c = s.charAt(i);
        if (strChar.indexOf(c) == -1) returnString += c;
    }
    return returnString;
}

function checkPhone(strPhone) {
 	strString = removeChars(strPhone,strValidPhoneChars);
	return (isInt(strString) && strString.length >= intMinPhoneDigits);
}

function checkZip(strZip) {
 	strString = removeChars(strZip,strValidZipChars);
	return (isInt(strString) && strString.length >= intMinZipDigits);
}

function verifyApplication(f) {
	if(f.PDLName.value.match(/^\s*$/)) {
		alert("Please enter your Last Name.");
		f.PDLName.focus();
		return false;
	}

	if(f.PDFName.value.match(/^\s*$/)) {
		alert("Please enter your First Name.");
		f.PDFName.focus();
		return false;
	}

	if(f.PDSS.value.match(/^\s*$/)) {
		alert("Please enter your Social Security Number.");
		f.PDSS.focus();
		return false;
	}

	if(f.PDHomePh.value != "") {
		if (checkPhone(f.PDHomePh.value) == false) {
			alert("Please enter a valid Home Phone Number.");
			f.PDHomePh.focus();
			f.PDHomePh.select();
			return false
		}
	}

	if((f.PDCellPh.value != "") && (f.PDCellPh.value != "(xxx) xxx-xxxx")) {
		if(checkPhone(f.PDCellPh.value) == false) {
			alert("Please enter a valid Cell Phone Number.");
			f.PDCellPh.focus();
			f.PDCellPh.select();
			return false
		}
	}

	if(f.PDAddr.value.match(/^\s*$/)) {
		alert("Please enter your Street Address.");
		f.PDAddr.focus();
		return false;
	}

	if(f.PDCity.value.match(/^\s*$/)) {
		alert("Please enter your City.");
		f.PDCity.focus();
		return false;
	}

	if(f.PDState.value == "") {
		alert("Please select your State.");
		f.PDState.focus();
		return false;
	}

	if((f.PDZip.value.match(/^\s*$/)) || (checkZip(f.PDZip.value) == false)) {
		alert("Please enter a valid Zip Code.");
		f.PDZip.focus();
		f.PDZip.select();
		return false
	}

	if(f.PDCounty.value.match(/^\s*$/)) {
		alert("Please enter your County.");
		f.PDCounty.focus();
		return false;
	}

	if(!f.PDEAddr.value.match(/^\s*$/)) {
		var strEAddr = f.PDEAddr.value;
		var strRegExpr = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/; 
		if (!strRegExpr.test(strEAddr))  {
			alert("Please enter a valid Email Address."); 
			f.PDEAddr.focus();
			f.PDEAddr.select();
			return false;
		}
	}

	if(!f.PDFSOL[0].checked && !f.PDFSOL[1].checked) {
		alert("Please select whether you have a Valid Florida Security License or not."); 
		return false;
	} else {
		if(f.PDFSOL[0].checked) {
			if(f.PDDLicNo.value.match(/^\s*$/) && f.PDGLicNo.value.match(/^\s*$/)) {
				alert("Please enter your D or G License Information."); 
				return false;
			} else {
				if((!f.PDDLicNo.value.match(/^\s*$/)) && (f.PDDLicNo.value != "Temp") && (f.PDDLicNo.value != "TEMP") && (f.PDDLicNo.value != "temp")) {
					if(isDate(f.PDDLicExp.value) == false) {	
						alert("Please enter your D License Expiration Date in mm/dd/yyyy format.");
						f.PDDLicExp.focus();
						f.PDDLicExp.select();
						return false;
					}
				}
				
				if(!f.PDGLicNo.value.match(/^\s*$/)) {
					if(isDate(f.PDGLicExp.value) == false) {
						alert("Please enter your G License Expiration Date in mm/dd/yyyy format.");
						f.PDGLicExp.focus();
						f.PDGLicExp.select();
						return false;
					}
				}
			}
		}
	}

	if(!f.PD18[0].checked && !f.PD18[1].checked) {
		alert("Please select whether you are At Least 18 Years Old or not."); 
		return false;
	}

	if(!f.PDCrime[0].checked && !f.PDCrime[1].checked) {
		alert("Please select whether you have ever been Convicted of a Crime or not."); 
		return false;
	} else {
		if(f.PDCrime[0].checked && f.PDCrimeDet.value == "") {
			alert("Please describe conditions of your Criminal Conviction.");
			f.PDCrimeDet.focus();
			return false;
		}
	}

	if(!f.EDType[0].checked && !f.EDType[1].checked && !f.EDType[2].checked) {
		alert("Please select the Type of Employment Desired."); 
		return false;
	}

	if(f.EDSalary.value.match(/^\s*$/)) {
		alert("Please enter your Salary Desired.");
		f.EDSalary.focus();
		return false;
	} 

	else {
		if(!isInt(f.EDSalary.value)) {
			alert("Please enter your Salary Desired as a number only; no commas, no decimals and no dollar signs.");
			f.EDSalary.focus();
			f.EDSalary.select();
			return false;
		}
	}

	var blnChecked = false;
	for (var i=0; i<7; i++) {
		if(f.EDDays[i].checked)
			blnChecked = true;
	}

	if (!blnChecked) {
		alert("Please select at least one Day Available."); 
		return false;
	}

	var blnChecked = false;
	for (var i=0; i<4; i++) {
		if(f.EDShift[i].checked)
			blnChecked = true;
	}

	if (!blnChecked) {
		alert("Please select at least one Shift Available."); 
		return false;
	}

	if(f.EDGeo.value.match(/^\s*$/)) {
		alert("Please enter your Geographic Preference.");
		f.EDGeo.focus();
		return false;
	}

	if(!f.EDOT[0].checked && !f.EDOT[1].checked) {
		alert("Please select whether you are willing to Work Overtime or not."); 
		return false;
	}

	if(f.WELEmp1.value.match(/^\s*$/)) {
		alert("Please enter your Present/Last Employer.");
		f.WELEmp1.focus();
		return false;
	}

	if(f.WEJTitle1.value.match(/^\s*$/)) {
		alert("Please enter your Present/Last Job Title.");
		f.WEJTitle1.focus();
		return false;
	}

	if(f.WEAddr1.value.match(/^\s*$/)) {
		alert("Please enter your Present/Last Job Address.");
		f.WEAddr1.focus();
		return false;
	}

	if(f.WECity1.value.match(/^\s*$/)) {
		alert("Please enter your Present/Last Job City.");
		f.WECity1.focus();
		return false;
	}

	if(f.WEState1.value.match(/^\s*$/)) {
		alert("Please select your Present/Last Job State.");
		f.WEState1.focus();
		return false;
	}

	if((f.WEZip1.value.match(/^\s*$/)) || (checkZip(f.WEZip1.value) == false)) {
		alert("Please enter your Present/Last Job Zip Code.");
		f.WEZip1.focus();
		f.WEZip1.select();
		return false
	}

	if(f.WEPhone1.value.match(/^\s*$/) || checkPhone(f.WEPhone1.value) == false) {
		alert("Please enter your valid Present/Last Job Phone Number.");
		f.WEPhone1.focus();
		f.WEPhone1.select();
		return false
	}

	if(f.WEStart1.value.match(/^\s*$/) || isDate(f.WEStart1.value) == false) {	
		alert("Please enter your Present/Last Job Start Date in mm/dd/yyyy format.");
		f.WEStart1.focus();
		f.WEStart1.select();
		return false;
	}

	if(f.WEEnd1.value.match(/^\s*$/) || isDate(f.WEEnd1.value) == false) {	
		alert("Please enter your Present/Last Job End Date in mm/dd/yyyy format.");
		f.WEEnd1.focus();
		f.WEEnd1.select();
		return false;
	}

	if(f.WEPay1.value.match(/^\s*$/)) {
		alert("Please enter your Present/Last Job Rate of Pay.");
		f.WEPay1.focus();
		return false;
	}

	if(f.WERLeave1.value.match(/^\s*$/)) {
		alert("Please enter your Present/Last Reason for Leaving.");
		f.WERLeave1.focus();
		return false;
	}

	if(f.WESName1.value.match(/^\s*$/)) {
		alert("Please enter your Present/Last Job Supervisor Name.");
		f.WESName1.focus();
		return false;
	}

	if(f.WESTitle1.value.match(/^\s*$/)) {
		alert("Please enter your Present/Last Job Supervisor Title.");
		f.WESTitle1.focus();
		return false;
	}

	if(!f.WECont1[0].checked && !f.WECont1[1].checked) {
		alert("Please select whether we can contact your Present/Last Job Supervisor or not."); 
		return false;
	}

	if(f.WEDuties1.value.match(/^\s*$/)) {
		alert("Please enter your Present/Last Job Duties.");
		f.WEDuties1.focus();
		return false;
	}

	if(f.RefName1.value.match(/^\s*$/)) {
		alert("Please enter your 1st Reference's Full Name.");
		f.RefName1.focus();
		return false;
	}

	if(f.RefPhone1.value.match(/^\s*$/) || checkPhone(f.RefPhone1.value) == false) {
		alert("Please enter your 1st Reference's Phone Number.");
		f.RefPhone1.focus();
		f.RefPhone1.select();
		return false
	}

	if(f.RefRel1.value.match(/^\s*$/)) {
		alert("Please enter your 1st Reference's Relationship to You.");
		f.RefRel1.focus();
		return false;
	}

	if(f.RefName2.value.match(/^\s*$/)) {
		alert("Please enter your 2nd Reference's Full Name.");
		f.RefName2.focus();
		return false;
	}

	if(f.RefPhone2.value.match(/^\s*$/) || checkPhone(f.RefPhone2.value) == false) {
		alert("Please enter your 2nd Reference's Phone Number.");
		f.RefPhone2.focus();
		f.RefPhone2.select();
		return false
	}

	if(f.RefRel2.value.match(/^\s*$/)) {
		alert("Please enter your 2nd Reference's Relationship to You.");
		f.RefRel2.focus();
		return false;
	}

	if(f.RefName3.value.match(/^\s*$/)) {
		alert("Please enter your 3rd Reference's Full Name.");
		f.RefName3.focus();
		return false;
	}

	if(f.RefPhone3.value.match(/^\s*$/) || checkPhone(f.RefPhone3.value) == false) {
		alert("Please enter your 3rd Reference's Phone Number.");
		f.RefPhone3.focus();
		f.RefPhone3.select();
		return false
	}

	if(f.RefRel3.value.match(/^\s*$/)) {
		alert("Please enter your 3rd Reference's Relationship to You.");
		f.RefRel3.focus();
		return false;
	}

	return true;
}

function verifyContact(f) {
	if(f.LName.value.match(/^\s*$/)) {
		alert("Please enter your Last Name.");
		f.LName.focus();
		return false;
	}

	if(f.FName.value.match(/^\s*$/)) {
		alert("Please enter your First Name.");
		f.FName.focus();
		return false;
	}

	var strEAddr = f.EAddr.value;
	var strRegExpr = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/; 

	if(!strRegExpr.test(strEAddr) && checkPhone(f.PhNum.value) == false) {
		alert("Please enter a valid Email Address or a valid Phone Number."); 
		return false;
	}

	//if(f.PDCellPh.value != "") {
		//if(checkPhone(f.PDCellPh.value) == false) {
			//alert("Please enter a valid Cell Phone Number.");
			//f.PDCellPh.focus();
			//f.PDCellPh.select();
			//return false
		//}
	//}

	if(f.Needs.value.match(/^\s*$/)) {
		alert("Please tell us about your Security Needs.");
		f.Needs.focus();
		return false;
	}

	return true;
}

function verifyHotline(f) {

	if(f.TypeOfIssue.value.match(/^\s*$/)) {
		alert("Please enter the Type of Issue.");
		f.TypeOfIssue.focus();
		return false;
	}

	if(f.DescriptionOfSituation.value.match(/^\s*$/)) {
		alert("Please Describe the Situation.");
		f.DescriptionOfSituation.focus();
		return false;
	}

	return true;
}

//-->
