


/***************************************************
		  ADDITIONAL CODE FOR TOOLTIP
***************************************************/
/*
 * 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 = 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 */		
	$("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");
	});			
};



// starting the script on page load
$(document).ready(function(){
	if($('a.tooltip') != null) {
		tooltip();
	}
});




/***************************************************
		  ADDITIONAL CODE FOR SKILLS
***************************************************/
jQuery(document).ready(function($){
		$('.skill-web').animate({ marginRight: '20px' }, 1000 );
		$('.skill-email').animate({ marginRight: '30px' }, 1000 );
		$('.skill-print').animate({ marginRight: '40px' }, 1000 );
		$('.skill-seo').animate({ marginRight: '10px' }, 1000 );
});






/***************************************************
		TABS JAVASCRIPT
***************************************************/
jQuery(document).ready(function($){
	//Default Action
	$(".tab_content").hide(); //Hide all content
	$("ul.tabs li:first").addClass("active").show(); //Activate first tab
	$(".tab_content:first").show(); //Show first tab content
	
	//On Click Event
	$("ul.tabs li").click(function() {
		$("ul.tabs li").removeClass("active"); //Remove any "active" class
		$(this).addClass("active"); //Add "active" class to selected tab
		$(".tab_content").hide(); //Hide all tab content
//		var activeTab = $(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content
		var activeTab = $(this).find("a").attr("name"); //Find the rel attribute value to identify the active tab + content
		$("#"+activeTab).fadeIn(); //Fade in the active content
		return false;
	});
});






/***************************************************
	     SCROLL TO TOP JAVASCRIPT
***************************************************/	
jQuery(document).ready(function(){
	if($('a[href=#wrapper]') != null) {
	    $('a[href=#wrapper]').click(function() {
	    if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
	        && location.hostname == this.hostname) {
	            var $target = $(this.hash);
	            $target = $target.length && $target || $('[name=' + this.hash.slice(1) +']');
	            if ($target.length) {
	                var targetOffset = $target.offset().top;
	                $('html,body').animate({scrollTop: targetOffset}, 500);
	                return false;
	            }
	        }
	    });
	}
});

