$(function(){
	
	// Activate jCarousel
	function mycarousel_initCallback(carousel)
	{
    	// Disable autoscrolling if the user clicks the prev or next button.
    	carousel.buttonNext.bind('click', function() {
    	    carousel.startAuto(0);
    	});

    	carousel.buttonPrev.bind('click', function() {
    	    carousel.startAuto(0);
    	});

    	// Pause autoscrolling if the user moves with the cursor over the clip.
    	carousel.clip.hover(function() {
    	    carousel.stopAuto();
    	}, function() {
    	    carousel.startAuto();
    	});
	};
	
	jQuery('#mycarousel').jcarousel({
	    auto: 6,
	    wrap: 'last',
	    animation: 1000,
		scroll: 1,
	    initCallback: mycarousel_initCallback
    });

	
});

$(function(){
	
	$('#peeper').hover(function() {
		$(this).animate({ top : "-65px", height: "175px"}, 225);            
		      }, function() {$(this).animate({ top : "-25px", height: "115px" }, 600);}
		);	
	$('#peeper img').click(function(){
		$('#ouch').show().fadeOut(500);
		
	})
	
});


$(function() {  
  
	spectrum();

	function spectrum(){
		$('body')
		.animate({ backgroundColor: "toyblue" }, 10000)
		.animate({ backgroundColor: "toygreen" }, 4000)
		.animate({ backgroundColor: "toypink" }, 4000);
		
		setTimeout(function(){
			spectrum();
		},18000);
	}
  
});


$(function() {
	$('#sockface').cycle({ 
	    fx:     'slideY', 
	    speed:  300, 
	    next:   '#sockface', 
	    timeout: 0
	});
});

$(function() {
	$("#trigger").click(function() {
		$("#join").slideToggle();
	})
	
	$("#no a").click(function() {
		$("#join form").hide('fast');
		$("#join #double_check").show('fast');
	})
	
	$("#double_check a").click(function() {
		$("#join #double_check").hide('fast');
		$("#join form").show('fast');
	});
	
	$('a.couponLink').click(function(){
		window.open(this.href);
		return false;
	});
});