$(document).ready(function() {
	$('#home_slider a:first').fadeIn(1000, function() {
		$('#home_slider')
			.cycle({
				fx:     'fade',
				timeout: 8000,
				speed:   600, 
				pager: "#home_slider_pager"
	    });
	});

	$('#video_slider')
		.cycle({
			fx:     'fade',
			timeout: 5500,
			speed:   400, 
			prev: "#video_prev",
			next: "#video_next",
    });

	$(".video_link").click(function() {
		$.fancybox({
				'overlayColor' : '#000000',
				'overlayOpacity' : 0.7,
				'padding'		: 0,
				'autoScale'		: false,
				'title'			: this.title,
				'width'			: 680,
				'height'		: 495,
				'href'			: this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
				'type'			: 'swf',
				'swf'			: {
				   	 'wmode'		: 'transparent',
					'allowfullscreen'	: 'true'
				}
			});

		return false;
	});
	
	$("#searchButton").click(function() {
		$("#searchForm").submit();
	});
});
