// Copyright © 2001 by Apple Computer, Inc., All Rights Reserved.

function checkConFirstName (strng) {
var error = "";
if (strng == "") {
   error = "Please Enter Your Contact First Name.\n";
}
return error;
}       

function checkConLastName (strng) {
var error = "";
if (strng == "") {
   error = "Please Enter Your Contact Last Name.\n";
}
return error;
}

function checkAddress (strng) {
var error = "";
if (strng == "") {
   error = "Please Enter Your Address.\n";
}
return error;
}

function checkCity (strng) {
var error = "";
if (strng == "") {
   error = "Please Enter Your City.\n";
}
return error;
}

function checkState (strng) {
var error = "";
if (strng == "") {
   error = "Please Enter Your State.\n";
}
return error;
}

function checkZip (strng) {
var error = "";
if (strng == "") {
   error = "Please Enter Your Zip Code.\n";
}
return error;
}

function checkdeparture (strng) {
var error = "";
if (strng == "") {
   error = "Please Enter A Departure City.\n";
}
return error;
}

function checkDestination (strng) {
var error = "";
if (strng == "") {
   error = "Please Enter A Destination City.\n";
}
return error;
}

function checkDates (strng) {
var error = "";
if (strng == "") {
   error = "Please Enter Your Travel Dates.\n";
}
return error;
}

function checkNights (strng) {
var error = "";
if (strng == "") {
   error = "Please Enter Nights Required.\n";
}
return error;
}

function checkNumPeople (strng) {
var error = "";
if (strng == "") {
   error = "Please Enter The Number of People.\n";
}
return error;
}

function checkPrice (strng) {
var error = "";
if (strng == "") {
   error = "Please Enter Your Price Range.\n\n";
}
return error;
}

function thankYou (strng) {
var thanks = "";
thanks = "Thank You.\n";
return thanks;
}

// email

function checkEmail (strng) {
var error="";
if (strng == "") {
   error = "Please Enter Your Email Address.\n";
}

    var emailFilter=/^.+@.+\..{2,3}$/;
    if (!(emailFilter.test(strng))) { 
       error = "Please Enter a Valid Email Address.\n";
    }
    else {
//test email for illegal characters
       var illegalChars= /[\(\)\<\>\,\;\:\ \\\"\[\]]/
         if (strng.match(illegalChars)) {
          error = "The Email Address Contains Illegal Characters.\n";
       }
    }
return error;    
}
