jQuery(document).ready(function() {
    jQuery('#carousel ul').cycle({
		fx: 'fade',
		timeout:  8000,
		pager:  '#carousel-nav'
	});
	
	jQuery('#featured-carousel ul').cycle({
		fx: 'fade',
		timeout:  8000,
		pager:  '#carousel-nav'
	});
	
	jQuery('#venues-carousel').cycle({
		fx: 'scrollBothWays',
		speed: 300,
		timeout: 5000,
		prev: '#prev',
		next: '#next',
		continuous: 0,
		pause: 1
	});			
});
jQuery.fn.cycle.transitions.scrollBothWays = function(jQuerycont, jQueryslides, opts) {	
			jQuerycont.css('overflow','hidden');
			opts.before.push(jQuery.fn.cycle.commonReset);

			// custom transition fn (trying to get it to scroll forward and backward)
		
			opts.fxFn = function(curr, next, opts, cb, fwd) {
			
				var w = jQuerycont.width();	
				opts.cssFirst = { left: 0 };
				opts.animIn	  = { left: 0 };
		
				if(fwd){
					opts.cssBefore= { left: w, top: 0 };
					opts.animOut  = { left: 0-w };
				}else{
					opts.cssBefore= { left: -w, top: 0 };
					opts.animOut  = { left: w };
				};
		
				var jQueryl = jQuery(curr), jQueryn = jQuery(next);
				var speedIn = opts.speedIn, speedOut = opts.speedOut, easeIn = opts.easeIn, easeOut = opts.easeOut, animOut = opts.animOut, animIn = opts.animIn;
		
				jQueryn.css(opts.cssBefore);
		
				var fn = function() {jQueryn.show();jQueryn.animate(animIn, speedIn, easeIn, cb);};
		
				jQueryl.animate(animOut, speedOut, easeOut, function() {
					if (opts.cssAfter) jQueryl.css(opts.cssAfter);
					if (!opts.sync) fn();
				});
				if (opts.sync) fn();
			};
		};
