(function($){
	$.fn.extend({
		initTestimonial: function() {
			return this.each(function(){
				var testimonial = $(this);
				testimonial.data('initialHeight',$('.comment', this).height());
				$('.comment', this).height(45);
				$('.more', this).click(function(){
					$(this).unbind('click');
					$(testimonial).slideTestimonialDown();
				});
			});
		},
		slideTestimonialDown: function() {
			var testimonial = $(this);
			$('.comment', this).animate({
					height: testimonial.data('initialHeight')
				},
				200,
				function(){
					$('.more', testimonial).addClass('up');
				}
			);
			$('.more', this).click(function(){
				$(this).unbind('click');
				testimonial.slideTestimonialUp();
			});
		},
		slideTestimonialUp: function() {
			var testimonial = $(this);
			$('.comment', this).animate({
					height: 45
				},
				200,
				function(){
					$('.more', testimonial).removeClass('up');
				}
			);
			$('.more', this).click(function(){
				$(this).unbind('click');
				testimonial.slideTestimonialDown();
			});
		}
	});
	
	$(document).ready(function(){
		$('.testimonial').initTestimonial();
		$('#movie .cta-viewmovie').click(function(){
			var source = $(this).is('.juicy-cta') ? 'button' : ( $(this).parent().is('.image') ? 'thumbnail' : '' );
			var page = $('body').hasClass('act_index') ? 'index' : ($('body').hasClass('act_affiliates') ? 'affiliates' : 'advertisers'); 
			try {
				_gaq.push(['_trackEvent', page, 'view-movie', source]);
			} catch(err) {}
		});
		try {
			$('#steps .content').tabs();
		} catch(err) {}
	});
})(jQuery.noConflict());
