(function($){
	
	$(function(){
		$('input').default_swap();
		$('#homepage_slideshow').cycle({ 
			fx: 'fade', 
			speed: 1200, 
			timeout: 10000,
			delay: -5000,
			pager: '#homepage_slideshow_pager',
			prev: '#homepage_slideshow_prev',
			next: '#homepage_slideshow_next'
		});
		$('#follow_icons').follow_icon_hover();
		$('.issue_box h3').lock_icon_hover();
	});
	
   $.fn.follow_icon_hover = function(){
		$('img', this).hover(
			function(){ $(this).stop().animate({'opacity' : 0.65}, 300); },
			function(){ $(this).stop().animate({'opacity' : 1}, 300); }
		);
	}
	
	$.fn.default_swap = function(){
		return this.each(function(){
			$(this).focus(function(){
				if ($(this).val() == $(this)[0].defaultValue){ 
					$(this).val('').addClass('active');
				}
			});
		});
	}
	
	$.fn.past_issue_rollover = function(){
		return $(this).each(function(){
			var info = $(this).find('.past_issue_info');
			$(this).hover(
				function(){ info.fadeIn(); },
				function(){ info.fadeOut(); }
			);
		});
	}
	
	$.fn.lock_icon_hover = function(){
		return $(this).each(function(){
			$(this).hover(
				function(){ $('.lock_icon div', this).fadeIn('fast'); },
				function(){ $('.lock_icon div', this).fadeOut('fast'); }
			);
		});
	}
		
})(jQuery);
