/**
 * tooltip
 * 
 * Copyright (c) 2009 Kyosuke Nakamura (kyosuke.jp)
 * Licensed under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 */

$(function(){
    var conf = {
        trigger: '.js_tooltip',
        content: '.js_tooltipContent'
    }
    $(conf.trigger).each(function(){
        var trigger = $(this);
        var content = trigger.find(conf.content);
        content.appendTo('body');
		trigger.mousemove(function(e) {
			content.css({
				left: e.pageX + 20 +'px',
				top: e.pageY + -20 + 'px'
			});
		}).hover(function(){
			if (content.is(':animated')) {
				content.stop();
			}
			content.css('opacity',1).fadeIn(100);
		}, function(){
			if (content.is(':animated')) {
				content.stop();
			}
			content.fadeOut(300);
		});
    });
});

