$(document).ready(function(){

	// Cufon
	Cufon.replace('.replace');
	Cufon.replace('.replace_shadow', {
		textShadow: '1px 1px rgba(0, 0, 0)'
	});

	// Delay function
	$.fn.delay = function(time,func){
		this.each(function(){
			setTimeout(func,time);
		});
		
		return this;
	};
	
	// News tag
	$('a.close_news_tag').click(function(){
		$("#news_tag").animate({ top:'-184px' });
		$.cookie("ripley_news_tag", "closed", { expires: 7 });
	});
	
	// Switcher
	$(".switcher ul.tabnav").idTabs(); 
	
	// Featured Videos
	$(".featured_vids ul").idTabs();
	$(".inside-the-studio ul").idTabs(); 
	
	// Related, Comments, & Categories
	// $(".switcher ul").idTabs(); 
	
	// Have U Heard scroller
	$('#content .huh_items').cycle({ 
		fx: 'scrollHorz', 
    	speed:		700,
    	timeout:	10000, 
    	next:		'.huh_next', 
    	prev:		'.huh_prev'
	});
		// Pause/resume slideshow on hover
		$('#content .huh_items').hover(function(){
			$('#content .huh_items').cycle('pause');
		}, function(){
			$('#content .huh_items').cycle('resume');
		});
		
	// Content Slider
	$('#content_slides').cycle({ 
		fx: 'scrollHorz', 
    	speed:		700,
    	timeout:	10000, 
    	next:		'.ct_next', 
    	prev:		'.ct_prev'
	});
		// Pause/resume slideshow on hover
		$('#content_slides').hover(function(){
			$('#content_slides').cycle('pause');
		}, function(){
			$('#content_slides').cycle('resume');
		});
		
	// Author Scroll Pane
	$('.jqscroll').jScrollPane();
	
	// Attractions
	$('.attractions_rotator .rotation').innerfade({ animationtype: 'fade', speed: 750, timeout: 3000, type: 'sequence', containerheight: '200px' }); 

	// Footer logo scroller
	$("#logo_slider").jcarousel({
		scroll: 3,
		animation:"slow",
		easing:'swing'
	});
	
	$.fn.clearDefault = function(){
		return this.each(function(){
			var default_value = $(this).val();
			$(this).focus(function(){
				if ($(this).val() == default_value) $(this).val("");
			});
			$(this).blur(function(){
				if ($(this).val() == "") $(this).val(default_value);
			});
		});
	};
	
	$('.mc-field-group input.text').clearDefault();    
}); 