
	<!-- CLICKABLE BLOCK -->
	jQuery(document).ready(function($){
		//feedback form
		jQuery.validator.addMethod('minWords', function(value, element, params) {
			return !jQuery(element).val() || jQuery(element).val().match(/\b\w+\b/g).length >= params;
		}, 'Please enter at least 2 words.');

		jQuery.validator.addMethod('minAge', function (value, element, params) {
			return value >= params;
		}, 'You must be at least 13.');
		
		var $tbxMiniFeedBack = jQuery("div#feedback-tab").tbxMiniFeedback({ajax : ajaxCom});
		var $tbxLoginBox = jQuery("div#login-area").tbxLoginBox({ajax : ajaxCom});

		jQuery(function(){
			jQuery('input').keydown(function(e){
				if (e.keyCode == 13) {
					jQuery(this).parents('form').submit();
					return false;
				}
			});
		});

		//registration form
		$("#regForm").validate({
			onblur:false,
			onkeyup:false,
			rules: {
				fullname: {
					required: true,
					minWords: 2
				},
				email: {
					required:true,
					email: true
				},
				password: {
					required: true,
					minLength: 5
				},
				age: {
					required: true,
					minAge: 13
				}
			},
			messages: {
				fullname: {
					required: "Required",
					minWords: "First and last"
				},
				email: {
					required: "Required",
					email: "Invalid"
				},
				password: {
					required: "Required",
					minLength: "Min 5 chars"
				},
				age: {
					required: "Required",
					minAge: "Must be 13"
				}
			}
		});
	});
	
	
	var activeId = 'participants';
	var navClick = false;
	function showContent (content, signup) {
		if (content != activeId) {
			jQuery('#' + activeId + 'Content').fadeOut(250);
			jQuery('#' + activeId + 'Text').fadeOut(250);
			jQuery('#' + activeId + 'Tab').removeClass('active-tab');
			jQuery('#' + content + 'Content').removeClass('inactive').addClass('active').fadeIn(250);
			jQuery('#' + content + 'Text').removeClass('inactive').fadeIn(250);
			jQuery('#' + content + 'Tab').addClass('active-tab');
			activeId = content;
		}
		// Clean up if we were showing the signup form
		jQuery('#' + content + 'SubText:hidden').fadeIn(250);
		jQuery('#' + content + 'Text').removeClass('signup-show');

		toggleSignup(signup);

		stopShareInterval();
	}

	function toggleSignup (show, hide) {
		if (show) {
			jQuery('#signupForm:hidden').fadeIn(250);

			if (hide) {
				jQuery('#' + hide + 'Text').addClass('signup-show');
				jQuery('#' + hide + 'SubText').hide();
			}
		} else {
			jQuery('#signupForm:visible').fadeOut(250);
		}
	}

	var shareInterval;
	function startShareInterval () {
		if (shareInterval == null) {
			shareInterval = window.setInterval('swapShare()', 3500);
		}
	}

	function stopShareInterval () {
		window.clearInterval(shareInterval);
		shareInterval = null;
	}

	var showShare = true;
	function swapShare () {
		if (showShare) {
			jQuery('#shareImg1').fadeOut(1000);
			jQuery('#shareImg2').fadeIn(1000);
		} else {
			jQuery('#shareImg1').fadeIn(1000);
			jQuery('#shareImg2').fadeOut(1000);
		}
		showShare = !showShare;
	}
