
 
<!-- Activate Cloaking Device


// whitespace characters
var whitespace = " \t\n\r";


function isWhitespace (s)

{   var i;

    // Is s empty?
    if (isEmpty(s)) return true;

    // Search through string's characters one by one
    // until we find a non-whitespace character.
    // When we do, return false; if we don't, return true.

    for (i = 0; i < s.length; i++)
    {   
        // Check that current character isn't whitespace.
        var c = s.charAt(i);

        if (whitespace.indexOf(c) == -1) return false;
    }

    // All characters are whitespace.
    return true;
}


 
function isValidName(s)
{
	var i;
	if (isWhitespace(s))
		{  return false;  }
	else {
	// Search through string's characters one by one
	// until we find a non-alphabetic character other than a space or apostrophe.
	// When we do, return false; if we don't, return true.

	for (i = 0; i < s.length; i++)
		{
			// Check that current character is letter or space or apostrophe
			var c = s.charAt(i);
		 	if (!(isLetter(c)  || (c==" ") ||  (c=="'"))) 
			  	{ return false; } 	
		}
			// All characters are letters or space or apostrophe
			return true;
	}
}

function isValidInt(s)
{
	var i;
	if (isEmpty(s))
		{  return false;  }
	else {
	// Search through string's characters one by one
	// until we find a  non-digit character.
	// When we do, return false; if we don't, return true.

	for (i = 0; i < s.length; i++)
		{
			// Check that current character is letter or space or apostrophe
			var c = s.charAt(i);
		 	if (!(isDigit(c)))
			               { return false; } 	 
		}
			// All characters are numbers
			return true;
	}
}

function isValidIntE(s)
{
	var i;
	 // Search through string's characters one by one
	// until we find a  non-digit character.
	// When we do, return false; if we don't, return true.

	for (i = 0; i < s.length; i++)
		{
			// Check that current character is letter or space or apostrophe
			var c = s.charAt(i);
		 	if (!(isDigit(c))) 
			  	{ return false; }
		}
			// All characters are numbers
			return true;
}
 


// Check whether string s is empty.

function isEmpty(s)
{   return ((s == null) || (s.length == 0))
}


// Returns true if character c is an English letter 
// (A .. Z, a..z).
//
// NOTE: Need i18n version to support European characters.
// This could be tricky due to different character
// sets and orderings for various languages and platforms.

function isLetter (c)
{   return ( ((c >= "a") && (c <= "z")) || ((c >= "A") && (c <= "Z")) )
}

// Returns true if character c is a digit 
// (0 .. 9).

function isDigit (c)
{   return ((c >= "0") && (c <= "9"))
}


function isEmail (s)
{   if (isEmpty(s)) 
              {	return false;}
          
    // there must be >= 1 character before @, so we
    // start looking at character position 1 
    // (i.e. second character)
    var i = 1;
    var sLength = s.length;

    // look for @
    while ((i < sLength) && (s.charAt(i) != "@"))
    { i++
    }

    if ((i >= sLength) || (s.charAt(i) != "@")) { return false; }
    else i += 2;

    // look for .
    while ((i < sLength) && (s.charAt(i) != "."))
    { i++
    }

    // there must be at least one character after the .
    if ((i >= sLength - 1) || (s.charAt(i) != ".")) return false;
    else return true;
}

// Removes all whitespace characters from s.
// Global variable whitespace (see above)
// defines which characters are considered whitespace.

function stripWhitespace (s)

{   return stripCharsInBag (s, whitespace)
}

// Removes all characters which appear in string bag from string s.

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++)
    {   
        // Check that current character isn't whitespace.
        var c = s.charAt(i);
        if (bag.indexOf(c) == -1) returnString += c;
    }

    return returnString;
}



