$(document).ready(function() {
$("#scrollable").scrollable({size: 1, clickable:false}).autoscroll({autoplay: false, autopause:true, interval:7000}).mousewheel(400).navigator({
		navi: ".subnav",naviItem: 'a', 
		activeClass: 'current'
		})
});

$(document).ready(function(){
	$("#instructions").jFade({
		trigger: "load",
		property: 'color',
		start: 'FFFFFF',
		end: '666666',
		steps: 40,
		duration: 160
	}).jFade({
		trigger: "mouseover",
		property: 'color',
		start: '666666',
		end: 'FFFFFF',
		steps: 25,
		duration: 30
	}).jFade({
		trigger: "mouseout",
		property: 'color',
		start: 'FFFFFF',
		end: '666666',
		steps: 25,
		duration: 30
	});
});

$(document).ready(function() {
	$("#logo").tooltip({tip: '#logohover', effect: 'bouncy'});
	$("#on").tooltip({tip: '#navhover', effect: 'bouncy'});
	
	$.easing.bouncy = function (x, t, b, c, d) {
		var s = 1.70158;
		if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
		return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
	}
	// create custom tooltip effect for jQuery Tooltip
	$.tools.tooltip.addEffect("bouncy",
		// opening animation
		function(done) {
			this.getTip().animate({top: '+=15'}, 500, 'bouncy', done).show();
		},
		// closing animation
		function(done) {
			this.getTip().animate({top: '-=15'}, 500, 'bouncy', function()  {
				$(this).hide();
				done.call();
			});
		}
	);
	
});

$.easing.drop = function (x, t, b, c, d) {
	return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
};

$.tools.overlay.addEffect("drop",  
	// loading animation
	function(done) { 
		var animateProps = {
			top: '+=55', 
			opacity: 1, 
			width: '+=20'
		};
		this.getOverlay().animate(animateProps, "medium", 'drop', done).show();
	}, 
	// closing animation
	function(done) {
		var animateProps = {
			top: '-=55', 
			opacity: 0, 
			width: '-=20'
		};
		this.getOverlay().animate(animateProps, "fast", 'drop', function()  {
			$(this).hide();
			done.call();		
		});
	}
);

$("a[rel]").overlay({
	effect: 'drop',
	expose: '#000'
});

$(document).ready(function(){	
		$("#scrollable a").easyTooltip();
		$(".subnav a").easyTooltip({
			tooltipId: "navTip",
			xOffset: -70
		});
		$("#nextprev a").easyTooltip({
			tooltipId: "nextTip",
			xOffset: -70,
			yOffset: 50
		});
	});