﻿/**
 *  jQuery Tooltip Plugin
 *  @requires jQuery v1.3 or 1.4
 *  http://intekhabrizvi.wordpress.com/
 *
 *  Copyright (c)  Intekhab A Rizvi (intekhabrizvi.wordpress.com)
 *  Licensed under GPL licenses:
 *  http://www.gnu.org/licenses/gpl.html
 *
 *  Mods by Max Díaz (MD) www.maxdiaz.com
 */
(function(a){jQuery.fn.tooltip=function(f){function k(d){var c="#"+b.dialogid,e=Math.max(0,d.pageY+b.offsetY);if(e+a(c).outerHeight()>=a(window).height())e=a(window).height()-a(c).outerHeight();d=Math.max(0,d.pageX+b.offsetX);if(d+a(c).outerWidth()>=a(window).width())d=a(window).width()-a(c).outerWidth();a(c).css({position:"absolute",top:e,left:d})}function l(d){var c="#"+b.dialogid,e=a(this).attr("id");if(!(b.mouseclk&&a(c).css("display")!="none")){if(b.folderurl!="NULL"){e=b.folderurl+e+"."+b.filetype;
a(c).load(e)}else if(a("#"+b.dataAttr+"_"+e).length>0)a(c).html(a("#"+b.dataAttr+"_"+e).html());else a(this).data("tt")!=null?a(c).html(a(this).data("tt")):a(c).html(e);k(d);a(c).stop(true,true).fadeIn(b.fadeIn)}}function m(){b.mouseclk||a("#"+b.dialogid).stop(true,true).fadeOut(b.fadeOut)}function n(d){b.mousefoll&&k(d)}var g={offsetX:15,offsetY:10,fadeIn:"200",fadeOut:"200",dataAttr:"data",folderurl:"NULL",filetype:"txt",cursor:"help",dialogid:"divToolTip",dialogsty:"border: 1px solid #6CE26C; background-color: #F8F8F8; color: #006699; font-size: 15px; padding: 5px 5px 5px 5px; -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; height: auto; width: auto;",
mousefoll:true,mouseclk:false,hoverInt:false};if(f==undefined||f.dialogid==undefined){for(var p="#"+g.dialogid.toLowerCase(),o=null,h=document.styleSheets[0],i=h.cssRules?h.cssRules:h.rules,j=0;j<i.length;j++)if(i[j].selectorText.toLowerCase()==p){o=i[j];break}if(o==null)a.browser.msie?h.addRule("#"+g.dialogid,g.dialogsty):h.insertRule("#"+g.dialogid+"{"+g.dialogsty+"}",i.length-1)}var b=a.extend(g,f);f="#"+b.dialogid;if(a(f).length==0){a("body").append("<div id='"+b.dialogid+"'></div>");a(f).hide();
if(b.mouseclk){a(f).click(function(){a(this).hide()});a(f).css("cursor","help")}}return this.each(function(){a(this).css({cursor:b.cursor});b.hoverInt?a(this).hoverIntent(l,m).mousemove(n):a(this).hover(l,m).mousemove(n)})}})(jQuery);

/**
* hoverIntent r5 // 2007.03.27 // jQuery 1.1.2+
* <http://cherne.net/brian/resources/jquery.hoverIntent.html>
* 
* @param  f  onMouseOver function || An object with configuration options
* @param  g  onMouseOut function  || Nothing (use configuration options object)
* @author    Brian Cherne <brian@cherne.net>
*/
(function($){$.fn.hoverIntent=function(f,g){var cfg={sensitivity:7,interval:100,timeout:0};cfg=$.extend(cfg,g?{over:f,out:g}:f);var cX,cY,pX,pY;var track=function(ev){cX=ev.pageX;cY=ev.pageY;};var compare=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if((Math.abs(pX-cX)+Math.abs(pY-cY))<cfg.sensitivity){$(ob).unbind("mousemove",track);ob.hoverIntent_s=1;return cfg.over.apply(ob,[ev]);}else{pX=cX;pY=cY;ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}};var delay=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);ob.hoverIntent_s=0;return cfg.out.apply(ob,[ev]);};var handleHover=function(e){var p=(e.type=="mouseover"?e.fromElement:e.toElement)||e.relatedTarget;while(p&&p!=this){try{p=p.parentNode;}catch(e){p=this;}}if(p==this){return false;}var ev=jQuery.extend({},e);var ob=this;if(ob.hoverIntent_t){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);}if(e.type=="mouseover"){pX=ev.pageX;pY=ev.pageY;$(ob).bind("mousemove",track);if(ob.hoverIntent_s!=1){ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}}else{$(ob).unbind("mousemove",track);if(ob.hoverIntent_s==1){ob.hoverIntent_t=setTimeout(function(){delay(ev,ob);},cfg.timeout);}}};return this.mouseover(handleHover).mouseout(handleHover);};})(jQuery);