function isCreditCard(st) {
  // Encoding only works on cards with less than 19 digits
  if (st.length > 19)
    return (false);

  sum = 0; mul = 1; l = st.length;
  for (i = 0; i < l; i++) {
    digit = st.substring(l-i-1,l-i);
    tproduct = parseInt(digit ,10)*mul;
    if (tproduct >= 10)
      sum += (tproduct % 10) + 1;
    else
      sum += tproduct;
    if (mul == 1)
      mul++;
    else
      mul--;
  }
// Uncomment the following line to help create credit card numbers
// 1. Create a dummy number with a 0 as the last digit
// 2. Examine the sum written out
// 3. Replace the last digit with the difference between the sum and
//    the next multiple of 10.

//  document.writeln("<BR>Sum      = ",sum,"<BR>");
//  alert("Sum      = " + sum);

  if ((sum % 10) == 0)
    return (true);
  else
    return (false);

} // END FUNCTION isCreditCard()





/*  ================================================================
    FUNCTION:  isVisa()
 
    INPUT:     cc - a string representing a credit card number

    RETURNS:  true, if the credit card number is a valid VISA number.
		    
	      false, otherwise

    Sample number: 4111 1111 1111 1111 (16 digits)
    ================================================================ */

function isVisa(cc1, cc2, cc3, cc4)
{
  if (((cc.length == 16) || (cc.length == 13)) &&
      (cc.substring(0,1) == 4))
    return isCreditCard(cc);
  return false;
}  // END FUNCTION isVisa()




/*  ================================================================
    FUNCTION:  isMasterCard()
 
    INPUT:     cc - a string representing a credit card number

    RETURNS:  true, if the credit card number is a valid MasterCard
		    number.
		    
	      false, otherwise

    Sample number: 5500 0000 0000 0004 (16 digits)
    ================================================================ */

function isMasterCard(cc)
{
  firstdig = cc.substring(0,1);
  seconddig = cc.substring(1,2);
  if ((cc.length == 16) && (firstdig == 5) &&
      ((seconddig >= 1) && (seconddig <= 5)))
    return isCreditCard(cc);
  return false;

} // END FUNCTION isMasterCard()





/*  ================================================================
    FUNCTION:  isAmericanExpress()
 
    INPUT:     cc - a string representing a credit card number

    RETURNS:  true, if the credit card number is a valid American
		    Express number.
		    
	      false, otherwise

    Sample number: 340000000000009 (15 digits)
    ================================================================ */

function isAmericanExpress(cc)
{
  firstdig = cc.substring(0,1);
  seconddig = cc.substring(1,2);
  if ((cc.length == 15) && (firstdig == 3) &&
      ((seconddig == 4) || (seconddig == 7)))
    return isCreditCard(cc);
  return false;

} // END FUNCTION isAmericanExpress()




/*  ================================================================
    FUNCTION:  isDinersClub()
 
    INPUT:     cc - a string representing a credit card number

    RETURNS:  true, if the credit card number is a valid Diner's
		    Club number.
		    
	      false, otherwise

    Sample number: 30000000000004 (14 digits)
    ================================================================ */

function isDinersClub(cc)
{
  firstdig = cc.substring(0,1);
  seconddig = cc.substring(1,2);
  if ((cc.length == 14) && (firstdig == 3) &&
      ((seconddig == 0) || (seconddig == 6) || (seconddig == 8)))
    return isCreditCard(cc);
  return false;
}



/*  ================================================================
    FUNCTION:  isCarteBlanche()
 
    INPUT:     cc - a string representing a credit card number

    RETURNS:  true, if the credit card number is a valid Carte
		    Blanche number.
		    
	      false, otherwise
    ================================================================ */

function isCarteBlanche(cc)
{
  return isDinersClub(cc);
}




/*  ================================================================
    FUNCTION:  isDiscover()
 
    INPUT:     cc - a string representing a credit card number

    RETURNS:  true, if the credit card number is a valid Discover
		    card number.
		    
	      false, otherwise

    Sample number: 6011000000000004 (16 digits)
    ================================================================ */

function isDiscover(cc)
{
  first4digs = cc.substring(0,4);
  if ((cc.length == 16) && (first4digs == "6011"))
    return isCreditCard(cc);
  return false;

} 

