﻿
// Input form field validation script for the Employment Opportunity section.
function ValidateFormEO(form) {
	var strFirst_Name = form.First_Name.value;
	var strLast_Name = form.Last_Name.value;
	var strAddress = form.Address.value;
	var strCity = form.City.value;
	var strZip = form.Zip.value;
	var strPhone_Number = form.Phone_Number.value;	
	var strEmail = form.email.value;	
	

	if (strFirst_Name.length < 2) {
		alert('Please enter your First Name so we could better serve you.  Thank You!');
		form.First_Name.focus();
		return(false);
	}
	if (strLast_Name.length < 2) {
		alert('Please enter your Last Name so we could better serve you.  Thank You!');
		form.Last_Name.focus();
		return(false);
	}
    if (strAddress.length < 8) {
		alert('Please enter your Address so we could better serve you.  Thank You!');
		form.Address.focus();
		return(false);
	}
    if (strCity.length < 3) {
		alert('Please enter your City so we could better serve you.  Thank You!');
		form.City.focus();
		return(false);
	}
	if (strZip.length < 5) {
		alert('Please enter your Zip Code so we could better serve you.  Thank You!');
		form.Zip.focus();
		return(false);
	}
	if (strPhone_Number.length < 12) {
		alert('Please enter your 10 digit Phone Number (123-456-7890) so we could better serve you.  Thank You!');
		form.Phone_Number.focus();
		return(false);
	}
    if ((strEmail.length < 6) || (strEmail.indexOf ('@', 0) == -1)  || (strEmail.indexOf ('.', 0) == -1) ) {
		alert('Please enter your Email address so we could better serve you.  Thank You!');
		form.email.focus();
		return(false);
	}

// Required field are ok, submit form for processing.
//	form.submit();
	return(true);
}


// Input form field validation script for the Business Opportunity section.
function ValidateFormBOpp(form) {
	var strContact_Name = form.Contact_Name.value;
	var strContact_Address = form.Contact_Address.value;
	var strContact_City = form.Contact_City.value;
	var strContact_Zip = form.Contact_Zip.value;
	var strContact_Phone_Number = form.Contact_Phone_Number.value;	
	var strEmail = form.email.value;	
	

	if (strContact_Name.length < 4) {
		alert('Please enter your Contact Name so we could better serve you.  Thank You!');
		form.Contact_Name.focus();
		return(false);
	}
    if (strContact_Address.length < 8) {
		alert('Please enter your Contact Address so we could better serve you.  Thank You!');
		form.Contact_Address.focus();
		return(false);
	}
    if (strContact_City.length < 3) {
		alert('Please enter your Contact City so we could better serve you.  Thank You!');
		form.Contact_City.focus();
		return(false);
	}
	if (strContact_Zip.length < 5) {
		alert('Please enter your Contact Zip Code so we could better serve you.  Thank You!');
		form.Contact_Zip.focus();
		return(false);
	}
	if (strContact_Phone_Number.length < 12) {
		alert('Please enter your 10 digit Contact Phone Number (123-456-7890) so we could better serve you.  Thank You!');
		form.Contact_Phone_Number.focus();
		return(false);
	}
    if ((strEmail.length < 6) || (strEmail.indexOf ('@', 0) == -1)  || (strEmail.indexOf ('.', 0) == -1) ) {
		alert('Please enter your Email address so we could better serve you.  Thank You!');
		form.email.focus();
		return(false);
	}

// Required field are ok, submit form for processing.
//	form.submit();
	return(true);
}


// Input form field validation script for the Commercial Buyers section.
function ValidateFormCom(form) {
	var strOrganization_Name = form.Organization_Name.value;
	var strAddress = form.Address.value;
	var strCity = form.City.value;
	var strZip = form.Zip.value;
	var strContact_Name = form.Contact_Name.value;	
	var strContact_Phone_Number = form.Contact_Phone_Number.value;	
	var strBest_Time_To_Call = form.Best_Time_To_Call.value;	
	var strEmail = form.email.value;


	if (strOrganization_Name.length < 2) {
		alert('Please enter your Organizational Name so we could better serve you.  Thank You!');
		form.Organization_Name.focus();
		return(false);
	}
    if (strAddress.length < 8) {
		alert('Please enter your Address so we could better serve you.  Thank You!');
		form.Address.focus();
		return(false);
	}
    if (strCity.length < 3) {
		alert('Please enter your City so we could better serve you.  Thank You!');
		form.City.focus();
		return(false);
	}
	if (strZip.length < 5) {
		alert('Please enter your Zip Code so we could better serve you.  Thank You!');
		form.Zip.focus();
		return(false);
	}
	if (strContact_Name.length < 4) {
		alert('Please enter your Contact Name so we could better serve you.  Thank You!');
		form.Contact_Name.focus();
		return(false);
	}
	if (strContact_Phone_Number.length < 12) {
		alert('Please enter your 10 digit Contact Phone Number (123-456-7890) so we could better serve you.  Thank You!');
		form.Contact_Phone_Number.focus();
		return(false);
	}
    if (strBest_Time_To_Call.length < 3) {
		alert('Please enter your Best Time To Call so we could better serve you.  Thank You!');
		form.Best_Time_To_Call.focus();
		return(false);
	}
    if ((strEmail.length < 6) || (strEmail.indexOf ('@', 0) == -1)  || (strEmail.indexOf ('.', 0) == -1) ) {
		alert('Please enter your Email address so we could better serve you.  Thank You!');
		form.email.focus();
		return(false);
	}

// Required field are ok, submit form for processing.
//	form.submit();
	return(true);
}


// This script is used to create a popup window.
function MyOpen( myURL, myTitle, myParameters )
{
var remote = window.open( myURL, myTitle, myParameters );
     if (!remote.opener)
                        remote.opener = self;
         if (window.focus)
                remote.focus();
}
