$(document).ready(function() {

// Subscribe fields various functions (header & footer)


$("#rightNav .subscribe .form-text").focus(function() {
	$("#rightNav .subscribe .form-text").val("");
									  });

$("#navFoot .subscribe .form-text").val("enter your email");
$("#navFoot .subscribe .form-submit").val("Subscribe");

$("#navFoot .subscribe .form-text").focus(function() {
	$("#navFoot .subscribe .form-text").val("");
									  });


					
// Home Page
	$("#nav li a:last").addClass('last');
	$("#homenews").hide();
	$("#video").hide();
    $(".blog").addClass('current');

		$(".video").click(function() {
		$("#homenews").hide();
		$("#video").show();
		$("#blog").hide();
		$(".blog").removeClass('current');
		$(".news").removeClass('current');
	    $(".video").addClass('current');
							  });
	$(".blog").click(function() {
		$("#homenews").hide();
		$("#video").hide();
		$("#blog").show();
		$(".video").removeClass('current');
		$(".news").removeClass('current');
	    $(".blog").addClass('current');
							  });
	$(".news").click(function() {
		$("#homenews").show();
		$("#video").hide();
		$("#blog").hide();
		$(".blog").removeClass('current');
		$(".video").removeClass('current');
	    $(".news").addClass('current');
							  });

// Nav Foot Separators 
$("#navFoot .links li").append('<span class="sep"> |</span>');
$("#navFoot .links li .sep:last").remove();

// Featured/Popular Blog
$("#popblog").hide();
	$(".popbloga").click(function() {
		$(".ftblog").hide();
		$(".tab1").removeClass('current');
		$(".tab2").addClass('current');
		$("#popblog").show();
});
	$(".ftbloga").click(function() {
		$("#popblog").hide();
		$(".tab2").removeClass('current');
		$(".tab1").addClass('current');
		$(".ftblog").show();
});


//Featured/Popular News 
$("#popNews").hide();
	$(".popblogb").click(function() {
		$("#mainNews").hide();
		$(".tab1").removeClass('current');
		$(".tab2").addClass('current');
		$("#popNews").show();
});
	$(".ftblogb").click(function() {
		$("#popNews").hide();
		$(".tab2").removeClass('current');
		$(".tab1").addClass('current');
		$("#mainNews").show();
});
	

// IMPORTANT!  	
$('.learnMax .node-add-to-cart').ajaxSuccess( function () {
var pathname = window.location.pathname;
var thepath = pathname.split('/');

if(thepath[ 1] != 'cart' && thepath[ 1] != 'news' && thepath[ 1] != 'archive' && thepath[ 1] != 'taxonomy' && thepath[ 1] != 'category' && thepath[ 1] != 'admin'){
	window.location = '/cart'; //redirects to cart after submission
 };
 }); 

	

	}); // End document.ready
 
// Cufon font replace 
		Cufon.replace('.banner h3');
			Cufon.replace('.banner h1'); 
			Cufon.replace('#featStory h2');
			Cufon.replace('.taxBanner h3');

//try{Typekit.load();}catch(e){}