/*
 *	tips 1.0 - mouse title show
 *	made by hery 2011-6-1
 *	作者：hery  2011-6-1
 * http://www.socss.cn
 *	欢迎交流转载，但请尊重作者劳动成果，标明插件来源及作者
 */


(function( $ ){
	$.fn.tooltip = function( options ) { 
		return this.each(function(e) {        
		// If options exist, lets merge them
		// with our default settings
		//ZD ADD

			if ( options ) { 
				$.extend( settings, options );
			}
			var tooltip = "";
			var title = "";
			$(this).mouseover(function(e){						 
				title = $(this).attr("title");
				if(title== ""){
					 tooltip = "";
				}else{
					tooltip = "<div id='tooltip'><p>"+title+"</p></div>";
					$(this).attr("title","");
				}		
				$('body').append(tooltip);
				
				$('#tooltip')
					.css({
					"opacity":"1",//"0.8",
					//"top":(e.pageY+20)+"px",
					//"left":(e.pageX+10)+"px"
					"top":(e.pageY - 60)+"px",
					"left":(e.pageX -10)+"px"
						}).show('fast');
			})
			$(this).mouseout(function(){
				$(this).attr("title",title);
				$('#tooltip').remove();				
			 })
			
			$(this).mousemove(function(e){
				$('#tooltip').css({
//					"top":(e.pageY+20)+"px",
//					"left":(e.pageX+10)+"px"
					"top":(e.pageY - 63)+"px",
					"left":(e.pageX -6)+"px"
				});							
			})
		});
		
	};
})( jQuery );
