$(document).ready(function(){
	initGallery();
	initCheckout();
	initActiveNav();
	
});


function initActiveNav(){
	$("#page_" + page + " a").addClass('active');
}

function initWufooForms(){

	$("input,textarea,select").focus(function () {
	//grab the parent nested LI of that input and add the bg color
		$(this).parents('li').addClass('wufooHover');
	}).blur(function() {
	//Then get rid of it
		$(this).parents('li').removeClass('wufooHover');
	});
	
	$(".instruct").each(function(){
		if($(this).text() != ""){
			$(this).css('visibility', 'visible');
		}
	});

}

function initCheckout(){
	$("#checkoutToggle").click(function(e){
		e.preventDefault();
		$("#cart_large").toggle('slow');
	});
	$("#cart_large").hide();
}

function initGallery(){
	$(".gal-item a").click(function(e){
		e.preventDefault();
		var src= $(this).attr('href');
		$("#galleryTarget").attr('src', src);
	});
	
	$(".gal-item a:eq(0)").trigger('click');
}