﻿$(document).ready(function () {
	
	// Homepage Slideshow
	$('.home-header-img').cycle({
        timeout: 10000,
		fx: 'fade'
     });
	
	// Publication Carousel
	$('.publication-slideshow').cycle({
		fx: 'fade',
		speed: 'fast',
		timeout: 0,
		next: '.right-col-right-btn',
		prev: '.right-col-left-btn'
	});
	
	// Publication Template Header Carousel
	$('.pub-header-container').cycle({
		fx: 'fade',
		speed: 'fast',
		timeout: 0,
		next: '.publications-slideshow-next',
		prev: '.publications-slideshow-prev'
	});
	 
	 // Publications Testimonials Cycle
	 $('.publications-testimonials-slideshow').cycle({
        timeout: 11500,
		random: true,
		fx: 'fade'
     });
	 
	// Testimonial & Client List Cycle
	 $('.interior-clients-container, .interior-testimonials-container').cycle({
        timeout: 11500,
		random: true,
		fx: 'fade'
     });
	 
	 // Speaking Header Testimonial Slideshow
	 $('.speaking-testimonials-slideshow').cycle({
        timeout: 11500,
		random: true,
		fx: 'fade'
     });
	 
	 
	 // Mental Espresso Preview 
	 $("a#mental-espresso-preview").fancybox({
			'overlayColor'		: '#140500',
			'overlayOpacity'	: 0.7
		});
	 
	
	// Publications Video Play
	$("a#publications-video-player").fancybox({
			'overlayColor'		: '#140500',
			'overlayOpacity'	: 0.7,
			'width'				: 640,
			'height'			: 360

		});
		
	//iPad Video Pop Up - Youtube Auto Play
	$(".ipadPopup").click(function() {
				$.fancybox({
				'padding'			: 15,
				'overlayColor'		: '#140500',
				'overlayOpacity'	: 0.7,
				'autoScale'			: false,
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'title'				: this.title,
				'width'				: 750,
				'height'			: 411,
				'href'				: this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
				'type'				: 'swf',
				'swf'				: {
				'wmode'				: 'transparent',
				'allowfullscreen'	: 'true'
			}
		});
		return false;
	});
	
	// Blog Dispersion
	$('#feed-display').rssfeed('http://feeds.feedburner.com/RidingTheCurrent', {
		limit: 1
	});
	
	
	
	

	
 });
