/* Tooltip from CSS Globe written by Alen Grakalic (http://cssglobe.com) */
this.tooltip = function(){	
	/* CONFIG */		
		xOffset = -44;
		yOffset = -8;		
		// these 2 variable determine popup's distance from the cursor
		// you might want to adjust to get the right result		
	/* END CONFIG */		
	$("a.tooltip").hover(function(e){											  
		this.t = this.title;
		this.title = "";									  
		$("body").append("<p class='itooltip'>"+ this.t +"</p>");
		$(".itooltip")
			.css("top",(e.pageY - yOffset) + "px")
			.css("left",(e.pageX + xOffset) + "px")
			.fadeIn(300);		
    },
	function(){
		this.title = this.t;		
		$(".itooltip").remove();
    });	
	$("a.tooltip").mousemove(function(e){
		$(".itooltip")
			.css("top",(e.pageY - yOffset) + "px")
			.css("left",(e.pageX + xOffset) + "px");
	});			
};

jQuery.preloadImages = function()
{
  for(var i = 0; i<arguments.length; i++)
  {
    jQuery("<img>").attr("src", arguments[i]);
  }
}

$(document).ready(function(){
	tooltip();
	
	$("#login").hover(
      function () {
        $(this).stop().animate({top:"-115px"});	
      }, 
      function () {
        $(this).stop().animate({top:"-180px"});	
      }
    );
});

$.preloadImages("http://www.71squared.com/wp-content/themes/71Squared/images/tooltip2.png","http://www.71squared.com/wp-content/themes/71Squared/images/bg-nav-hover.gif");
