/*
 * 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.tooltip2 = function(){	
	/* CONFIG */		
		xOffset = 20;
		yOffset = 20;		
		// these 2 variable determine popup's distance from the cursor
		// you might want to adjust to get the right result		
	/* END CONFIG */		
	$(".ressource").hover(function(e){	
	var bg = $(this).children('.description').html();
	var bg1 = $(this).children('.acces_nomade').html();
	var bg2 = $(this).children('.tutoriel').html();
		$("#tooltip").remove();

		this.t = this.title;
		this.t = bg;
		this.title = "";									  
		$("body").append("<p id='tooltip'>"+ this.t +bg1+bg2+"</p>");
		$("#tooltip")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px")
			.fadeIn("slow");		
    },
	function(){
		this.title = this.t;		
		
    });	
	$(".titre_ressource").mousemove(function(e){
		$("#tooltip")
	});			
};

 
 
 
this.tooltip = function(){	
	/* CONFIG */		
		xOffset = 20;
		yOffset = 20;		
		// these 2 variable determine popup's distance from the cursor
		// you might want to adjust to get the right result		
	/* END CONFIG */		
	$(".ressource").hover(function(e){	
	var bg = $(this).children('.description').html();

		this.t = this.title;
		this.t = bg;
		this.title = "";									  
		$("body").append("<p id='tooltip'>"+ this.t +"</p>");
		$("#tooltip")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px")
			.fadeIn("slow");		
    },
	function(){
		this.title = this.t;		
		$("#tooltip").remove();
    });	
	$(".titre_ressource").mousemove(function(e){
		$("#tooltip")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px");
	});			
};


this.tooltip_titre = function(){	
	/* CONFIG */		
		xOffset = 20;
		yOffset = 20;		
		// these 2 variable determine popup's distance from the cursor
		// you might want to adjust to get the right result		
	/* END CONFIG */		
	$("#block-block-5 h2").hover(function(e){	
	var bg = $("#block-block-5 .description").html();

		this.t = this.title;
		this.t = bg;
		this.title = "";									  
		$("body").append("<p id='tooltip_titre'>"+ this.t +"</p>");
		$("#tooltip_titre")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px")
			.fadeIn("slow");		
    },
	function(){
		this.title = this.t;		
		$("#tooltip_titre").remove();
    });	
	$("#block-block-5 h2").mousemove(function(e){
		$("#tooltip_titre")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px");
	});			
};




// starting the script on page load
$(document).ready(function(){
	tooltip2();
    tooltip_titre();

});