function testBox12(GenericForm)
 {
	
	cc1=GenericForm.cardnumber1.value;
	cc2=GenericForm.cardnumber2.value;
	cc3=GenericForm.cardnumber3.value;
	cc4=GenericForm.cardnumber4.value;
	cc=cc1+cc2+cc3+cc4;
	Ctrl= GenericForm.cardnumber1;
	card= GenericForm.creditcard.value;
		if (!(card=="VISA"))
			{ return true; }
		else if (((cc.length == 16) || (cc.length == 13)) &&
     	 		(cc.substring(0,1) == 4))
			 {  
		                 if (isCreditCard(cc))
				{ return true; }
			else
				{validatePrompt(Ctrl, "The VISA number entry is invalid")
				  return false;  }}
		else {  
			validatePrompt(Ctrl, "The VISA number entry is invalid")
			return false;    }
}

function testBox13(GenericForm)
 {
	cc1=GenericForm.cardnumber1.value;
	cc2=GenericForm.cardnumber2.value;
	cc3=GenericForm.cardnumber3.value;
	cc4=GenericForm.cardnumber4.value;
	cc=cc1+cc2+cc3+cc4;
	 Ctrl=GenericForm.cardnumber1;
	card=GenericForm.creditcard.value;
		firstdig=cc.substring(0,1);
		seconddig=cc.substring(1,2);
	  	if (!(card=="MasterCard"))
			{ return true; }
		else if  ((cc.length == 16) && (firstdig == 5) &&
			((seconddig >= 1) && (seconddig <= 5)))     	 	 	
			 {  
		                 if (isCreditCard(cc))
				{ return true; }
			else
				{validatePrompt(Ctrl, "The MasterCard number entry is invalid")
				  return false;  }}
		else {  
			validatePrompt(Ctrl, "The MasterCard number entry is invalid")
			return false;    }
}


function testBox14(GenericForm)
 {
	
	cc1=GenericForm.cardnumber1.value;
	cc2=GenericForm.cardnumber2.value;
	cc3=GenericForm.cardnumber3.value;
	cc4=GenericForm.cardnumber4.value;
	cc=cc1+cc2+cc3+cc4;
	 Ctrl=GenericForm.cardnumber1;
	card=GenericForm.creditcard.value;
	first4digs = cc.substring(0,4);
	 	if (!(card=="Discover"))
			{ return true; }
		else if  ((cc.length == 16)  && (first4digs == "6011"))		
			 {  	
		                 if (isCreditCard(cc))
				{ return true; }
			else
				{validatePrompt(Ctrl, "The Discover number entry is invalid")
				  return false;  }}
		else {  
			validatePrompt(Ctrl, "The Discover number entry is invalid")
			return false;    }
}



function testBox15(GenericForm)
 {
	
	cc1=GenericForm.cardnumber1.value;
	cc2=GenericForm.cardnumber2.value;
	cc3=GenericForm.cardnumber3.value;
	cc4=GenericForm.cardnumber4.value;
	cc=cc1+cc2+cc3+cc4;
	Ctrl=GenericForm.cardnumber1;
	card=GenericForm.creditcard.value;
	firstdig = cc.substring(0,1);
	seconddig = cc.substring(1,2);
		if (!(card=="American Express"))
			{ return true; }
		else if  ((cc.length == 15) && (firstdig == 3)  && ((seconddig == 4) || (seconddig == 7)))
			 {  
		                 if (isCreditCard(cc))
				{ return true; }
			else
				{validatePrompt(Ctrl, "The American Express number entry is invalid")
				  return false;  }}
		else {  
			validatePrompt(Ctrl, "The American Express number entry is invalid")
			return false;    }
}

function testBox16(GenericForm) 
{ 
	
	Ctrl = GenericForm.ccname;
	Ctrlvalue = GenericForm.ccname.value;
		  if (isValidName(Ctrlvalue))
			{ return true; }
		else {		
			validatePrompt (Ctrl, "Please Enter a Legitimate Credit Card Name")
			return false; }
}



function testBox1(GenericForm) 
{ 
	
	Ctrl = GenericForm.lastname;
	Ctrlvalue = GenericForm.lastname.value;
		  if (isValidName(Ctrlvalue))
			{ return true; }
		else {		
			validatePrompt (Ctrl, "Please Enter a Legitimate Last Name")
			return false; }
}

function testBox2(GenericForm) 
{ 
	Ctrl = GenericForm.firstname;
	Ctrlvalue = GenericForm.firstname.value;
		  if (isValidName(Ctrlvalue))
			{ return true; }
		else {		
			validatePrompt (Ctrl, "Please Enter a Legitimate First Name")
			return false; }
}

