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

this.vtip = function() {    
    this.xOffset = -30; // x distance from mouse
    this.yOffset = 30; // y distance from mouse    
	var tipLeft = $("#menuMain").offset().left;
	var tipWidth = $("#menuMain").width()-21;
	var tipHeight = 30;
    $(".vtip").unbind().hover(
        function(e) {
			//console.log($(this).offset().left, $("#menuMain").offset().left, $("#menuMain").width());
            this.t = this.title;
            this.title = ''; 
            //this.top = (e.pageY + yOffset);
			this.top = 202;
			//this.left = (e.pageX + xOffset);
			this.left = tipLeft;
            
            $('body').append( '<p id="vtip"><img id="vtipArrow" />' + this.t + '</p>' );
                        
            $('p#vtip #vtipArrow').attr("src", 'assets/templates/sova/scripts/vtip/images/vtip_arrow_yellow.png');
			$('p#vtip #vtipArrow').css("left", $(this).position().left+60);
            $('p#vtip').css("top", this.top+"px").css("left", this.left+"px").css("width", tipWidth).fadeIn("slow");
            
        },
        function() {
            this.title = this.t;
            $("p#vtip").fadeOut("slow").remove();
        }
    ).mousemove(
        function(e) {
            //this.top = (e.pageY + yOffset);
			this.top = 202;
            //this.left = (e.pageX + xOffset);
			this.left = tipLeft;
                         
            $("p#vtip").css("top", this.top+"px").css("left", this.left+"px").css("width", tipWidth);
        }
    );            
    
};

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