	$(document).ready(function() {
		var pcp_margin = parseInt($("#pressContactPop").css("margin-top"));
		var cp_margin = parseInt($("#contactPop").css("margin-top"));
		//Contact Popup
		$("#popBG, #contactPop, #pressContactPop").addClass("hidden");
		$("#contactBtn").click( function(event) {
			$("#popBG").css({
				height: ($(window).height()>$(document).height() ? $(window).height() : $(document).height() ),
				display: 'block',
				opacity: 0.0
			}).animate( { opacity: 0.85 }, 350 );
			$("#contactPop").fadeIn(350);
			return false;
		});
		$("#pressContactBtn").click( function(event) {
			$("#popBG").css({
				height: ($(window).height()>$(document).height() ? $(window).height() : $(document).height() ),
				display: 'block',
				opacity: 0.0
			}).animate( { opacity: 0.85 }, 350 );
			$("#pressContactPop").fadeIn(350);
			return false;
		});
		$("#popBG").click(function(event){
			$("#popBG, #contactPop, #youtubePop, #pressContactPop, #audienceReviewBox").fadeOut("slow");
			$("#youtubePop").html('');
		});
		//Contact
		$("#contactForm").submit( function () {
			$.ajax({
				url: "/email.php",
				data: $("#contactForm").serialize(),
				type: "post",
				complete: function (response) {
					var e = response.responseText;
					if (!!e)
						return alert ("The following errors have occurred:\n\n" + e.replace(/,/g, "\n"));
					$("#popBG").click();

				}
			});
			return false;
		});
		$(window).scroll( function () {
			$("#pressContactPop").css("margin-top", pcp_margin + $(window).scrollTop());
			$("#contactPop").css("margin-top", cp_margin + $(window).scrollTop());
		});
		$(window).resize( function () {
			$("#popBG").css( { height: ($(window).height()>$(document).height() ? $(window).height() : $(document).height() ) } );
		});
	});