/*

 */
 
(function($) {

	$.fn.easyHighlightIcons = function(options){
	  
		// default configuration properties
		var defaults = {	
			xOffset: 10,		
			yOffset: 25,
			tooltipId: "easyTooltip",
			clickRemove: false,
			content: "",
			useElement: "",
			UpPar: 10
			
		}; 
			
		var options = $.extend(defaults, options);  
		var content;
		var oWidth = 78;
		var oHeight = $(this).find("img").height;
				
		this.each(function() {  
						   
		
		
			var title = $(this).attr("title");				
			$(this).hoverIntent(function(e){		
				
				content = (options.content != "") ? options.content : title;
				content = (options.useElement != "") ? $("#" + options.useElement).html() : content;
				$(this).attr("title","");									  				
				if (content != "" && content != undefined){			
					$("body").append("<div id='"+ options.tooltipId +"'>"+ content +"</div>");		
					$("#" + options.tooltipId)
						.css("position","absolute")
						.css("top",(e.pageY - options.yOffset) + "px")
						.css("left",(e.pageX + options.xOffset) + "px")						
						.css("display","none")
						.fadeIn("fast")
				}
				
		$(this).find("img").animate({
          width: (oWidth+options.UpPar) +'px',
          height: (oHeight+options.UpPar) +'px'
    	 },200);
			},
			function(){	
			
			$(this).find("img").animate({
          width: (oWidth) +'px',
          height: (oHeight) +'px'
    	 },100);
				$("#" + options.tooltipId).remove();
				$(this).attr("title",title);
			});	
			$(this).mousemove(function(e){
				$("#" + options.tooltipId)
					.css("top",(e.pageY - options.yOffset) + "px")
					.css("left",(e.pageX + options.xOffset) + "px")					
			});	
			if(options.clickRemove){
				$(this).mousedown(function(e){
					$("#" + options.tooltipId).remove();
					$(this).attr("title",title);
				});				
			}
		});
	  
	};

})(jQuery);
