<!--
//verify for netscape/mozilla
var isNS4 = (navigator.appName=="Netscape")?1:0;

function isChecked(object) {
    if (object.checked) return true;
    else return false;
}

/**
 * Cdn Postal Code validation script. (http://home.cogeco.ca/~ve3ll/jstutor5.htm)
 * for format see: http://www.infinitegravity.ca/postalcodeformat.htm
 */
function isPostCode(entry){ // CANADIAN CODES ONLY
	strlen = entry.length; if (strlen != 6) {return false;}
	entry=entry.toUpperCase();        // in case of lowercase characters
	// Check for legal characters in string - note index starts at zero
	if ('ABCEGHJKLMNPRSTVXY'.indexOf(entry.charAt(0)) < 0) {return false;}
	if ('0123456789'.indexOf(entry.charAt(1)) < 0) {return false;}
	if ('ABCDEFGHJKLMNPQRSTUVWXYZ'.indexOf(entry.charAt(2)) < 0) {return false;}
	if ('0123456789'.indexOf(entry.charAt(3)) < 0) {return false;}
	if ('ABCDEFGHJKLMNPQRSTUVWXYZ'.indexOf(entry.charAt(4)) < 0) {return false;}
	if ('0123456789'.indexOf(entry.charAt(5)) < 0) {return false;}
	return true; 
}

function checkKeypress(intKey) {
	if (!(intKey==8 || intKey==46 || intKey==37 || intKey==39 || intKey==9)) 
		return true;
return false;
}

function validateCardUser(theForm)
{
  // Interests: -----------------------------------------------------
  var i_question1 = 0;
  if(isChecked(theForm.Routine) == true) i_question1 = i_question1 + 1;
  if(isChecked(theForm.Family) == true) i_question1 = i_question1 + 1;
  if(isChecked(theForm.Relax) == true) i_question1 = i_question1 + 1;
  if(isChecked(theForm.Neverdone) == true) i_question1 = i_question1 + 1;
  if(isChecked(theForm.NewPlaces) == true) i_question1 = i_question1 + 1;
  if(isChecked(theForm.Peace) == true) i_question1 = i_question1 + 1;
  if(isChecked(theForm.Fun) == true) i_question1 = i_question1 + 1;
  if (i_question1 != 3)
  {
    alert("Please select the 3 most important reasons you have for taking a 3-7 day leisure trip (question 1).");
    theForm.Routine.focus();
    return (false);
  }
  if (isChecked(theForm.Familiar[0]) == false && isChecked(theForm.Familiar[1]) == false)
  {
    alert("Please answer question 2a.");
    theForm.Familiar[0].focus();
    return (false);
  }
   if (isChecked(theForm.Rural[0]) == false && isChecked(theForm.Rural[1]) == false)
  {
    alert("Please answer question 2b.");
    theForm.Rural[0].focus();
    return (false);
  }
  if (isChecked(theForm.Excitement[0]) == false && isChecked(theForm.Excitement[1]) == false)
  {
    alert("Please answer question 2c.");
    theForm.Excitement[0].focus();
    return (false);
  }
  if (isChecked(theForm.Challenge[0]) == false && isChecked(theForm.Challenge[1]) == false)
  {
    alert("Please answer question 3.");
    theForm.Challenge[0].focus();
    return (false);
  }
   if (isChecked(theForm.PlanTrip[0]) == false && isChecked(theForm.PlanTrip[1]) == false)
  {
    alert("Please answer question 4.");
    theForm.PlanTrip[0].focus();
    return (false);
  }
  // Details: -----------------------------------------------------
  
  if (isChecked(theForm.emailOtherInfo[0]) != true && isChecked(theForm.emailOtherInfo[1]) != true)
  {
    alert("Please indicate whether you would like to be notified of Last Minute Specials.");
    theForm.emailOtherInfo[0].focus();
	return (false);
  }
  if (isChecked(theForm.emailOffers[0]) != true && isChecked(theForm.emailOffers[1]) != true)
  {
    alert("Please indicate whether you would like to be notified of Holiday Card offers.");
    theForm.emailOffers[0].focus();
	return (false);
  }
   if (theForm.FirstName.value == "")
  {
    alert("Please enter your First name.");
    theForm.FirstName.focus();
    return (false);
  }
  if (theForm.LastName.value == "")
  {
    alert("Please enter your Last name.");
    theForm.LastName.focus();
    return (false);
  }
   if (theForm.City.value == "")
  {
    alert("Please enter your City.");
    theForm.City.focus();
    return (false);
  }
  if (theForm.Province.value == "")
  {
    alert("Please select your Province.");
    theForm.Province.focus();
    return (false);
  }
  //if (theForm.PostalCode.value == "")
  //{
  //  alert("Please enter your Postal Code.");
  //  theForm.PostalCode.focus();
  //  return (false);
  //}  
  if (theForm.PostalCode.value == "")
  {
    alert("Please enter your 6 character Postal Code with no spaces, eg. T2R1J5.");
	theForm.PostalCode.focus();
    return false;
  }
  else if (isPostCode(theForm.PostalCode.value)==false)
  {
    alert("Please enter a valid 6 character Postal Code with no spaces, eg. T2R1J5.");
	theForm.PostalCode.focus();
    return false;
  }
  if (theForm.Email.value == "")
  {
    alert("Please enter your E-mail.");
    theForm.Email.focus();
    return (false);
  }
  if (theForm.confirmEmail.value == "")
  {
    alert("Please confirm your E-mail.");
    theForm.confirmEmail.focus();
    return (false);
  }
   if (theForm.Email.value != theForm.confirmEmail.value)
  {
    alert("The E-mail addresses that you entered are not the same.\nPlease enter your E-mail address again.");
    theForm.Email.focus();
    return (false);
  }
   if (theForm.CardNumber.value == "")
  {
    alert("Please enter your Holiday Card Number.");
    theForm.CardNumber.focus();
    return (false);
  }
  else if(theForm.CardNumber.value.length != 11)
  {
    alert("Please enter your 11 digit Holiday Card Number, with no non-numeric characters.");
    theForm.CardNumber.focus();
    return (false);
  }
  if (theForm.Username.value == "")
  {
    alert("Please enter a Username.");
    theForm.Username.focus();
    return (false);
  }
   if (theForm.password.value == "")
  {
    alert("Please enter a Password.");
    theForm.password.focus();
    return (false);
  }
  else if(theForm.password.value.length < 4)
  {
    alert("Please enter a Password containing at least 4 characters.");
    theForm.password.focus();
    return (false);
  }
  if (theForm.confirmpassword.value == "")
  {
    alert("Please confirm your Password.");
    theForm.confirmpassword.focus();
    return (false);
  }
  if (theForm.password.value != theForm.confirmpassword.value)
  {
    alert("The Passwords you have entered are not the same.\nPlease enter your Passwords again.");
    theForm.password.focus();
    return (false);
  }
  if (theForm.verificationQuestion.value == "")
  {
    alert("Please enter a Verification Question.");
    theForm.verificationQuestion.focus();
    return (false);
  }
  if (theForm.verificationAnswer.value == "")
  {
    alert("Please enter a Verification Answer.");
    theForm.verificationAnswer.focus();
    return (false);
  }
  
  //return (true);
}
//-->