$(function() {

	//Dropdown Menu
	$('#dropdown').find('li').hover(
		function(){
			$(this).addClass('hover').find('ul').hide().slideDown('medium');
		},function(){
			$(this).removeClass('hover').find('ul').hide();
	});
	
	//Home Page Splash
	$('#splash.slider').scrollable({circular:true,speed:1000}).autoscroll({ autoplay: true,interval:9000});;

	//Inklink News Main Page
	$('#news_splash div.items').tabs('#news_splash > div.items div', {
		effect: 'fade',
		fadeOutSpeed: "slow",
		rotate: true
	}).slideshow({autoplay:true,interval:8000});
	
	//Side Navigation
	$("#side_nav").tabs("#side_nav ul", {tabs: 'h3', effect: 'slide', initialIndex: -1});
	$('li a','#side_nav').hover(function(){
		$(this).stop().animate({paddingLeft : "5px"},200);
	},function(){
		$(this).stop().animate({paddingLeft : "0px"},200);
	});
		
	//Case Study Tabs
	$("#case_study_slider .controls").tabs("#case_study_slider > .content > div", {effect:'fade'});
	
	// Custom Animation For Case Study Tooltips Called 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;
	}

	// Custom Tooltip Effect For Case Study Tooltips
	$.tools.tooltip.addEffect("bouncy",
		function(done) {
			this.getTip().animate({top: '+=5'}, 500, 'bouncy', done).show();
		},
		function(done) {
			this.getTip().stop().animate({top: '-=5',opacity:0}, 300, 'bouncy', function()  {
				$(this).hide().css({opacity:1});
				done.call();
			});
		}
	);
	
	// Case Study Tooltips
	$("#case_study_slider .controls a[title]").tooltip({effect:'bouncy',offset:[-10,0],tipClass:'case_study_tooltip',delay:0});


	// Setup video overlay
	$('#document a.video').overlay({
		expose: {	color: '#111111'}
	});

	// Anti-Spam Script For Contact Form
	$('form[name=contactusform]').submit(function() {
		$(this).find('input[name=post_to]').val('boss');
	});


}); //end jQuery
