$(document).ready(function(){
	$("a.fancybox").click(function() {
		$.fancybox({
				'padding'		: 0,
				'autoScale'		: false,
				'transitionIn'	: 'fade',
				'transitionOut'	: 'fade',
				'overlayColor'	: '#000',
				'overlayOpacity': 0.8,
				'width'			: 680,
				'height'		: 495,
				'href'			: this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
				'type'			: 'swf',
				'swf'			: {
					'wmode'		: 'transparent',
					'allowfullscreen'	: 'true'
				}
			});

		return false;
	});
	
	$(".manage .thumbs a").jqzoom({
		title: false,
		zoomWidth: 368,
		zoomHeight: 184,
		showEffect: 'fadein',
		hideEffect: 'fadeout',
		fadeoutSpeed: 'fast'
	});
	
	$(".learnmore").click(function(e) {
		e.preventDefault();
		var section = $(this).attr("href").substr(1);
		$("html, body").animate({
			scrollTop: $("a[name=" + section + "]").offset().top
		}, 400);
	});
	
	$(".backtotop").click(function(e) {
		e.preventDefault();
		$("html, body").animate({
			scrollTop: $("a[name=top]").offset().top
		}, 400);
	});

});
