//*** onChange Camp select 
	function changeCamp(camp) {
	switch(camp)
	{
		//The Island!
		case "Isle of White":
			//display starting date list
			$(".beaumonthighdates").hide();
			$(".dukeshousewooddates").hide();
			$(".colomendydates").hide();
			$(".thehousedates").hide();
			$(".theislanddates").show();
			$(".pinewoodsandsdates").hide();
			
			$("#unescorted").show();
			$("#pinewoodut").hide();
			$("#beaumonthighut").hide();
			$("#theislandut").show();
			
			$("#nodates").hide();
			
			//show/hide transport routes the Island
			$("#transportnote").hide();
			$("#theisland").show();
			$("#theislandroutes").show();
			$("#pinewood").hide();
			$("#pinewoodroutes").hide();
			$("#beaumonthigh").hide();
			$("#beaumonthighroutes").hide();
			$("#colomendy").hide();
			$("#colomendyroutes").hide();
			$("#dukeshousewood").hide();
			$("#dukeshousewoodroutes").hide();
			
			//show/hide activities for The Island!
			$("#soccerschool").show();
			$("#english").show();
			$("#horseriding").show();
			$("#learnerdriver").hide();
			$("#motorsports").show();
			$("#studio27").hide();
			$("#specialagent").hide();
			$("#talentacademy").hide();
			$("#tennisacademy").hide();
			$("#watersports").show();
			$("#dolphins").hide();
			$("#adventureextreme").hide();
			$("#leadership").show();			
			
			
			break;
		case "The House":
			//display starting date list
			$(".beaumonthighdates").hide();
			$(".dukeshousewooddates").hide();
			$(".colomendydates").hide();
			$(".thehousedates").show();
			$(".theislanddates").hide();
			$(".pinewoodsandsdates").hide();
			
			$("#unescorted").show();
			$("#pinewoodut").show();
			$("#beaumonthighut").hide();
			$("#theislandut").hide();
						
			$("#nodates").hide();
			
			//show/hide transport routes the house
			$("#transportnote").hide();
			$("#theisland").hide();
			$("#theislandroutes").hide();
			$("#pinewood").show();
			$("#pinewoodroutes").show();
			$("#beaumonthigh").hide();
			$("#beaumonthighroutes").hide();
			$("#colomendy").hide();
			$("#colomendyroutes").hide();
			$("#dukeshousewood").hide();
			$("#dukeshousewoodroutes").hide();
			
			//show/hide activities for The House!
			$("#soccerschool").hide();
			$("#english").show();
			$("#horseriding").show();
			$("#learnerdriver").show();
			$("#motorsports").hide();
			$("#studio27").hide();
			$("#specialagent").hide();
			$("#talentacademy").hide();
			$("#tennisacademy").show();
			$("#watersports").hide();
			$("#dolphins").hide();
			$("#adventureextreme").hide();
			$("#leadership").hide();			
			
			break;
			
		//PineWood Sands
		case "Norfolk Coast":
			//display starting date list
			$(".beaumonthighdates").hide();
			$(".dukeshousewooddates").hide();
			$(".colomendydates").hide();
			$(".thehousedates").hide();
			$(".theislanddates").hide();
			$(".pinewoodsandsdates").show();
			
			$("#unescorted").show();
			$("#pinewoodut").show();
			$("#beaumonthighut").hide();
			$("#thisislandut").hide();
			$("#nodates").hide();
		
			//show/hide trasnport routes pinewood sands
			$("#transportnote").hide();
			$("#theisland").hide();
			$("#theislandroutes").hide();
			$("#pinewood").show();
			$("#pinewoodroutes").show();
			$("#beaumonthigh").hide();
			$("#beaumonthighroutes").hide();
			$("#colomendy").hide();
			$("#colomendyroutes").hide();
			$("#dukeshousewood").hide();
			$("#dukeshousewoodroutes").hide();
			
			//show/hide activities for Pinewood Sands!
			$("#soccerschool").show();
			$("#english").show();
			$("#horseriding").show();
			$("#learnerdriver").hide();
			$("#motorsports").show();
			$("#studio27").show();
			$("#specialagent").show();
			$("#talentacademy").show();
			$("#tennisacademy").show();
			$("#watersports").hide();
			$("#dolphins").show();
			$("#adventureextreme").hide();
			$("#leadership").show();			
			
			break;
			
		//beaumont high
		case "Beaumont High":
			//display starting date list
			$(".beaumonthighdates").show();
			$(".dukeshousewooddates").hide();
			$(".colomendydates").hide();
			$(".thehousedates").hide();
			$(".theislanddates").hide();
			$(".pinewoodsandsdates").hide();
			
			$("#unescorted").show();
			$("#theislandut").hide();
			$("#pinewoodut").hide();
			$("#beaumonthighut").show();
			$("#nodates").hide();
		
			//show/hide transport routes beaumont high
			$("#transportnote").hide();
			$("#theisland").hide();
			$("#theislandroutes").hide();
			$("#pinewood").hide();
			$("#pinewoodroutes").hide();
			$("#beaumonthigh").show();
			$("#beaumonthighroutes").show();
			$("#colomendy").hide();
			$("#colomendyroutes").hide();
			$("#dukeshousewood").hide();
			$("#dukeshousewoodroutes").hide();
			
			//show/hide activities for Beaumont High
			$("#soccerschool").show();
			$("#english").hide();
			$("#horseriding").show();
			$("#learnerdriver").hide();
			$("#motorsports").hide();
			$("#studio27").hide();
			$("#specialagent").show();
			$("#talentacademy").show();
			$("#tennisacademy").hide();
			$("#watersports").show();
			$("#dolphins").show();
			$("#adventureextreme").hide();
			$("#leadership").hide();			
			
			
			break;
		case "Colomendy":
			//display starting date list
			$(".beaumonthighdates").hide();
			$(".dukeshousewooddates").hide();
			$(".colomendydates").show();
			$(".thehousedates").hide();
			$(".theislanddates").hide();
			$(".pinewoodsandsdates").hide();
			
			$("#unescorted").hide();
			
			$("#nodates").hide();
			
			//show/hide transport for colomendy
			$("#transportnote").hide();
			$("#theisland").hide();
			$("#theislandroutes").hide();
			$("#pinewood").hide();
			$("#pinewoodroutes").hide();
			$("#beaumonthigh").hide();
			$("#beaumonthighroutes").hide();
			$("#colomendy").show();
			$("#colomendyroutes").show();
			$("#dukeshousewood").hide();
			$("#dukeshousewoodroutes").hide();
			
			//show/hide activities for Colomendy Valley
			$("#soccerschool").hide();
			$("#english").show();
			$("#horseriding").show();
			$("#learnerdriver").show();
			$("#motorsports").hide();
			$("#studio27").hide();
			$("#specialagent").hide();
			$("#talentacademy").hide();
			$("#tennisacademy").hide();
			$("#watersports").show();
			$("#dolphins").hide();
			$("#adventureextreme").show();
			$("#leadership").show();
			
			
			break;
		case "Dukeshouse":
			//show/hide starting date list dukeshouse
			$(".beaumonthighdates").hide();
			$(".dukeshousewooddates").show();
			$(".colomendydates").hide();
			$(".thehousedates").hide();
			$(".theislanddates").hide();
			$(".pinewoodsandsdates").hide();
			
			$("#unescorted").hide();
			$("#nodates").hide();
			
			//show/hide transport routes for Dukeshouse Wood
			$("#transportnote").hide();
			$("#theisland").hide();
			$("#theislandroutes").hide();
			$("#pinewood").hide();
			$("#pinewoodroutes").hide();
			$("#beaumonthigh").hide();
			$("#beaumonthighroutes").hide();
			$("#colomendy").hide();
			$("#colomendyroutes").hide();
			$("#dukeshousewood").show();
			$("#dukeshousewoodroutes").show();
			
			//show/hide activities for Dukeshouse Wood
			$("#soccerschool").hide();
			$("#english").show();
			$("#horseriding").show();
			$("#learnerdriver").hide();
			$("#motorsports").hide();
			$("#studio27").hide();
			$("#specialagent").show();
			$("#talentacademy").show();
			$("#tennisacademy").hide();
			$("#watersports").hide();
			$("#dolphins").show();
			$("#adventureextreme").hide();
			$("#leadership").hide();
			
			break;
	}
		$(camp).show();
		//camp = camp + "routes";
		//$(camp).show();
		
	}


   $(document).ready(function() {
   
	
   	$(".insurance_check").click(function() {
		
		if(document.form1.chkDisclosureUnderstood.checked)
		{
			
		} else {
			alert("Please tick the insurance disclosure checkbox under Travel Insurance before proceeding.");
			return false;
		}
	})
	 
 // Newsletter AJAX
	$('.error').hide();
	
	//intercept the click!
	$("#newslettersubmit").click(function() {  
		
		//make sure our error messages are definitely not showing yet
		$('.error').hide();
		
		//grab values from the form
		var newsletter_title = $("select#newsletter_title").val();  
		var newsletter_title_other = $("input#newsletter_title_other").val();
		var newsletter_firstname = $("input#newsletter_firstname").val();
		var newsletter_lastname = $("input#newsletter_lastname").val();
		var newsletter_email = $("input#newsletter_email").val();
		
		//do some basic validation, so we don't get blanks or invalid emails.
		if(newsletter_firstname.length < 2) {
			$("label#firstname_error").show();
			$("input#newsletter_firstname").focus();
			return false;		
		}
		if(newsletter_lastname.length < 2) {
			$("label#lastname_error").show();
			$("input#newsletter_lastname").focus();
			return false;
		}
		if(!isEmailAddr(newsletter_email)) {
			//$("label#email_error").show();
			$("input#newsletter_email").focus();
			$("input#newsletter_email").addClass("highlight");
			return false;
		}
		if (newsletter_email.length < 2) {
			$("label#email_error").show();
			$("input#newsletter_email").focus();
			return false;
		}
		alert("here");
		//if we pass validation....
		// replace form with a loading gif while we make an Ajax call to submit the data...
		$('#newsletter_form').html("<div id='message'><img id='loeading' src='_assets/images/design/ajax-loader.gif' /></div>");
		
		//assemble the datastring for passing to our script
		var dataString = 'submitted=1&newsletter_title='+ newsletter_title + '&newsletter_title_other=' + newsletter_title_other
		+ '&newsletter_firstname=' + newsletter_firstname + '&newsletter_lastname='+ newsletter_lastname + '&newsletter_email=' + newsletter_email;  

		//alert(dataString);
		
		//make the AJAX call to our signup script, passing the dataString
				$.ajax({
		      type: "POST",
		      url: "newslettersignup.asp",
		      data: dataString,
		      success: function() {
		        $('#newsletter_form').html("<div id='message'></div>");
		        $('#message').html("<h4>Thanks for Signing up!</h4>")
		        .append("<p>We will be in touch soon.")
		        .hide()
		        .fadeIn(400, function() {
		          $('#message').append("<img id='checkmark' src='_assets/images/design/check.png' /></p>");
		        });
		      },
			  error: function(errorThrown) {
				alert("An Error Has Occurred! Please email webmaster@campbeaumont.com [" + errorThrown + "]");
			  }
		     });
		//cancel normal form button operation, since we intercepted it.
		// (It still works even if javascript is disabled)
		return false;
	}); //end submit click function
	
	
	
		//hide our transport routes
		$("#pinewood").hide();
		$("#beaumonthigh").hide();
		$("#colomendy").hide();
		$("#theisland").hide();
		$("#dukeshousewood").hide();
		$("#theislandroutes").hide();
	    $("#beaumonthighroutes").hide();
	    $("#colomendyroutes").hide();
	    $("#pinewoodroutes").hide();
	    $("#dukeshousewoodroutes").hide();
		
		$("#unescorted").hide();
	    //$("#waiting").hide();
		
		//hide our camp start dates
		$(".beaumonthighdates").hide();
		$(".dukeshousewooddates").hide();
		$(".colomendydates").hide();
		$(".thehousedates").hide();
		$(".theislanddates").hide();
		$(".pinewoodsandsdates").hide();
		$("#nodates").show();
		
		
	   
	   $("#submit").click(function() {
		$("#waiting").show();
		})
		
		//2008 Survey 
		
	
			//$(".section5").hide();
			//$(".section4").hide();
			//$(".section3").hide();
			//$(".section2").hide();
			$("#termsandconditions").hide();
				$("#terms").click(function() {
					$("#termsandconditions").toggle();
					return false;
				});
				
				
	
		
	});
	
	
//newsletter "Other" title entry field display/hide depending on selection
function checkOther()
{

	if(document.newsletterform.newsletter_title.selectedIndex == 5)
	{
		$("#newsletter_title_other").show();
	}
	else
	{
		$("#newsletter_title_other").hide();
	}
}

//email validation check
function isEmailAddr(email)
{
      var result = false
      var theStr = new String(email)
      var index = theStr.indexOf("@");
 
      if (index > 0)
      {
      var pindex = theStr.indexOf(".",index);
      if ((pindex > index+1) && (theStr.length > pindex+1))
           result = true;
      }
  return result;
}
