/**
Vertigo Tip by www.vertigo-project.com
Requires jQuery
*/

this.vtip = function() {    
    this.xOffset = 35; // x distance from mouse
    this.yOffset = -25; // y distance from mouse       
    
    $(".vtip").unbind().hover(    
        function(e) {
            this.t = this.title;
            this.title = ''; 
            this.top = (e.pageY + yOffset); this.left = (e.pageX + xOffset);
            
            $('body').append( '<p id="vtip"><img id="vtipArrow" /><em>' + this.t + '</em></p>' );
                        
            $('p#vtip #vtipArrow').attr("src", 'http://www.sitewards.com/js/graphics/vtip_arrow.png');
            $('p#vtip').css("top", this.top+"px").css("left", this.left+"px").fadeIn("fast");
            
        },
        function() {
	
            this.title = this.t;
            $("p#vtip").fadeOut("slow").remove();
        }
    ).mousemove(
        function(e) {
       
			this.top = (e.pageY + yOffset);
            this.left = (e.pageX + xOffset);
			
			
			// repositioning if element is out of viewport
			var bottomspace = $(window).height() - e.clientY;
			var sumheight = yOffset + $("p#vtip").height();
			if(bottomspace < sumheight){
				this.top = (e.pageY - $("p#vtip").height());
				var arrowpos = $("p#vtip").height() - 20;
				$('#vtipArrow').css("position","absolute"); 
				$('#vtipArrow').css("top",arrowpos + "px");
			}
			else {
				$('#vtipArrow').css("top","20px");
			}
			
		    
            $("p#vtip").css("top", this.top+"px").css("left", this.left+"px");
        }
    );            
    
};

jQuery(document).ready(function($){vtip();}) 







this.ffmtip = function() {    
    this.xOffset = 35; // x distance from mouse
    this.yOffset = -25; // y distance from mouse       
    
    $(".ffmtip").unbind().hover(    
        function(e) {
            this.t = this.title;
            this.title = ''; 
            this.top = (e.pageY + yOffset); this.left = (e.pageX + xOffset);
            
            $('body').append( '<p id="ffmtip"><img id="vtipArrow" />' + this.t + '</p>' );
                        
            $('p#ffmtip #vtipArrow').attr("src", 'http://www.sitewards.com/js/graphics/vtip_arrow.png');
            $('p#ffmtip').css("top", this.top+"px").css("left", this.left+"px").fadeIn("fast");
            
        },
        function() {
	
            this.title = this.t;
            $("p#ffmtip").fadeOut("slow").remove();
        }
    ).mousemove(
        function(e) {
       
			this.top = (e.pageY + yOffset);
            this.left = (e.pageX + xOffset);
			
			
			// repositioning if element is out of viewport
			var bottomspace = $(window).height() - e.clientY;
			var sumheight = yOffset + $("p#ffmtip").height();
			if(bottomspace < sumheight){
				this.top = (e.pageY - $("p#ffmtip").height());
				var arrowpos = $("p#ffmtip").height() - 20;
				$('#vtipArrow').css("position","absolute"); 
				$('#vtipArrow').css("top",arrowpos + "px");
			}
			else {
				$('#vtipArrow').css("top","20px");
			}
			
		    
            $("p#ffmtip").css("top", this.top+"px").css("left", this.left+"px");
        }
    );            
    
};

jQuery(document).ready(function($){ffmtip();}) 
