
$(document).ready(function() {
	$("#emailform form").validate();
	
		if($.cookie('totheMoon') == "underage") {
		$("#emailform form").hide();
		$("#emailform .underage").show();
	}
	

	$(".helpcarousel").jCarouselLite({
        btnNext: ".next",
        btnPrev: ".prev"
    });

	
	
	$("#emailform form").submit(function() {
		

	      if ($("#DOB").val() < 1996) {
	        window.open( 'http://www.verticalresponse.com', 'vr_optin_popup', 'scrollbars=yes,width=600,height=450' );
	        return true;
	      }
			$.cookie('totheMoon', 'underage', { expires: 0.00347222222 });
			$("#emailform form").fadeOut();
			$("#emailform .underage").fadeIn("slow");
			return false;
		
    });
});


function showSharing() {
		$("#share").animate({
			"top": "0px"
    	}, "medium");
}

function hideSharing() {
		$("#share").animate({
			"top": "-175px"
    	}, "medium");
		dispatchClose();
}


function showTwitter() {
		$("#twitter").animate({
			"top": "0px"
    	}, "medium");
}

function hideTwitter() {
		$("#twitter").animate({
			"top": "-191px"
    	}, "medium");
		dispatchClose();
}


function showEmbed() {
		$("#air-wrap").hide();
		$(".embedwrapper").show();
		$("#embedwidget").animate({
			"top": "0px"
    	}, "medium");
}

function hideEmbed() {
		$("#embedwidget").animate({
			"top": "-316px"
    	}, "medium");
		dispatchClose();
}



function showHelp() {
		$("#helpscreen").animate({
			"top": "0px"
    	}, "medium");
}

function hideHelp() {
		$("#helpscreen").animate({
			"top": "-261px"
    	}, "medium");
		dispatchClose();
}



function showEmail() {
		$("#emailform .underage-learn").hide();		
		$("#emailform").animate({
			"top": "0px"
    	}, "medium");
}

function hideEmail() {
		$("#emailform").animate({
			"top": "-211px"
    	}, "medium");
		dispatchClose();
}



function showlearnmore() {
	$("#emailform form").fadeOut();
	$("#emailform .underage-learn").fadeIn("slow");

}

function backtoform() {
	$("#emailform .underage-learn").fadeOut();
	$("#emailform form").fadeIn("slow");

}


function hideAir() {
	$("#air-wrap").fadeOut();
	$(".embedwrapper").fadeIn();

}


function showAir() {
	$(".embedwrapper").fadeOut();
	$("#air-wrap").fadeIn();

}



function dispatchClose() {
	document.getElementById("flashcontent").killOverlay();
}


function showTerms() {
	window.open("terms.html","Window1","menubar=no,width=615,height=580,toolbar=no,resizable=yes,scrollbars=1");

}

function showPrivacy() {
	window.open("privacy.html","Window1","menubar=no,width=615,height=580,toolbar=no,resizable=yes,scrollbars=1");

}


function showTerms() {
	window.open("terms.html","Window1","menubar=no,width=615,height=580,toolbar=no,resizable=yes,scrollbars=1");

}



function showRadio() {
	window.open("player.html","Window2","menubar=no,width=305,height=177,toolbar=no,resizable=no,scrollbars=0");

}
