/**
Vertigo Tip by www.vertigo-project.com
Modified by Tomy Saman
*/
(function($) {
		  
this.vtip = function(selector) {    
	this.xOffset = -10; // x distance from mouse
	this.yOffset = 25; // y distance from mouse       
	
	$(""+selector).unbind().hover(    
		function(e) {
			// Original: get tooltip content from the selected element's title attribute.
			this.t = this.title;
			this.title = ''; 
			// 2nd option: get tooltip content from the div element in selected element.
			//this.t = $(this).find('div').html();
			
			// Original: use an arrow image and <p> tag.
			//$('body').append( '<p id="vtip"><img id="vtipArrow" />' + this.t + '</p>' );
			//$('p#vtip #vtipArrow').attr("src", 'images/vtip_arrow.png');
			// 2nd option: don't use the arrow image and using div instead of p (so all html will be displayed correctly between the tag).
			$('body').append( '<div id="vtip">' + this.t + '</div>' );
			
			this.top = (e.pageY + yOffset); this.left = (e.pageX + xOffset);
			$('div#vtip').css("top", this.top+"px").css("left", this.left+"px").fadeIn("slow");
		},
		function() {
			this.title = this.t;
			$("div#vtip").fadeOut("slow").remove();
		}
	).mousemove(
		function(e) {
			this.top = (e.pageY + yOffset);
			this.left = (e.pageX + xOffset);
			$("div#vtip").css("top", this.top+"px").css("left", this.left+"px");
		}
	);            
};

})(jQuery);
