//ceetip
/*
 * CeeTip 1.0.1 jQuery Plugin
 * Requires jQuery 1.3.2
 * Code hosted on GitHub (http://github.com/catcubed/ceetip) Please visit there for version history information
 * By Colin Fahrion (http://www.catcubed.com)
 * based on vtip by vertigo project http://www.vertigo-project.com/projects/vtip 
  * Modified into a jQuery plugin and modified to work with CeeBox (http://github.com/catcubed/ceetip)
 * Copyright (c) 2009 Colin Fahrion
 * Licensed under the MIT License: http://www.opensource.org/licenses/mit-license.php
*/

(function($) {
	$.fn.ceetip = function(opts) {
		$.fn.ceetip.defaultSettings = {xOffset:-58,yOffset:26,border:'2px solid #ccc',arrow:"/cms_Scripts/CeeTip/images/spitze.png"} //default drops in right under the windows 
		var opts = $.extend({}, $.fn.ceetip.defaultSettings, opts);

		return this.each(function() {
			$this = $(this);
			
			$this.unbind("hover").hover(    
				function(e) {
//cfcf					this.t = this.title;
// Ändern, da entweder alt oder rev benutzt werden soll!
if(typeof this.alt=='string') this.t=this.alt; else this.t=this.rev;

                    this.title = ''; 
					var top = (e.pageY + opts.yOffset), left = (e.pageX + opts.xOffset);
					
					$('body').append( '<p id="ceetip"><img id="ceetipArrow" />' + this.t + '</p>' );
								
					$('p#ceetip #ceetipArrow')
					.attr("src", opts.arrow)
					.css({
						position: 'absolute',
						top: '-30px',
						left: '75px'
					});
					$('p#ceetip')
					.css({
						top:top+'px',
						left:left+'px',
						display: 'none',
						position: 'absolute',
						padding: '10px', 
						fontSize: '1.2em',
						backgroundColor: '#eee',
						border: opts.border,
						"-moz-border-radius": '5px',
						"-webkit-border-radius": '5px',
						zIndex: 9999
					})
					.fadeIn("slow");
					
				},
				function() {
//cfcf					this.title = this.t;
					$("p#ceetip").fadeOut("slow").remove();
				}
			).mousemove(
				function(e) {
					var top = (e.pageY + opts.yOffset),left = (e.pageX + opts.xOffset);
								 
					$("p#ceetip").css({top:top+"px",left:left+"px"});
				}
			);  
		})
	}

	
})(jQuery);
