/*
 * jQuery Cycle Plugin 
 * Examples and documentation at: http://malsup.com/jquery/cycle/
 * Copyright (c) 2007-2008 M. Alsup
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 */


$(document).ready(function(){

/*
 * 		Cycle functions (jquery.cycle.js)
 */

	(function($) {

		$.fn.cycle.transitions.scrollVert = function($cont, $slides, opts) {
		    $cont.css('overflow','hidden');
		    opts.before.push(function(curr, next, opts, fwd) {
		        $(this).show();
		        var currH = curr.offsetHeight, nextH = next.offsetHeight;
		        opts.cssBefore = fwd ? { top: -nextH } : { top: nextH };
		        opts.animIn.top = 0;
		        opts.animOut.top = fwd ? currH : -currH;
		        $slides.not(curr).css(opts.cssBefore);
		    });
		    opts.cssFirst = { top: 0 };
		    opts.cssAfter = { display: 'none' }
		};

	})(jQuery);

//events

	$('#events ul').cycle({ 
	    fx: 'scrollVert',
		speed: 1500,
		rev: true,
		timeout: 10000,
		next:   '#events ol li.next', 
	    prev:   '#events ol li.previous'
	});
	
	$('#scrollbackevents ul').cycle({ 
	    fx: 'scrollVert',
		speed: 1500,
		rev: true,
		timeout: 10000,
		next:   '#scrollbackevents ol li.next', 
	    prev:   '#scrollbackevents ol li.previous'
	});
 

//Reports

	$('#reports ul').cycle({ 
	    fx: 'scrollVert',
		speed: 1500,
		rev: true,
		timeout: 10000,
		next:   '#reports ol li.next', 
	    prev:   '#reports ol li.previous'
	});
	
	$('#scrollbackreport ul').cycle({ 
	    fx: 'scrollVert2',
		speed: 1500,
		rev: true,
		timeout: 10000,
		next:   '#scrollbackreport ol li.next', 
	    prev:   '#scrollbackreport ol li.previous'
	});
	
	
	$('#courses ul').cycle({ 
	    fx: 'scrollVert',
		speed: 1500,
		rev: true,
		timeout: 10000,
		next:   '#courses ol li.next', 
	    prev:   '#courses ol li.previous'
	});
	
	$('#scrollbackcourses ul').cycle({ 
	    fx: 'scrollVert',
		speed: 1500,
		rev: true,
		timeout: 10000,
		next:   '#scrollbackcourses ol li.next', 
	    prev:   '#scrollbackcourses ol li.previous'
	});

	
	//publications

	$('#publications ul').cycle({ 
	    fx: 'scrollVert',
		speed: 1500,
		rev: true,
		timeout: 10000,
		next:   '#publications ol li.next', 
	    prev:   '#publications ol li.previous'
	});
	
	$('#scrollbackpublications ul').cycle({ 
	    fx: 'scrollVert2',
		speed: 1500,
		rev: true,
		timeout: 10000,
		next:   '#scrollbackpublications ol li.next', 
	    prev:   '#scrollbackpublications ol li.previous'
	});
	

});
