jQuery(document).ready(function($) {
	// HOME PAGE SLIDESHOW
	$("#tabs").tabs("#features > li", {
		// enable "cross-fading" effect
		effect: 'fade',
		// fadeOutSpeed: "slow",
		// start from the beginning after the last tab
		rotate: true
	// use the slideshow plugin. It accepts its own configuration
	}).slideshow();
	
	// FOOTER TOGGLE
	$("#footer .toggle").click(function(){
		if ($(this).is(".active")) {
			$("#footer").animate({
			height: '49'
			}, 'slow');
		} else {
			$("#footer").animate({
			height: '230'
			}, 'slow');
		}
		$(this).toggleClass("active");
	});
	
	// FINE ART GALLERY HELPERS
	$(".ngg-gallery-thumbnail-box:nth-child(4n)").addClass('last');
	// $(".ngg-gallery-thumbnail-box").fadeIn(1000);
	$(".ngg-gallery-thumbnail-box").show();
	
	// DROP DOWN NAVIGATION
    $("ul.nav li").hover(function() {
        $(this).addClass("hover");
        $('ul:first',this).css('visibility', 'visible');
    }, function() {
        $(this).removeClass("hover");
        $('ul:first',this).css('visibility', 'hidden');
    });

	// $(".shoppingcart").click(function() {
	// 	$(this).toggleClass('active');
	// 	$('.shoppingcart ul').toggle();
	// });
	// $(".shoppingcart").click(function(e) {
	// 	e.stopPropagation();
	// 	// if (!e) var e = window.event;
	// 	// e.cancelBubble = true;
	// 	// if (e.stopPropagation) e.stopPropagation();
	// });
	// $(document).click(function() {
	// 	$('.shoppingcart').removeClass('active');
	// 	$(".shoppingcart ul").hide();
	// });

	// SETUP IN-FIELD LABELS PLUGIN
	$("#mc_signup_form label").inFieldLabels();
	
	// FIX FOR ANCHOR TITLE ATTRIBUTE FOR NEXTGEN GALLERY
	$(".ngg-gallery-thumbnail a img").each(function() {
		var title = $(this).attr("title");
		$(this).parent().attr("title", title);
	});
	
	// REMOVE DEFAULT PAYPAL BUTTON AND REPLACE WITH SOMETHING MORE AWESOME
	$(".wp_cart_checkout_button").attr('src', 'http://robbsiverson.com/wp-content/themes/robbsiverson/images/paypal.png')
	
	// ADD ARROW KEY NAVIGATION TO THICKBOX
	// $("#TB_next a").keydown( function (event) { if (event.keyCode == "39") { $("#TB_next a").click() } });
});
