<!--
function isChecked(object) {
    if (object.checked) return true;
    else return false;
}

// Begin - validate the form fields
function Validate(theForm)
{
  	if (theForm.Name.value == "")
  	{
    	alert("Please enter your \"Name\".");
    	theForm.Name.focus();
    	return (false);
  	}
  	if (theForm.Address.value == "")
  	{
    	alert("Please enter your \"Address\".");
    	theForm.Address.focus();
    	return (false);
  	}
  	if (theForm.City.value == "")
  	{
    	alert("Please enter your \"City\".");
    	theForm.City.focus();
    	return (false);
  	}
	/*  if (theForm.Province_State.value == "")
  	{
    	alert("Please enter your \"State/Province\".");
    	theForm.Province_State.focus();
    	return (false);
  	}
	*/
  	if (theForm.Zip_Postal.value == "")
  	{
    	alert("Please enter your \"Postal Code\".");
    	theForm.Zip_Postal.focus();
    	return (false);
  	}
  	/*  if (theForm.Country.value == "")
  	{
    	alert("Please enter your \"Country\".");
    	theForm.Country.focus();
    	return (false);
  	}  
  	if (theForm.Email.value == "")
  	{
   		alert("Please enter your \"Email\".");
    	theForm.Email.focus();
    	return (false);
  	}
	*/
	
	var ContactForSurvey //initial value is null because we gave it no other value

	for (var i=0; i<theForm.Contact_For_Survey.length; i++)  {	
		if (theForm.Contact_For_Survey[i].checked)  {	
			ContactForSurvey = theForm.Contact_For_Survey[i].value //set found_it equal to checked button's value	
		} 	
	}
	if(!ContactForSurvey)
	{ 
		//if found_it is equal to false or null, a button has NOT been checked
		alert("Please indicate whether you would be willing to participate in a survey to help Alberta market itself as a tourism destination.");
		theForm.Contact_For_Survey[0].focus();
		return (false);
	}
	
	/*	if (isChecked(theForm.Add_To_Mailing_List[0]) != true && isChecked(theForm.Add_To_Mailing_List[1]) != true)
	{
		alert("Please indicate whether you would like to be added to Travel Alberta's mailing list to receive more information in the future about tourism in Alberta.");
		theForm.Add_To_Mailing_List[0].focus();
		return (false);
	}
  	if (isChecked(theForm.Contact_For_Survey[0]) != true && isChecked(theForm.Contact_For_Survey[1]) != true)
  	{
		alert("Please indicate whether you would be willing to participate in a survey to help Alberta market itself as a tourism destination.");
		theForm.Contact_For_Survey[0].focus();
		return (false);
  	}*/
	
  	// start - count the number of travel guide checkboxes that are checked ----------------
	var GuideTotal = 0;
	var max1 = theForm.Guide.length;
	var max2 = theForm.Guide2.length;
	//start incrementing after the operatorType hidden field
	for (var idx = 0; idx < max1; idx++) {
		if (eval("theForm.Guide[" + idx + "].checked") == true) {
				GuideTotal += 1;
		   }
	}
	for (var idx = 0; idx < max2; idx++) {
		if (eval("theForm.Guide2[" + idx + "].checked") == true) {
		    if (theForm.Guide2[2].checked != true) {
				GuideTotal += 1;
			}
		}
	}
	//alert(GuideTotal);
	if (theForm.Guide3.checked)
  	{
		GuideTotal += 1;
  	}
	if (theForm.Guide4.checked)
  	{
		GuideTotal += 1;
  	}
	
  	if (GuideTotal == 0)
  	{
    	alert("Please select at least one \"Travel Guide\" or the \"Travel Alberta Holiday Card\"");
    	theForm.Guide[0].focus();
		return (false);
  	}
  	/*else if (theForm.Guide2[1].checked && theForm.Guide2[2].checked) {
  		alert("Please select only ONE of either the \"Accommodation\" or \"Campground\" Guide checkboxes.");
    	theForm.Guide[1].focus();
		return (false);
  	}*/
	
	
  	// end - travel guide checkbox count ----------------------------------------------------  	
  	
}
// End - validate the form fields
//-->