//Set jQuery into no conflict mode
var $jq = jQuery.noConflict();
 $jq(document).ready(function() {	
 	// Hover effect for the icon Link
	$jq('a#navigation-fb').children('span').css('opacity', 0);
	$jq('a#navigation-fb').children('span').css('display', 'block');
	$jq('a#navigation-fb').hover(
		function(){
			$jq(this).children('span').stop().fadeTo(900, 1);},
		function(){
			$jq(this).children('span').stop().fadeTo(900, 0);;
	});			
});
 	// Hover effect for the menu Link
		var $jq = jQuery.noConflict();
		$jq(document).ready(function() {		
			$jq("ul#menu li:nth-child(1) div").addClass("fade-arrow");$jq("ul#menu li:nth-child(2) div").addClass("fade-arrow");$jq("ul#menu li:nth-child(3) div").addClass("fade-arrow");$jq("ul#menu li:nth-child(4) div").addClass("fade-arrow");$jq("ul#menu li:nth-child(5) div").addClass("fade-arrow");$jq("ul#menu li:nth-child(6) div").addClass("fade-arrow");$jq("ul#menu li:nth-child(7) div").addClass("fade-arrow");$jq("ul#menu li").children("div").addClass("full-height show");$jq("ul#menu li").children("div").css("opacity", 0);$jq("ul#menu li").hover(function(){$jq(this).children("div").stop().fadeTo(900, .9);$jq(this).find("span.subtitle").stop().fadeTo(900, 1);},function(){$jq(this).children("div").stop().fadeTo(900, 0);$jq(this).find("span.subtitle").stop().fadeTo(900, .7);});		}); 	

 	// Hover effect for the NS Link
$(document).ready(function(){
         $('.button a').hover(function(){
		         $(this).stop().animate({'opacity' : '0'}, 500);
		 }, function(){$(this).stop().animate({'opacity' : '1'}, 500);});
});
$(document).ready(function(){
         $('.button2 a').hover(function(){
		         $(this).stop().animate({'opacity' : '0'}, 500);
		 }, function(){$(this).stop().animate({'opacity' : '1'}, 500);});
});

 	//  Effect for the spritely BG
	(function($) {
		$(document).ready(function() {
			$('#bg').pan({fps: 30, speed: 2, dir: 'left'}); 
		});
	})(jQuery);

 
// create custom animation algorithm for jQuery called "bouncy"
$.easing.bouncy = function (x, t, b, c, d) {
    var s = 2.2458;
    if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(3.2548))+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: '+=10'}, 500, 'bouncy', done).show();
	},
 
	// closing animation
	function(done) {
		this.getTip().animate({top: '-=5'}, 500, 'bouncy', function()  {
			$(this).hide();
			done.call();
		});
	}
);

$("#tooltips img[title]").tooltip({effect: 'bouncy'});
$("#tooltips div[title]").tooltip({effect: 'bouncy'});
