/**
*
*    simpleTooltip jQuery plugin, by Marius ILIE
*    visit http://dev.mariusilie.net for details
*
**/
(function($){ $.fn.simpletooltip_green = function(){
    return this.each(function() {
        var text = $(this).attr("title");
        $(this).attr("title", "");
        if(text != undefined) {
            $(this).hover(function(e){
                var tipX = e.pageX + 12;
                var tipY = e.pageY + 12;
                $(this).attr("title", ""); 
                $("body").append("<div id='simpleTooltip_green' style='position: absolute; z-index: 100; display: none;'>" + text + "</div>");
                if($.browser.msie) var tipWidth = $("#simpleTooltip_green").outerWidth(true)
                else var tipWidth = $("#simpleTooltip_green").width()
                $("#simpleTooltip_green").width(tipWidth);
                $("#simpleTooltip_green").css("left", tipX).css("top", tipY).fadeIn("medium");
            }, function(){
                $("#simpleTooltip_green").remove();
                $(this).attr("title", text);
            });
            $(this).mousemove(function(e){
                var tipX = e.pageX + 12;
                var tipY = e.pageY + 12;
                var tipWidth = $("#simpleTooltip_green").outerWidth(true);
                var tipHeight = $("#simpleTooltip_green").outerHeight(true);
                if(tipX + tipWidth > $(window).scrollLeft() + $(window).width()) tipX = e.pageX - tipWidth;
                if($(window).height()+$(window).scrollTop() < tipY + tipHeight) tipY = e.pageY - tipHeight;
                $("#simpleTooltip_green").css("left", tipX).css("top", tipY).fadeIn("medium");
            });
        }
    });
}})(jQuery);

(function($){ $.fn.simpletooltip_blue = function(){
    return this.each(function() {
        var text = $(this).attr("title");
        $(this).attr("title", "");
        if(text != undefined) {
            $(this).hover(function(e){
                var tipX = e.pageX + 12;
                var tipY = e.pageY + 12;
                $(this).attr("title", ""); 
                $("body").append("<div id='simpleTooltip_blue' style='position: absolute; z-index: 100; display: none;'>" + text + "</div>");
                if($.browser.msie) var tipWidth = $("#simpleTooltip_blue").outerWidth(true)
                else var tipWidth = $("#simpleTooltip_blue").width()
                $("#simpleTooltip_blue").width(tipWidth);
                $("#simpleTooltip_blue").css("left", tipX).css("top", tipY).fadeIn("medium");
            }, function(){
                $("#simpleTooltip_blue").remove();
                $(this).attr("title", text);
            });
            $(this).mousemove(function(e){
                var tipX = e.pageX + 12;
                var tipY = e.pageY + 12;
                var tipWidth = $("#simpleTooltip_blue").outerWidth(true);
                var tipHeight = $("#simpleTooltip_blue").outerHeight(true);
                if(tipX + tipWidth > $(window).scrollLeft() + $(window).width()) tipX = e.pageX - tipWidth;
                if($(window).height()+$(window).scrollTop() < tipY + tipHeight) tipY = e.pageY - tipHeight;
                $("#simpleTooltip_blue").css("left", tipX).css("top", tipY).fadeIn("medium");
            });
        }
    });
}})(jQuery);

(function($){ $.fn.simpletooltip_red = function(){
    return this.each(function() {
        var text = $(this).attr("title");
        $(this).attr("title", "");
        if(text != undefined) {
            $(this).hover(function(e){
                var tipX = e.pageX + 12;
                var tipY = e.pageY + 12;
                $(this).attr("title", ""); 
                $("body").append("<div id='simpleTooltip_red' style='position: absolute; z-index: 100; display: none;'>" + text + "</div>");
                if($.browser.msie) var tipWidth = $("#simpleTooltip_red").outerWidth(true)
                else var tipWidth = $("#simpleTooltip_red").width()
                $("#simpleTooltip_red").width(tipWidth);
                $("#simpleTooltip_red").css("left", tipX).css("top", tipY).fadeIn("medium");
            }, function(){
                $("#simpleTooltip_red").remove();
                $(this).attr("title", text);
            });
            $(this).mousemove(function(e){
                var tipX = e.pageX + 12;
                var tipY = e.pageY + 12;
                var tipWidth = $("#simpleTooltip_red").outerWidth(true);
                var tipHeight = $("#simpleTooltip_red").outerHeight(true);
                if(tipX + tipWidth > $(window).scrollLeft() + $(window).width()) tipX = e.pageX - tipWidth;
                if($(window).height()+$(window).scrollTop() < tipY + tipHeight) tipY = e.pageY - tipHeight;
                $("#simpleTooltip_red").css("left", tipX).css("top", tipY).fadeIn("medium");
            });
        }
    });
}})(jQuery);
