// Tabbed Content Area //

$(document).ready(function() {

	//When page loads...
	$(".tabbed_content").hide(); //Hide all content
	$("ul.tabs li.tab1").addClass("tab1_active").show(); //Activate first tab
	$(".tabbed_content:first").show(); //Show first tab content

	//On Click Event
	$("ul.tabs li.tab1").click(function() {

		$("ul.tabs li.tab2").removeClass("tab2_active"); //Remove any "active" class
		$("ul.tabs li.tab3").removeClass("tab3_active"); //Remove any "active" class
		$(this).addClass("tab1_active"); //Add "active" class to selected tab
		$(".tabbed_content").hide(); //Hide all tab content

		var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content
		$(activeTab).fadeIn(); //Fade in the active ID content
		return false;
	});
	
	$("ul.tabs li.tab2").click(function() {

		$("ul.tabs li.tab1").removeClass("tab1_active"); //Remove any "active" class
		$("ul.tabs li.tab3").removeClass("tab3_active"); //Remove any "active" class
		$(this).addClass("tab2_active"); //Add "active" class to selected tab
		$(".tabbed_content").hide(); //Hide all tab content

		var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content
		$(activeTab).fadeIn(); //Fade in the active ID content
		return false;
	});
	
	$("ul.tabs li.tab3").click(function() {

		$("ul.tabs li.tab1").removeClass("tab1_active"); //Remove any "active" class
		$("ul.tabs li.tab2").removeClass("tab2_active"); //Remove any "active" class
		$(this).addClass("tab3_active"); //Add "active" class to selected tab
		$(".tabbed_content").hide(); //Hide all tab content

		var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content
		$(activeTab).fadeIn(); //Fade in the active ID content
		return false;
	});

});

// Form Validation //

$(document).ready(function(){
	$("#ts_form").validate({
		rules: {
			firstname: "required",
			lastname: "required",
			areacode: {
				required: false,
				minlength: 1,
				maxlength: 3,
				digits: true

			},
			number: {
				required: true,
				minlength: 10,
				digits: true
			},
			email: {
				required: true,
				email: true
			}
		},
		messages: {
			firstname: "Please enter your first name.",
			lastname: "Please enter your last name.",
			number: "Please enter your phone number.",
			email: "Please enter a valid email address"
		}
	});

  });

function videoStarted() {
	alert("clicked the button");
	
}