function testBox3(GenericForm)
 {
	Ctrl=GenericForm.date_needed;
	Ctrlvalue=GenericForm.date_needed.value;
		if (isWhitespace(Ctrlvalue))
			{ validatePrompt(Ctrl, "Please enter a date this is needed")
			return false;    }
		return true;
  }

function testBox23(GenericForm)
 {
	Ctrl=GenericForm.desc_of_service;
	Ctrlvalue=GenericForm.desc_of_service.value;
		if (isWhitespace(Ctrlvalue))
			{ validatePrompt(Ctrl, "Please Enter a description of service being requested")
			return false;    }
		return true;
  }

function testBox4(GenericForm)
 {
	Ctrl=GenericForm.city;
	Ctrlvalue=GenericForm.city.value;
		if (isValidName(Ctrlvalue))
			{ return true; }
		else
			{ validatePrompt(Ctrl, "Please Enter a Legitimate City Name")
			return false;    }
 }

function testBox5(GenericForm)
 {
	Ctrl=GenericForm.state;
	Ctrlvalue=GenericForm.state.value;
		if (isEmpty(Ctrlvalue))
			{ validatePrompt(Ctrl, "Your State is Required")
			return false;    }
		else {
		return true; }
  }

function testBox6(GenericForm)
{
	Ctrl = GenericForm.zip1;
	Ctrlvalue = GenericForm.zip1.value;
		  if (isValidInt(Ctrlvalue)  && Ctrlvalue.length==5)
			{ return true; }
		else {		
			validatePrompt (Ctrl, "The First Five Digits of the Zip Code is Required")
			return false; }
}

function testBox7(GenericForm)
{
	Ctrl = GenericForm.zip2;
	Ctrlvalue = GenericForm.zip2.value;
		  if (isValidIntE(Ctrlvalue) || sWhitespace(Ctrlvalue))
			{ return true; }
		else {		
			validatePrompt (Ctrl, "The Last Four Digits of the Zip Code Must Be Numbers if Entered")
			return false; }
}

function testBox8(GenericForm)
{
	Ctrl = GenericForm.telephone1;
	Ctrlvalue = GenericForm.telephone1.value;
		  if (isValidInt(Ctrlvalue) && Ctrlvalue.length==3)
			{ return true; }
		else {		
			validatePrompt (Ctrl, "Please Correct Your Telephone Number")
			return false; }
}

function testBox9(GenericForm)
{
	Ctrl = GenericForm.telephone2;
	Ctrlvalue = GenericForm.telephone2.value;
		  if (isValidInt(Ctrlvalue) && Ctrlvalue.length==3)
			{ return true; }
		else {		
			validatePrompt (Ctrl, "Please Correct Your Telephone Number")
			return false; }
}

function testBox10(GenericForm)
{
	Ctrl = GenericForm.telephone3;
	Ctrlvalue = GenericForm.telephone3.value;
		  if (isValidInt(Ctrlvalue) && Ctrlvalue.length==4)
			{ return true; }
		else {		
			validatePrompt (Ctrl, "Please Correct Your Telephone Number")
			return false; }
}

function testBox11(GenericForm)
{
	Ctrl = GenericForm.email_addr;
	Ctrlvalue = GenericForm.email_addr.value;
		  if (isEmail(Ctrlvalue))
			{ return true; }
		else {		
			validatePrompt (Ctrl, "You Must Enter a Legitimate Email Address")
			return false; }
}


// ************** THIS IS WHERE THE SCRIPTS FOR THE JOB POSTINGS START ************

function username(GenericForm)
{
	Ctrl = GenericForm.username;
	Ctrlvalue = GenericForm.username.value;
		  if (isEmail(Ctrlvalue))
			{ return true; }
		else {		
			validatePrompt (Ctrl, "You Username Must be a Legitimate Email Address")
			return false; }
}

function username_submit(CheckForm) 
{
	if (!username(CheckForm)) return;
	CheckForm.submit();
	return;
}



