$(document).ready(function (){
	$('#rotator-container')
		.before('<div id="rotator-nav">')
		.cycle({
			fx: 'fade',
			pager: '#rotator-nav',
			timeout: 10000
			//pause: 1
	});
	$(".featured-carousel").jCarouselLite({
		auto: 1000,
		speed: 1000
	});	
});

$(document).ready(function (){
    $("img.youtube-overlay").click(function(e) {  
        var video_id = $(this).attr("id");
        $(".vid-hide-"+video_id).hide();
      	$("#show-video-"+video_id).html( vid_iframe(video_id) ).show();
     	$("#rotator-container").cycle('pause');
        e.preventDefault();     	
     	return false;
    });

    function vid_iframe( video_id ) {
    	return "<iframe width=360 height=300 src=http://www.youtube.com/embed/"+video_id+"?autoplay=1 frameborder=0 allowfullscreen></iframe>";
    }	
});


