﻿/*
Original Developed: Vertigo Tip by www.vertigo-project.com
Customized by Raimond Kuipers
*/

/// <reference path="jquery-1.3.2-vsdoc.js" />

this.b2tip = function() {
    this.xOffset = -40; // x distance from mouse
    this.yOffset = 30; // y distance from mouse       

    $(".b2tooltip").unbind().hover(
        function(e) {
            this.t = this.title;
            this.title = '';
            this.top = (e.pageY + yOffset); this.left = (e.pageX + xOffset);
            $('body').append('<p id="b2tip" ><img id="b2tipArrow" /></p>');
            $('p#b2tip #b2tipArrow').attr("src", $('#apppath').html() + '/images/b2tip_arrow.png');
            $('p#b2tip').css("top", this.top + "px").css("left", this.left + "px").show();  //fadeIn("fast");
            //$('p#vtip').append("<p>x</p>");
            
            $('.' + this.t).clone().show().appendTo('p#b2tip');
        },
        function() {
            this.title = this.t;
            $("p#b2tip").fadeOut("slow").remove();
        }
    ).mousemove(
        function(e) {
            this.top = (e.pageY + yOffset);
            this.left = (e.pageX + xOffset);

            $("p#b2tip").css("top", this.top + "px").css("left", this.left + "px");
        }
    );

};

jQuery(document).ready(function($) { b2tip(); }) 