function category(GenericForm)
 {
	Ctrl=GenericForm.category;
	Ctrlvalue=GenericForm.category.value;
		if (isEmpty(Ctrlvalue))
			{ validatePrompt(Ctrl, "Your Job Category is Required")
			return false;    }
		else {
		return true; }
  }

function job_title(GenericForm)
 {
	Ctrl=GenericForm.title;
	Ctrlvalue=GenericForm.title.value;
		if (isEmpty(Ctrlvalue))
			{ validatePrompt(Ctrl, "Your Job Title is Required")
			return false;    }
		else {
		return true; }
  }

function requirements(GenericForm)
 {
	Ctrl=GenericForm.requirements;
	Ctrlvalue=GenericForm.requirements.value;
		if (isEmpty(Ctrlvalue))
			{ validatePrompt(Ctrl, "Requirements for this job is Required")
			return false;    }
		else {
		return true; }
  }

function employer(GenericForm)
 {
	Ctrl=GenericForm.employer;
	Ctrlvalue=GenericForm.employer.value;
		if (isEmpty(Ctrlvalue))
			{ validatePrompt(Ctrl, "Employer of this job is Required")
			return false;    }
		else {
		return true; }
  }

function contact_name(GenericForm)
 {
	Ctrl=GenericForm.contact_name;
	Ctrlvalue=GenericForm.contact_name.value;
		if (isEmpty(Ctrlvalue))
			{ validatePrompt(Ctrl, "Contact Name for this job is Required")
			return false;    }
		else {
		return true; }
  }

function app_method(GenericForm)
 {
	Ctrl=GenericForm.app_method;
	Ctrlvalue=GenericForm.app_method.value;
		if (isEmpty(Ctrlvalue))
			{ validatePrompt(Ctrl, "Application Method for this job is Required")
			return false;    }
		else {
		return true; }
  }


function location(GenericForm)
 {
	Ctrl=GenericForm.location;
	Ctrlvalue=GenericForm.location.value;
		if (isEmpty(Ctrlvalue))
			{ validatePrompt(Ctrl, "Job Location is Required")
			return false;    }
		else {
		return true; }
  }


function survey_submit(CheckForm) 
{
	if (!category(CheckForm)) return;
	if (!job_title(CheckForm)) return;
	if (!requirements(CheckForm)) return;
	if (!employer(CheckForm)) return;
	if (!contact_name(CheckForm)) return;
	if (!app_method(CheckForm)) return;
	if (!location(CheckForm)) return;
	CheckForm.submit();
	return;
}

function employee_password(GenericForm)
 {
	Ctrl=GenericForm.employee_password;
	Ctrlvalue=GenericForm.employee_password.value;
		if (isEmpty(Ctrlvalue))
			{ validatePrompt(Ctrl, "Password is Required")
			return false;    }
		else {
		return true; }
  }

function employer(GenericForm)
 {
	Ctrl=GenericForm.employer;
	Ctrlvalue=GenericForm.employer.value;
		if (isEmpty(Ctrlvalue))
			{ validatePrompt(Ctrl, "Employer is Required")
			return false;    }
		else {
		return true; }
  }

function fname(GenericForm)
 {
	Ctrl=GenericForm.fname;
	Ctrlvalue=GenericForm.fname.value;
		if (isEmpty(Ctrlvalue))
			{ validatePrompt(Ctrl, "First Name is Required")
			return false;    }
		else {
		return true; }
  }

function lname(GenericForm)
 {
	Ctrl=GenericForm.lname;
	Ctrlvalue=GenericForm.lname.value;
		if (isEmpty(Ctrlvalue))
			{ validatePrompt(Ctrl, "Last Name is Required")
			return false;    }
		else {
		return true; }
  }

function employer_submit(CheckForm) 
{
	if (!employee_password(CheckForm)) return;
	if (!employer(CheckForm)) return;
	if (!fname(CheckForm)) return;
	if (!lname(CheckForm)) return;
	CheckForm.submit();
	return;
}

function employee_login_submit(CheckForm) 
{
	if (!username(CheckForm)) return;
	if (!employee_password(CheckForm)) return;
	CheckForm.submit();
	return;
}



function validatePrompt(Ctrl, PromptStr)
{
	alert (PromptStr)
	Ctrl.focus();
	return;
}



//Deactivate Cloaking -->
 



