$(function(){
    
    //Social Icons - No Padding on Right Icons
    $('.socials img:eq(3)').addClass('last');
    $('.socials img:eq(7)').addClass('last');
    $('.socials img:eq(11)').addClass('last');
    $('.socials img:eq(15)').addClass('last');
    
    //Widget Styling
    $('div#navigation ul li:last').addClass('last');
    $('ul li.page_item:last, ul li.recentcomments:last, div.box ul li:last, ul li.cat-item:last').addClass('last-widget');
    $('ul.links li:last').addClass('last');
    
    //Navigation Menu
    $('ul.sf-menu').superfish();
        
    //Slider
    $("#slider").easySlider({
            auto: true, 
            continuous: true,
            pause: 4000,
            numeric: true
    });
    
    //Tabs
    var tabContainers = $('div.tab-content > div');
						
    $('div.tabs a').click(function () {
        tabContainers.hide().filter(this.hash).fadeIn('slow');;
        
        $('div.tabs a').removeClass('active');
        $(this).addClass('active');
        
        return false;
    }).filter(':first').click();
    
    //Last Nav Button
    $('ul.sf-menu li:last').addClass('last');
});


/*
 * Tooltip script 
 * powered by jQuery (http://www.jquery.com)
 * 
 * written by Alen Grakalic (http://cssglobe.com)
 * 
 * for more info visit http://cssglobe.com/post/1695/easiest-tooltip-and-image-preview-using-jquery
 *
 */
 
this.tooltip = function(){	
	/* CONFIG */		
		xOffset = 55;
		yOffset = -45;		
		// these 2 variable determine popup's distance from the cursor
		// you might want to adjust to get the right result		
	/* END CONFIG */		
	$("a.tooltip").hover(function(e){											  
		this.t = this.title;
		this.title = "";									  
		$("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.title = this.t;		
		$("#tooltip").remove();
    });	
	$("a.tooltip").mousemove(function(e){
		$("#tooltip")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px");
	});			
};

$(document).ready(function(){
	tooltip();
});