/*
 * Tooltip script 
 * powered by jQuery (http://www.jquery.com)
 * 
 * written by Alen Grakalic (http://cssglobe.com)
 * 
 * for more info visit http://cssglobe.com/post/1695/easiest-tooltip-and-image-preview-using-jquery
 *
 */
	   $(document).ready(function(){ 
	       $("ul.sf-menu").supersubs({ 
	           minWidth:    6,   // minimum width of sub-menus in em units 
	           maxWidth:    27,   // maximum width of sub-menus in em units 
	           extraWidth:  1     // extra width can ensure lines don't sometimes turn over 
	                              // due to slight rounding differences and font-family 
	       }).superfish({
		});  // call supersubs first, then superfish, so that subs are 
	                         // not display:none when measuring. Call before initialising 
	                         // containing tabs for same reason. 

	//						$(".sf-menu li").mouseover(function(){
	//							$(".sf-menu li").css("background", "none");
	//							$(this).css("background", "#fff");
	//						});


	//						for (var i=0; i < 3; i++) {
	//							$("ul").animate({opacity: "hide"}, "fast").animate({opacity: "show"}, "slow");
	//						};

		tooltip();

// dates_prices are hidden with css until the page loads as the thickbox doesn't work till full page load
// below displays and animates the dates_prices 
		$("a.dates_prices").css("display", "inline").animate({opacity: "hide"}, "slow").animate({opacity: "show"}, "slow");

	// for image dropshadows
		$("img.dropshadowR").wrap("<div class='wrap1R'><div class='wrap2'>" + "<div class='wrap3'></div></div></div>");
		$("img.dropshadowL").wrap("<div class='wrap1L'><div class='wrap2'>" + "<div class='wrap3'></div></div></div>");


	    });


this.tooltip = function(){	
	/* CONFIG */		
		xOffset = 5;
		yOffset = 20;		
		// 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 id='tooltip'>"+ this.t +"</p>");
		$("#tooltip")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px")
			.fadeIn("fast");		
    },
	function(){
		this.title = this.t;		
		$("#tooltip").remove();
    });	
	$("a.tooltip").mousemove(function(e){
		$("#tooltip")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px");
	});			
};

