// VC Code Validator Script

function VC_Validator(myForm)
	{
	if (myForm.Vcode.value == "")
	{
		alert("Please enter the Verification Code that apppears in the top center of your postcard.");
		myForm.Vcode.focus();
		return (false);
	}
	currentStatus=new Array (false, false, true, true, false, false);
	var checkStr=new String (myForm.Vcode.value);
	for (j = 0; j <= 5; j++)
	{	
//		alert(checkStr.charAt(j));
//		alert(checkStr.charCodeAt(j));
		codeForThisChar=checkStr.charCodeAt(j);
		
		if(codeForThisChar > 47 && codeForThisChar < 58)
		{
		alpha = true;  //IS A NUMBER
		}
		else
		{
		alpha = false;  //IS ALPHA
		}

//		alert(currentStatus[j] + " " + alpha);
				
		if(alpha != currentStatus[j])
		{
		
		alert("I'm sorry that code does not match any of our current offers, please re-type your VC Code, or call 1-800-291-2520 for help.");
		myForm.Vcode.focus();
		return (false);
		}		
	}
	return (true);
}


// Selected Offer Validator Script

<!-- Begin
function validateOFFER(myForm2) {

var listCheck = document.offerselect.maingift.selectedIndex;
if (document.offerselect.maingift.options[listCheck].value=="none") {
alert("Please select a vacation or cruise offer.");
return false;
}

if (document.offerselect.zipcode.value=="") {
alert("Please enter your 5 digit zip code.");
myForm2.zipcode.focus();
return false;
}

return true;
}
//  End -->


// Offer Form Validation Script
<!-- Begin

function validate(myForm3) {

var theMessage = "Please complete the following: \n-------------------------\n";
var noErrors = theMessage

// make sure First Name is not blank
 if (document.OfferForm.FirstName.value=="") {
 theMessage = theMessage + "\n --> Enter your first name";
 }

// make sure Last Name is not blank
 if (document.OfferForm.LastName.value=="") {
 theMessage = theMessage + "\n --> Enter your last name";
 }

// make sure Street Address is not blank
 if (document.OfferForm.Street.value=="") {
 theMessage = theMessage + "\n --> Enter your street address";
 }

// make sure City is not blank
 if (document.OfferForm.City.value=="") {
 theMessage = theMessage + "\n --> Enter your city";
 }

// Make sure a State is selected
 var listCheck = document.OfferForm.State.selectedIndex;
 if (document.OfferForm.State.options[listCheck].value=="--") {
 theMessage = theMessage + "\n --> Choose your state";
 }

// make sure Zip is not blank
 if (document.OfferForm.Zip.value=="") {
 theMessage = theMessage + "\n --> Enter your Zip code";
 }

// make sure Phone Number is not blank
 if (document.OfferForm.DayPhone.value=="") {
 theMessage = theMessage + "\n --> Enter your phone number";
 }

// validate an e-mail address
 if (!/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(document.OfferForm.Email.value)){
 theMessage = theMessage + "\n --> Enter a valid e-mail address";
 }

// Make sure a User Source is selected
 var listCheck = document.OfferForm.UserSource.selectedIndex;
 if (document.OfferForm.UserSource.options[listCheck].value=="none") {
 theMessage = theMessage + "\n --> How you first hear of us";
 }

// Make sure a single checkbox is checked
 var boxCheck = false;
 if (document.OfferForm.Details.checked) {
 boxCheck = true; }
 if (!boxCheck) {
 theMessage = theMessage + "\n --> Accept Details of Participation";
 }

// If no errors, submit the form
 if (theMessage == noErrors) {
 return true;

} else {

// If errors were found, show alert message
 alert(theMessage);
 return false;
 }
 }
 // End -->


