/***************************************************************************************/
/*  innerfade  */
$(document).ready(
        function(){
            
            $('ul#rotate_each_li').innerfade({
                speed: 1000,
                timeout: 5000,
                type: 'sequence',
                containerheight: '84px'
            });				
    });

/***************************************************************************************/
/* basic tooltip */
this.tooltip = function(){	
	/* CONFIG */		
		xOffset = 10;
		yOffset = 20;		
		// these 2 variable determine popup's distance from the cursor
		// you might want to adjust to get the right result		
	/* END CONFIG */		
	$("img.tooltip").hover(function(e){											  
		this.t = this.alt;
		this.alt = "";									  
		$("body").append("<p id='tooltip'>"+ this.t +"</p>");
		$("#tooltip")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px")
			.fadeIn("fast");
			
					
    },
	function(){
		this.alt = this.t;		
		$("#tooltip").remove();
    });	
	$("img.tooltip").mousemove(function(e){
		$("#tooltip")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px");
	});			
};

// starting the script on page load
$(document).ready(function(){
    $('div#rotate_wrapper img').addClass('tooltip');
	tooltip();
});


/***************************************************************************************/
/* facebox */
 jQuery(document).ready(function($) {
  $('a[rel*=facebox]').facebox()
});

/***************************************************************************************/
/* ahover  - main navigation */
jQuery(function($) {
    $('ul.cards li').ahover({moveSpeed: 100, hoverEffect: function() {
        $(this)
            .css({opacity: 0.99})
            .animate({opacity: 0.5}, 750)
            .animate({opacity: 0.99}, 750)
            .dequeue();
        $(this).queue(arguments.callee);
    }});
});

