jQuery(document).ready(function($){



// bof top cart
	var miniCartTrigger = $(".top-cart");
	var display_timeout = 0;
	$('a[name=trigger]').click(function(e) {  
        //Cancel the link behavior  
        e.preventDefault();
		});
		
	$(miniCartTrigger).hover(function(){
		if(display_timeout != 0) {
				clearTimeout(display_timeout);
		}
		// save a reference to 'this' so we can use it in timeout function
		var this_element = this;
                display_timeout = setTimeout(function() {
				display_timeout = 0;
				// perform things with this_element here buy referencing it like $(this_element)
				if (!$(this_element).hasClass(".top-cart")) {
					$(".mini-cart").fadeIn("fast");
				}
			}, 300);
	},
	function(){
		if(display_timeout != 0) {
				clearTimeout(display_timeout);
			}
			$(".mini-cart").fadeOut("fast");
	});	
	
	$(".mini-cart .mini-cart-close").click(function(){
	  $(this).parents("#mini-cart").animate({ opacity: "hide" }, "fast");
	});

// eof top cart	

// bof tooltips

	//tooltip
	$("#payment").tooltip();
	$("#alert").tooltip();
	$("#promo").tooltip();

// eof tooltips

})(jQuery);

