﻿/***
* jQuery qTips
*
* qTips is a jQuery plugin that allows you to quickly and easily add simple tooltips 
* to any element or group of elements by using standard jQuery selectors.
*
* @name jquery.qtips.js
* @author Daniel Wilhelm II Murdoch (wilhelm.murdoch@gmail.com)
* @version 1.0.0 Alpha
* @date February 19, 2009
* @category jQuery plugin
* @copyright (c) 2009 Daniel Wilhelm II Murdoch (wilhelm.murdoch@gmail.com)
* @license CC Attribution 2.5 Australia - http://creativecommons.org/licenses/by/2.5/au/
* @example Visit http://www.thedrunkenepic.com/dev/jquery/qtips/
***/
(function($) {
	$.fn.qtip = function(options) {
		var defaults =
		{
			container: 'qtip',
			content: '',
			position: 'center',
			nudge_top: 10,
			nudge_left: 0,
			preRender: function(e, tip) { },
			postRender: function(e, tip) { },
			onShow: function(e, tip) { },
			onHide: function(e, tip) { }
		};

		var interval;
		options = $.extend(defaults, options);

		return this.each(function(i) {
			if($("div.qtip-wrapper").length==0) {
				$('<div></div>').prependTo('div.lt-memorial')
								.append($('<div></div>'))
								.addClass('qtip-wrapper')
								.attr('id', options.container);
			}

			$(this).hover(function() {
				var height = $('#' + options.container).height();
				var width = $('#' + options.container).width();

				var top = $(this).offset().top - (height + options.nudge_top);
				var left = $(this).offset().left + options.nudge_left;

				$('#' + options.container + " div").html( $(this).html() );
				$('#' + options.container).css('left', left).css('top', top).show();
			},
			function() {
				$('#' + options.container).hide();
			});
		});
	};
})(jQuery);
